Emerson Sensi Thermostat

Hi Joel. I see you posted an OH 2.3 Wink jar file. What is the procedure for upgrading to this new version? Do I just put the jar file in the addons directory?

Thanks

So I put in the new Wink jar file and restarted OH. Lots of errors are showing up related to Wink, like this:

2018-07-06 11:46:09.782 [ERROR] [org.openhab.binding.wink            ] - [binding.wink(24)] Error during instantiation of the implementation object

java.lang.Error: Unresolved compilation problems: 

	The import com.google.common cannot be resolved

	ImmutableSet cannot be resolved

	ImmutableSet cannot be resolved

	at org.openhab.binding.wink.internal.WinkHandlerFactory.<init>(WinkHandlerFactory.java:30) ~[?:?]

	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]

	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]

Also, why I try to manually add a Wink Hub 2 thing:

2018-07-06 11:47:43.416 [WARN ] [ore.thing.internal.ThingRegistryImpl] - Cannot create thing. No binding found that supports creating a thing of type 'wink:wink_hub_2'.

Any ideas?

-Nathan

Sorry. I posted that jar prematurely. I am working on this still but only get an hour here and there to work on it. I am close I think to having a working jar.

Joel

I have a version built that I am trying to debug with. I installed the 2.3 runtime and dropped in my jar to the addons folder, but I keep getting the following error:

org.osgi.framework.BundleException: The bundle class path entry "lib/pubnub-gson-4.4.3-all.jar" 
could not be found for the bundle "osgi.identity; type="osgi.bundle"; version:Version="2.4.0.201807071109";
osgi.identity="org.openhab.binding.wink"; singleton:="true""

I’m not sure how to add the necessary dependency so the binding will work. Previously when debugging my jar, I did not have this dependency issue.

I am also getting:

2018-07-07 07:46:02.931 [ERROR] [org.openhab.binding.wink            ] - Component descriptor entry 'OSGI-INF/*.xml' not found

This is what I am currently stuck on…

@shawncrosbys, do you happen to know what I’m doing wrong with the wink binding and the pubnub-gson dependency? My end goal is to use the wink thermostat feature.

EDIT: I see, I was missing a lib directory call out in my build.properties file… All set on the dependency issue.

@42Network, Please try the 2.4 jar. The bundle activated without errors, but I was unable to add any things in paper ui. Can you let me know if this is the same for you?

Thanks for letting me know about the new version.

All I have to do is put the 2.4.0 jar in my addons directory?

I copied it and then restarted OH. I see this error in the logs:

2018-07-07 21:17:17.259 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, id=121, bundle=222/file:/usr/share/openhab2/addons/org.openhab.binding.wink-2.4.0-SNAPSHOT.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) [22:com.google.gson:2.7.0]

	at com.google.gson.JsonParser.parse(JsonParser.java:45) [22:com.google.gson:2.7.0]

Am I doing something wrong for the installation of the jar possibly?

Thanks

You should be able to just drop the jar into the addons folder.

Could you please try closing down OH and Clear OH Cache and try again.

How far do you get before the errors show up? Do the errors come just after starting up OH, or do they come as you try to add the wink hub thing and/or thermostat thing?

I cleared the cache and reastarted OH. These are the wink errors I got:

2018-06-28 14:04:57.499 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, id=341, bundle=212/file:/usr/share/openhab2/addons/org.openhab.binding.wink-2.2.0-SNAPSHOT.jar]: Unexpected problem updating configuration org.openhab.wink
java.lang.NullPointerException: null
        at org.openhab.binding.wink.internal.AuthenticationConfigurationService.updated(AuthenticationConfigurationService.java:37) [212:org.openhab.binding.wink:2.2.0.201801262202]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1479) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1435) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [8:org.apache.felix.configadmin:1.8.16]
        at java.lang.Thread.run(Thread.java:748) [?:?]
2018-06-28 14:11:27.072 [WARN ] [g.dispatch.internal.ConfigDispatcher] - Could not parse line 'xxxxxxxxxxxxxxxx'
2018-06-28 14:11:40.448 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, id=341, bundle=212/file:/usr/share/openhab2/addons/org.openhab.binding.wink-2.2.0-SNAPSHOT.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) [212:org.openhab.binding.wink:2.2.0.201801262202]
        at com.google.gson.JsonParser.parse(JsonParser.java:45) [212:org.openhab.binding.wink:2.2.0.201801262202]
        at org.openhab.binding.wink.client.DelegatedAuthenticationService.getResultAsJson(DelegatedAuthenticationService.java:93) [212:org.openhab.binding.wink:2.2.0.201801262202]
        at org.openhab.binding.wink.client.DelegatedAuthenticationService.<init>(DelegatedAuthenticationService.java:60) [212:org.openhab.binding.wink:2.2.0.201801262202]
        at org.openhab.binding.wink.internal.AuthenticationConfigurationService.configure(AuthenticationConfigurationService.java:51) [212:org.openhab.binding.wink:2.2.0.201801262202]
        at org.openhab.binding.wink.internal.AuthenticationConfigurationService.updated(AuthenticationConfigurationService.java:39) [212:org.openhab.binding.wink:2.2.0.201801262202]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1792) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [8:org.apache.felix.configadmin:1.8.16]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 15 path $
        at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1559) ~[?:?]
        at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1401) ~[?:?]
        at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542) ~[?:?]
        at com.google.gson.stream.JsonReader.peek(JsonReader.java:425) ~[?:?]
        at com.google.gson.JsonParser.parse(JsonParser.java:60) ~[?:?]
        ... 12 more

Your log message shows the 2.2 binding after clearing the cache. Would you mind trying again with the 2.4 binding please?

Weird. I am really confused. I removed the 2.2.0-SNAPSHOT jar a few days ago. It is not on my system:

[17:32:31] openhabian@openHABianPi:/srv/openhab2-conf/persistence$ sudo find / -name \*binding.wink\*
/usr/share/openhab2/addons/org.openhab.binding.wink-2.4.0-SNAPSHOT.jar
/srv/openhab2-addons/org.openhab.binding.wink-2.4.0-SNAPSHOT.jar
/srv/openhab2-sys/addons/org.openhab.binding.wink-2.4.0-SNAPSHOT.jar

How could OH still be using the old one?

I rebooted my RPi. Same error happens, but with the right jar version. :frowning:

2018-07-09 17:39:53.947 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, id=114, bundle=189/file:/usr/share/openhab2/addons/org.openhab.binding.wink-2.4.0-SNAPSHOT.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) [22:com.google.gson:2.7.0]
        at com.google.gson.JsonParser.parse(JsonParser.java:45) [22:com.google.gson:2.7.0]
        at org.openhab.binding.wink.client.DelegatedAuthenticationService.getResultAsJson(DelegatedAuthenticationService.java:93) [189:org.openhab.binding.wink:2.4.0.201807080123]
        at org.openhab.binding.wink.client.DelegatedAuthenticationService.<init>(DelegatedAuthenticationService.java:60) [189:org.openhab.binding.wink:2.4.0.201807080123]
        at org.openhab.binding.wink.internal.AuthenticationConfigurationService.configure(AuthenticationConfigurationService.java:51) [189:org.openhab.binding.wink:2.4.0.201807080123]
        at org.openhab.binding.wink.internal.AuthenticationConfigurationService.updated(AuthenticationConfigurationService.java:39) [189:org.openhab.binding.wink:2.4.0.201807080123]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1479) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1435) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [8:org.apache.felix.configadmin:1.8.16]
        at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [8:org.apache.felix.configadmin:1.8.16]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 15 path $
        at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1559) ~[?:?]
        at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1401) ~[?:?]
        at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542) ~[?:?]
        at com.google.gson.stream.JsonReader.peek(JsonReader.java:425) ~[?:?]
        at com.google.gson.JsonParser.parse(JsonParser.java:60) ~[?:?]
        ... 13 more

I cannot say how the old version showed up. Strange for sure.

Are you using a wink.cfg file in your services folder to set the delgated option and to set the herokuapp auth_service_token ? I noticed the log mentioned not being able to parse something that looked like it might be your herokuapp auth_service_token… Maybe there is a typo there?

Also, just to confirm, with the 2.4 jar, you can add the sudo wink hub, but not your thermostats, correct?

Here is the entire contents of my wink.cfg - seems ok to me - can you confirm?

auth_service=delegated
auth_service_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

And no, I am not able to add the Wink Hub completely. It always has a status of “Uninitialized” shown in the UI.

Are there more places to clear out tmp and cache besides /var/lib/openhab/cache and tmp? It was really strange that my system didn’t forget about your old 2.2.0 jar until after a reboot.

-Nathan

Yes, that does look correct. You may want to edit your post to remove the token though, otherwise someone could use it to control your devices. Your token was also in your log errors a couple posts above.

I’m curious if the root of our problems is with the herokuapp authentication. I am going to try to setup the alternate authentication and see if I have success.

Are there more places to clear out tmp and cache besides /var/lib/openhab/cache and tmp?

Not that I know of, but I cannot say for sure.

Also, have you tried to remove the wink hub and re-add it?

Yes I’ve tried removing and adding the Wink device several times. I xxxxx’ed out my tokens in earlier posts. Thanks for that good advice.

@42Network I was able to get the thermostat support to work again! I uploaded a new 2.4 jar, The jar has a lot of debugging logging that I will eventually trim out.

image

The problem was not with the herokuapp authentication. I set up the oauth through developer.wink.com and had the same issues. it ended up being a json parsing issue.

Let me know if it works for you. Please clear you cache and remove your items and then try the new jar.

Thanks,
Joel

1 Like

Joel,

Thanks for your hard work on this. I’m looking forward to it working. But I still get the same error as before about malformed JSON after clearing the OH cache & tmp files, installing the new jar, and restarting OH. I wish the error said what JSON file had an error.

How can I enable the debugging code you have in the jar? Perhaps we can get some more helpful errors!

2018-07-13 17:06:11.849 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, id=99, bundle=157/file:/usr/share/openhab2/addons/org.openhab.binding.wink-2.4.0-SNAPSHOT.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) [22:com.google.gson:2.7.0]

	at com.google.gson.JsonParser.parse(JsonParser.java:45) [22:com.google.gson:2.7.0]

	at org.openhab.binding.wink.client.DelegatedAuthenticationService.getResultAsJson(DelegatedAuthenticationService.java:93) [157:org.openhab.binding.wink:2.4.0.201807130010]

	at org.openhab.binding.wink.client.DelegatedAuthenticationService.<init>(DelegatedAuthenticationService.java:60) [157:org.openhab.binding.wink:2.4.0.201807130010]

	at org.openhab.binding.wink.internal.AuthenticationConfigurationService.configure(AuthenticationConfigurationService.java:51) [157:org.openhab.binding.wink:2.4.0.201807130010]

	at org.openhab.binding.wink.internal.AuthenticationConfigurationService.updated(AuthenticationConfigurationService.java:39) [157:org.openhab.binding.wink:2.4.0.201807130010]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [8:org.apache.felix.configadmin:1.8.16]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [8:org.apache.felix.configadmin:1.8.16]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [8:org.apache.felix.configadmin:1.8.16]

	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1479) [8:org.apache.felix.configadmin:1.8.16]

	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1435) [8:org.apache.felix.configadmin:1.8.16]

	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [8:org.apache.felix.configadmin:1.8.16]

	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [8:org.apache.felix.configadmin:1.8.16]

	at java.lang.Thread.run(Thread.java:748) [?:?]

Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 15 path $

	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1559) ~[?:?]

	at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1401) ~[?:?]

	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:542) ~[?:?]

	at com.google.gson.stream.JsonReader.peek(JsonReader.java:425) ~[?:?]

	at com.google.gson.JsonParser.parse(JsonParser.java:60) ~[?:?]

	... 13 more

Despite the above error, I was able to add the Wink Hub. Discovery didn’t find anything, but I was able to manually add a thermostat. But it asked for a Wink-assigned UID. I have no idea how to find this UID. The Wink app on my phone, which shows my two Sensi thermostats, doesn’t tell me the UID.

I guessed and put in a UID of 1 and OH did add a thermostat, which I can see in the control area, but it shows no data.

Thoughts?

To manually add the uuid, you would have to use the wink api on their website to get it. I couldn’t figure out how to get it from there.

It looks like the errors you are getting are earlier than my error logging. It may be worth trying to got to the herokuapp and click disconnect from wink, then reconnect to wink. It shouldn’t change your I’d, but it may be worth trying.

Joel

How did you add your thermostat? Did Discovery work for you? Or did you add manually? If so, how did you determine the UID? Is this only a problem for me because I have two Sensis?

I manually added the wink hub, then discovery found my thermostat.

Maybe on your wink app you could remove one thermostat then try the wink binding again. I have never tried with two thermostats.

Joel