Limit automation trigger cat litter box motion sensor

Hi,

I have a motion sensor on the cat litter box so I can keep an eye on when he goes, and I know when to clean up.
However my cat has the habbit that he goes back in and out 3-4 times (because cats, what else). So I get a ton of messages.

Is there a way to limit the trigger somehow, that if it triggers once, it shuts up for at least 5 minutes? Thanks in advance!

My trigger:

platform: device
domain: mqtt
device_id: 931619281a1611eb95b34943727631e6
type: action
subtype: tilt
discovery_id: 0x00158d0002c4a7e1 action_tilt

My action:

data:
  title: Cat just went to the litterbox
  message: 'Check the box, and clean up, you lazy pig!'
service: notify.pushover_me
action:
  - service: notify.pushover_me
    data:
      title: Cat just went to the litterbox
      message: 'Check the box, and clean up, you lazy pig!'
  - delay:
      minutes: 5

In single automation mode (default) this will not run again until the delay is finished.

Thanks @tom_l, I saw this before but I expected not to wait after the first trigger, but more like a ‘sleep’ kind of thing. I’ll give that a try, thanks!

Using this method is easy but the cat can re-trigger the automation, it just wont run because in ‘single’ mode only one instance of the card is allowed to run at a time. It will put a warning in the log that the automation is already running (really this should be at the info level IMO).

There is a more complex way of adding a condition to check the last time the automation ran. See here for an example:

It’s how I used to do it. Now I just use the dely method.

Thanks, I’ll keep using the delay method, works like a charm! Though I agree this should actually be info level, yes.

1 Like