Following along with what other’s have suggested, but still running into issues. I have (2) Aqara Motion Sensors setup in the garage, and want to trigger the lights to come on if either motion sensor senses. I create a Group for the 2 motion sensors for the OR, but doesn’t seem to trigger. There’s also a condition based on the lux.
hello you said you created a group with sensors.
but i see a binaries sensor “binary_sensor.garage_motion_sensors”, it should not be a “group.garage_motion_sensors” instead of?
Binary sensor groups created in the UI will be under domain binary_sensor. It is still possible to create legacy style groups through YAML that are under the domain group but this is not the recommended practice for any entity group type that can be created in the UI.
Your “off” automation will never execute the actions because your trigger and conditions are working against one another. The trigger fires as soon as both motion sensors are ‘off’. But the conditions fail because they have not been off long enough. Conditions test the state of the entity at that exact moment… they do not wait around for things to change. Your “off” automation needs to have the duration moved to the trigger:
alias: Garage Group OFF
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.garage_motion_sensors
from: 'on'
to: 'off'
for: "00:01:00"
condition: []
action:
- type: turn_off
device_id: 7664a5155cee99755e8f68d9773aedd7
entity_id: switch.garage_test
domain: switch
mode: single
Similarly, the conditions in your “on” automation may be working against you. Triggering with the group means that only one of the motion sensors needs to be ‘on’ to fire, but the conditions require both to be ‘on’ to move on to the actions. Getting rid of the motion conditions will solve that:
Oddly enough the group ON automation is suddenly working. The group OFF automation is not - seems like it would be easier to troubleshoot since there are no conditions.
When you say just add two triggers, as in like Sensor 1 ON and Sensor 2 ON to initiate the automation?
yes to the triggers. I have in my bathroom 3 motion sensors, all are triggers for the light. Please check if the LUX is working consistently because this is a known ‘by design’ feature of Aqara sensors.
Thanks for all of your help on this. Finally got it to work - not exactly sure why it was not working as described initially after your guidance, but it eventually started to function.