Strategies to redo rules if missed

I'm not sure if there is a good answer to this, but I am wondering if others have any strategies to redo rules that don't successfully do their action. In other words, if I have a rule to turn on some lights at a specific time, I would say that 90% of the time it works fine, but for the other 10%, I am having to go in manually and run the rule. Is there a way to set up a rule structure so that if a rule fires and is not successful that it tries it again?

I think the best route might be trying to figure out why the rule never fires in the first place. Is it that the rule never triggers or the rule triggers but one of the actions it is supposed to do does not work correctly?

I could see where you might be able to write a second rule to make sure the first fired ok by checking a hub variable or something. In other words rule #1 could set "rule_1_completed" and rule 2 could check to make sure "rule_1_completed" was true. Or if rule 1 is supposed to turn on the bedroom lights you could have another rule check the bedroom lights to see if the first rule completed. But it gets messy quickly.

I guess you could add a delay, then test if the lights are on and turn them on if not. Which works for devices that can have their state tested but not for more abstract actions

1 Like

Yeah I think finding out the reason why they don't always fire is the better way to go. If I want to start debugging, is the best way to go into each rule and turn on logging and app events? Or what would be the best way to understand why something is not running? The logs will show me when things run, but I guess I want more information that could cause them not to.

Yeah logging is your first bet. But to your point it will only tell you what IS happening not what is SUPPOSED to happen but does not. That has to be derived from the log results. Also is the issue the rule is not triggering at all, or it is triggering but certain actions just aren't working? Like if the rule triggers at 10 am and turns on 4 lights, do only 3 of the lights go on or does the rule not even trigger?

You could also post the rule and let folks take a look. Or post the rule and the logs. Screen shots work best for both,

Awesome. Sounds good. I'll turn on logging for a few rules that might have issues and start the troubleshooting process. Thanks for the help.

1 Like

Here's how I manage that situation:

  1. Wife shrieks that light isn't turning on again.

  2. I shriek "Don't touch the switch!"

  3. I start fiddling with the Hubitat app on my phone.

  4. Wife turns on light with switch anyway.

  5. I can't figure out why the light didn't turn on.

  6. Light seems to work OK again for no particular reason.

  7. Problem solved!

3 Likes