I’m pretty new to HA, but I’m savvy enough to steal other people’s configs and make stuff happen in my setup.
I got a Xiaomi hub with a temperature sensor, and managed to get a switch to turn my heater on and off, when the temperature dips below a given temperature and off again when it goes above a given temperature. It was also time-restricted but I’ve just taken that out in case it was the issue…
What is the issue? Well, the symptom is that the automation rarely fires of its own accord. Right now for example the temperature is below the threshold (and the time is past the now-removed time restriction) but HA is just staring blankly at me, and not firing the automation. I can trigger it manually, so I know that it does work. And it will fire itself, now and again (although more of the again than the now).
The entry from my config is:
- alias: "Turn on Heater"
hide_entity: False
trigger:
platform: numeric_state
entity_id: sensor.temperature_158d0001b8cb5b
below: 16
condition:
- condition: time
after: '18:00:00'
#before: '22:30:00'
action:
- service: homeassistant.turn_on
entity_id: switch.plug_158d00023ee1b8
- service: light.turn_on
data:
entity_id: light.gateway_light_7811dce1774a
brightness: 255
color_name: red
automation heater off:
- alias: "Turn off Heater"
hide_entity: False
trigger:
platform: numeric_state
entity_id: sensor.temperature_158d0001b8cb5b
above: 18
condition:
- condition: time
after: '18:00:00'
#before: '22:30:00'
action:
- service: homeassistant.turn_off
entity_id:
- switch.plug_158d00023ee1b8
- service: light.turn_on
data:
entity_id: light.gateway_light_7811dce1774a
brightness: 255
color_name: blue```