Help With checking for sensor group, state off to turn off switch

I have a smart switch turning off and on a light. I have 2 sensors on the same room, it’s a large room. I want the light to turn on if either detects motion, and to turn off after 1 minute if neither detects motion. But I’m stuck.

I’ve created 2 automations, one to turn lights on and one to turn lights off. The condition should trigger if either or neither of the sensors detect motion.

I created a binary group called binary.sensor.office_two_motion sensors containing both sensor motion entities. I wanted to use this group to check for motion or lack of motion.

I’m trying to create something like this (for lilght off, similar for on):

alias: Office LIghts Off Both Sensors Test
description: ""
trigger:
  - type: no_motion
    platform: device
    entity_id: group.binary_sensor.office_two_motion_sensors
    for: 00:02:00
    platform: state
    to: 'off'
condition: []
action:
  - service: light.turn_off
    data: {}
    target:
      device_id: 96bc17037cdbad0bcd83c779c511b8d7
mode: single

When I save it, and go back into it, it has changed to:

alias: Office LIghts Off Both Sensors Test
description: ""
trigger:
  - type: no_motion
    platform: device
    device_id: fbc713c8f9ded91c11e84ee573bc83de
    entity_id: binary_sensor.office_tri_sensor_motion_detection
    domain: binary_sensor
    for:
      hours: 0
      minutes: 1
      seconds: 0
condition: []
action:
  - service: light.turn_off
    data: {}
    target:
      device_id: 96bc17037cdbad0bcd83c779c511b8d7
mode: single

Where binary_sensor.office_tri_sensor_motion_detection is one of the two sensors in the group.

So it’s not looking at the second sensor in the group. Could someone point me in the right direction?

This does not appear to be a valid entity id. Check in Developer Tools → States. It is likely just group.office_two_motion_sensors.

Also some advice about device triggers and actions: don’t use them.

Changed the group ID, same problem exists. Code gets changed. This is new automation:

alias: Office LIghts Off Both Sensors Test
description: "Test of combining sensors for off condition"
trigger:
  - type: no_motion
    platform: device
    entity_id: group.office_two_motion_sensors
    for: 00:02:00
    platform: state
    to: 'off'
condition: []
action:
  - service: light.turn_off
    data: {}
    target:
      device_id: 96bc17037cdbad0bcd83c779c511b8d7
mode: single

Also tried this, automation won’t even save. I know there are many ways to get the same result, but nothing seems to be working for me:

alias: Office LIghts Off Both Sensors Test
description: ""
trigger:
  - type: no_motion
    platform: state
    entity_id: group.office_two_motion_sensors
    for: '00:01:00'
    platform: state
    to: 'off'
condition: []
action:
  - service: switch.turn_off
    data: {}
    target:
    entity_id: light.jasco_products_43080_light
mode: single

Did you actually check the entity id like I said?

Or did you just copy what I guessed it might be?

The entity is actually binary_sensor.office_two_motion_sensors according to the states page.

However, I notice that the state doesn’t change from off to on when I make obvious motion in front of both sensors.

Did you create the group in the UI?

Can you take a screenshot of the group settings?

I think you might have hit the nail on the head as I was having problems understanding groups. I created the group, went back to check which devices were included in the group, but couldn’t find it. The only thing I see in the group setting is this:

EDIT: I might add that under the group logbook, it seems to be triggering on and off on both sensors in the group.