Emerson Sensi Thermostat


(Nathan Ellsworth) #42

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


(joel_shumann) #43

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


(Nathan Ellsworth) #44

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?


(Nathan Ellsworth) #45

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


(joel_shumann) #46

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?


(Nathan Ellsworth) #47

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


(joel_shumann) #48

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?


(Nathan Ellsworth) #49

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.


(joel_shumann) #50

@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


(Nathan Ellsworth) #51

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

(Nathan Ellsworth) #52

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?


(joel_shumann) #53

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


(Nathan Ellsworth) #54

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?


Offering to implement the Wink Hub 2 bindings
(joel_shumann) #55

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


(joel_shumann) #56

@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