Rule running for months now throws errors


So a Rule Machine 5.0 rule has been running fine for months and after an upgrade to Hubitat last week (though not necessarily causal), it's now just giving errors. I'm not aware of anything else that has changed. (I have subsequently installed at least another OS upgrade, and I think this rule ran OK for a day or two, but then it's back to errors.)

Any ideas on where to begin to fix this?

I might try re-creating the rule in Rule 5.1. There were some problems with rules that had certain kinds of required expressions (predicate rule/conditions) in the past that were fixed but caused this kind of problem before that, and it's possible your rule ran into one of them. The difference is that now it warns you about the runaway schedule. :slight_smile:

2 Likes

You should definitely redo that rule in 5.1. There is most likely a scheduling bug in 5.0, and it's causing this. That bug was fixed in 5.1.

2 Likes

OK, I recreated it. Let's see what happens!

But, how I wish such mulligans weren't necessary! I wonder if apps could ever have an "advanced" tab with the full code exposed so those who are more comfortable could so some advanced cutting-and-pasting to save a lot of time clicking drop-downs? :wink:

I'll post an update in a day or two.

2 Likes

You misunderstand the design of Rule Machine. The UI presentation you see does not generate code. RM is not a compiler.

2 Likes

Well it must translate into something behind the scenes? But maybe that something is what has the suggested bug in it and that would come across too with the raw whatever-it-is

Rule Machine is written in Groovy. The configuration of Rule Machine, what the end-user does when they create of Rule, is not code. It is data used by the RM Goovy Code to determine how the rule will behave.

For users who what to 'see the code', they should simply learn to write their own Groovy Applications. For most simple tasks, writing an app in Groovy is not too difficult. However, writing an Groovy App like Rule Machine or WebCoRE... that is very difficult. :wink:

3 Likes

No, there is no translation to anything. Rule is not a programming language, nor a compiler, nor an interpreter. There are Settings and State variables set in various ways by the user interacting with the app. If you look at the App Status page you can see all of these Settings and State. If you export the rule these are written to a json file, and that can be re-imported to recreate the rule. To a limited extent a subset of those state objects represent a script that guides the running of the actions of a rule. In and of itself, this 'script' is incomplete, and relies implicitly on the Settings and other State objects to function.

2 Likes

Ah ok a bit like the xml tuning files in The Sims that provide data infill for the c# games procedures to eat at runtime

Download the Hubitat app