LED control for Leviton RZCZ4 and RZCS4

I call anything that bugs me a bug! Ha…it is not Vera, I agree.

For those who want more complexity to the lights one can add this in:

local lul_temp=luup.variable_get("urn:upnp-org:serviceId:Dimming1","LoadLevelStatus",21) if( tonumber(lul_temp)<1 ) then luup.call_action("urn:micasaverde-com:serviceId:SceneControllerLED1","SetLight",{newValue="0",Indicator="4"}, 34) else luup.call_action("urn:micasaverde-com:serviceId:SceneControllerLED1","SetLight",{newValue="1",Indicator="4"}, 34) end
This will leave the LED green if the dimmer associated to the button is on. Lots of possibilities here.....
I think you'll have to use the Leviton remote to get it to work entirely right. Programming just the associations with Vera will work (as you have demonstrated), but there are limitations.
I have the scene controllers programed with Vera, seems perfect with Leviton Dimmers.....what have you found to be the limitations? Regards Tim Alls AllSeas Yachts

;D lol

I have the scene controllers programed with Vera, seems perfect with Leviton Dimmers.....what have you found to be the limitations?
You wouldn't get the reverse associations (unless you programmed those too), so your LEDs don't work properly. -> Program an association to a scene button. Set scene. Press button -> light on -> LED on. Turn off light locally -> LED stays on?

You don’t know what scene numbers are in use; or you do, if it is a freshly reset controller (scenes 1, 2, 3 and 4). This can get interesting if you did this on multiple controllers with ‘overlapping’ lights.
→ Program light 1 to button 1 on controller A. Set scene.
→ Program light 1 and 2 to button 1 on controller B. Set scene.
→ Press button on controller B → lights are according to scene.
→ Press button again → lights off.
→ Press button on controller A → light 1 is according to what you programmed on controller B, not controller A. Which may be what you intended all along. But what if you didn’t?

Does this bug you?

@TimAlls,
Not sure if you sorted this somehow. If not, then we have different behavior. I got around to monkeying with an M0 scene controller. It works. So: the LED control seems to work on all 4 flavors (scene/zone -M0/-MR).

Does this bug you?
Ha, yes it does....this bugs me more
MCV, Would it be possible to make your knowledge of what works and what doesn't work available to us all? I have 3 Leviton zone controllers (4 button) and two of the four button scene controllers. I lost countless hours of my precious time trying to make it work with Vera. I discovered that the GE dimmers did not work with the Leviton scene controllers. I currently use Vera as a secondary because only the Leviton Remote can properly set these devices up where everything on them works correctly. When I read your last response I realized you have these devices in your lab and know that there are issues with these devices. I read the forum frequently and it keeps coming up over and over again.....issues with the Leviton zone and scene controllers. Perhaps you do have all your good information stored on a page that I am unaware of......please enlighten me. Regards Tim Alls
They responded with........................................(nothing)

You have gone a step further with your research…you went back to Leviton Remote and found you were unable to gain control of the LEDS! Is that correct?
I am happy with my current configuration…my scene controllers are working fine , buttons, dimming, Leviton Scene Control Method working fine, and now I have more options available than before. The result is that I am happier with the new manual control over the Zone Controllers and I can combine a new feature that I am working on:
My Leave button is now going to turn off my Sonos Player!
Getting closer as I try to adapt to the scripting language…
More to come
Tim

Correct; meaning the controller itself is not controlling the LEDs anymore!
(I use a native Leviton network as baseline for what I expect Vera to do.)

I am happy with my current configuration....my scene controllers are working fine , buttons, dimming, Leviton Scene Control Method working fine, and now I have more options available than before. The result is that I am happier with the new manual control over the Zone Controllers and I can combine a new feature that I am working [...]
Good!

BTW, there is a subtle difference with the LEDs under Vera control: the LED goes back on once you restore a scene (say: turn a light off and then back on). With native LED control, once you break the scene, the LED stays off.

[...]this bugs me more MCV, Would it be possible to make your knowledge [...] [...] They responded with........................................(nothing)
It certainly would be nice to have the additional info. But it may not be in their interest to attempt to maintain such a public page. It's going to be subject to a lot of interpretation/generalization/confusion etc., as it often comes down to the details.

In your specific example Vera is not involved, and both devices work as specified, I believe.

[quote=“oTi@, post:2, topic:168211”]As was discussed in prior threads, you need to have the more recent scene/zone controllers for external LED control to work:

Scene Controllers: VRCS4-M0 or VRCS4-MR
Zone Controllers: VRCZ4-M0 or VCZ4-MR
M0 = no local switch ; MR = with local switch
There’s a letter at the end to indicate face color sets (X, or Z): not important.

No go on the older ones (VRCS4-1L, VRCZ4-1L).[/quote]

I have about fifteen VRCZ4-1L’s, and it’s clear to me that Vera is able to control the LED’s on them, even if the interface published in the Leviton LED Debugging Wiki (http://wiki.micasaverde.com/index.php/Leviton_LED_Debugging) is a NOP for the VRCZ4-1L’s.

Here is example evidence:
Device 5 is a VRCZ4-1L.
I associate Button 2 on Device 5 with a Scene that turns on one incandescent Light.
I press Button 2 ON. The Scene is Run, and the incandescent light turns on. The LED on Button 2 turns on instantly.
Now, if I turn off the incandescent light manually (i.e. not pressing Button 2 off), then the incandescent light goes off and, after a perceptible delay, the LED on Button 2 goes off.

If I repeat the experiment, but unplug Vera during the perceptible delay, then the LED on Button 2 does not go off.

Therefore, in this example, it is clear that Vera is what turns off the LED on Button 2.

Furthermore, if I turn on Verbose logging before running the example, then afterward in the LuaUPnP.log file, I find the following:

ZWaveNode::SetSceneControllerIndicator button: 2 value 0 state was: 3 now: 1 <0x2ba11680>

Device_Variable::m_szValue_set device: 5 service: urn:micasaverde-com:serviceId:SceneControllerLED1 variable: e[35;1mLightSettingse[0m was: 3 now: 1 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:0 <0x2ba11680>

The second line immediately follows the first, but for ease of readability I put a blank line between them above. The first line seems fairly plain as to what it means. The second line looks related to the invocation documented Leviton Debugging LED wiki.

Is there some difference between the above and what the Leviton Debugging LED wiki says that would suggest a way to gain control over the LED’s in the VRCZ4-1L’s? Since I have fifteen of them, I really don’t want to have to rip them out and replace them with upgrades.

Anyone? I would greatly appreciate a solution.

I think the test indicates that Vera has to be ‘in the loop’, for proper operation of the LED on the VRCZ4-1L; however, the LED may be under VRCZ4 control, yet an expected response (of some kind) from Vera is missing, causing the device to declare the zone as still being active and thus leaving the LED lit.

(Even with the newer controllers, turning Vera off may lead to ‘slowness’, as the controller attempts to communicate with Vera.)

Vera doesn’t appear to distinguish between older and newer controller, so the same actions are done (i.e. keep/control LED state), regardless of whether they are supported by the actual device.

It’s been quite a while since I played with a -1L, but I think my impression was that in simpler configurations and in combination with Leviton dimmers/switches (VRI06/VRS15 etc.), the LED operation is fine. My guess is things may get more problematic if non-Leviton devices are used, or multiple controllers control the same device.

Do you currently see issues with the -1L?

I developed a lua function to set the LEDs on Leviton scene controllers and thought I would share it here. The first argument is a hex mask representing the color to set each of four LED buttons to and the second argument is the scene controller device number.

function setControllerLEDs(led_mask, lul_device)
   local bit=require("bit")
   local band, rshift, lshift = bit.band, bit.rshift, bit.lshift

   for indicator = 1, 4, 1 do
      value = rshift(band(led_mask, 0xF000), 12)
      led_mask = lshift(led_mask, 4)
      luup.call_action("urn:micasaverde-com:serviceId:SceneControllerLED1","SetLight",{newValue=value,Indicator=indicator}, lul_device)
   end
end 

Simply add the above code to your Vera startup LUA under Apps->Develop. Then you can use a single line of Lua in a scene luup to set all four LEDs. Here are a few examples for my scene controller device number 107.

setControllerLEDs(0x0020, 107) -- set 3rd button LED to red
setControllerLEDs(0x0000, 107) -- set all button LEDs to off
setControllerLEDs(0x1111, 107) -- set all button LEDs to green

On Vera’s later then UI5, the lua interpreter may have the math.floor function that will shorten the code to:

function setControllerLEDs(led_mask, lul_device)
   for indicator = 1, 4, 1 do
      value = math.floor((led_mask & 0xF000) / 0x1000)
      led_mask = led_mask * 0x10
      luup.call_action("urn:micasaverde-com:serviceId:SceneControllerLED1","SetLight",{newValue=value,Indicator=indicator}, lul_device)
   end
end 

I hope others find this useful.

Looks like LED control is now supported within the Vera interface. Green value is 1, red value is 2, off value is 0. The indicator value is the button number 1,2,3 or 4

Tip: Use a one second delay before assigning each value for increased reliability. Without the delay(s) the light(s) may intermittently turn off after a second. With the delay it stays on.

1 Like

And orange is 3!

1 Like

Interesting, I have been using this exact same function and variable for years but with luup code, not with the scene editor and without any delay. Didn’t even notice the change. Thanks for reporting it.

1 Like