Checking for monsters (or cats) in the closet

So we have a cat that likes to sneak in behind us and hide in the closet (our closet is a huge walk-in that we regularly use as a changing room). The other day we accidentally locked the cat in the closet for 2 hours and it dug a nice hole in the carpet.

I picked up a motion sensor and a door sensor and added a simple automation to send a notification if the door is closed and there’s motion in the closet. (I even added a smart bulb in a lamp that would turn on, too just for kicks).

The issue I have is that every time we close the door, the automation triggers because obviously we had just triggered the motion sensor that’s by the door and then we close it, so the trigger happens.

Is there anyway to write an automation that essentially holds for four minutes after the door closes? (Since it takes four minutes for the motion sensor to go from “Motion Detected” to “No Motion Detected”).


I could easily do this in webcore.

IF Closet_Motion detected
Closet_Door has been closed for 5 minutes
send notification.

I could not find a way in automations to check for Closet_Door has been closed for 5 minutes condition.

1 Like

You could use a virtual switch to represent the possibility of the cat being shut in the room and trashing your carpet. So when you open the door …

    Door is open
    Turn off Schrodinger

and when you close the door

    Door is closed
    Turn on Schrodinger with delay of five minutes

And finally

    Closet motion is active
    Schrodinger is on
    Send notification

The cat still gets five minutes to trash your carpet though.


Or you could add a cat door to the closet door.

I set that same process up in Automations, but the issue is that as soon as you leave the closet and close the door, it sets off the notification.

1 Like


I have nothing serious to add to this discussion other than I feel your pain. Our cat would sneak in everywhere it could like yours. When people ask why I have sensors on every door and closet, I show them a picture of our cat…

It was so bad at one point that we just left everything open and had ST alert us if something was closed when we left. Eventually she realized that staying closed up in a tiny closet away from food and her box was not fun. I guess negative reinforcement worked in this case?

1 Like

Thanks, I might try this. The cat is usually fine for a few minutes

Thought about that, we have a cat door in our bedroom. The issue is that we don’t want the cat in there at all. The doors we have, you can lock to make them one way only, but then the cats bat up against them to get in. (Stupid animals only want to be where they can’t) I’m afraid that if I put the door there as exit only the cat will spend all night banging on it to get in.


webCore would certainly work well, but if you’re not familiar and prefer a more graphical interface, Sharptools Rule Engine would also work.


It’s not available in the official features, but there are alternatives… :sunglasses:

FAQ: Get a Notification if Something is Left On, Open, or Unlocked for X Minutes (2020)

Another vote for webCoRE.

I set this up and it seems to be working. This evening I’ll purposely throw the cat in there for a real test.


For anyone interested, it works perfectly. The motion sensor is able to pick up the cat in the dark. She spends 4 minutes looking around the closet, then our phones go off, the lamp turns on and the lights under the kitchen cabinet turn red.

I set up a second automation so that when the closet door opens, the lamp turns off and the cabinet lights go back to white.


I suspect that whoever is responsible for placing low limits on the number of automations doesn’t have a cat.


Interesting, I had no idea there was a limit, but I read up on it after seeing your post. The good news for me is that it looks like I can create scenes to lump in several actions, so I’ll play with that later. Thanks for the heads up.

1 Like