Rule trigger set to hub variable change, but variable change doesn't trigger

Hello All. I would sure appreciate some input.

Goal:
Get the 1st rule to trigger when a hub variable is set by the 2nd rule.

The 2nd rule detects a switch was changed independent of the rule that handles the night light routines, it sets a hub variable to say as much. Problem is the 1st rule doesn't retrigger even with a Trigger set to the variable changing.

I can see the variable change in the logs, then nothing... The 1st rule doesn't refire even with the trigger.

Am I just overlooking something simple?

Thanks,
Marty

First, if you aren't on the latest hub platform, I'd suggest updating in case there were any fixes (I don't recall this being one recently, but you probably won't get help with this on an old version anyway). You can use Settings > Check for Updates to verify.

If you are, try just hitting Done in the rule to re-initialize things, including the subscription to the hub variable. If that doesn't help, there's more you can look at but probably not much else you can try to fix it yourself (unless trying a new rule just works), so it's possible there could be a bug. I haven't seen anything on this recently FWIW.

In addition to what @bertabcd1234 said above, please look at the Event Subscriptions on the App Status page (gear icon) of the rule that won't fire as expected. If you could post a screenshot of those that would help. I may want you to post some logs, but for now let's just start with that. Please do update to the latest release first.

There could be a bug causing this, but one I'm not aware of. If there is, it will get fixed pronto.

This happened to me too after a recent update. (I think .117 or .118, but I’m on beta so not sure.) Variable changed but no trigger. You can see that I re-initialized and that fixed the problem. But it definitely didn’t resubscribe to the event after the update. I thought I was going crazy, but it’s good to know at least @marty thinks I might not be!

I can't reproduce what I saw. I am chalking it up to me edited the rule and not pressing Done.

Could have sworn I saved/initalized it, but must have been wrong.

I appreciate your quick response regardless. Sorry for the false alarm.

I’m having similar issue after the latest update. I updated two nights ago and started having this problem. Has worked for well over a year. One rule sets a variable then the second rule triggers off of that change.

I can get the second rule to trigger if I go into Hub Variables and change the variable manually.

I was on version 2.3.5.118. Seems like the upgrade to version 2.3.5.121 brought this on.

Oh, interesting, this is my setup as well. I manually changed the variable to make sure the app was working, and it did… but sounds like I need to test the exact scenario!

Please show the rules. There was a subtle change made in the hub with respect to Hub Variable caching, and this could be related to that.

1 Like

The variable "F2 Begin Dosing" DOES get set to "Yes" via the rule "AD - F2 Monitor". But the other rule "AD - F2 Reservoir" doesn't trigger as a result.

I do get the rule "AD - F2 Reservoir" to trigger by going into the UI and changing the Hub Variable "F2 Begin Dosing" to "No" (something other than "Yes"), then back to "Yes".

Please turn on all logging for these rules, and post a screenshot of when it fails.

Also, please show the Event Subscriptions from the AD - F2 Reservoir rule, on its App Status page (gear icon).

1 Like

One rule sets variable "F2 Need Dosing" to Yes. The other rule is triggered by "F2 Begin Dosing". That's your problem!

I apologize. There is an intermediary rule "AD - Master Controller" that runs every minute. It's a polling rule to dose reservoirs, but ONLY one at a time. So if 2 reservoirs report needing dosing, one wins and one waits.

I assure you, these have been running without a hitch for well over a year. It's not something that "rookie" :wink:

Working on getting you the information you've requested. I believe all you need is the "AD - Master Controller" rule and the "AD - F2 Reservoir" rule.

The "AD - F2 Reservoir" rule generates no logs as it never triggers.

The strange thing... it has failed 100% over the last day & a half. About 12 different times, consistently, over 3 different sets of rules & variables (3 reservoirs). Just now, it worked. I will continue to monitor and report.

That error in your logs is quite telling. Polling is a bad idea. I suggest you rethink your approach to this. You want your automations to be event driven without polling.

I will work on reducing or eliminating the polling. The thing that puzzles me is that the variable actually gets set properly, but the other rule doesn't trigger by that variable getting set. It worked twice out of 5 times yesterday, 0 for 8 so far today.

There is no doubt that the rule "AD - Master Controller" (which polls every minute) utilizes the most hub time of any rule. By far. It has been working 100% for over a year, now it fails almost every time over the last few days. I ASSUMED it was due to the .221 upgrade, because the timing fit. I will continue to monitor, tweak and report.

There was some checking added to the hub that is getting caught by this, and killing the app. We are going to modify that to warn instead of kill the rule.

2 Likes

Is there a mechanism to send out alarms for higher load? Either via email, SMS, or app?

The easiest method is to use this driver:

You can then setup a notification rule of your choice. There are plenty of options: push notifications via the Hubitat app; email (there's a few custom apps that can do this; and direct text using something like Twilio (there's a built in virtual device driver for this one).

1 Like

I've got my polling rules under control, and switched some to event-based triggering. Once I slowed the main polling problem rule down, things became stable again. FYI