Solved! -- How to Keep your Cooper RF Master/Accessory Switch always in Sync

Wanted thanks folks who had been helping me out with my Cooper Switch Associations with a bit of help on how to keep your Master/Accessory Switch always in sync and functioning with Instant Status –
These instructions are for Cooper RF 9540/9542 dimmers and 9501/9517 binary switches

Updated with new parameter fix for dimmers and switches (thanks to Wholm for this awesome undocumented hack!)

First you must associate the switches or dimmers to each other, using group 1. Make sure Master and all Aux have associations to all other Aux/master in the circuit.

Problem… LEDs don’t stay in in sync on the AUX Switch
After you associate your Master and Accessory switch they work great when you manually push the button, but if you try to use Vera, Vera scenes, phone App, etc to turn on or off your Master Switch, the LED on your Accessory Switch does not stay sync, meaning you might have to double tap it later to get it work.

Solution…
Add the following to the Master Switch Only

On device options tab add
Parameter 10 using 1 Byte hex and set to 1

This will ensure both the on/off LED and Dimmer Level LED stays in sync for all scenarios.

Problem… Instant Status seems flaky or not working:
If your Instant Status is not working properly (this is usually caused by having a secondary controller or scene controller in your network that controls your lights and it eats your instant status). So if you have a Minimote you are using, or in-wall scene controller you might see this behavior.

Solution…
Add an association in Group 255 from the Master switch, back to the Vera (Device ID 1, which is listed as “ZWAVE” in the device list in unassigned, should be at the very bottom of the list in the UI).

Problem… your LEDs on your AUX switches are still not staying in sync sometimes.
Unfortunately I have found that sometimes parameter 10 doesn’t work quite reliably (if the connection between the switches is weak particularly for the On command), if you try to use it, and only the off command will sync or neither. You can use Scenes instead or in addition to using parameter 10 try the following:

Solution…
Create two scenes to control the two (or more) switches together using the Advanced Scene editor, one scene to turn the LED on, and one to turn the LED off, using the Master Switch (on or off) as the trigger for the scene.

Don’t know how to get the advanced Scene Editor? Just start out by creating a manually triggered scene to turn your master switch on, near the end of the process in step three you will see Advanced Editor, click on it. From there add an Action, you can now select the Accessory Switch, and Set the Target to True (1) to match the Master Switch. If you have more that one Accessory switch add it as well.
Now make sure you set the trigger to be the off or on state of the master switch. Save your Scene and repeat but create an Off Scene.

Note: if the SetTarget is not available in the advanced editor for your Aux switch, give it a few minutes it take several minutes for it to be available after you first add it to Vera.

If you have an old Dimmer switch that does not support parameter 10 for some reason you can use the two scene method above then add the following to your “on” scene to sync the dimmer level. Note that since just changing the dimmer level on the master will not trigger instant status you aux will still be a little out of sync at times but this will catch them up the next time the master is turned on.

Now you need to add a little LUUP code to your Scenes to fix your blue LED –
Use below code:
Where light_main should be set to your master dimmer
light_aux should be set to your accessory dimmer
Note the 3 in the call_delay command you be equal to or higher than the ramp speed on your dimmer. The default on the coopers is 3. If you ramp speed is slower you need to set that to match (otherwise it sync the led mid ramp…which is wrong).
You should also add this LUUP code to any scene where you are setting the dimmer level on your master switch as purely changing the dimmer level (with out turning the switch on/off) via the UI or a scene does not trigger the on/off scene to sync the blue LED, you need the cal the LUUP code any time there is a change that only the load level is changing and not the power state.

function delaysync()
local light_dstat = “0”
local light_main = 34
local light_aux = 35
light_dstat = luup.variable_get(“urn:upnp-org:serviceId:Dimming1”, “LoadLevelStatus”, light_main)
luup.call_action(“urn:upnp-org:serviceId:Dimming1”, “SetLoadLevelTarget”, {newLoadlevelTarget = light_dstat}, light_aux)
end

luup.call_delay(“delaysync”,3,“”)

Lastly if you have scenes that change the dimming level of the master, you can add advance scene edits for the AUX dimmers by setting their SetLoadLevelTarget to the same value you are setting the Master in your scene.

The only way now your dimmer levels will get out of sync is when you directly change the master dimmer level from web/app with out turning it off/on.

Hope this helps folks!
Enjoy!

A couple other tips for keeping your Cooper Light and Aux switch in sync –

If you like using the light controls in the Vera UI or Vera Mobile Apps

Create a scene for each light switch, that is triggered by the Master Switch. When the Master Switch is on, trigger the Aux Switch on (using the Advance settings in the Scene). Then Create a second Scene for Off on the Master Switch.
Since the Cooper Light switchs support instance status this trigger the scene (usually in 1 second or less, to sync the light on the Aux Switch).

Here is a little cleaned up code for the sync. What I do, is setup a scene that triggers any time the master switch is turned on or off, then run this LUUP code:

local light_stat = 0
local light_main = 6
local light_aux1= 7

light_stat = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”, “Status”, light_main)
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = light_stat}, light_aux1)

What Cooper switches are you using? Dimmers?

I am using both:
Dimmer Master (RF9540) and Dimmer Aux (RF9542)
Switch Master (RF9501) and Switch Aux (RF9517)

It takes a while for the “GetTarget” and “SetTarget” options to show up for the Aux switch (they don’t show initially on enrollment). I believe on one of my older Aux switches with older firmware I may have had to set the Category ID from 14 to 3 temporarily in the advanced settings and then some toggle commands to it, in order to trick Vera into offering the Get/SetTarget Commands for the device. Otherwise all you get the “Toggle” command which is much more tricky to get to sync up correctly.

I also have a couple of battery powered dimmers/switches that I use, but they don’t have to be kept in sync as they don’t have a LED, and use a different command when interacting with switches so don’t get out of sync. Love these by the way… excellent battery powered switch. (RF9500) - note they cannot be used as scene controllers I don’t think (I briefly tried that but could never get it to work), but they work great if you use to associate to the switch in question.

I agree 9500 are great. I have three of them. My real question is as follows: If you are looking at your Vera UI and you turn on a 9540 switch does the Vera report the on status instantly as on? Then when you turn it off does it instantly show it as off?

OK here are some things I have learned about the various Cooper Switches I am using:
First off, the Auxiliary switches… they don’t support instant status (as they aren’t truly a light switch). And if you use them to Associate to your Master Switch, the Master Switch will not send instant status back to the Vera that it’s state changed, so the UI in the Vera will not be updated, and you cannot trigger a scene from the Aux button being pressed if you need it to trigger right away (because the trigger has to be built on the Master which is not sending an update status in that case).

If you press the Master Switch, it does support instant status, and the UI will update accordingly.
Further, if I use the Vera UI to turn On/Off the Master device it will trigger scenes that look at the status master switch instantly (not sure if this is because of instant status or because of the Vera doing some magic on its own).
In addition if I use a scene to turn on the Master Switch it will Trigger another Scene if it s looking for a Trigger on the Master Switch.

I have one dimmer that is too far away from the Vera and so the instant status update pretty much never makes it back to the Vera so the UI is always behind.

So you are out of luck if you are looking to trigger a scene based on the Master Switch if it is too far away from the Vera, or the Aux switch is pressed. In most other cases you should be good.

If all you are trying to do is keep the LEDs in Sync, you should be in shape as long as you master switches are in range of the Vera for the instant status to make it.

jquincy… I can’t tell if my messages are getting through so thought I would just put a few things here…

One of my dimmers that is farther away is a little flakey about the instant status… it does better after I did a network heal. But still isn’t 100%. I have noticed that it is pretty accurate about telling Vera it is on, but the dimmer level updates get lost. Sometime when I turn it off (from 100%) and what it will show on the UI it will got from 100% to 50ish% to 11% and then get lost and stay at 11% (instead of ending on off), it won’t go to off until it is polled again.

Since it is a dimmer that is giving you trouble –
You may just have a bad dimmer but I would try some of the following –
Since you said you were using CFL bulbs… try turning on kickstart:
Set parameter 8 to 1 (1 byte dec) in the Device Options tab (default is 0)
That might help particularly with On status.
You might also need to mess with the minimum dimming floor (since most CFLs can’t go all the way to lowest dimming. That is parameter 11. If when you are dimming from the switch your bulbs, they go off before the switch is actually off, you need to raise the number (default is 4). that might also be messing with the instant status.

If you need accurate dimmer status, you might also try fiddling with the ramp speed.
This is parameter 7, the default is 3 seconds, you might try 0 to eliminate ramp updates that get lost. I noticed my dimmer tends to send one update per second, so if not fully off… it gets stuck at 11 or 12% in the UI when turning off. Or may not show 100% when fully turning on.

If none of that works… maybe your switch is just bad, since your dimmer is so close to the Vera.

One more post on how to keep your Cooper RF Master Dimmer and Accessory Switch in Sync

If you use the method I described early about using a Scene with a Trigger, that will keep the Yellow LED light in sync (switch on or off) but may not keep the dimming level (the blue LED) in sync.

So first create a Scene with a Trigger of Master Dimmer On, and add an advanced option (with no delay), and selected the Accessory Switch, select command Service: urn:upnp-org:serviceId:SwitchPower1 SetTarget, and set to True (1).

Create a second scene with a Trigger of Master Dimmer Off but set the SetTarget of the Accessory Switch to False (0)

That will fix the Yellow LED.

Now you need to add a little LUUP code to your Scenes to fix your blue LED –
Use below code:
Where light_main should be set to your master dimmer
light_aux should be set to your accessory dimmer
Note the 3 in the call_delay command you be equal to or higher than the ramp speed on your dimmer. The default on the coopers is 3. If you ramp speed is slower you need to set that to match (otherwise it sync the led mid ramp…which is wrong).
You should also add this LUUP code to any scene where you are setting the dimmer level on your master switch as purely changing the dimmer level (with out turning the switch on/off) via the UI or a scene does not trigger the on/off scene to sync the blue LED, you need the cal the LUUP code any time there is a change that only the load level is changing and not the power state.

function delaysync()
local light_dstat = “0”
local light_main = 34
local light_aux = 35
light_dstat = luup.variable_get(“urn:upnp-org:serviceId:Dimming1”, “LoadLevelStatus”, light_main)
luup.call_action(“urn:upnp-org:serviceId:Dimming1”, “SetLoadLevelTarget”, {newLoadlevelTarget = light_dstat}, light_aux)
end

luup.call_delay(“delaysync”,3,“”)

Shallowearth…Ok I think I have learned a lot about these switches. I have moved the 3 dimmers from the bathroom to different bedrooms since I couldn’t figure out how to change the 4 second delay when they turn off.

Another problem is when PLEG turns on a master light in the Hallway. I have to press the auxiliary switches 2 to 3 times to get them to turn off the master. I have written a scene according to your recommendation. Please look at this and see if I am doing it right

Have you Associated the Aux Switches to the Master using Group 1.

If so, they may be too far away from the Master to reliably change the state on the master and other AUX switches. Associations do not use the routing mesh, the two switches have to talk directly to each other so must be close enough to talk to each other directly. In your configuration you need to associate the Master to all 3 Aux. Then you need to associate each Aux to the Master and to the 2 other Aux switches, and repeat for the other 2 Aux switches.

How to debug this… if the LED light it in sync (aka Master is on, and the LED on the AUX are on) and you press the AUX and the light doesn’t go out, they are probably to far away or not associated correctly.

[quote=“shallowearth, post:10, topic:186193”]Have you Associated the Aux Switches to the Master using Group 1.

Yes all three Auxiliary switches are in group ! and all paired to each other along with master

If so, they may be too far away from the Master to reliably change the state on the master and other AUX switches. Associations do not use the routing mesh, the two switches have to talk directly to each other so must be close enough to talk to each other directly. In your configuration you need to associate the Master to all 3 Aux. Then you need to associate each Aux to the Master and to the 2 other Aux switches, and repeat for the other 2 Aux switches.

All switches are in the same hallway which is 30 ft long. Vera is in a closet in the middle of the hallway

How to debug this… if the LED light it in sync (aka Master is on, and the LED on the AUX are on) and you press the AUX and the light doesn’t go out, they are probably to far away or not associated correctly.[/quote]

Is the Master switch the same dimmer you were having trouble with before? Maybe one of your switches is just bad/flakey.
Try shutting your Vera off (the association commands should still work with the Vera off) and test the heck out of the Master and Aux switches, when you turn one on… all the LEDs go on, when you turn one off all the LEDs go off. My guess is something is is bad there.

If they all work flawlessly with the Vera Off, then turn the Vera on, and start debugging your Scenes. You might have mis-setup something.

I know I mine. I accidentally had one of my triggers to sync my LEDs to the Off state was resetting the master… not the Aux switch. So one of my switches was falling out of sync after running a specific scene.

Nope they were in the bathroom. I couldn’t figure out how to get them to instantly go off vs fading out over 4 seconds.

I will turn off the vera tonight and test the associations.

Cool…
Here is the specific instructions for changing the ramp time on your cooper dimmers…

Go to the Dimmer Device page in the Vera UI (by clicking on Devices then the Dimmer in Question)
Click on “Device Options” near the bottom of the page.
Click on “Add configuration settings” button (a line is added under Configuration settings, and a popup says a line was added, hit OK)
For the Variable change it from 1 to 7
For Data Size change it to 1 byte dec
For the Desired Value set it to 0

Note: the desired value is 0 to 127 in seconds for how long you want the ramp to be. If you want longer than 127 seconds than you use a negative number, -1 would be 128 seconds, through -127 which would be 254 seconds. The Ramp is for both On and Off, sorry… they don’t split them out. You may not need to go to 0, you might find that 1 seconds does the trick if you don’t like instant on and off effect. I believe the default is 3 seconds.

Then select “Save Changes”

Note: if Save Changes does not through a popup that says “Data saved” with an OK button, you are not on the latest UI7 firmware which has a bug in it. Go back and update your Vera firmware.

After saving the changes hit the "Back"button near the top.

Then go back into “Device Options” and see if the Desired Value and Current Value are the same. If they are not hit the “Back” button.
Go to “Advanced”
Click on “Commands”
Click on Configure node right now.

Then go back and check the device options again.

Now try out your switch and see how the ramp time is working. I have attached the full table of behaviors you can set on the cooper dimmer below if you want to try trimming the minimum dimming level or using the Kickstart feature. Note that Delayed OFF time is a feature of the dimmer where if you hold the button down for 2-3 second (while the light is on) it will wait to turn off the switch for that many seconds. It is not the dimmer ramp time which is parameter 7.

[quote=“shallowearth, post:7, topic:186193”]Since it is a dimmer that is giving you trouble –
You may just have a bad dimmer but I would try some of the following –
Since you said you were using CFL bulbs… try turning on kickstart:
Set parameter 8 to 1 (1 byte dec) in the Device Options tab (default is 0)
That might help particularly with On status.[/quote]

I have played a lot with this these settings on two different dimmers both Cooper 9540. Setting variable 7 to 0 made lights go off instantly. When I set variable 8 to 1 ,I get Failed at: Setting user configuration. Any ideas on that?

If I am on the Vera Ui I can click on and off lights and they are instant. When I turn them on or off manually the Vera takes 2 to 20 seconds to record the status change. Weird still

Not sure your devices don’t seem to be quite working up to par…

What version is the firm ware on your dimmer?
I have two that are 3,3,52,1,0 and one that is 3,3,67,1,1

One of my 3,3,52,1,0 dimmers is slightly less reliable then the other two on instant status.

You can find this on the advanced variables tab for the device, VersionInfo

So I took out the dimmers and replaced them with Cooer 9501 Version on all of them is 3,3,52,3,15.

Same situation. When I manually turn off the switches it can take 3 seconds or 20 minutes to register on the UI.

Very confused. When I turn them on or off from the UI they are instant. But when I manually turn them off I get the delay. Aggravating since I can’t set up Pleg conditions with them if the do not register off or on properly

Yeah, something is amiss, I assume you have done a network heal, maybe try Vera support, seems like the Vera itself is having trouble with instant status.

All my coopers instant status works fine except for that one dimmer. It is too suspicious that even switching things up with a non-dimmer still is having problems, unless your networks it just so busy crazy that the instant status it just not routing back to the vera.

I would do a network heal, and then double check that you don’t have any run away scenes or devices that are flooding your mesh commands.

Cindy

Before I totally give up on these Cooper dimmers I would like to try your solution above. I have tried Solution 1 and they still get out of sync.

[quote=“shallowearth, post:1, topic:186193”]Solution 2…
Switch still getting out sync (may you have a button that doesn’t support scenes that is turning on/off your master switch).
Create a Scene that runs every so often (every few minutes?), to sync up your Accessory switch.
You want to create a scene that all it does is run some LUUP code (maybe there is a smarter way to trigger the scene… this was just the easiest way I found).[/quote]

You state to set up the master switch to go on and then under Advanced Editor you turn it off? Think I am confused here.

[quote=“shallowearth, post:1, topic:186193”]Then go into the Also, execute the following Luup code, and click on No Luup Code Defined
And add the following code there but
replace 6 with your Master Switch and
7 with your Accessory Switch.[/quote]

Where do I find Also to add the Lua code?

[quote=“shallowearth, post:1, topic:186193”]Should work for keeping all acceossory switches in sync you can add a new line for each accessory switch (between the then and else, or the else and end statement).

if ( luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”, “Status”, 6) == “1”) then
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “1”}, 7) else
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “0”}, 7)
end[/quote]

Since I have 3 Auxiliary switches do I need 3 lines of code between then & else and also between else & end?

Thanks

First lets understand what is causing your switches to get out of sync?
I assume that you have all your associations set correctly so that no press of any of the switches (master or Aux) causes an out of sync scenario.

Assuming that is all working…

Is it Vera scene that is running and causing it to get out of sync? That is super easy to fix using the advanced editor.

Or is it that you are using the Vera UI, the Vera App for Ipad/Android or other 3rd party app to control the master switch that is causing the Aux switches to get out of sync?