Release 2.2.8.143 Can't install new rules

After updating to 2.2.8.143 new RM5 rules will not install. I rebooted the hub to see if that would help and then clicked "Install Rule" again, but no luck

I assume you're getting as far as making a new rule? If so, have you tried the "Done" button in the rule instead of "Install Rule"? They should do basically the same thing, except "Done" closes that app and takes you back the app list, whereas "Install Rule" keeps you in the rule (on the same page), so you don't need to hit "Install Rule." (But because they do nearly the same thing, I'm not saying this will actually work.)

That being said, there's no reason this shouldn't work even if this possible workaround does (unless you're blocking JavaScript or using an unsupported browser; recent versions of Firefox, Chrome, and Safari should all work). I just tested and wasn't able to get it to fail for me, so I'm not sure about that part...

Yes, I have tried hitting "Done" and testing if the rule would trigger. It doesn't

My browser hasn't changed. It's the same browser I used to make rules in the previous version and that worked fine. I am assuming if I was blocking JavaScript a lot of other actions would fail.

Weird that it works for you...

But that could be a different problem. Is the rule not getting installed, i.e., added to your Apps list, or is it just not working as you expect after installation?

I'm assuming you don't have any RM5.0 rules installed.
If that is the case I would try removing RM5 and then installing it again.
Then see if you can 'Create New Rule'.

I have 30 RM5 rules. The rule gets added to the app list (without showing the "Not Installed" text). Then when opening the rule settings, it shows Not Installed. Like I said, the rule does not get triggered in testing, so it's more than a display problem.

Follow-up: I removed the Predicate from the rule and that made it work when hitting "Install Rule". I had a predicate that looked like this: Mode: Midnight AND NOT (time between x and y)

Just to follow-up again... I redid another rule from scratch to test this behavior and I'm seeing the same thing. It won't install with Predicate set. Removing the Predicate will allow installing the rule.

Haven't tested (yet) if re-configuring the predicate after the rule is installed, will work correctly.

Tested if predicate works after installing the rule... it won't trigger, so something is going on

A rule shouldn't trigger when the predicate is false (though until the predicate truth changes for the first time after installation, it may still "trigger" and just bail if the predicate is false). Can you provide a specific example of a rule that isn't working as you expect and the current states of any relevant devices?

2 Likes

I wonder if this could be a database corruption issue... ? Maybe try the road @bertabcd1234 is suggesting but if you don't get anywhere do a backup, download a local copy, do a soft reset, reload from backup. Make sure you do the backup because a soft reset wipes your database.

Just happened to me. After a reboot, rule still doesn't install... I'll try a soft reset in a bit...

Nope, soft reset and backup didn't resolve this issue... If I delete the predicate conditions (I had 2), the rule will install... still investigating

The conversation was about a rule that won't install if you configure a predicate. I mentioned that - for testing purposes - I tried to see if the rule would trigger, noting that I had set the predicate to be true. This was just to see of Hubitat shows the rule as Not Installed while it in fact was. It was not.

It would still be helpful if you could provide a specific rule where this does not work as expected for you (a screenshot if you can post one, or a complete description of all parts of the rule). Predicate conditions are new in 2.2.8, and maybe there's some odd behavior related to something specific that no one else has caught yet. Otherwise, in general, I don't recall seeing a problem like this reported anywhere yet.

1 Like

Here is my original rule that would not install, even after a soft reset

I deleted all predicates - and the rule installed. I added back the 1st predicate - and the rule ran. I added the 2nd predicate and the rule did NOT run even though both predicates were true.

It seems to run for all of my predicates EXCEPT the one dealing with time between 2 time variables. Even though the predicate shows true, the rule does not run:

If I convert that time predicate by moving as a conditional within the action as an exit, the rule runs fine.

Sure hope that helps locate this issue... holler if you need something else

Ah, now we're getting somewhere. :slight_smile: My suspicion is that there is something going on with the time component here--or, more generally, with using a variable as a predicate. Normally, a predicate subscribes to an event, and the rule keeps track of whether the predicate is true or false as these events fire and the resulting conditions become true or false. However, variables do not generate events, so when their value changes, it's likely the rule will never "see" that. I think they are going to do some more work to address this in a future version (they probably shouldn't allow you to select variables for predicates at all for this reason), though it's possible they've already made some changes since the initial release.

What you can do instead is use a connector instead. Either hub or local variables let you make connectors, which are just devices you can use in any app (including Rule Machine). Devices do generate events and should work for this purpose. That being said, I haven't tested this myself, and DateTime variables are new (they were formerly just Time), so there could still be some oddities in either case. But...this is what I'd start with.

Not sure I understand... both variables referenced are the new global variables WITH connectors.

So I'm not sure what you're suggesting, sorry

You need to be aware that Variables do not generate events, so they can't be used in Predicate Conditions because the condition will not be updated. If you want to use variable time in a Predicate, you must use a DateTime variable Connector.

There is code to prevent you from using Variables in Predicate Conditions, but evidently I missed the one you are using. Will get it so that isn't allowed either.