Cat Fans: Increase the amount a fan runs based on how many days it's been since I changed the letterbox?


(Nick L) #1

I have a closet where the cat’s litter box is. In that closet I have a exhaust fan tied to a smart things switch. I would like to program the switch to do the following.

Event: Every time I clean the litter box.

  • Is there a way to trigger the “event” from the smart things App?

Day 0: The day the event is triggered, run the fan right away for 20 minutes.
Day 1: Run the Fan for 20 minutes at 06:00AM & 06:00PM
Day 2: Run the Fan for 20 minutes at 06:00AM, 12:00PM, & 06:00PM
Day 3: Run the Fan for 20 minutes at 12:00AM, 06:00AM, 12:00PM, & 06:00PM
Day 4-10: Run the Fan for 20 minutes at 12:00AM, 03:00AM, 06:00AM, 09:00AM, 12:00PM, 03:00PM, 06:00PM, 09:00PM

I’m not sure even where to begin. Any help would be great!


(Matt) #2

You could create a separate timer for each day that the times fluctuate.


(Nick L) #3

@mattjfrank

That would work if I always changed it on a Tuesday and Friday. But I travel and am inconsistent. I can’t base it on a day of the week.

Perhaps there is another way that I’m over looking?

Nick


(Matt) #4

It’s above me, but I’m guessing a smartapp could be written that uses day number rather than day of week and you reset that day number when you change it. Hopefully someone with more knowledge can chime in.


(Bruce) #5

This would be a pretty simple smartapp, using @mattjfrank’s idea of using a day number. Especially if your schedule just is what it is. The app would schedule itself for 4 days, and then repeat indefinitely after that. Each time you changed the litter you’d have to trigger the app to start over. One way to trigger the app would be to just use a virtual button, a Momentary Button Tile, as it were. Each time you pushed that virtual button would restart the schedule.

Do you need help writing the app?


(Nick L) #6

@bravenel

That sounds like exactly what I need. Where would the “Momentary Button Tile” show up in the app?

If you don’t mind helping me write it, that would be great. Been a while since programming classes in college and not sure where to start. I’m a geek though and once you get me started, I can tweak and edit the code from there (if needed).

Nick


(Bruce) #7

OK. You can create a Momentary Tile Button in the IDE My Devices. That’s just a trigger for the app, the pressing of which would mean, litter changed. Let me suggest two things: First, read the developer documentation about scheduling, here: http://docs.smartthings.com/en/latest/smartapp-developers-guide/scheduling.html. Then send me a private message, and I’ll help you get started with the code. If you know how to program AT ALL, this is easy. Just think through the algorithm – getting that into Groovy is easy. I’d be happy to get you started, and once started you’ll be able to do this and a lot more…


(Bruce) #8

The Momentary Tile Button is just a Thing in the mobile app.


(Calvin Robertson) #9

Based on the day you could vary a runin() time 720 minutes the first day 360 the next day 180 the next day, etc.


(Bruce) #10

Ya, until it’s running every 22.5 minutes – for 20 minutes. At some point the app should send a text nagging for a litter change. Pretty funny idea, great automation!


(Keith Croshaw) #11

Anybody with cats… I can’t recommend The Cat Genie enough… I made a smart timer to turn it off at night because it’s loud, but other than that it’s amazing. Haven’t come in contact with cat excrement in 7 months, (gotta clean it out every once in a while…)

Look it up seriously, and don’t listen to the naysayers about costs, I have 3 cats and put less resources into than those people said they did for one cat. Basement is best though as it an smell as it’s washing but other than that green works fresh…


(Brad B.) #12

How about a canary on a pressure plate?