Possible Bug in how Caseta Dimmers are represented in Wink Plug-in

Cybermage,
I noticed folks complaining that they can’t trigger Scenes or PLEGevents on Caseta Dimmers being On/Off (on PLEG you can work around this by watching the LoadLevelStatus variable), and I think I figured out why.

On your Caseta Dimmer you care creating both
Dimmer1 Status
and a
SwitchPower1 Status

But you are only ever setting the SwitchPower1 Status and the Dimmer1 Status is never set.

I am wondering if Vera and PLEG are prefering to looks at the Dimmer1 Status if it exists, and that is why it is getting lost when it comes to triggering events based on on/off. Ironically Vera seems to be looking at the SwitchPower1 Status for the Icon status :slight_smile:

I think if you set the Dimmer1 Status/Target when you set the SwitchPower1 Status/Target state that will give folks more flexibility to trigger scenes etc. But it is just a guess of course.

The Lutron RA plug-in has the same bug. Where it has a Dimmer1 Status that is never set so makes trigger scenes difficult.

[quote=“shallowearth, post:1, topic:189841”]On your Caseta Dimmer you care creating both
Dimmer1 Status
and a
SwitchPower1 Status[/quote]

That is correct.

Both are required for the dimmable light device to function correctly.

That is incorrect.

Here is an excerpt from my Vera Edge UI 7.0.12 logs with the latest version of the plugin:

From a command sent by Vera to the Wink API:

02      11/23/15 22:22:19.325   luup_log:486: (Wink_Connect::HUB_DEVICES::updateDevice): Received http response [200] [HTTP/1.1 200 OK] [{"data":{"desired_state":{"powered":false,"brightness":0.0},"last_reading":{"connection":true,"connection_updated_at":1448342512.11712,"powered":true,"powered_updated_at":1448342512.11712,"brightness":1.0,"brightness_updated_at":1448342512.11712,"desired_powered":false,"desired_powered_updated_at":1448342539.2101722,"desired_brightness":0.0,"desired_brightness_updated_at":1448342539.2101722,"desired_powered_changed_at":1448342539.2101722,"desired_brightness_changed_at":1448342539.2101722,"powered_changed_at":1448342512.11712},"subscription":{"pubnub":{"subscribe_key":"sub-c-f7bf7f7e-0542-11e3-a5e8-02ee2ddab7fe","channel":"f08d47fdb88b3eaf4375eeedcac85dde05c405cc|light_bulb-809778|user-107803"}},"light_bulb_id":"809778","name":"Office Fixture","locale":"en_us","units":{},"created_at":1438467841,"hidden_at":null,"capabilities":{},"user_ids":["107803"],"triggers":[],"manufacturer_device_model":"lutron_p_pkg1_p_wh_d","manufacturer_device_id":null,"device_manufacturer":"lutron","model_name":"Caseta Lamp Dimmer \u0026 Pico","upc_id":"33","upc_code":"784276072083","gang_id":null,"hub_id":"112742","local_id":"20","radio_type":"lutron","linked_service_id":null,"lat_lng":[0.0,0.0],"location":"","order":0},"errors":[],"pagination":{}}]. <0x77cf0320>
50      11/23/15 22:22:19.333   luup_log:486: (Wink_Connect::setChildVariable) Device [881] SID [urn:upnp-org:serviceId:Dimming1] variable [LoadLevelTarget] current [100] new [0]. <0x77cf0320>
50      11/23/15 22:22:19.334   luup_log:486: (Wink_Connect::setChildVariable) Setting LoadLevelTarget [0]. <0x77cf0320>
06      11/23/15 22:22:19.334   Device_Variable::m_szValue_set device: 881 service: urn:upnp-org:serviceId:Dimming1 variable: LoadLevelTarget was: 100 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xd7d588/NONE duplicate:0 <0x77cf0320>
50      11/23/15 22:22:19.359   luup_log:486: (Wink_Connect::setChildVariable) Device [881] SID [urn:upnp-org:serviceId:SwitchPower1] variable [Target] current [1] new [0]. <0x77cf0320>
50      11/23/15 22:22:19.359   luup_log:486: (Wink_Connect::setChildVariable) Setting Target [0]. <0x77cf0320>
06      11/23/15 22:22:19.360   Device_Variable::m_szValue_set device: 881 service: urn:upnp-org:serviceId:SwitchPower1 variable: Target was: 1 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xcf91d8/NONE duplicate:0 <0x77cf0320>
50      11/23/15 22:22:19.360   luup_log:486: (Wink_Connect::setChildVariable) Device [881] SID [urn:upnp-org:serviceId:Dimming1] variable [LoadLevelStatus] current [100] new [0]. <0x77cf0320>
50      11/23/15 22:22:19.361   luup_log:486: (Wink_Connect::setChildVariable) Setting LoadLevelStatus [0]. <0x77cf0320>
06      11/23/15 22:22:19.361   Device_Variable::m_szValue_set device: 881 service: urn:upnp-org:serviceId:Dimming1 variable: LoadLevelStatus was: 100 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xd78758/NONE duplicate:0 <0x77cf0320>
50      11/23/15 22:22:19.362   luup_log:486: (Wink_Connect::setChildVariable) Device [881] SID [urn:upnp-org:serviceId:SwitchPower1] variable [Status] current [1] new [0]. <0x77cf0320>
50      11/23/15 22:22:19.363   luup_log:486: (Wink_Connect::setChildVariable) Setting Status [0]. <0x77cf0320>
06      11/23/15 22:22:19.363   Device_Variable::m_szValue_set device: 881 service: urn:upnp-org:serviceId:SwitchPower1 variable: Status was: 1 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xcf9240/NONE duplicate:0 <0x77cf0320>
50      11/23/15 22:22:19.364   luup_log:486: (Wink_Connect::ACTION_Dimming1::setLoadLevelTarget): Wink device updated [13]. <0x77cf0320>
04      11/23/15 22:22:19.365   <Job ID="3234" Name="" Device="881" Created="2015-11-23 22:22:18" Started="2015-11-23 22:22:18" Completed="2015-11-23 22:22:19" Duration="0.735414000" Runtime="0.735029000" Status="Successful" LastNote=""/> <0x77cf0320>

From a notification sent by the Wink API (in response to pressing the physical button on the Lutron Caseta Dimmer):

02      11/23/15 22:28:35.102   luup_log:486: Wink_Connect::HUB_PUBNUB::processSubscription: Received subscription data '[[{"capabilities":{},"created_at":1438467841,"desired_state":{},"device_manufacturer":"lutron","gang_id":null,"hidden_at":null,"hub_id":"112742","icon_id":"71","last_reading":{"brightness":1.0,"brightness_updated_at":1448342914.133889,"connection":true,"connection_updated_at":1448342914.133889,"desired_brightness_changed_at":1448342540.2870462,"desired_brightness_updated_at":1448342540.2870462,"desired_powered_changed_at":1448342540.2870462,"desired_powered_updated_at":1448342540.2870462,"powered":false,"powered_changed_at":1448342914.133889,"powered_updated_at":1448342914.133889},"lat_lng":[0.0,0.0],"light_bulb_id":"809778","linked_service_id":null,"local_id":"20","locale":"en_us","location":"","manufacturer_device_id":null,"manufacturer_device_model":"lutron_p_pkg1_p_wh_d","model_name":"Caseta Lamp Dimmer \\u0026 Pico","name":"Office Fixture","object_id":"809778","object_type":"light_bulb","order":0,"radio_type":"lutron","subscription":{"pubnub":{"channel":"f08d47fdb88b3eaf4375eeedcac85dde05c405cc|light_bulb-809778|user-107803","subscribe_key":"sub-c-f7bf7f7e-0542-11e3-a5e8-02ee2ddab7fe"}},"triggers":[],"units":{},"upc_code":"784276072083","upc_id":"33","user_ids":["107803"],"nonce":"03df4215-5559-49a1-a890-f450d2940eff"}],"14483429142765239","f08d47fdb88b3eaf4375eeedcac85dde05c405cc|light_bulb-809778|user-107803"]'. <0x75cfa520>
02      11/23/15 22:28:35.116   luup_log:486: (Wink_Connect::processDeviceState): Processing Device State update . <0x75cfa520>
50      11/23/15 22:28:35.117   luup_log:486: (Wink_Connect::HUB_DEVICES::findVeraDeviceByWinkId): Searching for device with Wink ID [809778]. <0x75cfa520>
50      11/23/15 22:28:35.118   luup_log:486: (Wink_Connect::HUB_DEVICES::findVeraDeviceByWinkId): found device [13]. <0x75cfa520>
50      11/23/15 22:28:35.125   luup_log:486: (Wink_Connect::processDeviceState): updating dimmer device [13] vera [881] hub [112742] connected [TRUE]. <0x75cfa520>
02      11/23/15 22:28:35.125   luup_log:486: (Wink_Connect::getLatestUpdatedValue): varName [brightness] actual value does exists - Returning actual value [1]. <0x75cfa520>
02      11/23/15 22:28:35.126   luup_log:486: (Wink_Connect::getLatestUpdatedValue): varName [powered] actual value does exists - Returning actual value [FALSE]. <0x75cfa520>
50      11/23/15 22:28:35.127   luup_log:486: (Wink_Connect::processDeviceState): updating light_bulb dimmer device [881] name [[FIRMWARE] Office Fixture] target [0] status [0] hub [112742] connected [TRUE]. <0x75cfa520>
50      11/23/15 22:28:35.127   luup_log:486: (Wink_Connect::setChildVariable) Device [881] SID [urn:upnp-org:serviceId:Dimming1] variable [LoadLevelTarget] current [0] new [0]. <0x75cfa520>
50      11/23/15 22:28:35.128   luup_log:486: (Wink_Connect::setChildVariable) Device [881] SID [urn:upnp-org:serviceId:SwitchPower1] variable [Target] current [0] new [0]. <0x75cfa520>
50      11/23/15 22:28:35.128   luup_log:486: (Wink_Connect::setChildVariable) Device [881] SID [urn:upnp-org:serviceId:Dimming1] variable [LoadLevelStatus] current [100] new [0]. <0x75cfa520>
50      11/23/15 22:28:35.129   luup_log:486: (Wink_Connect::setChildVariable) Setting LoadLevelStatus [0]. <0x75cfa520>
06      11/23/15 22:28:35.130   Device_Variable::m_szValue_set device: 881 service: urn:upnp-org:serviceId:Dimming1 variable: LoadLevelStatus was: 100 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xd78758/NONE duplicate:0 <0x75cfa520>
50      11/23/15 22:28:35.159   luup_log:486: (Wink_Connect::setChildVariable) Device [881] SID [urn:upnp-org:serviceId:SwitchPower1] variable [Status] current [1] new [0]. <0x75cfa520>
50      11/23/15 22:28:35.159   luup_log:486: (Wink_Connect::setChildVariable) Setting Status [0]. <0x75cfa520>
06      11/23/15 22:28:35.160   Device_Variable::m_szValue_set device: 881 service: urn:upnp-org:serviceId:SwitchPower1 variable: Status was: 1 now: 0 #hooks: 0 upnp: 0 skip: 0 v:0xcf9240/NONE duplicate:0 <0x75cfa520>

As you can see, both “Target” and “Status” are updated for the SwitchPower1 service and “LoadLevelTarget” and “LoadLevelStatus” are updated for the Dimming1 service.

There is absolutely nothing that can be changed/fixed with the Wink Connect plugin, as it already sets the correct variables in the child device.

I would speculate that you have an error in your PLEG configuration. Check that you have the correct serviceID/variable pairs…
Specifically, the Dimming1 service does NOT use Target/Status… It uses LoadLevelTarget/LoadLevelStatus.

CyberMage, Here is advanced tab of the Caseta Dimmer that the Wink Plug-in created and the values when dimmed at 50%.

You will notice that there are both
Dimming1:Status
Dimming1:Target
That are both zero

SwitchPower1:Status
SwitchPower1:Target
That are both 1

My Wink Add in and PLEG are both up todate.
It looks like because you created the Dimmer1:Status value but don’t set it, things like PLEG try to look at it for on/off status, I can get PLEG to work correctly if I explicitly tell it to watch the Dimming1:LoadLevelStatus or SwitchPower1:Status instead it works. But if I just use the generic, is the switch on shortcuts, it gets confused.

I am not sure how those Dimming1:Status and Target values got added, maybe is a bug from earlier version of the plug-in and a delete and re-add of the device will remove them. I am just remarking that it is odd they they are listed in the advance properties and not set, it seems to be a bug and confuse PLEG.

When I have time to do a delete and add to see if that removes the rogue Status and Target value I will let you know.
Screen shot of the advanced tab attached. I hovered over the first Target variable to just demonstrate that the first set is Dimming1 not SwitchPower1 which are the bottom set.

[quote=“shallowearth, post:3, topic:189841”]CyberMage, Here is advanced tab of the Caseta Dimmer that the Wink Plug-in created and the values when dimmed at 50%.

You will notice that there are both
Dimming1:Status
Dimming1:Target
That are both zero

SwitchPower1:Status
SwitchPower1:Target
That are both 1[/quote]

Your dimmer device was created by an OLD version of the plugin (before v0.12).

In the early versions, the plugin did set the Status and Target variables. This was an error and has been fixed… The correct variables are LoadLevelStatus and LoadLevelTarget.

That is NOT a workaround… It is the correct way to monitor a dimmer device.

The Dimming1:Status and Dimming1:Target variables will never be updated because they are not the correct variables!

If you have configured PLEG to look at Dimming1:Status and Dimming1:Target, that is incorrect.

If PLEG is automatically using Status and Target, because they are present in the device, that is also incorrect.

Unfortunately, once a device variable is created, it can not be deleted. The only option is to delete the dimmer device and let the plugin recreate it.

Thanks for the confirm, I have just been enjoying the Wink Plug in that long I guess! ;D (think I started with version .6 or .7). I ended up having to get a Caseta dimmer for my dining room because no z-wave dimmer on the market could dim this massive LED ceiling light we have properly, only the Lutron’s dimmers work with it. So it was great to see I could get a cheap Wink hub and still automate this light. Thanks!

I dont’ have a lot of automation associated with this particular device so I will just delete it and start over with the right set of variables.

OK, delete and recreate of the dimmer fixed it… thanks!