[BUG] Changing variable resets everything

As already mentioned in this thread is resetting everything only because of selecting another variable a big "no go":

This happens e.g. when you edit a set variable action:

Everything still OK:

But after only selecting another variable:

All the settings for this action are gone!?! :open_mouth:

And to make everything even more unsatisfying:
There is no possibility to UNDO!

I have seen something that seems to me to be very similar to what you are showing. When it was investigated by @bravenel, the cause of the issue was found to be with the driver code.

There can be a problem with how the attribute was declared in the driver (Ex.: “Text” versus “ENUM”).

I am not a developer, so this was a bit over my head... Assuming that this problem is with a community driver, the developer might be able to make some code modifications to fix this. Alternatively, if you can code in Groovy, you might be able to make/test some changes yourself to see if it fixes the issue.

Hi @Sebastien, thanx a lot for your answer!

But the problem shown in my example is 100% driver independent; In fact no device is touched in this rule action.

Setting variables are completly done by Rule Machine itself.
BTW: Where is the source code for Rule Machine published? :thinking:

Ah! Then it might be a different issue...

It is not. It is proprietary to Hubitat.

1 Like

This kinda relates to the OP.

Didn't want to start a new thread on this as I'd kinda rather hide the stupidity of not thinking about the consequence of my actions.

Set up Local Variable in RM 5.0
Went in and used the variable in a Delay
Decided I didn't like the name, went back to change it
Didn't see how to change, so created new one
Blissfully decided to do the house cleaning and DELETED old one

Yup, sure enough I broke things with the old one still referenced in the rule !
-----> [error] java.lang.ClassCastException: null (mainPage)

I get blank screen trying to get back in there and change the reference to the old variable.

Don't think I'd call this a bug because it was risky to follow this order of revisions. But it would have been nice (but not essential) to have been able to EDIT that original variable name. @bravenel

1 Like

Yeah, there is some ungracefulness in how it deals with removed variables, and certainly so in that context of a variable delay. I'll see if that can't be smoothed up a bit for the next release.

It does warn you IF the rule has been completed. In the case where the rule hasn't been completed when the variable is removed, there is no warning. But still, it could be more graceful.

1 Like