CoRE - Get peer assistance here with setting up Pistons

Edit: SOLVED - I just didn’t have the right wait time. I found that the system needed more time and it worked well after 4 seconds. If I go any shorter, it uses the previous variable value. I’m going on the assumption the system just needed more time to write to the variable space. Below is a picture of my setup, in the event someone is looking to do the same thing.

Hi Everyone,

I can use some help with the latest Piston I’m trying to configure. In short, I’m looking to control three dimmer switches via one virtual switch. Here is a bit more information…

Setup

  • I have three dimmers: Kitchen, Living Room, Breakfast Nook
  • I created a Simulated/Virtual Dimmer based on a custom device handler (see link below if curious). The new dimmer switch is called Main Floor Lights

Objective
Use the Main Floor Lights virtual dimmer to control the Kitchen, Living Room and Breakfast Nook dimmers. I want the percentage of dim to carry over to each of the three dimmers.

What I Have Tried

  1. I tried the Dim With Me SmartApp and it did not control the dimmers at all
  2. I created a CoRE Piston to change all three dimmers any time the Main Floor Lights switched was changed. I didn’t get the exact percentage to carry over, however. I used ranges to set the level. Basically, if the virtual dimmer was set to anything in the range of 1 - 33, I set all three switches to 25%. If the virtual switch was set from 34 to 66, I set all three to 50%. 66 - 80 = 75% and 80%+ = 100%. While this worked, this is not ideal.
  3. I tried creating a Piston that extracted the the state from the virtual switch and stored it in a local variable. I did this using the task: “Save state to variable” and grabbed the level. I named the variable mainFloorLightLevel. I then used “Load state from variable” for the three switches. This had unexpected results. Every time I changed the virtual dimmer level, the three dimmers got sent to the previous virtual dimmer level. For example: The virtual dimmer is set to 45%, I change it to 88%: all three dimmers get set to 45%. If I then change it to 27%, all three go to 88%. I thought the issue was due to both the level setting and the variable setting events happening at the exact same time, so I tried adding a wait before using the variable. No luck. I thought about a global variable, but I’m not even sure how to create one…

I have tried setting this up in so many ways, including follow-up Pistons and the like. Still no luck. When I get change, I’ll upload a picture of my current setup…even though it isn’t working.

Thanks for reading through. Thoughts?

Virtual Dimmer Custom Device Handler: How to create a virtual dimmer?

Dim with Me App: Dim With Me App Updated