Offering to implement the Wink Hub 2 bindings

oh2bindings
wink
Tags: #<Tag:0x00007fd30ff5eff8> #<Tag:0x00007fd30ff5eeb8>

(Shawn Crosby) #81

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


(James Jennings) #82

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.


(Mike Miller) #83

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


(Sébastien Marchand) #84

@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!


(Shawn Crosby) #85

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.


(Shawn Crosby) #86

@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.


(James Jennings) #87

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.


(Paul Muldoon) #88

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.


(Shawn Crosby) #89

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


(Randy Elias) #90

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


(Shawn Crosby) #91

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


(Randy Elias) #92

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


(Shawn Crosby) #93

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.


(Randy Elias) #94

Thanks! That fixed it … :slight_smile:


(Wayne Crosbie) #95

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


(Wayne Crosbie) #96

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]


(Shawn Crosby) #97

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.


(Shawn Crosby) #98

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


(Wayne Crosbie) #99

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


(Shawn Crosby) #100

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?