Global/Local Variables

Here's how I do something similar... I use modes and scenes but the idea is the same.

Hmm. Very interesting!!
May I ask how you do this.
I get the global var and connector bit. It's the adjusting from a dashboard tile I don't get.
Would you mind telling me how you do it.

If you use a Variable Number tile when you tap on it, it allows a new number to be entered.

Thanks for the quick reply.
Just been playing and managed to figure it out. I like it!!!!!!!

1 Like

Yep I used to do this with many platforms though their dashboards that is why variables are so powerful. And with a macro language like Rule Machine you don't have to write apps or device drivers to do it.

ok, i still need a little more info. does anyone know if the devs has put a video of global variables up?

i have tried to mess about and i cant even copy that screenshot to try to get a understanding whats going on. in variables, whats the connector for "lux_indoor_lower_limit(80) <<<< its the number i cant replicate. also when trying to "compare to a..." i choose variable and nothing comes up

80 is the illuminance value that existed at the time you looked at that. Show the rule you have setup, that you can't get to do what you want.

Are the new hub variables only accessible from 4.1 rules? I tried to update a 4.0 rule, but I don't see the hub variable when I'm entering a new IF statement.

Hub Variables are not supported in any version of Rule before Rule 5.0, when they were introduced. We are now using Rule 5.1. Before 5.0, Rule-4.0 and Rule-4.1 used Global Variables implemented in Rule Machine.

Yes, I mean 5.1. So in order to use them, I need to re-code the rules from 4.1 to 5.1?

1 Like

Also wondering similar thing - any way we could set the value of a global variable value created in RM Legacy in Rule-5.1?

Not sure what you're asking. But if the question is accessing a value of an Legacy Global variable in a Rule 5.1, or vice versa, accessing a Hub Variable in an older Legacy rule, you could do this via a connector. Both 4.1 Global Variables, and Hub Variables allow connectors to be defined. These are simply virtual devices that mirror the value of the variable itself. Setting the variable sets the device, and vice versa. Such devices can be accessed in ANY app.

1 Like

@bravenel just a quick improvement hopefully in RM 5.1 , I have a hub variable for a time value (number) in a rule I want to use it as a delay on an action in minutes but it has no option to switch so the variable is used in seconds, no biggy just times by 60.

Could RM be updated to have the option between seconds/minutes/ hours when using a variable for delays

No. Too much UI complexity.

OK,. If I selected the hh:mm:ss option instead could I use the %variablename% in the minutes field?

No. Same issue, only worse.

OK then I can create a in rule variable I can do the math on

1 Like

I couldn't see how, but is there a way to do this in simple automation or Basic rule that I'm missing

No.