Hi,
I want to setup automation that would notify my at 7AM if temperature was below 0 at night
I set the trigger to 1C and I’m using openweather as the temperature source
I have this:
alias: Notify when night temp was below 0°C
description: ''
trigger:
- platform: template
value_template: '{{ states(''sensor.openweathermap_temperature'') | float < 1 }}'
condition:
- condition: time
after: '23:00'
before: '07:00'
action:
- condition: time
after: '07:01'
- service: notify.mobile_app_my_iphone
data:
message: Temp at night was below 0
mode: single
This looks OK to me but that does not seem to be working. I cannot figure out why.
The reason the automation doesn’t seem to be working is that you have set up your conditions in such a way that they will never all be true… There is no time that is “after 23:00” and “before 7:00” as well as “after 7:01”… so when the automation is triggered overnight, it passes the first time condition, then fails the one you have in the action section of the automation.