Author Topic: Solved! -- How to Keep your Cooper RF Master/Accessory Switch always in Sync  (Read 9219 times)

Offline shallowearth

  • Hero Member
  • *****
  • Posts: 963
  • Karma: +45/-9
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!
« Last Edit: June 24, 2016, 01:17:57 pm by shallowearth »

Offline shallowearth

  • Hero Member
  • *****
  • Posts: 963
  • Karma: +45/-9
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)

Offline jquincy

  • Full Member
  • ***
  • Posts: 138
  • Karma: +0/-0
What Cooper switches are you using? Dimmers?

Offline shallowearth

  • Hero Member
  • *****
  • Posts: 963
  • Karma: +45/-9
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.

Offline jquincy

  • Full Member
  • ***
  • Posts: 138
  • Karma: +0/-0
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?

Offline shallowearth

  • Hero Member
  • *****
  • Posts: 963
  • Karma: +45/-9
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.

Offline shallowearth

  • Hero Member
  • *****
  • Posts: 963
  • Karma: +45/-9
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.



Offline shallowearth

  • Hero Member
  • *****
  • Posts: 963
  • Karma: +45/-9
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,"")

Offline jquincy

  • Full Member
  • ***
  • Posts: 138
  • Karma: +0/-0
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

Offline shallowearth

  • Hero Member
  • *****
  • Posts: 963
  • Karma: +45/-9
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.


Offline jquincy

  • Full Member
  • ***
  • Posts: 138
  • Karma: +0/-0
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.



Offline shallowearth

  • Hero Member
  • *****
  • Posts: 963
  • Karma: +45/-9
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.




Offline jquincy

  • Full Member
  • ***
  • Posts: 138
  • Karma: +0/-0
Is the Master switch the same dimmer you were having trouble with before?  Maybe one of your switches is just bad/flakey.

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.


Offline shallowearth

  • Hero Member
  • *****
  • Posts: 963
  • Karma: +45/-9
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.






Offline jquincy

  • Full Member
  • ***
  • Posts: 138
  • Karma: +0/-0

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.



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