Hi,
I have written this automation in the past and it work just fine. But recently I changed to the newest version of Home Assistant and it is not working any more.
- alias: vent_timer
trigger:
- platform: state
entity_id: switch.ventilator_ventilator
to: 'on'
for:
minutes: "{{ states('input_number.vent_time')|int }}"
action:
- entity_id: switch.ventilator_ventilator
service_template: >
{% if states('input_number.vent_time')|int > 0 %}
switch.turn_off
{% else %}
switch.turn_on
{% endif %}
It is supposed to turn the Ventilator off after the minutes (configured with the input_number) have passed.