I’ve set up a rule to turn the lights on and off based on three motion sensors. It works fine for turning it on:
trigger:
platform: state
entity_id: binary_sensor.homematic_motion_sensor_motion, binary_sensor.homematic_switch_1_motion, binary_sensor.homematic_switch_2_motion
to: 'on'
but not correctly for turning it off:
trigger:
platform: state
entity_id: binary_sensor.homematic_motion_sensor_motion, binary_sensor.homematic_switch_1_motion, binary_sensor.homematic_switch_2_motion
to: 'off'
for:
minutes: 2
Even if I move within the range of one sensor, the lights turn off after two minutes. I guess I created a rule where ALL sensors have to be triggered to prevent the light from turning off. How do I change this so it doesn’t matter which sensors are triggered within the given time frame?
The trigger for the second automation is telling Home Assistant to turn off the lights if ANY of those motion sensors goes to off for 2 minutes, regardless of which motion sensor actually turned the lights on.
What do you want to actually happen? We can probably help you modify your automations.
All three motion sensors are in the hallway and turn on the hallway-light. I want the light to stay on as long as a person is there. In other words, turn the light off if no motion is detected for two minutes from any of the sensors.
That’s what those automations are currently doing. If any of those motion sensors goes to off for two minutes, it will turn the light off. Similarly, if any of those motion sensors goes to on, it will turn the lights on.
Triggers are OR by default, so when you list multiple triggers or multiple entities in a trigger, the action will fire if ANY of the triggers happens.