We have moved at community.getvera.com

Author Topic: Leviton VRCS2 - answer and question  (Read 1075 times)

Offline Juggler

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +0/-0
Leviton VRCS2 - answer and question
« on: February 25, 2014, 08:49:48 pm »
I have finally managed to include my Leviton VRCS2 into my VeraLite network. I wanted to share how I got it to work the way I wanted in case anyone else is scratching their heads. I also have a question...

First: Is it possible to turn the LEDs on/off via a luup call? I am able to do this with my Leviton VRCZ4 (luup.call_action("urn:micasaverde-com:serviceId:SceneControllerLED1","SetLight",{newValue="3",Indicator="3"}, DEVICEID) where newValue = 0=off, 1=green, 2=red, 3=amber).

My set-up is as follows:
- 1x VRCS2 with both load-lines capped as they are not directly switching any local load
- 1x VRCZ4 where toggle switch 2/3 control the overhead light/fan respectively
- 1x Aeotec Micro Illuminator
- 1x Aeotec Micro Switch

The Aeotecs are in my overhead fan that includes a light; the Illuminator controls the light, while the switch turns the fan on/off.

I've set-up scenes to turn the Aeotecs on/off in MiOS (for the light I had to use a luup call rather than the GUI). In addition, I created another scene for each of these that triggers when they are turned on/off. I then use luup to turn the corresponding LED on the VRCZ4 green/off. These scenes (2 on, 2 off) where then assigned to the on/off of the VRCZ4 buttons.

When I attempted to do the same with the VRCS2, it didn't appear to work. It appeared that each push of the button only toggled the "on" scene. To get around this, I created another scene that toggles the state of the corresponding Aeotec with the following luup code:
Code: [Select]
local overhead_light_status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", DEVICEID)

if overhead_light_status == "1" then
  luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = "0"}, DEVICEID)
  luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = "1"}, DEVICEID)

This scene was then assigned to both the on & off buttons for the VRCS2.

Not sure this is the correct way, but everything is working as expected.