Offering to implement the Wink Hub 2 bindings

Hey @sebmarchand, submitted a pull request here: https://github.com/openhab/openhab2-addons/pull/2943

My problem is it worked for quite a while and now it is not working. I am a experiencing an class mismatch now that did not occur before. I deleted an item that worked but stopped working and tried to reload, but that is not working either.

Hello all. Stumbled upon this thread doing some research. While I havenā€™t seen it in action, looks like some good work has been done here. Had a few questions though.

I actually have a rooted Wink Hub 1 and am using OH1. Everything is working and working well, so no need that I see to change it to be honest. Though I will say my WinkHub has been acting a little wonky lately (like somehow losing itā€™s static IP address I assigned, though I fixed this by assigning static reservation in dnsmasq on my home server).

So, I got to thinking about replacing that with something. I really do like the Wink Hub hardware due to the various assortments of radios; however, I hate hate hate the fact that they (like so many other out of touch HA products) rely on apps and the cloud - sure many provide apiā€™s but they still depend on the cloud.

While I didnā€™t read every single post in this thread, it looks like this binding leveraged the cloud service. So, the question is what happens when the internet goes out?

Also, I read that Wink Hub 2 actually does now (actually as more than a year ago) have local access via APIā€™s. I found some references to what the APIā€™s do, but nothing really on if it has been figured out how to access the APIā€™s outside the Wink App. Is local API access outside of the app still unattainable (most likely due to some auth issues)?

If so, and my lovely rooted WH1 bites the dust, I will probably forgo the WH2 until it can be accessed locally, hacked or not. To be honest, I like the availability of the radios, but currently all I work with is Zigbee for bulbs and some 433ā€™s running off some transmitters on my breadboard connected to my RPi for outlets and it works well so far. Just donā€™t want to be limited in the future. Thanks!

Mike

@shelzmike : It should be possible to use the local control but this isnā€™t implemented yet, thereā€™s some information on this page: https://github.com/python-wink/python-wink/pull/76

@shawncrosbys Thanks a lot for taking care of the pull request!

Hey Mike,

No reason we canā€™t implement a local network client if the apis exist. I know nothing of the local API and it was @sebmarchand that did the initial research for the cloud based API. If you have some docs, the change would likely be simple.

S.

@jjennings308 I had an issue once with class cast issues when building the jar. Something in the cache or tmp folder I think. I came across a post that told me to clear the cache and tmp directory in openhab and restart which fixed it for me.

Thanks for the help. Your suggestion fixed the problem. I shutdown OH, cleared the cache and tmp directories, then restart and all is working.

Thanks.

1 Like

Could anyone possibly give a quick overview/summary of what is currently supported with the Binding? Particularly Zwave devices and/or Hue/Zigbee devices? Or possibly Milight and Wifi devices?

I have always liked the Wink hub, but left it for OH2 a while back. But I would like to still possibly use a Wink Hub sort of like a back up system.

ie, set my zwave and other devices up on the Wink Hub, but then have OH2 control everything on it. This way if my OH2 system ever crashed, I would still have some control over things via the Wink, Hue, and other Apps out there.

Iā€™m also not that familiar yet with setting up a Secondary Zwave controller. It would also be great if you could use the Wink as a primary zwave controller, and then have a secondary connected to OH2.

The binding supports a number of devices and can be extended to support more if someone actually has the devices to test for us. See the readme file for what it currently supports: https://github.com/shawncrosby/openhab2-addons/blob/ring_doorbell/addons/binding/org.openhab.binding.wink/README.md

Thanks @shawncrosbys and @sebmarchand for implementing this binding!
I have done the following in OH2.2:

  1. Copied the wink binding jar add-on file to the addons directory
  2. Discovered and added the Wink Hub 2 Things in PaperUI Things
  3. Configured the wink binding auth service and auth service token to the attributes created using the herokuapp
  4. Added the Doorbell (Ring Doorbell Pro) and Lock (August Smartlock Pro) Things in PaperUI Things

However, when doing step 4, Iā€™m not sure what to enter for the mandatory ā€œConfigure Parametersā€ field.
Please advise.

Thanks,
Randy

1 Like

@randye007 the only required parameter for things is the wink uuid value which discovery should populate for you.

Thanks for the quick reply @shawncrosbys!
After reviewing my steps, I realized that I didnā€™t click the ā€œConnect to Winkā€ link in the herokuapp.
However, even after doing that step, I canā€™t get my Wink-connected devices to auto-discover.
Iā€™ve created the Wink Hub 2 Thing, then try to auto-discover my devices, but they are never populated.

Any thoughts?

Thanks,
Randy

Ahā€¦small bug. You can work around by putting a non-null value in the client_id field in the binding config and then searching again. Iā€™ll put a fix in.

S.

Thanks! That fixed it ā€¦ :slight_smile:

Thanks for your hard work guys, but I must be doing something wrongā€¦
Iā€™ve used the herokuapp to get my token, logged into the Wink pop-up using the credentials I use for the Wink app.
Should the Wink login give me any result, or just return to herokuapp?
I put in the token and select delegated in the PaperUI.
When I try discovery, I get a 401 error.

Thanks for your help

Wayne

Iā€™m also seeing this traceback:
19:37:21.676 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedService, id=116, bundle=28/file:/usr/share/openhab2/addons/org.openhab.binding.wink-2.2.0-SNAPSHOT(1).jar]: Unexpected problem updating configuration org.openhab.wink
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 15 path $
at com.google.gson.JsonParser.parse(JsonParser.java:65) [28:org.openhab.binding.wink:2.2.0.201708131354]
at com.google.gson.JsonParser.parse(JsonParser.java:45) [28:org.openhab.binding.wink:2.2.0.201708131354]
at org.openhab.binding.wink.client.DelegatedAuthenticationService.getResultAsJson(DelegatedAuthenticationService.java:94) [28:org.openhab.binding.wink:2.2.0.201708131354]
ā€¦

Hey @wcrosbie,

I think @randye007 came across the same problem. There was a little bug in the configuration of the binding that I fixed in the current pending PR. You can work around it by putting a non-null value in the client_id config adding the hub thing and then searching again. The original binding didnā€™t have the delegated authentication service, so we missed it when we did our initial testing.

Let me know if that fixes it for you.

S.

https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.wink/2.3.0-SNAPSHOT/ has the updated jar that fixes the config issue

Thanks. Iā€™m still getting the traceback. I wonder if I have something else going on.

Iā€™d like to remove all the wink config and start again. Is that easy to do?

Wayne

I expect so. You should just be able to delete all the wink things. Iā€™m not sure how to clear config once its set though. Your error looks strange, do you have some strange characters in your config file?