Using PLEG to sync light levels across different circuits in kitchen


I have three circuits in my kitchen I would like to keep synced. The main Kitchen overhead lights and 2 different under cabinet lights. The kitchen is on a Leviton controller and the 2 under cabinet lights are on Kichler z wave dimmers. I would like the 2 under cabinets lights to track the main kitchen lights for on, off and dimmer changes. I don’t want the Kitchen to track the under cabinets. I would like the under cabinet lights to be able to be turned off independently of the Kitchen overhead lights. I keep thinking I saw a post on this type of implementation, but have been unable to find it. Is this possible in PLEG and does anyone have a link to that discussion?


You are going to use the LoadLevelTarget property of the 3 switches


KitchenDim Set all three Inputs to be DeviceProperties with LoadLevelTarget


SetCounterDim = KitchenDim


SetCounterDim - Set Load Level Target on both counter Dimmers to {(KitchenDim)} in the advanced tab [select only one if you include the 2nd part below]

If you want the two other dimmers to behave the same and be controlled by either switch (just remember they will do that in any scene you have either switch)


Dim1 = (CounterDim1 != CounterDim2) and (CounterDim1 ; CounterDim2)
Dim2 = (CounterDim1 != CounterDim2) and (CounterDim2 ; CounterDim1)


Dim1 Set Load Level Target on CounterDim1 to {(CounterDim2)} in the advanced tab
Dim2 Set Load Level Target on CounterDim2 to {(CounterDim1)} in the advanced tab

fixed the names…

Thanks. I will give that a try. Frist attempt to use PLEG so will be interesting.


Assuming these are instant status switches, If you get frustrated that you cannot adjust the KitchenDim without affecting the CounterDim’s you can modify this:

SetCounterDim = KitchenDim

To this instead:
SetCounterDim = KitchenDim AND (KitchenDim;Now<1:00)

This will allow you to change the dim of just the KitchenDim if you do it a second time in less than one minute from the last time you set it. Play with the time to see what works for you. you may not like it if you tend to ‘tweak’ the dim…

try it

This could be helpful if you want to turn off the kitchen light and leave the cabinet lights on!

Hi Bulldoglowell,
I made some changes to what you sent me but it is not working. Here is what I have so far:
Device Properties

Name Device Name Device Variable

KitchenDim Kitchen LoadLevelTarget
RightCounterDim Right Counter LoadLevelTarget
LeftCounterDim Left Counter LoadLevelTarget

Name Repeat Expression

Dim1 Yes (RightCounterDim != KitchenDim) and (LeftCounterDim != KitchenDim)


Actions for Condition: Dim1


Device Action Arguments

Left Counter SetLoadLevelTarget newLoadlevelTarget={(KitchenDim)}
Right Counter SetLoadLevelTarget newLoadlevelTarget={(KitchenDim)}

When I change the Kitchen level it does not trigger the other actions. Trying to use this as a learning exercise so hints would be appreciated. I am thinking that I need to monitor the LoadLevelTarget for Kitchen device for level changes of more than x %.Can I set a variable with the current LoadLevelTarget and compare it with the device?

Do you have instant status reporting switches ?

You can tell by watching the Vera Dashboard. Ask some one else to change the switch setting (i.e. On/Off or change dim level).

Do you see the change on Vera right away ? If you do you have instant status reporting. If not … wait awhile … Vera should notice it on the next poll interval.

Unless you have instant status reporting switches … This type of automation is not going to be possible.

Not at home to test physically. Not sure this is a valid test because it is going through the Vera, but if I bring up the page and then change the lights from my phone it does report the status change immediately. Is that from the instant status, or from Vera detecting the change because it made it? If the former, then I have instant status switches.


It does not count if you change it from the Vera interface as Vera already knows the state (since it made it). You have to physically make the change at the switch and see it in vera, then you have instant status switches.

Do you know what kind of switches you have? I believe most if not all Leviton and Cooper switches have instants status, I’m not sure about any of the other brands.

Correct, only Cooper, Leviton and Lutron devices currently support Instant Status.

For price/performance/features/aesthetics I’m leaning on standardizing on Cooper Z-wave and non-Zwave devices.

The Wall switch is a Leviton VRI06 I believe. That is the one I want to see the state change on. The 2 under counter lights are using Kichler 12387’s.


OK, Assuming I have instant status lights on at least the Kitchen switch, is my logic close to correct?


Id they are instant status … and pass the test above … then:

  1. Make sure your PLEG is armed.
  2. Try to interact with your switches … then Post the output from the Status report.

Hi Richard,

Just tested from the UI and the script works. Last night I was testing from the physical switch and it was not working, so that leaves me to believe that PLEG is not seeing the state change on the Kitchen switch when it is changed manually.


OK, so now we have what is known as “scope creep”

I’m not fond of your logic, so let’s learn it first and figure out if it will behave the way you want…

Name Repeat Expression

Dim1 Yes (RightCounterDim != KitchenDim) and (LeftCounterDim != KitchenDim)


Name Repeat Expression

Dim1 Yes (RightCounterDim != KitchenDim) AND (RightCounterDim;KitchenDim)


Dim1 RightCounterDim LoadLevelTarget = {(KitchenDim)}

this says it will return True if one of the switches doesn’t match the other and the KitchenDim was the last one to change.

If this works (and it should if KitchenDim does support instant status) then you can start to tweak.

I made the changes you suggested to my conditions and it works from the Vera UI. If I set Kitchen to 80% the 2 under counter lights go to 80%. if I change the under counter light back to 50% the Kitchen light remains at 80%. Just need to test if from the physical button when I get home.


[quote=“RogerO, post:15, topic:180118”]I made the changes you suggested to my conditions and it works from the Vera UI. If I set Kitchen to 80% the 2 under counter lights go to 80%. if I change the under counter light back to 50% the Kitchen light remains at 80%. Just need to test if from the physical button when I get home.


I hope no one is home right now. The first time I did something like this, the folks home at the time thought the house was possessed ;D

lol yes, but eventually they get used to seeing ghosts!

If I am lucky the cat was on the kitchen counter were he is not supposed to be and I scared him off. I might need to incorporate a motion detector into the script (scope creep) to scare them off the counter.

There is a little dedicated device that I use for my cat in unwanted counters:

Built in motion sensor…but no Z-Wave integration :frowning:

you can use the ‘empty can’ method of alerts to let you know if the cat is misbehaving