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:
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
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.