Creating a Poop Alert

Hello everyone. I have a situation for which I would like to create an automation.

Our dog has learned to use a large cloth incontinence pad which has been placed in a doggy play pen as her bathroom. She learned this as a puppy and the weird little thing seems to think that going outside is something that "just isn't done" by civilized people.

Anyway, she will go into my home office area where we keep the doggy play pen and drop her load. When we know she has done this, we simply pick it up with a tissue and toss it into the toilet. Simple, but if we don't know she has done it, then the office smells like crap.. literally.

I put a motion sensor over the Pee Pen as we affectionately call it and I've also set up a spare Blink Mini that can display the contents of the Pee Pen on an Echo Show 8 in the Living Room. The motion sensor is exposed to the Echo Show and an Alexa Routine announces "Motion detected in the Pee Pen" if she enters the Pen.

Now.. you would think this is enough, but we have missed the announcement several times. I recently purchased a pair of RGBW bulbs and decided it would be neat to have a bulb placed behind the television backlight the wall in red and a desk lamp on my office desk change from Soft White to Red (I've "missed" a Poop Alert while playing games with headphones on).

Ideally, the Poop Alert would only fire when the dog has been in the Pee Pen at least 3 seconds to make sure she didn't just duck her head in there and do nothing.

I'd like the Red Alert lights to light up for about 2 minutes so we have time to notice it if we are watching television. After the two minutes, I'd like both lights to turn off, BUT would also like the Desk Lamp to reset to Soft White so I can use it more easily and avoid resetting the color by voice command with Alexa. In my rule below, I put in a 10 second fade so I could see if the color was changing on the Desk Lamp like I wanted it to.

I tried to do this with the Motion and Mode Lighting App.. but couldn't do more than turn on/off after 2:00 minutes.

I set up a Simple Rule, but I couldn't figure out how to change the color of the bulbs independently.

I made the following in Rule Machine and hope someone may have a more elegant rule as this one seems pretty clunky:

Bulbs are named "Poop Alert" and "Desk Lamp" (I also realize a named the Rule: Poop Alert)
Motion sensor is named "Pee Pen"

Select Trigger Events (ANY will trigger)

Pee Pen motion active and stays that way for: 0:00:03

Select Actions for Poop Alert

Toggle: Poop Alert: 100
Toggle color: Desk Lamp Red Level: 25
Wait for event: --> elapsed time: 0:01:30
Toggle color: Desk Lamp Soft White Level: 50
Wait for event: --> elapsed time: 0:00:30
Toggle: Poop Alert: 0
Toggle: Desk Lamp: 0 --> fade: 10

Do I need an "Exit Rule" action?
Also, I don't know if I'm using the "Toggle" action correctly. I assumed it would toggle from one state to another such as "off" to "on". When I test the automation, the living room "Poop Alert" light turns on for 2 minutes total and is Red. The "Desk Lamp" light turns on Red, but then just turns to Soft White and fades off quickly.

Thanks for an help with this crazy automation!!

I would not use Toggle in this case since you want a specific state.
I would specifically set to ON and OFF, and also specifically Set the DIM level and color.
Also FYI for most devices, if you set a level it also turns it on, so you probably only need to set the level.

Tried several other combinations of actions and this finally works.

Set color: Poop Alert Red Level: 100
Set color: Desk Lamp Red Level: 20
Wait for event: --> elapsed time: 0:01:00
Off: Poop Alert
Set color: Desk Lamp Soft White Level: 20
Off: Desk Lamp --> delayed: 0:00:05

Not sure if there is an issue with the Dim Action or these particular bulbs because I could not get the bulbs to Dim to 0 when selecting a Fade over time.

Using the Switch On/Off action allowed me to select the bulb and just switch it off.

The 5 second delay lets me know the Desk Lamp actually switched back to Soft White. I think this is why I was using the Toggle Action before. I was hoping that the light would toggle back and forth between Soft White and Red. Regardless, this is yielding the result I wanted.

Thanks for the input!

Thom

The bulbs or driver may not allow dimming to 0, but they should in case you wanted to do a slow fade to off. Could always do a fade to 1 then turn off if needed.

For setting the desk lamp, if it is something that you might possibly have on already you should check out the capture and restore options. You could capture the state of the desk lamp when the rule starts and then restore it back how it was when it ends.

Example I have that turns on certain lights for my vac so it can see better (and then sets them back how they were when its done).

jtp10181 -- WOW! Thanks for pointing that capability out. That is exactly what I need. After testing things, I realized that if I'm at the desk with the lamp on in Soft White and the Poop Alert goes off, I'm left in the dark and having to use an Alexa Voice command to turn it back on.

I predict commercial home automation solutions for odor / airborne chemical detection and analysis are ~10 years out. The race is on: will your pup learn to go outside in time for this development :grinning:

1 Like