#Motion sensor to turn light on - switches it off immediately

1 messages · Page 1 of 1 (latest)

rugged yacht
#

This is a bit of a head scratcher for me.
I am moving stuff from other systems all into home assistant.

For some strange reason, the lights turn on, and immediately off again.

I have a Hue Motion sensor in a room and I want to switch the lights on when motion is detected.
Easy I thought. Trigger is any status change on the sensor, so that I can work with "choose" in the automation and do not have to create individual ones for on and off.
The behavior of the sensor entity is correct, it goes to "detected" immediately and to "none" after a few seconds.

Under "Actions" I added a "choose" and have two conditions:

  • If the day/night object (a binary) in my house is 0/day and the status of the motion sensor is "detected" then I turn on three lights
  • If the day/night object is 1/night and the status is "detected" I turn on only one of the lights
  • Initially I added another option that switches off the lights, when the status is "none" but I already removed that when I tried to debug this issue.

The traces show that "option" 1 is executed, which only uses light.turn_on, but it also states that it turned the lights off.

#

This is the config:
`alias: Licht Ankleide
description: Schaltet das Licht in der Ankleide in Abhängigkeit von Tag/Nacht und Bewegung
triggers:

  • trigger: state
    entity_id:
    • binary_sensor.hue_bwm_ankleide_bewegung
      conditions: []
      actions:
  • choose:
    • conditions:
      • condition: and
        conditions:
        • condition: state
          entity_id: binary_sensor.hue_bwm_ankleide_bewegung
          state: "on"
        • condition: state
          entity_id: input_boolean.hausstatus_tag_nacht_0_1
          state: "off"
          sequence:
      • action: light.turn_on
        metadata: {}
        data: {}
        target:
        entity_id:
        - light.ankleide_deckenlicht
        - light.ankleide_schranklicht_innen
        - light.ankleide_schranklicht_oben
    • conditions:
      • condition: and
        conditions:
        • condition: state
          entity_id: binary_sensor.hue_bwm_ankleide_bewegung
          state: "on"
        • condition: state
          entity_id: input_boolean.hausstatus_tag_nacht_0_1
          state: "on"
          sequence:
      • action: light.turn_on
        metadata: {}
        data: {}
        target:
        entity_id: light.ankleide_schranklicht_innen
        mode: single
        `
harsh oyster
#

Sounds like your changes weren't loaded

#

How did you remove the turn off part? What did you do afterward?