Motion sensor keeps turning off my lights!

Hi all

I have motion sensor in my kitchen that turns my light on when motion detected and turn it off when there is no movement.

Problem when I turn the light manually on, after while the sensor turn it of.

is there a condition to disable the sensor automation when light is turned on manually?

Thanks

Depends on how you have set your automation to turn on and off the lights but you can add a condition for if lights are in state “on”

need to add some logic so HA knows how the lights were turn on by motion or Manually

you could add a Toggle helper “motion kitchen Turn On” then in the condition of the motion turn off to check toggle helper is ON then turn light off and turn the helper off to.

and or when manualy turn on . turn off that helper so motion does not kick in

What worked for me was capturing what originally turned the light on in my automation. I first have an automation which says if motion happens turn on this light.

My second automation says turn off the light if it was motion that turned it on, and turn it back off in X minutes. I stole the code from someone on here. I’ll try to find it.

Sounds like a great idea if can elaborate on that please with some details :pray:

How come a condition that the light must be off to trigger the automation doesn’t work?

Do you really not want the lights to go out based on no motion if you turn them on manually? I think that would be one of the main benefits of a motion sensor light. That they are auto-off if no one is using the room, no matter how they were turned on.

In other words, is the problem with the motion detection itself not firing reliably enough to keep the lights on when you are in the room?

Ok so here are my two automations; this works for me.

Turn On Light Automation:

trigger:
  - platform: state
    entity_id: binary_sensor.videosource_1_motion_alarm
    from: 'off'
    to: 'on'
action:
  - service: switch.turn_on
    target:
      entity_id: switch.front_porch_entry_switch

Turn Off Automation if turned on by motion:

trigger:
  - platform: state
    entity_id: binary_sensor.videosource_1_motion_alarm
    from: 'on'
    to: 'off'
    for: '00:05:00'
action:
  - service: switch.turn_off
    target:
      entity_id: switch.front_porch_entry_switch

I have some conditions in mine for specific times of day as during some times I have my front porch light on anyways so no need to attempt to turn it on, and I don’t want to turn it off. I left those out to make it less confusing.

2 Likes

Thank you so much , prefect :pray: :ok_hand: