Table of Contents
Summer heat kills MY equipment 🥵
In my previous blog post, I mentioned the unexpected failure of my APC unit, which got me thinking about potential causes. Currently, my server rack sits right next to my desk on the upper level of my house—an area that becomes extremely hot during the summer, especially in recent weeks.
Fortunately, I recently installed an AC unit in my office, which has made working in this heat far more bearable. However, this led me to a new question: How can I automate the cooling of my server rack to ensure it stays cool at all times, even when I’m not at home?
Current Setup: Automating the Cooling Process
In my office, I’ve installed several devices to monitor and control the environment, including:
- Temperature Sensors (Aqara): Installed in both the rack and the room, these sensors provide real-time temperature data.
- Door Sensor (Homematic IP): Monitors the rack’s door status, ensuring it’s closed when cooling is needed.
- IR Blaster (SwitchBot Hub): Originally used to control a bot for turning a PC on and off, this hub has the capability to learn and send IR commands, which I realized could be repurposed for controlling my AC unit.
- Rack Fans: The rack is equipped with four top-mounted fans to help with cooling. These fans are connected to a Zigbee plug, which is also integrated with my Conbee stick and controlled via IObroker.
The AC unit itself isn’t a smart device and can only be controlled via a remote. After some research, I discovered that the Switchbot Hub, which I was already using, could learn the AC’s IR commands and send them, essentially making my AC smart.
Here’s how the components are currently integrated:
- Aqara Sensors: These communicate via Zigbee to my Conbee stick, which is directly integrated with my IObroker setup.
- Door Sensor: This communicates over 866 MHz to my Raspimatic, which is also integrated with IObroker.
- Rack Fans: Controlled via a Zigbee plug connected to the Conbee stick, allowing automated or remote control through IObroker.
- Notifications: For visual notifications, I’m using my LaMetric, which displays real-time alerts. Additionally, I’ve set up WhatsApp notifications via IObroker to send alerts and status updates regarding the home automation system.
The only challenge I’ve encountered is with the SwitchBot, which is integrated with Alexa. While this setup works, the integration with IObroker is not as smooth as I’d like. In the future, I plan to explore the SwitchBot API to bypass the Alexa integration and streamline the process.
Analyzing Temperature Data: June to July
To develop an effective automation strategy, I first analyzed the temperature data from June to July. It’s important to note that during this period, the rack was never fully closed. Had it been closed, the internal temperatures would likely have been significantly higher.
From the statistics, it’s clear that the temperature inside the rack consistently runs a few degrees warmer than the room temperature. This is expected given the heat generated by the equipment, but it also highlights the need for proper cooling.
Automation Strategy
The goal is to close the rack and fully utilize the rooftop fans to manage the internal temperature more effectively. Based on the temperature data, I’ve outlined the following automation rules:
-
Trigger Point: When the rack temperature exceeds 33°C, the automation will:
- Start the Rack Fans: Turn on the four top-mounted fans to circulate air within the rack.
- Activate the AC Unit: The Switchbot Hub will send the IR command to turn on the AC, cooling the entire room.
- Send Notifications: Alerts will be sent via LaMetric and WhatsApp to notify me of the temperature spike and the activation of the cooling system.
-
Warning Threshold: If the temperature inside the rack reaches 35°C:
- Generate a Warning: A notification will be sent via LaMetric and WhatsApp indicating that the cooling system may not be functioning correctly, prompting immediate attention.
-
Door Sensor Alert: If the door is opened while the AC is running:
- Generate a Warning: A notification will be triggered, warning that the rack door is open while cooling is active, which could compromise the efficiency of the cooling system.
-
Cooling Threshold: The cooling system will remain active until the rack temperature normalizes to 22°C. Once this threshold is reached:
- Turn Off the Fans and AC: The fans and AC will be turned off to conserve energy and maintain a stable environment within the rack.
This approach should ensure that the equipment remains within a safe operating temperature range, even during the hottest days, while also providing peace of mind with real-time notifications and alerts for any potential issues.
Javascript
on({ id: [].concat(['deconz.1.sensors.00158d00036b5683.temperature']), change: 'ne' }, async (obj) => {
let value = obj.state.val;
let oldValue = obj.oldState.val;
if (getState('deconz.1.sensors.00158d00036b5683.temperature').val > 33) {
if (getState('0_userdata.0.alarm_state.rack_temperature_notification').val == false) {
setState('0_userdata.0.alarm_state.rack_temperature_notification' /* rack_temperature_notification */, true);
sendTo("whatsapp-cmb.0", "send", {
text: ('Alert! Temperature inside of the rack to high: ' + String(getState('deconz.1.sensors.00158d00036b5683.temperature').val))
});
sendTo('lametric', 'notification', {
priority: 'warning',
iconType: 'alert',
sound: 'alarm1',
lifeTime: parseInt(1000),
icon: 'i31820',
text: ('Alert! Temperature inside of the rack to high: ' + String(getState('deconz.1.sensors.00158d00036b5683.temperature').val)),
cycles: parseInt(1),
});if (getState('deconz.1.lights.7cb03eaa0a06a7f7.on').val == false) {
setState('deconz.1.lights.7cb03eaa0a06a7f7.on' /* On */, true);
}
if (getState('alexa2.0.Smart-Home-Devices.5717d413-5260-4f40-a32d-3d6a12517adc.powerState').val == false) {
setState('alexa2.0.Smart-Home-Devices.5717d413-5260-4f40-a32d-3d6a12517adc.powerState' /* powerState */, true);
}
}
}
if (getState('deconz.1.sensors.00158d00036b5683.temperature').val < 23) {
if (getState('0_userdata.0.alarm_state.rack_temperature_notification').val == true) {
setState('0_userdata.0.alarm_state.rack_temperature_notification' /* rack_temperature_notification */, false);
sendTo("whatsapp-cmb.0", "send", {
text: ('Temerature in the rack normalised: ' + String(getState('deconz.1.sensors.00158d00036b5683.temperature').val))
});
sendTo('lametric', 'notification', {
priority: 'info',
iconType: 'alert',
lifeTime: parseInt(1000),
icon: 'i31820',
text: ('Temerature in the rack normalised: ' + String(getState('deconz.1.sensors.00158d00036b5683.temperature').val)),
cycles: parseInt(1),
});if (getState('deconz.1.lights.7cb03eaa0a06a7f7.on').val == true) {
setState('deconz.1.lights.7cb03eaa0a06a7f7.on' /* On */, false);
}
if (getState('alexa2.0.Smart-Home-Devices.5717d413-5260-4f40-a32d-3d6a12517adc.powerState').val == true) {
setState('alexa2.0.Smart-Home-Devices.5717d413-5260-4f40-a32d-3d6a12517adc.powerState' /* powerState */, false);
}
}
}
if (getState('deconz.1.sensors.00158d00036b5683.temperature').val > 35) {
sendTo("whatsapp-cmb.0", "send", {
text: ('Something is wrong! Cooling is not working in the rack: ' + String(getState('deconz.1.sensors.00158d00036b5683.temperature').val))
});
sendTo('lametric', 'notification', {
priority: 'info',
iconType: 'alert',
lifeTime: parseInt(1000),
icon: 'i31820',
text: ('Something is wrong! Cooling is not working in the rack: ' + String(getState('deconz.1.sensors.00158d00036b5683.temperature').val)),
cycles: parseInt(1),
});}
});
Results
After a few days of letting the automation run, it’s been a real pleasure to walk into my office and feel the cool air, while the rest of the house remains quite hot. The automation has effectively maintained a comfortable working environment in my office, which is clearly reflected in the temperature and humidity graphs.
Here’s what the data shows:
- Temperature Regulation: The graphs indicate that on particularly hot days, the automation kicks in approximately five times over a 24-hour period. During the night, it only activates once, which aligns with the cooler nighttime temperatures.
- Humidity Control: The humidity levels are also more stable, contributing to a more comfortable environment overall.
These results affirm that the automation is functioning as intended, ensuring that my equipment remains within safe operating temperatures and that my workspace stays comfortable, even during the hottest days.