Condition for a button rule based on another button

I have a Hubitat 8 Pro and various Lutron Dimmers and Picos.

I have a 2 button Pico where I have set Button 2 to switch on and off lights based on waiting actions for various times.

I would like Button 1 of the same Pico to run a set of light if Button 2 was not pressed previously or is not engaged in running the 'if' process.

I would also like Button 1 to run a different set of lights (on/off) if Button 2 was pressed previously and is currently undergoing its if rule process.

I have attached a screenshot of the If tree. Button 1 doesnt seem to know the difference of when Button 2 was pressed or not.

Any help would be appreciated.

Have you tried setting a boolean hub variable to true when the button 2 rule starts running and then to off when it stops? The only thing to remember is that the delayed events would not be included in this - some could still be ā€œwaitingā€ after the rule completed.

1 Like

Thats an interesting suggestion.

I created the private boolean to true at the start of Button 2 and off at the end.
I dont see how the wait time can be excluded in this though.

Now that this is inserted in button 2 how do I create an IF condition for button 1 to check if the Boolean is True or False?

1 Like

For the boolean, I think it needs to be a Hub Variable. I can’t recall if a rule’s private boolean can be read by another or not…

For the condition under button 1, you could do the same as what you have already, replacing the ā€œHallway All: button 2 pushed runningā€ with ā€œBoolean is trueā€:

If Boolean is true, then
First option
Else
Second option
Endif

I cant seem to set the button 1 to check is the private boolean from button 2 is true or not.

How would I do that?
Or use the hub variable?

You can't do this. A rule's Private Boolean is kind of like a local variable to that rule only with the unique thing being that it can be set to true or false from other rules. To do what you want, you'll need to create a Hub Variable from the Settings page. From there, you'll need to use Button 2 and its various steps to set the Hub Variable. For every IF in Button 2, you should have the setHubVariable be the first command. Then, Button 1's rules can read off the Hub Variable and do its branching based on that value.

With all this said, have you consider just buying either a dimmer pico (usually around $20 or so) or a scene pico (usually between $50-70)? Going this route would give you 4-5 buttons to work with and might greatly simplify your rules.

2 Likes

This worked a treat! Thank you!

I wanted the 2 button because its the Home and Away Pico

PK2-2B-TAW-P01

1 Like