Hi,
I have an automation to turn off my heater within a certain timeframe.
When the timeframe stays before 00:00h it works perfectly, but when it crosses the 00:00h line it fails.
I now have 2 different automations; one from 22:00 till 23:59 and one from 00:00 till 05:00.
Is there a way to overcome this ?
My automation for the whole period (wich is not working) :
alias: 'Verwarming hk snachts uit'
initial_state: 'on'
trigger:
- platform: homeassistant
event: start
# voorwaarden in het tijdvak van 22.00u tot 05.00u
- platform: template
value_template: "{{ states('sensor.time') == '22:00' }}"
- platform: template
value_template: "{{ states('sensor.time') == '05:00' }}"
# indien de instelling handmatig wordt veranderd wordt de automation opnieuw getriggerd na 30 seconden
- platform: state
entity_id: climate.huiskamer
from: "off"
for:
seconds: '30'
action:
- service_template: >
{% if '22:00' <= states('sensor.time') < '05:00' %}
climate.turn_off
{% else %}
climate.turn_on
{% endif %}
entity_id: climate.huiskamer