What i am trying to do is, after motion sensor one had detected movement if no movement on other motion (lowest else part) sensor within one minute turn the light back off. This automation is not complete because i am not sure how to finish it. The problem is because i don’t walk all the way up the second motion sensor doesn’t detect motion so there is no going on/off .
@Operations8 I do the same thing in a few places around my home, in my case it’s a bit different as my system is set up as if someone trips the bedroom motion sensor and then the adjoining room then partially wake up the house, if the adjoining sensor isn’t tripped in 2 minutes then reset for next triggers.
So my script that fires when that first sensor is tripped to wait for the second one is:
one_awake:
alias: One Awake
icon: mdi:home
sequence:
# --------------------------------------
# WAIT FOR NEXT ROOM MOTION WITHIN 2 MINUTES
# --------------------------------------
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.greatroom_motion_sensor
to: "on"
#for: 10
timeout:
minutes: 2
continue_on_timeout: false
- service: cover.set_cover_position
data:
entity_id: cover.curtains_back
position: 100
- service: input_select.select_option
data:
entity_id: input_select.sleep_mode
option: "One Awake"
Hopefully you can use that as inspiration for your solution.
I have similar setup. I have two motion sensors on stairs. I created sensor group and put those two sensors in it.
So when one or both sensors detect motion, motion is detected.
I also created timer helper because I wanted to restart shutdown countdown if any of the sensors start detecting a motion. Light will turn on only if a brightness level is under specified value.
The rest is automation.
You can create new automation, switch to yaml, paste the automation and adjust it to suit your needs.
I use timer helper for that. I use this because it just works no issues. If motion is cleared timer will start countdown. If motion is detected while timer is running it will reset the timer and start timer again after motion is cleared.
I will look into timer helper have never uaed that before.
If i would paste your code into YAML i would still need to know what to put in a helper timer.
I don’t know. This just works. I didn’t noticed any problems with it so I didn’t explore any other option.
Edit.
Just create timer helper with value ir. 1 minute.