Emerson Sensi Thermostat

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

@42Network, Here is a jar with additional debugging messages. I added a ā€˜versionā€™ debug message that should appear so we know OH isnā€™t running with an old jar like it did once before. The ā€˜versionā€™ message is:

[ERROR] [lient.DelegatedAuthenticationService] - Debugging 'Version' 2.4.1  

In this jar, I added a JsonReader.setLenient(true) call based on your error messages, along with tracing out the string data we are trying to parse with a JsonParser.

Please let me know how it goes.

Joel

@42Network, This jar (debug ā€˜versionā€™ 2.4.12) has a fix for the pubnub subscriptions for the thermostats. Please let me know how it goes for you.

Thank you,
Joel

Thanks for the update. I just installed it and it is much more responsive to hardware button changes. Except the change shows up in Celsius rather than Farenheit. Right now my thermostats in the paperUI Control area bounce back and forth between F and C. Didnā€™t used to do this.

Any ideas?

Iā€™ve duplicated the behavior. Iā€™ll let you know when it is fixed. Sorry about that.

Joel

I have fixed the temperature issue. Here is a jar with the fix.

debug ā€˜versionā€™ 2.4.17

I noticed the humidity reading does something similar. Iā€™ll get this fixed soon, but it may not be until next week.

Thanks,
Joel

Here is another update. I do not know of any more bugs. So this will hopefully be the last update for a while.
debugging ā€˜versionā€™ 2.4.20

Thanks,
Joel