Nest binding in 2.0?

Just wondered if anyone has played with the Nest binding in OpenHAB 2? I tried briefly and it seems to not load at all. I added the debug logging, and there is nothing being written to the log.

Does the bundle start at all (or is it maybe lacking a dependency)? Check on the OSGi console with “ss nest”.

ss nest
"Framework is launched."

id    State       Bundle
159    INSTALLED   org.openhab.binding.nest_1.8.0.201508130117

INSTALLED is bad indeed, it means that it wasn’t possible to resolve its dependencies.
Try to do a „start 159“ and you will be told, what is missing.

I pulled it into my 2.0 dev setup, and found it referring to jackson json calls from org.codehaus, so those are all updated to com.fasterxml entries, and they all resolve now. The IDE is showing no errors, so I decided to export the binding jar. It created the new binding jar, so I dropped it in, but am still getting a jackson dependency at runtime, so I need to figure out why it wasn’t included.

runtime dependencies fixed for export, I have a running binding in 2.0. Now to see if it works right.

2015-08-25 17:03:33 [INFO ] [.service.AbstractActiveService:169 ] - Nest Refresh Service has been started

Please let us know if it seems to be running properly with the later JSON library.

watou, were you working on a dedicated updated Nest binding for 2.0?

I am not now working on one, but I do very much want to as my first contribution to OH2/ESH. I am excited to have discovery populate the available Things instead of currently requiring manual definition. It will be a nice step forward, like OH2.

I have the version 1 binding returning and parsing now from OH2 except last event time, but that is being returned in the json, so I think it is a simple matter of not ignoring it when it changes and it should populate as well. I am working with smoke_co currently. The thermostat should work as well though, I just need to create the virtual home device for it. Getting it going was mostly a dependency issue resolution. I will commit back to my fork, but I would like to see if it still works in OH1 first. I don’t have OH1 installed anymore though. A funny? situation would be the OH1 binding working only with OH2. Okay, not so funny…

I know there was some reason I was limited to using the older org.codehaus JSON library instead of com.fasterxml, but in the 2.0 version I plan to switch to GSON, as I recently read that that is the preferred library. Perhaps it would make sense to add the org.codehaus library to the 1.x compatibility layer so we can avoid code changes before then?

I agree, this bundle is used by some other bindings as well. Would you be so kind to create a PR, which adds Jackson to the openHAB 2 TP and to the dependencies feature, so that it ends up in the distribution?

Amended issue#274 for the time being.

Is there a old thread I can read that debates gson vs jackson?

Not that I am aware of. But in Eclipse SmartHome, GSON had been chosen for a few central parts, that’s why it also leaks into openHAB 2.
From what I find on the net, there might be some slightly better performance in gson vs. jackson and the API is rather nice to use. So for all new bindings, gson is the suggested library to use.

Regards,
Kai

Anyone find a way to bind the nest? try to, but it find no things

Since the Nest binding is currently a 1.x binding, you must specify a binding config string in a .items file. See the wiki page for more information. I plan on having a 2.0 version that discovers your thermostats, smoke + CO detectors and cameras.

ah thanks, would be nice with discovery

I Installed the Nest1 Binding and configured items and a test sitemap, and now I’m getting a Could not lock User prefs every 30 seconds in my log. I’ve checked ownership and permissions on my Linux instance. What file is the Nest binding trying to touch?

2016-12-20 14:31:49.260 [WARN ] [java.util.prefs                     ] - Could not lock User prefs.  Unix error code 2.
2016-12-20 14:31:49.261 [WARN ] [java.util.prefs                     ] - Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.

I added bindings = zwave,astro,nest1 into my addons.cfg in

bundle:list
211 | Active | 80 | 1.9.0.201612190210 | openHAB Nest Binding

~openhab/.java/.userPrefs should be it.