cancel
Showing results for 
Search instead for 
Did you mean: 

Help wanted: Script ignoring `for:` in starter

domwhewell
Community Member

Hey would someone be able to help, I have this automation to turn off the kitchen light if there is no activity for 2 minutes but it often turns off the light when there is definitely motion. If it helps the its an eve motion sensor over matter.

# Turn the light off
  - starters:
      - type: device.state.OccupancySensing
        state: occupancy
        is: UNOCCUPIED
        device: Motion Sensor - Kitchen
        for: 2min
    condition:
      type: and
      conditions:
        - type: time.between
          before: sunrise
          after: sunset
          weekdays:
            - MON
            - TUE
            - WED
            - THU
            - FRI
            - SAT
            - SUN
        - type: home.state.HomePresence
          state: homePresenceMode
          is: HOME
        - type: device.state.OnOff
          state: on
          is: false
          device: Night Switch - Bedroom
    actions:
      - type: device.command.OnOff
        on: false
        devices: Kitchen Light - Kitchen

 

1 REPLY 1

domwhewell
Community Member

I'm just investigating this a bit more and looking at the logs, it looks like the automation is starting as the kitchen is occupied. But that definitely isn't in the script...

23/01/2024 22:00:00
[INFO] Starter check: conditions not met.
23/01/2024 22:00:00
[INFO] Starter check: conditions met.
23/01/2024 22:00:00
[INFO] Automation started by: [Motion Sensor] because [home.graph.traits.OccupancySensing/occupancy] [string_value: "UNOCCUPIED"].
23/01/2024 22:00:00
[INFO] Automation started by: [Motion Sensor] because [home.graph.traits.OccupancySensing/occupancy] [string_value: "UNOCCUPIED"].
23/01/2024 21:59:36
[INFO] Automation check: conditions met.
23/01/2024 21:59:36
[INFO] Starter check: conditions met.
23/01/2024 21:59:36
[INFO] Starter check: conditions not met.
23/01/2024 21:59:35
[INFO] Automation started by: [Motion Sensor] because [home.graph.traits.OccupancySensing/occupancy] [string_value: "OCCUPIED"].
23/01/2024 21:59:35
[INFO] Automation started by: [Motion Sensor] because [home.graph.traits.OccupancySensing/occupancy] [string_value: "OCCUPIED"].