I’m creating a delay timer for my washer with a Shelly plus1 switch.
I have created a timer based on time and a toogle switch on dashboard as a condition.
To avoid re-current events i want to reset the toggle to off after automations has been performed.
But i can’t get it to work.
I use these automations to turn on and off the fan in my bathrooms but only if the light has been on for 3 minutes.
For the halfbath
- id: 'Half Bath Fan Run'
alias: Half Bath Fan Run
description: Turn on Half bath fan if light was turned after after being on for
at least 3 minutes
trigger:
- platform: state
entity_id: switch.half_bath_light
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: timer.halfbath_timer
state: idle
action:
- service: switch.turn_on
target:
entity_id: switch.half_bath_fan
- delay:
seconds: "{{ states('input_number.fan_runtime')| int(30) }}"
- service: switch.turn_off
target:
entity_id: switch.half_bath_fan
mode: single
For the Timer
- id: '1612134477709'
alias: Half Bath Timer Activation
description: Activate the timer for the half bath
trigger:
- platform: state
entity_id: switch.half_bath_light
from: 'off'
to: 'on'
condition: []
action:
- service: timer.start
data:
duration: '180'
target:
entity_id: timer.halfbath_timer
mode: single