Mapping Switch To Pico

Wondering if anyone knows if a way to map or bind a virtual switch to a button device like a lutron pico.

Short answer is yes - but you probably should share more details about your desired binding... E.g. does on map to pressed or held, off = released? Does the virtual switch need to auto-off? Or do on/off map to two separate buttons?

so basically since I can't expose pico's in google home, i want to create a binding between my pico's and virtual switches track whether a light is on of off. So Switch On = Button 1 and Switch Off = Button 5

This can be accomplished in any of the "rules" apps - Basic Rules, Simple Automations, Rule Machine. Essentially you would set up two Rules, one that triggers on Button 1 pressed, and has an action to turn on the virtual switch on - and the second triggers on Button 5 pressed, and turns the switch off.

If you want the switch as the master control, reverse the trigger/actions. If you want dual control, the rules get a bit more complex, as you need checks to prevent a feedback loop.

1 Like

right so I think i need to figure out dual control

Hmm... Might be a candidate for Rule Machine, with some Required Expressions?

Rule #1
Trigger: switch on
Action: press button 1

Rule #2
Trigger: switch off
Action: press button 2

Rule #3
Required expression: switch is off
Trigger: button 1 pressed
Action: switch on

Rule #4
Required expression: switch is on
Trigger: button 5 pressed
Action: switch off

To walk through, pressing button 1 when the switch is off will trigger rule #3, turning the switch on. This will trigger rule #1, and press button 1 again. But the loop is cut off but the required expression on rule #3 - the switch is now on, so the rule is not triggered again... Same flow for 4 and 2

wouldn't this lead to a loop?

The required expression in Rules 3 and 4 breaks the loop.