Simple automation not behaving as expected

I have a Hue motion sensor on our landing, controlling a light. I want the the light to come on for 5 mins, if motion is detected between sunset and sunrise.

The problem is that after the 5 mins delay and the light has gone out, the automation won’t trigger again for several minutes, even if motion is detected. The automation appears to get blocked.

Here’s the automation:

description: ""
triggers:
  - type: motion
    device_id: f46fa5e069e99ad735f55a4971712017
    entity_id: binary_sensor.landing_motion_motion
    domain: binary_sensor
    trigger: device
conditions:
  - condition: sun
    before: sunrise
    after: sunset
    enabled: true
    after_offset: "-00:30:00"
actions:
  - data:
      rgb_color:
        - 246
        - 97
        - 81
      brightness_pct: 50
    target:
      device_id:
        - a78e5c2d3c76f167faa12a694220d00b
        - c0626aac904f2ae49c75fced050e9f7b
    action: light.turn_on
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - data: {}
    target:
      device_id:
        - a78e5c2d3c76f167faa12a694220d00b
        - c0626aac904f2ae49c75fced050e9f7b
    action: light.turn_off
mode: single

I’d be grateful for some guidance, please.

Jim

Hi Jim, have a look at this: Motion activated lights automation

Side note: Why and how to avoid device_ids in automations and scripts

Mode Restart fixed it. Sorry to have wasted ‘bandwidth’
Jim

Thanks for the helpful advice, Nick!
Jim

2 Likes

I forgot to mention to look at the traces from that automation.
If you haven’t done so yet, this is a way to start to troubleshoot these kind of issues.