At the moment, i have the mechanism to switch on lights when motion is detected controlled with the hue app. This is based on the hour of the day, and it is a pain as sometimes it is very dark at 9am for example
I am looking to build an automation in home assistant to switch on the lights when:
Motion is detected
Sensor is on (There are some scenarios where i want to deactivate the motion sensor, as when having a bath)
Have you looked at the HACS integration Entity Controller? Itās designed to do this sort of thing and can reduce quite complex automations to a few lines. For example, my yard light:
- yard_light:
sensor:
- binary_sensor.yard_motion_sensor_motion # motion sensor
entities:
- light.yard_1 # light
delay: 180 # time light stays on
overrides:
- input_boolean.yard_movement_detector # switch to turn off sensor at particular light level
- input_boolean.override_yard_motion_sensor # switch to turn off sensor entirely
Itās been a while since I switched to Entity Controller, but as I remember I was already using input_booleans to control the motion sensor, with those being turned on and off elsewhere.
Much easier to maintain than one large chunk of yaml (though I imagine purists would find it inelegant ).
Hi - I am a newbie here and this forum was such a great help. I have a motion sensor automation related question that I could not figure out.
I wanted to set up two automations for each rooms: turn on the lights when motion is detected (and when it is dark outside) and turn off the lights when there is no motion. I thought this was pretty basic, butā¦
Now while it seems easy, I found myself in a pretty funny situation. The lights turn on, but then they turn off and the funniest part is that then they get triggered and got stuck in a loop.
My guess is that my motion and/or occupancy sensors (Aqara P1 and FP2) do detect the motion, but if I stay stationary, like sitting at my desk or chilling on my couch, they stop detecting it, thus activate the turn off automation.
The problem is that:
A: it would be ideal for it to check if Iām still in the room, and
B: I donāt understand that when I am not there and they do turn off, the motion sensor still might think that it was a motion so it triggers the turn on automation, which is not ideal
Any help and suggestions would be a great help. Thanks in advance,
p