I have a vent fan controller that is a combination of circuits and ESPHome YAML code from different sources. The one I’ve made is for use in my shop, to handle smoke from my CNC/Laser system and to vent my 3D printers.
I have two small dogs and have them trained to use a pet potty and will soon be moving that potty area into a storage closet and adding a vent fan and using an ESP32 to control it in the same way I’m controlling the ones in my shop.
I don’t want the fan running all the time. I thought about maybe doing something like 5 minutes of every hours, but, ideally, I’d run it for 5-10 minutes after every time they use the puppy potty.
I have never had to detect motion or change and have thought that of 3 possibilities:
- A motion detector, or
- A video camera
- Some kind of entrance monitor
The problem is I want the area of detection to be limited to ONLY the pet potty and I know many motion detectors use ultrasound, so I don’t want to use sound that will bother dogs. I don’t know if there are motion detectors I could use with ESPHome, or just what kind of input from them I’d be looking for or using.
For video, I thought it might be possible to mount a webcam that would detect when X% of the image changed, or when it detected change in the image (which would mean a dog was in the potty area). Of course, there would be some tolerance in there to allow for the change over a day as the dogs make use of the potty pads. So I can’t just do something to check if the image is all white or not. (The potty pads are white, so if I had a camera, I figured it’d look straight down on it.)
For an entrance monitor, that can’t be something they step on and trigger, unless it can go under a protective shield, so there’s no problem with potty leakage possibly damaging in (if that kind of leakage happens). Maybe a light beam they don’t see that gets interrupted as they go in?
I’m sure there are a number of other methods I haven’t even thought of. I’m open to other ideas. The main point is to be able to toggle something on when motion ends. (I may need to toggle something when motion starts and something else when it ends - but I would think the end is more important than the beginning.)
What I’d do would be to set up the system using a countdown (I forgot the actual object name - it’s in my current fan controller code) so the fans would start a few minutes after the motion happens and stops. That way the dogs don’t associate their actions with triggering the fans.
Any ideas on how to detect when they go in the potty area and leave it?

