Rule Machine - ERROR - Set Mode command crash if no mode is defined

Hi to all,

I ran into a nasty error with Rule Machine. I was working on a long (very long) rule and I wanted to add a line to change the value of a variable. Going through the popup menus I clicked by error on 'Set Mode' instead of 'Set Variable'. Rule Machine immediately run into a 'null()' Error and I was unable to access to my rule. Every time I tried to click on the rules I ran into the same error screen.

** This is very choking when you have a long and complex rule **

After some resignation, I realised that I started a mode change command but I have no modes at all defined in my system as I don't work with them. So I defined a mode and I was able again to access my code.

This should be corrected by Hubitat. I already run into a similar error with a variable not existing, but the error message didn't show the name of the variable so that I was not able to get out of that situation. Null() Errors should not be handled that way. It would be wise to show a Broken rule as for other problems and to allow the user to correct these errors, or even better, when trying to define a rule for a non existing item, ignoring the command and doing nothing.

I will look into this.

Fix for the no modes situation will be in the next release.

If you could provide more information about the variable not existing I could look into that. Pretty much all of the variable references are now pull downs that present a list of existing variables, so I don't know the context in which you had a problem.

2 Likes

Thank you for your feedback. It was shortly after the release of Rule Machine 5.0. I can't exactly say how it happened, but I created a Hub variable and used it in a rule. Some time later I was not able to access the rule with just this null() error. Looking at the settings, the variable figured in the list, but the value of the variable was null() too. Trying to delete the variable also ended up in a null() error. My only way out of this was to restore to an earlier backup. I'm pretty sure that it happened during a clone action (that has been removed now).

OK. If you ever encounter an error again, the thing to do that would be most helpful is to open a tab in your browser to Logs, hit refresh on the page throwing the error (even though it says Error), and then take a screenshot of the Logs (which will show a log entry for the error). That screenshot is what I need to see. Thanks.

1 Like

Download the Hubitat app