I have a button that toggles a fan; the automation is done with the UI. I need to change it so that the toggle feature remains, but when the fan toggles ON must switch off after a delay, if not toggled OFF again by the button push.
I have done this automation on ST using WebcoRE but struggling with YAML.
Do you guys have a suggestion to put me in the right direction?
trigger:
platform: state
entity_id: switch.your_fan
to: on
for:
seconds: 7 # or whatever delay you want
action:
service: switch.turn_off
entity_id: switch.your_fan