I’m trying to setup an automation to turn on a switch when the external temperature drops below 12 degrees and the time is either between 6:30 - 8am or 4:45 - 6pm (i.e. it should trigger twice in a day).
The automation doesn’t trigger even though all criteria have been met.
I’m obviously doing something wrong.
Can anyone shed some light on it for me?
automation:
- alias: "Turn on Heater"
hide_entity: True
trigger:
platform: numeric_state
entity_id: sensor.yr_temperature
below: 12
condition:
- condition: or
conditions:
- condition: time
after: '06:30:00'
before: '08:00:00'
- condition: time
after: '16:45:00'
before: '18:00:00'
action:
service: homeassistant.turn_on
entity_id:
- switch.heater
This will only trigger if the temperature drops below 12 in the given time periodes.
If the temperature drops to 11*C at 06:25 it will not trigger the automation at 06:30
Is it even possible to do what I’m after then?
I tried changing the trigger to be time and the condition to be the temp, but that still doesn’t seem to work
I think it can be even more simplified in the trigger section, because the conditions take care of all constraints. Even if the automation is triggered everytime the temperatur changes, it will not cause an action unless all conditions pass.