Got this automation and I have narrowed it to one line that it doesn’t like.
- alias: 'Upstairs Bath Fan Auto Off'
trigger:
# If the bathroom is unoccupied for a while
- platform: state
entity_id: binary_sensor.upstairs_hall_bath_occupied
to: 'off'
for: '00:30:00'
# If the humidity has gone down and staying down
- platform: template
value_template: "{{ states('sensor.upstairs_hall_bath_4_in_1_sensor_relative_humidity') | float > (states('sensor.upstairs_thermostat_relative_humidity_corrected') | float + 5) }}"
for: '0:20:00'
condition:
# If the bathroom is unoccupied for a while
- condition: state
entity_id: binary_sensor.upstairs_hall_bath_occupied
state: 'off'
for: '00:30:00'
# If the humidity has gone down and staying down
- condition: template
value_template: "{{ states('sensor.upstairs_hall_bath_4_in_1_sensor_relative_humidity') | float > (states('sensor.upstairs_thermostat_relative_humidity_corrected') | float + 5) }}"
# *************************************************
#for: '00:20:00' <----- ***THIS LINE FAILS WHEN UNCOMMENTED***
# *************************************************
action:
service: switch.turn_off
entity_id: switch.upstairs_hall_bath_exhaust_fan_switch
Error:
Invalid config for [automation]: [for] is an invalid option for [automation]. Check: automation->condition->1->for. (See ?, line ?).
Am I missing something obvious?
Is ‘for’ duration not allowed for a template condition?