I am new to Home Automation, and I searched alot of hours today and tried implementing a delay for light.turn_off.
In short: I have a Automation which turns on my Entrance light when arriving home, and I want this to be turned off after 5 minutes, I dont know how to do that in the online editor?
I tried this:
I have the same automation. You can use ‘for’ in your trigger so that it triggers when something has been in the current state ‘for’ an amount of time, in my case 10 minutes:
- alias: "Buitenlamp uit na 10 minuten"
trigger:
platform: state
entity_id: light.voordeur
from: 'off'
to: 'on'
for:
hours: 0
minutes: 10
seconds: 0
condition:
condition: state
entity_id: binary_sensor.fibaro_multisensor_hal_sensor
state: 'off'
action:
service: light.turn_off
data:
entity_id: light.voordeur
transition: 30
I had to do it this way because the light is also controlled by another automation and I needed the condition.
I have Philips hue that already turns my lights on and off after a few mins already via motion sensor ,but wanted to trigger other devices to turn on and off in home assistant using the motion sensor.