Devices seem to be "losing sync" in Vera

Here is an experimental update adding support for the Ring Video Doorbell.

Please test… (only changes are in L_Wink_Hub1.lua)

[quote=“cybrmage, post:21, topic:189845”]Here is an experimental update adding support for the Ring Video Doorbell.

Please test… (only changes are in L_Wink_Hub1.lua)[/quote]
So I figured out why my Relay came back! When I went into the Wink app I noticed I didn’t see the Ring doorbell anywhere, so I added it again…Relay disappeared. So the first Ring I received had issues and they sent me a new one, once I removed it from the app it was also removed from Wink which is why my Relay came back.

I installed the update, the motion sensor seems to work but doesn’t update automatically in Vera. When I get a motion alert (from Ring app) nothing changes on Vera, but if I do a resync it shows tripped, and then after a few minutes if I resync again it shows untripped.

I figured that was what was happening… When you add the Ring, It is added as both a device and a sensor pod… BUT the API (incorrectly) removes (or at least no longer reports) the Wink Relay sensor pod.

I’m working on a work-around…

So far, so good… I expected that the button/motion devices would not get state update, as I have no data from an update to work with…

What I need to proceed is… Capture a LuaUPnP log… Starting logging and trigger a resync… wait 10 seconds… then trigger the motion sensor on the Ring… wait 5 seconds, press the doorbell button… wait 5 seconds… stop logging and post the results… That should capture the current state of the devices and the notifications that are sent when the Ring is activated…

I figured that was what was happening… When you add the Ring, It is added as both a device and a sensor pod… BUT the API (incorrectly) removes (or at least no longer reports) the Wink Relay sensor pod.

I’m working on a work-around…

So far, so good… I expected that the button/motion devices would not get state update, as I have no data from an update to work with…

What I need to proceed is… Capture a LuaUPnP log… Starting logging and trigger a resync… wait 10 seconds… then trigger the motion sensor on the Ring… wait 5 seconds, press the doorbell button… wait 5 seconds… stop logging and post the results… That should capture the current state of the devices and the notifications that are sent when the Ring is activated…[/quote]
Here you go!

EDIT: Looks like once the Ring detects motion it causes the Wink connect plugin to crash. I just tested it while watching the logs, everything was working until I set off the motion.

Here is another test fix…

It should fix the doorbell and support your iHome device… It should also make your Wink Relay reappear… (but it may not update properly…)

(only changes are in L_Wink_Hub1.lua)

[quote=“cybrmage, post:25, topic:189845”]Here is another test fix…

It should fix the doorbell and support your iHome device… It should also make your Wink Relay reappear… (but it may not update properly…)

(only changes are in L_Wink_Hub1.lua)[/quote]

After uploading the new lua file posted above I can’t login to the WebUI of Vera any longer. Looking at the logs, the only mention of “Wink” is this line:

LuaInterface::LoadCode: [string "-- Wink_Connect 0.20.35..."]:2867: unexpected symbol near 'if' <0x776af320>

Sorry… Accidentally left some test code in the file…

Fixed…

[quote=“cybrmage, post:27, topic:189845”]Sorry… Accidentally left some test code in the file…

Fixed…[/quote]

No dice! Wink Connect is getting stuck at “Configuring Devices” Here’s a log capture right after a LUUP reload, hopefully it helps.

NO!!! We have dice!!! They’re just coming up snake-eyes!!

The new processing code for the Wink Relay caused the plugin to crash

Here is a fix… may not make the Relay Device appear… but it should let you test the iHome and Ring devices while I continue to bash away at the Wink Relay… (I’m REALLY trying to resist the urge to bash away at the one on my wall!!)

{UPDATE}: nope - won’t work either… fix coming soon…

This should fix the plugin crashing with your Wink Relay…

Can’t get into WebUI again, seeing this error:

01	12/17/15 17:20:30.266	LuaInterface::LoadCode: [string "-- Wink_Connect 0.20.36..."]:434: nesting of [[...]] is deprecated near '[' <0x77347320>

Can’t get into WebUI again, seeing this error:

01	12/17/15 17:20:30.266	LuaInterface::LoadCode: [string "-- Wink_Connect 0.20.36..."]:434: nesting of [[...]] is deprecated near '[' <0x77347320>

Crap!!!

I added an older file to the archive…

Not having a good day 8-{[/quote]

[quote=“cybrmage, post:32, topic:189845”]Crap!!!

I added an older file to the archive…

Not having a good day 8-{[/quote]
Looks like everything is working. The Relay is there but data isn’t correct and the motion isn’t working to trigger events (which I think you are aware of). The Ring motion and button are working to trigger events! The ISP5 switch is working but not updating status.

Thanks for all your hard work on this plugin!

The changes I made are a stop-gap measure. Originally, a device for the Wink Relay would only be created if there was API data for the Wink Relay AND the sensor device associated to it. Now, if there is API data for the Wink Relay, a device is created for it…

Now, there is a bug in the Wink API… When you added the Ring doorbell, the data for the Doorbell device and it’s associated sensor was added BUT Wink Relay’s associated sensor pod disappeared for the .sensors group. The .sensors group (a system generated group that is normally hidden in the Wink APP) is the only was to get the reference to the sensor_pod_id for the Wink Relay sensors.

I suspect that that the actual sensor pod data is still available in the API data, but there is no way to get to it without the sensor_pod_id. There are signs that the data is still available, as the temperature/humidity/proximity/presence readings still appear in the .sensors group under reading_aggregation…

I could use the data from the reading_aggregation as the data for the Wink Relay device (when the sensor pod is not accessible), but that would create problems if there are more than one Wink Relay’s on the account…

I have reported the issue to Wink… Ideally, they will fix the issue…

Can you provide logs showing a full on/off/on or off/on/off cycle of the switch…

The first couple of on/off commands didn’t work right after the resync so I did a few more.

Edit: This looks like it is more of an issue between Wink and the iHome ISP5 switch…the Wink app very rarely shows the correct status of the ISP5.

This may be part of the issue… but, since I had no idea what data the notification contained… the processing did cause the plugin to crash…

Attached is an update that should fix it…

I wasn’t able to really test the last update due to my Wink hub crashing and had to send it back the other day. Tonight, I just repaired all my bulbs to either my Relay or a Link Hub. I was able to sync and get all my bulbs back, of course they were named differently due to Wink keeping the old devices stored and not actually removing them.

I’m not sure what’s going on here as the plugin says Ready but if I try to change any status it fails and if I try to manually sync it says DEVICE NOT READY.

Here’s a log of a Luup restart: Dropbox - WinkCrashLog.txt - Simplify your life

EDIT: Another thing I’ve noticed is my trippers (that were originally paired to my Relay and not the Wink hub) have continued to operate correctly with the plugin. Which leads me to believe that it’s definitely caused by having to re-pair all my devices and remove them from the old hub.

Looks like it’s still running into issues caused by the lack of sensor data for the Wink Relay…