Litter Box Reminder Assistance


I have put this RM together and can't seem to get success. The first part (marking litter as cleaned) is working like a charm. I was struggling to get the delayed action to set it to "dirty" to work, though I may have finally gotten that to trigger. I have yet to see the While loop get triggered at all, so I'm never getting the nagging reminders to clean the litter. Can someone assist please? Do I need the While loop to be inside the if/then statements?

T.I.A.

You should turn on logging and then post a screenshot after triggering the rule for both when open and closed.

A nit picking thing, is you don't need a ELSE-IF, that could just be ELSE. If the contact is open then the only other option is closed.

It looks like if the contact opens the rule should just send it's been cleaned and exit.

Then when the contact closes it should wait 1 hour and then start sending notification every hour. Woudl have to see log to see why it's not doing that.

I have seen in the past that a rule would not trigger properly when using change, but would if you set two triggers one for open and one for close. It's been many revisions ago since I have seen that, however.

I've seen this as well, but I don't think this is the problem here. I suspect it is the delayed action. As your rule executes i see this sequence....

Contact changes from open to closed. Rule is triggered.
Any delayed actions are canceled.
First IF statement is false and is skipped.
ELSE-IF is true and executed, but the variable isn't changed immediately. Rule Machine schedules an action to occur in one hour to change the variable to false. Between now and then the value remains true.
While statement is skipped because the variable is still true.
Rule is fully executed and exits.
After a one hour delay the variable changes to false.

So I see two potential "fixes." The first assumes that you are intending to use a wait instead of a delay. That "pauses" the rule for one hour and then resumes it where it left off. The second is to add a second trigger for when the variable is changed from true to false so that the actions are run again, but this time the variable will actually be false and the while statement will be executed as intended.

I'll be honest, I think option 2 will work, but it feels sloppy to me. There is likely a better way to build this rule that feels cleaner.

Thank you. I am certainly new to Hubitat and the RM logic so any help is appreciated. I think you understand the intention of the automation. if the lid of our litter box is opened, tell me the litter was cleaned and wait 48 hours. after 48 hours nag me hourly until it's cleaned again. I rebuilt the app this morning and I'm waiting to test a few things. Here is my current logic:

while litter_clean = false - nag me
if litter box is opened - cancel delayed actions, set litter_clean = true, tell me it cleaned
elseIF litter box is closed - set litter_clean = false (delayed action by 48 hours)
endif

I wasn't aware of "pause" vs delay. I might end up trying that if this fails. Thank you both (Dylan and Terminal3). I'll report back.

I was reading it as a separate delay after setting the variable, but the delay is on the setting of the variable itself. So you are right the variable is not set false for 1 hour and the While is bypassed because the rule does not stop when the delay is used in this manner.

The log should show this, so always a good idea to post the logs.

I go down to the basement and clean my kitty's litter box once a day.
I think my kitty appreciates it.

Or just get a LitterBot. That thing has been a game chnager. And there are a couple community integrations to work with RGB bulbs to indicate when the tray needs to be emptied. For my 4 cats itā€™s usually 24 to 36 hours, depending on how wild a party my two tuxedo kittens had in there the night before!

While I do appreciate your solution, the $600 investment isn't up my alley. I was hoping to utilize what I already have in place, hardware wise. and it seemed a decent challenge to learn how Hubitat (rule machine) logic work.

1 Like

I believe I have my solution. I took some advice and simplified my logic significantly. No variable. Just simple timers that are cancellable. Hoping this helps at least one person out there.

1 Like

Yes. Until you have a Litter Robot, you donā€™t realize what a life changer it is.

Respectfully, you just donā€™t realize how amazing it is. My cats love that their litter is always clean. A very well-engineered product.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.