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: “”
trigger:

  • type: motion
    platform: device
    device_id: c3c29f6964cf3e3594ed0c913b74f5bf
    entity_id: e2cdcee3b0ca15feab4d856e5f0ea8b9
    domain: binary_sensor
    for:
    hours: 0
    minutes: 0
    seconds: 0
    id: Motion detected
  • platform: event
    event_data:
    entity_id: timer.light_timer
    id: Timer finished - Light off
    enabled: true
    event_type: timer.finished
    condition:
  • condition: time
    after: sensor.sun_next_setting
    before: sensor.sun_next_rising
    weekday:
    • sun
    • sat
    • fri
    • thu
    • wed
    • tue
    • mon
      action:
  • choose:
    • conditions:
      • condition: trigger
        id:
        • Motion detected
          enabled: true
          sequence:
      • type: turn_on
        device_id: 2dd03e650081fd8d7db4219ae76d3844
        entity_id: 5977e1ff3014bff578a5cbc3b6290730
        domain: switch
        enabled: true
      • service: timer.start
        data: {}
        target:
        entity_id: timer.light_timer
    • conditions:
      • condition: trigger
        id:
        • Timer finished - Light off
          enabled: true
          sequence:
      • service: switch.turn_off
        data: {}
        target:
        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”.