I’ve been grouping binary sensors together for easier use within automations.
When they’re motion based sensors this works great for turning lights on & off.
However not so much for door based sensors, while it works if all doors are closed as the state changes from “off” to “on” if a door is left open the state is already “on” so the automation doesn’t fire.
Is there a nicer way of grouping door based sensors together or have I just got to suck it up and add them individually to an automation to make sure they fire each time?
I only ask as my landing light automation has 4 doors on it and while not the end of the world I like to keep things as clean as possible.
I do door sensors individually. I do this for a lot of closets. I think I have 10 of 12. They turn both on and off in one automation. For doors and windows tied to to the alarm system I do some grouping.
This is probably brute force and stupidity but it works and is manageable.
- id: 'xxxxxxxxxxxxxxxxxxxxx'
alias: Mechanical Room - Turn on-off Light when door is open/closed
description: 'Turn on/off light when door is open closed'
trigger:
- platform: state
entity_id: binary_sensor.mechanical_room_door_sensor
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.mechanical_room_door_sensor
from: 'on'
to: 'off'
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.mechanical_room_door_sensor
state: 'on'
sequence:
- service: switch.turn_on
target:
entity_id:
- switch.mechanical_room_light
- conditions:
- condition: state
entity_id: binary_sensor.mechanical_room_door_sensor
state: 'off'
sequence:
- service: switch.turn_off
target:
entity_id:
- switch.mechanical_room_light
default: []
mode: single