cancel
Showing results for 
Search instead for 
Did you mean: 

Scripted Automation for Presence Sensor flooding Activity Feed

FreemanAMG
Community Member

I have an Eve Motion sensor that use to control the lights in my kitchen between Sunset and Midnight. The problem is that the Turn Off automation generates an Activity Event every time I leave the kitchen, regardless of time. Why are my conditions being ignored?

automations:
  - starters:
      - type: device.state.OccupancySensing
        state: occupancy
        is: UNOCCUPIED
        for: 4min
        device: Kitchen Occupancy Sensor - Kitchen
    condition:
      type: and
      conditions:
        - type: time.between
          after: sunset-1hour
          before: 12:00 AM
        - type: home.state.HomePresence
          state: homePresenceMode
          is: HOME
        - type: device.state.OnOff
          device: Kitchen Main Switch - Kitchen
          state: on
          is: false
        - type: device.state.OnOff
          device: Cabinet Light - Kitchen
          state: on
          is: true
    actions:
      - type: device.command.OnOff
        on: false
        devices:
          - Cabinet Light - Kitchen
3 REPLIES 3

BrienGerber
Community Member

Is the action actually being performed, or is the routine just showing up in the Activity tab of the Google Home app, but your conditions are filtering out the action?

 

I've noticed sometimes the Activity tab will show the routine even if the conditions correctly filter the action 

The actions are not performed, so the conditions do work. Apparently is related to the "For: 4 minutes" part in my trigger

You also could use the suppressFor parameter as part of the starter, to prevent rapid activations in a time window