Rules randomly not working

Hey all,

I've noticed some of my rules will randomly not fire since the latest update. I'm running version 1.1.6.116. Several rules inside of rule machine have randomly not run. I haven't been able to figure out a cause or a link yet. They had all been running perfectly prior to the upgrade and I haven't changed anything other than running the upgrade and rebooting the hub after i discovered several rules not working.

Examples:

Yesterday I noticed that my kitchen lights didn't go on at 4:45pm (they are set to turn on at 4:45 and go off at 6pm). I went to the log, the rule did not try to run. So I went into the rule opened it to make sure it was set to run every day. I clicked done and the lights went on and turned off at 6 like they were supposed to. These lights are zigbee and attached to my phillips hue bridge

This morning I opened a door that is supposed to trigger 2 lights to go on. They did not turn on. I didn't have time to check the logs at the time as I was leaving. Those lights are not on the hue bridge and now that I'm back home the rule seems to be running properly again.

There are a few others lights not going off when they should etc. Any ideas as to how I can start troubleshooting? Should I just open all the rules and re-save them and see if that helps?

Thanks for your help all

Logs are the best tool. Rule Machine will log everything that happens. If the rule itself doesn't fire when it should, I'd very much like to have the details. The next place you look is the app status page (click on the circle i on the apps page for the rule in question). On there you can see the scheduled jobs. If something didn't happen when it should, I'd like to see the bottom half of that page, and the rule itself, just its main page. Finally, if you see a rule fire but the lights didn't turn on, check the device page for the device in question. You can also click on Events from that page to see recent events for that devices. Between those sets of things, we can usually pinpoint what happened.

Thanks for the quick reply. I'll start keeping track over the next few days and report back any issues

1 Like

I have a somewhat related issue. Yesterday I created a time-triggered rule to activate a Good Morning scene at 7am on weekdays.

and it didn't fire this morning. I checked the app status, and the the schedule seems a bit off.

I mean, the cron schedule looks plausible, but the "Next Run Time" field says it's set for Sunday morning.

Errors in logs? Oh, I see. Let me check that Cron string.

11%20AM

Looks like it's generating the wrong cron string for weekdays. Will investigate and fix. Thanks for finding this!

1 Like

Interesting. Does Hubitat's crontab have Sunday == 1, then? (Not that it's particularly important, I just assumed crontab formats were fairly standard.)

That is the crontab standard. Rule Machine had 1,2,3,4,5 for every weekday, should have 2,3,4,5,6. Easy fix, already done.

40%20AM

Apparently BSD/Mac's format differs; it has Sunday as 0 or 7, Monday as 1, etc. Maybe someone was looking at a Mac man page when they wrote that. :slight_smile:

Haha, the somebody was me, and I don't remember what I looked at. Maybe ST is different, because that was where that code was written and tested. Suffice it to say that the online CRON string calculator and our hub have Sunday = 1.

Things were working well until this morning. I have a rule that turns on several lights and changes the mode. I see that according to the log, the rule ran but no lights turned on and the mode didn't change. I think I've included all the requested screenshots. Thanks for the help!

Just an update. I went in to the rule in rule machine and hit done and the lights that were supposed to turn on 25 min ago turned on and the mode changed like it was supposed to. Hope that helps

Do you have any Restrictions set on that rule? Only during mode Night and only on Sunday. What was the mode at 5:30? If it wasn't Night, the rule wouldn't run.

It did not run at 5:30. It looked at the time then, but didn't run. Notice in your log you posted "Backdoor Light is now True" -- that is what it looks like when a rule runs. There is no such entry for Church Good Morning.

Hi Bruce, The mode was set to night. I checked after the rule didn't run and it was still set to night.

I'm confused. The last line of the log that says Church good morning.

That's actually the first line (newest on top, scrolls down). That is the rule saying it was fired by the time of day being 5:30. If it had run, it would have said Church Good Morning is now True, as the next entry. But it didn't say that, so that means the rule evaluated to false or was Restricted. I don't know why it didn't evaluate to true. That much is a mystery at the moment.

I would suggest that you experiment with this rule by changing it some, and testing. You probably don't need the mode Restriction. You could try testing with different times, in the near future, to see if it runs or not.

that line just says that the rule was monitoring a condition for time and saw it hit the set point, 5:30 happened. But that did not cause the rule to become true and execute. Here is a rule I have Called Path Lighting On. You can see it is monitoring all of the conditions that are part of the rule and when they finally all line up it goes true and when one of them falls out it goes false.

Got it thanks! You're right I probably don't need the restriction for mode. What's puzzling to me is that when I opened the rule, it said true. I'll remove the mode restriction and see if that helps. Thanks guys

Whenever you open a rule and hit Done, it is evaluated and does the true or false part.

Got it. What confused me is if you look at the rule machine screenshot it was listed as tru

Look at the log, when did it change from False to True? If it was already true at 5:30 it would not fire any actions. So did it go false since the previous time it went true?