Hy everyone can you help me creating an automation?
I’m trying to set up an automation that when i arrive home (when my iPhone sensor become in home zone) if i open the door of my house (which has a sensor) within 30 minutes, HA lights my kitchen light up.
I managed to set up the automation but i can’t figure out how to set up the 30min range mentioned before. Hope you can help me!
Easiest way is just to use a wait for trigger. So in the action of your automation do this:
action:
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.front_door_open
to: 'on'
timeout: '00:30:00'
continue_on_timeout: false
- service: light.turn_on
data:
entity_id: light.kitchen
Basically waits up to 30 minutes to see if your door opens. When it does it continues to the rest of the actions (turning on the ligths). If it doesn’t then it stops.
Should use either mode: single or mode: restart on your automation as well. So only one instance of your automation can be running at a time.
If you want to wait for 30 minutes before turning on the lights after your automation triggers, you can add an action similar as the one below:
Just create a scene with all your kitchen lights in it and you’ll be ok