Pass Parameter to RM Local Variable when using Run Actions

Hi Everyone,

Is it possible, or if not is this an idea, to pass a parameter to a RM5.1 local variable (setting it) when you call a rule from another rule/button/etc?

Idea came from having two button controllers using the Run Actions to execute the same RM5.1 Rule, but I'd like to pass a variable to the rule (indicating the button) so that the rule can change a different lamp.

Button 1 Pushed --> Run Actions (Turn on Lamp Rule) with variable set to 1 --> Rule turns on Lamp 1.

Button 2 Pushed --> Run Actions (Turn on Lamp Rule) with variable set to 2 --> Rule turns on Lamp 2.

I didn't feel like writing multiple rules which are essentially the same but with a different end device. I also realize that I could use a global variable, but I was thinking that might cause issues if the buttons were pressed too close together. On the off chance.

Any thoughts?

Not sure if this will work for you, but the trigger device, I believe, gets passed from rule to rule. Not sure about from a button controller. Look at the variable %device% when in the RM rule. I think it might be set to the trigger device in the button controller.

You could also use a global. I believe you can set hub global variables in the button controller app.

I'll check it out. I guess I assumed that it wouldn't be because the controller app is triggering the action.

I did think of global variables but thought I might get a timing issue if the rule gets executed multiple times close together.

It doesn't pass the device along from the button controller. So in this use case it looks best to put the event subscription in the rule itself instead of using the button controller because then I can see which device triggered it.

It would be nice to be able to have it pass through from the trigger in the controller though where the other button rules for held and double tapped are.