Somewhat new to HA and am trying to set up an automation that occurs when it is cooler outside than inside. My automation is below but isn’t triggering. I am assuming the issue lies in my condition statement syntax being incorrect.
alias: TEST Baby Room Is Hotter than outside / Turn His Fan On
trigger:
- above: '78'
entity_id: sensor.baby_room_temp
platform: numeric_state
condition:
- condition: state
entity_id: switch.baby_fan
state: 'off'
- condition: template
value_template: '{{ states.sensor.baby_room_temp | int > states.sensor.dark_sky_temperature | int }}'
action:
- entity_id: switch.baby_fan
service: switch.turn_on
- data:
message: baby room is above 78 farenheit! Turning the fan on.
service: notify.alert_living_room
- data:
message: baby room is above 78 farenheit! Turning the fan on.
service: notify.alert_bedroom
- service: script.ghvolumereset
- delay: 00:00:02
- data:
message: baby room is above 78 degrees farenheit! I'm turning on his fan! It is cooler outside!
entity_id: media_player.home
service: tts.google_translate_say
Thanks, still doesn’t seem to work with the changes. Here it is now.
alias: TEST Baby Room Is Hotter than outside / Turn His Fan On
trigger:
- above: 78
entity_id: sensor.baby_room_temp
platform: numeric_state
condition:
- condition: state
entity_id: switch.baby_fan
state: 'off'
- condition: template
value_template: '{{ states("sensor.baby_room_temp") | int > states("sensor.dark_sky_temperature") | int }}'
action:
- entity_id: switch.baby_fan
service: switch.turn_on
- data:
message: baby room is above 78 farenheit! Turning the fan on.
service: notify.alert_living_room
- data:
message: baby room is above 78 farenheit! Turning the fan on.
service: notify.alert_bedroom
- service: script.ghvolumereset
- delay: '00:00:02'
- data:
message: baby room is above 78 degrees farenheit! I'm turning on his fan! It is cooler outside!
entity_id: media_player.home
service: tts.google_translate_say
Is your baby_room_temp changing? If the answer is no, then it won’t trigger. It will only trigger when it changes state. It will not ‘see that is above 78’ and trigger unless there is a state change.