I have a server rack in a room that I want to keep exhausted when the room gets above 90F.
I have two Dallas sensors to measure the tempertaure and a zigbee smart plug that will turn the exhaust fan on.
Looking at other yaml in many posts I cobbled together the following, but it does not seem to work.
The temperature sensors are reading fine, and I can through toggle the plug, but the automation does not trigger it. Ran traces and all seems normal.
Any thoughts greatly appreciated.
####################################################
# SERVER TEMPERATURE FAN #
####################################################
- id: "07e785e7-a5a0-48c1-a0ea-fe2b5fe7d220"
alias: "Server Room Fan Control"
description: " > 90 fan on, turn off only when both < 87"
mode: restart
trigger:
- platform: numeric_state
entity_id:
- sensor.server_temp_monitor_temperature_1
- sensor.server_temp_monitor_temperature_2
above: 90
id: "server_hot"
- platform: numeric_state
entity_id:
- sensor.server_temp_monitor_temperature_1
- sensor.server_temp_monitor_temperature_2
below: 87
id: "server_cool"
condition: []
action:
- choose:
# If either sensor goes > 90, turn the fan ON
- conditions:
- condition: trigger
id: "server_hot"
sequence:
- service: switch.turn_on
target:
entity_id: switch.server_room_fan_power
# If a sensor goes < 87, check if BOTH OFF
- conditions:
- condition: trigger
id: "cool"
- condition: numeric_state
entity_id: sensor.server_temp_monitor_temperature_1
below: 87
- condition: numeric_state
entity_id: sensor.server_temp_monitor_temperature_2
below: 87
sequence:
- service: switch.turn_off
target:
entity_id: switch.server_room_fan_power
####################################################
# SERVER TEMPERATURE ALERT #
####################################################
- id: "7c9ea310-787c-4644-9940-90df3156cb25"
alias: "Server Room Critical Temp Alert"
description: "Notify if any sensor is > 95°F for over 60 minutes"
trigger:
- platform: numeric_state
entity_id:
- sensor.server_temp_monitor_temperature_1
- sensor.server_temp_monitor_temperature_2
above: 95
for:
minutes: 60
action:
- service: notify.pushover
data:
title: "🔥🔥🔥 Critical: Server Room Overheating"
message: "Temperature has been above 95°F for 60 minutes! Check the fan and server health."
notification_id: "server_temp_alert"