Poop Sensor & Fan


#1

Overview

This is probably the most ridiculous piston I’ve attempted to create. Essentially, I have a Zigbee light switch (Leviton) which controls a fan in one of our bathrooms. I’d like to have the fan turn on whenever someone has been in the bathroom for a “long-ish” amount of time…in other words, :poop:

I have a three-axis (SmartThings) contact sensor on the door, a motion sensor (Hue) in the bathroom, and a humidity sensor (ST).

What is the expected behavior?
If someone has been in the bathroom for longer than 5 minutes, then 30 seconds after they exit, turn the fan on for 10 minutes, unless humidity exceeds X (i.e. someone showering).

3) What is happening/not happening?
I first tried to do this using only the contact sensor (see screenshot). I was having an issue when the ‘active’ acceleration of the door sensor became inactive. I’m still not able to get this piston to work, nor am I sure exactly how I should incorporate the humidity sensor or motion sensor (which may show as inactive “during the act”).

4) Post a Green Snapshot of the pistonimage


#2

Why not just 1 if that checks for 1) door contact sensor changes to open and 2) previousAge([Basement Bathroom Door Sensor : contact]) > ({poopThreshold} * 60 * 1000) (and maybe 3) light on)? Then run your actions if all true.