Hi all,
I got an automation which has multiple triggers, as of now 2 motion 1 door sensors and a wall switch.
when the trigger goes of it will turn on the light, start a delay of 5 minutes and turns the lights off. Not so difficult, and this works.
Only thing that is bothering me is dat when i stay in the room the motion sensor won’t retrigger until it clears. Most of the times i am not longer in the room then 5 minutes but when i do i need the automation to keep the lights on and extend the 5 minutes (or restart the automation till there is a clear)
I am not sure on how to make such a automation, hope some one can help me out. Thanks!! Current automation below:
alias: Ganglamp
description: ''
trigger:
- platform: state
entity_id: binary_sensor.door2_contact
from: 'off'
to: 'on'
- platform: state
entity_id: switch.voordeur_schakelaars_switch_l1
from: 'off'
to: 'on'
- type: motion
platform: device
device_id: 77bee982c70d989779e277109e9b9004
entity_id: binary_sensor.trap_beweging_occupancy
domain: binary_sensor
- type: motion
platform: device
device_id: e7577b34e61fe50055b171d21731cfc8
entity_id: binary_sensor.lobby_beweging_occupancy
domain: binary_sensor
condition: []
action:
- service: switch.turn_on
data: {}
entity_id: switch.voordeur_schakelaars_switch_l1
- type: turn_on
device_id: c64f5a9433ebaf40a4dbdcef11a18ca0
entity_id: switch.lobby_l1
domain: switch
- delay: '00:05:00'
- service: switch.turn_off
data: {}
entity_id: switch.voordeur_schakelaars_switch_l1
- type: turn_off
device_id: c64f5a9433ebaf40a4dbdcef11a18ca0
entity_id: switch.lobby_l1
domain: switch
mode: restart