Hi,
I have these two basic automations, one to turn light on and one off :
- alias: Turn on bryggers light when there is movement
trigger:
platform: state
entity_id: binary_sensor.motion_office
to: 'on'
condition:
condition: sun
after: sunset
after_offset: "-2:30:00"
action:
service: light.turn_on
entity_id: light.bryggers
- alias: Turn off bryggers light 2 minutes after last movement
trigger:
platform: state
entity_id: binary_sensor.motion_office
to: 'off'
for:
minutes: 2
condition:
condition: sun
after: sunset
after_offset: "-2:30:00"
action:
service: light.turn_off
entity_id: light.bryggers
My question is, is there a way to know if the automation when i turn off the light has been started by a motion e.g the automation before ?