Automation timer lights off, keep turning lights on

Im new to HomeAssistant… Trying to set a automation. I have a Reolink camera so whenever motion is detected I want the entrance light to turn on, so I have a timer and it all seem to work except when timer runs out motion is triggered and light turns back on.

Not sure if the code helps to see what could be wrong or if I paste pictures of ui instead?

alias: Detection Entré Light On
description: “”

  • type: motion
    platform: device
    device_id: c3c29f6964cf3e3594ed0c913b74f5bf
    entity_id: e2cdcee3b0ca15feab4d856e5f0ea8b9
    domain: binary_sensor
    hours: 0
    minutes: 0
    seconds: 0
    id: Motion detected
  • platform: event
    entity_id: timer.light_timer
    id: Timer finished - Light off
    enabled: true
    event_type: timer.finished
  • condition: time
    after: sensor.sun_next_setting
    before: sensor.sun_next_rising
    • sun
    • sat
    • fri
    • thu
    • wed
    • tue
    • mon
  • choose:
    • conditions:
      • condition: trigger
        • Motion detected
          enabled: true
      • type: turn_on
        device_id: 2dd03e650081fd8d7db4219ae76d3844
        entity_id: 5977e1ff3014bff578a5cbc3b6290730
        domain: switch
        enabled: true
      • service: timer.start
        data: {}
        entity_id: timer.light_timer
    • conditions:
      • condition: trigger
        • Timer finished - Light off
          enabled: true
      • service: switch.turn_off
        data: {}
        entity_id: switch.entrance_tvattstuga_on_off
        mode: single

It’s working exactly the way you designed it; it turns on the light (and restarts the timer) whenever motion is detected. It turns off the light when the timer finishes … but it will turn it back on if motion is detected.

How do you want it to work?

It works now, finally. Changed trigger/Entity on the camera to Person instead of Motion, seems to work as intended now :slight_smile:

For future reference, no one can know what was intended unless you tell us. In your first post you clearly said:

That’s all anyone in this community forum could know what was “intended”.