Single timer triggering off two separate sensors

Hey everyone! I have two motion sensors in the same room/group for my entryway - one at the top of the stairs, and one downstairs. What I want is to keep the three lights in the entryway group on as long as either detector senses movement.

I’ve only been able to trigger single sensors at a time - so the upstairs will detect movement, turn on the lights, I go downstairs, and then a minute later the upstairs sensor is no longer detecting movement, so it cuts the lights while I’m still downstairs. If I’m downstairs for more than five minutes, it’ll cut the lights too since I guess the timer starts as soon as it first detects an “off” state.

Any way to have either trigger reset the timer and keep the lights on if I’m moving around on either sensor?

Relevant triggers here:

- alias: "Entryway motion detected - upstairs"
    trigger:
      platform: state
      entity_id: binary_sensor.stairs_sensor_sensor
      to: 'on'
    action:
      service: script.turn_on
      entity_id: script.entryway_motion_detected_script

  - alias: "Entryway motion not detected for awhile - upstairs"
    trigger:
      platform: state
      entity_id: binary_sensor.stairs_sensor_sensor
      to: 'off'
      for:
        minutes: 5
    action:
      service: script.turn_on
      entity_id: script.entryway_motion_not_detected_script

  - alias: "Entryway motion detected - downstairs"
    trigger:
      platform: state
      entity_id: binary_sensor.entryway_sensor_sensor
      to: 'on'
    action:
      service: script.turn_on
      entity_id: script.entryway_motion_detected_script

  - alias: "Entryway motion not detected for awhile - downstairs"
    trigger:
      platform: state
      entity_id: binary_sensor.entryway_sensor_sensor
      to: 'off'
      for:
        minutes: 1
    action:
      service: script.turn_on
      entity_id: script.entryway_motion_not_detected_script

I would use something like the kitchen light timer. Use a script that turns off the light after a period of time but is reset when either motion is sensed by automation.

You mean this example? That’s what I’m using; however, the fact that the first of the two sensors no longer detecting movement turns off the lights even with the second sensor detecting is what is tripping me up.

I meant this example which was the old kitchen light motion timer. It has a script which is the key you’re looking for.

Try something like

automation
triggers

  • motion 1
  • motion 2

action

  • stop timed script
  • start timed script

timed script

  • delay 5 min
  • shut off light
1 Like

Yeah, just from a glance that seems to hold enough info to get me down the right path. I’ll give it a shot - thank you!

Hi

Have you figured it out?

I know this is pretty old and maybe resolved, but a solution to this could be using templating.
that way you can use a template that checks the state of one or the other or one and the other.

Have the automation use all binary sensors as the trigger, and then have templated conditions or templated actions.