Rule Machine Global Variables

When it comes out (soon) there will be a red notice upper right, and you go to Settings / Check for Updates.

1 Like

The fix for this was released 2.2.9.146

1 Like

2.2.9.146 fixes the define in settings, but "AM" shows ups when I use the GV in a Rule.
See attached.
John
gvdefined
gvinrule

Yea, I missed that one, and realized it later... Fix is coming. That is a UI issue only. The time shown on the Hub Variables page is correct.

Thanks for the quick responses. I experimenting with the best way to test my rules that will run at certain fixed times, but I want to do the testing at anytime. Is there a way to get sunset into a GV.

You should able to use a rule to do it, but believe it's already generally available as a variable to most things.

Yep, I was being lazy. Just discovered that can be done. I want to start testing many rules that will normally use sunset, but I want to test at other times and I would like not to redo the same rules after my testing is done. There probably many ways to do this, but I'm a novice.

I have noticed that the GVs that I have been creating and using seem to remain "being used" in rules even if I remove them from the rules. Is there a way to do edit of rules to prevent these false flags?
Thanks

They should be cleaned up. I will look into it. You do have to hit Done in the rule.

Is there a way to use a "legacy" variable in a new rule machine rule?

I understand why a new hub variable can't be used in a legacy rule (no backward compatibility), so I have re-created legacy rules in the new rule machine, when I want to use a newly-defined hub variable. Will I also need to re-create variables (and any legacy rules that use them) in order to make a new rule that uses what is currently a legacy variable?

Depending on how you're using the variable, you could create a connector, then use the connector instead of the variable directly. If you aren't familiar, this makes a device you can use in any app, Rule or otherwise (though I suspect Dashboard may have been one of the primary targets).

There is no way to use legacy global variables in Rule 5.x; that was one of the breaking changes and the impetus for an entirely new parent app (where these used to be stored) as well.

2 Likes

Thanks. I have a connector for the variable, which shows up as a Rule Machine Connection device, but I couldn't see how to manipulate it in a rule.

At any rate, the workaround I ended up using was to clone a Legacy Rule Machine rule and then modify it to do what I needed to do with the variable.

Sorry If this has been covered already, but where would I find global variables now? The legacy version which I have always used keeps crashing now?

app:10822021-12-29 07:48:36.676 errorjava.lang.IllegalArgumentException: A device with the same device network ID exists, Please use a different DNI on line 383 (method globalVar)

Shouldn’t be crashing (looks like maybe a connector conflict) but Hub Variables (the new Global) are under Settings | Hub Variables

3 Likes