One motion sensor to another if not light out

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 .

Any ideas?

alias: 05_Zolder lichtstrip AAN
description: ""
trigger:
  - type: motion
    platform: device
    device_id: f7956d8222ae519c5bab3a80b64b6f82
    entity_id: 8e3943ef71673e74d4199f30ea9bcf4f
    domain: binary_sensor
    id: M1
    for:
      hours: 0
      minutes: 0
      seconds: 2
condition: []
action:
  - if:
      - condition: trigger
        id:
          - M1
      - condition: and
        conditions:
          - condition: device
            type: is_off
            device_id: b0c55edbef2a605066f18ab38ad482fc
            entity_id: fa91105a8cd1ce6554524620d6f225d3
            domain: light
          - condition: device
            type: is_off
            device_id: bd8606b8e7a7597fbf67d6f7b0da44cd
            entity_id: 415db59de9d9c2d2e31633a5d3b873e7
            domain: light
    then:
      - type: turn_on
        device_id: bd8606b8e7a7597fbf67d6f7b0da44cd
        entity_id: 415db59de9d9c2d2e31633a5d3b873e7
        domain: light
        brightness_pct: 100
      - type: turn_on
        device_id: b0c55edbef2a605066f18ab38ad482fc
        entity_id: fa91105a8cd1ce6554524620d6f225d3
        domain: light
        brightness_pct: 100
    else:
      - if:
          - type: is_occupied
            condition: device
            device_id: aa018b762329a79ca75aab17e5f95c8e
            entity_id: f19603518edf797a89804dc539a98f2c
            domain: binary_sensor
        then: []
trace:
  stored_traces: 25
mode: single

You can use helper to put two sensors in a group. Create a timer helper and re do the automation.
I use something like this

alias: Stairs light motion
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.stairs_motion
    from: "off"
    to: "on"
    id: Motion detected
  - platform: state
    entity_id:
      - binary_sensor.stairs_motion
    from: "on"
    to: "off"
    for:
      hours: 0
      minutes: 0
      seconds: 0
    id: Motion cleared
  - platform: state
    entity_id:
      - timer.stairs_light_helper
    from: active
    to: idle
    id: Helper
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: Motion detected
          - type: is_illuminance
            condition: device
            device_id: d1da1ce2d2e3ac9abca015089846c7bf
            entity_id: sensor.stairs_motion_sensor_1_illuminance_lux
            domain: sensor
            below: 50
            enabled: false
          - condition: or
            conditions: []
            enabled: false
          - type: is_illuminance
            condition: device
            device_id: 0fe0d6abaffb579787f9d6348c072347
            entity_id: sensor.stairs_motion_sensor_2_illuminance_lux
            domain: sensor
            below: 50
            enabled: false
        sequence:
          - service: timer.cancel
            data: {}
            target:
              entity_id: timer.stairs_light_helper
          - service: light.turn_on
            data: {}
            target:
              entity_id: light.stairs_light_group
      - conditions:
          - condition: trigger
            id: Motion cleared
        sequence:
          - service: timer.start
            data: {}
            target:
              entity_id: timer.stairs_light_helper
      - conditions:
          - condition: trigger
            id: Helper
        sequence:
          - service: light.turn_off
            data: {}
            target:
              entity_id: light.stairs_light_group
mode: single
max_exceeded: silent

I am trying to make sense of your automation but not sure how to adjust my automation this way.

@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 have created a group will test tomorrow morning.

One question why are you not using mode:restart?
I read in a different question topic of my someone said he did that to reset the timers.

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.

Isn’t mode:restart easier than?

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.