I have a zooz dimmer switch with ESP 32 connected to a LD2410 for motion detection. My automation has 2 trigger_ids motion_on and motion_off. Is there a way to get the motion_off trigger to be after 10 minutes from 7am - 9am and 1 minute all other times?
The easiest way to accomplish is by this using an automation. I created an automation that uses my motion detector as the trigger to turn the light on. Then depending on the time of day it waits for the motion detector to report motion off. Once the motion detector reports motion off it goes to the next step in the process which is to wait 10 minutes. After 10 minutes it then turns off the Stairs Light.
alias: _Test
description: ""
trigger:
- type: motion
platform: device
device_id: 33fafc570ccb3b351d6a1d58c0dad09c
entity_id: cd62efe132e358b5e456d37a2e745af1
domain: binary_sensor
alias: Motion Detector Reports Motion ON
condition: []
action:
- type: turn_on
device_id: 06a62f3cf1de8c2a4a5e905e91311e57
entity_id: f799f5f743892a53771bae0bac6adbf3
domain: light
alias: Turn on Stairs Light
- choose:
- conditions:
- condition: time
after: "07:00:00"
before: "09:00:00"
sequence:
- wait_for_trigger:
- type: no_motion
platform: device
device_id: 33fafc570ccb3b351d6a1d58c0dad09c
entity_id: cd62efe132e358b5e456d37a2e745af1
domain: binary_sensor
alias: Stairs Motion Detector Stopped Detecting Motion
alias: Wait for Motion Detector to Report Motion Off
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 06a62f3cf1de8c2a4a5e905e91311e57
entity_id: f799f5f743892a53771bae0bac6adbf3
domain: light
alias: Turn Off Stairs Light
- conditions:
- condition: time
after: "09:00:00"
before: "07:00:00"
sequence:
- wait_for_trigger:
- type: no_motion
platform: device
device_id: 33fafc570ccb3b351d6a1d58c0dad09c
entity_id: cd62efe132e358b5e456d37a2e745af1
domain: binary_sensor
alias: Stairs Motion Detector Stopped Detecting Motion
alias: Wait for Motion Detector to Report Motion Off
- type: turn_off
device_id: 06a62f3cf1de8c2a4a5e905e91311e57
entity_id: f799f5f743892a53771bae0bac6adbf3
domain: light
alias: Turn Off Stairs Light
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
mode: single
1 Like
Thanks will test when I get home. Had some minor issues getting option and also getting the options choice. I think I have it now.