Nest thermostat thing offline

Hello. After my OH 1.8.3 project went dormant for a year or so, I decided to start with a fresh 2.2.0 install. After overcoming some hurdles with getting the Nest v2.2.0 thermostat binding going in PaperUI, I was at least able to get the things discovered and added. However, I’m now running into a new roadblock getting OH to communicate with the thermostat.

After dropping the nest.cfg and nest.items files in their respective directories, I got the “Nest Account” and “Home” Things to come online, but the thermostat Thing is still offline. For good measure, I generated a new PIN to replace the old one in nest.cfg, but the issue still persists.

Next, when I try to add a widget in Habpanel, using “NestTStat_ambient_temperature_f” for example, it returns 0. If I add widgets using “NestTStat_last_connection” and “NestTStat_software_version”, those both return NULL. All of these variables are stated in the nest.items file, so there’s definitely a disconnect between OH and the Nest API.

No matter what I try, I can’t get it to work; not even uninstalling and reinstalling the binding and generating a new PIN. The block below is what is being generated over and over in openhab.log:

2018-04-17 23:24:50.036 [WARN ] [nternal.rest.NestStreamingRestClient] - An exception occurred while processing the inbound event
java.lang.NullPointerException: null
	at org.openhab.binding.nest.handler.NestThermostatHandler.getChannelState(NestThermostatHandler.java:53) ~[?:?]
	at org.openhab.binding.nest.handler.NestThermostatHandler.getChannelState(NestThermostatHandler.java:1) ~[?:?]
	at org.openhab.binding.nest.handler.NestBaseHandler.lambda$0(NestBaseHandler.java:131) ~[?:?]
	at java.lang.Iterable.forEach(Unknown Source) ~[?:?]
	at org.openhab.binding.nest.handler.NestBaseHandler.updateChannels(NestBaseHandler.java:131) ~[?:?]
	at org.openhab.binding.nest.handler.NestThermostatHandler.onNewNestThermostatData(NestThermostatHandler.java:155) ~[?:?]
	at java.lang.Iterable.forEach(Unknown Source) ~[?:?]
	at org.openhab.binding.nest.handler.NestBridgeHandler.broadcastDevices(NestBridgeHandler.java:213) ~[?:?]
	at org.openhab.binding.nest.handler.NestBridgeHandler.lambda$1(NestBridgeHandler.java:208) ~[?:?]
	at java.util.concurrent.CopyOnWriteArrayList.forEach(Unknown Source) ~[?:?]
	at org.openhab.binding.nest.handler.NestBridgeHandler.broadcastDevices(NestBridgeHandler.java:208) ~[?:?]
	at org.openhab.binding.nest.handler.NestBridgeHandler.onNewTopLevelData(NestBridgeHandler.java:388) ~[?:?]
	at org.openhab.binding.nest.internal.rest.NestStreamingRestClient.lambda$4(NestStreamingRestClient.java:206) ~[?:?]
	at java.util.concurrent.CopyOnWriteArrayList.forEach(Unknown Source) ~[?:?]
	at org.openhab.binding.nest.internal.rest.NestStreamingRestClient.onEvent(NestStreamingRestClient.java:206) ~[?:?]
	at org.glassfish.jersey.media.sse.EventSource$EventProcessor.notify(EventSource.java:687) [180:org.glassfish.jersey.media.jersey-media-sse:2.22.2]
	at org.glassfish.jersey.media.sse.EventSource$EventProcessor.notify(EventSource.java:681) [180:org.glassfish.jersey.media.jersey-media-sse:2.22.2]
	at org.glassfish.jersey.media.sse.EventSource$EventProcessor.onEvent(EventSource.java:668) [180:org.glassfish.jersey.media.jersey-media-sse:2.22.2]
	at org.glassfish.jersey.media.sse.EventSource$EventProcessor.run(EventSource.java:614) [180:org.glassfish.jersey.media.jersey-media-sse:2.22.2]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]

Remove the nest.cfg file for you services folder, the PaperUI generates that in another location

@keithm You can fix this on OH 2.2.0 by making sure the “Thermostat read/write v6” permission is enabled in the Nest Developer console.

See: Openhab2 Nest binding - 2.2.0.SNAPSHOT An Updated 2.0 Binding that works!

In OH 2.3.0-SNAPSHOT the binding properly handles missing values due to insufficient permissions.

Thanks for the input. @vzorglub I removed the nest.cfg file in the services folder but I still received the same block of java errors in the logs and widgets were still returning null output.

@wborn I confirmed that Thermostat read/write v6 permissions were set in the developer console.

With the nest.cfg file gone, I removed the Things, uninstalled the Nest binding, deleted the OAuth client in the developer console, then recreated a new OAuth client. Now, after reinstalling the Nest binding, I figured out how to add the Product ID, secret, and PIN. The Nest Account came online immediately. “Home” and “FamilyRoom Thermostat” things did not; they remained Uninitialized. After adding the latter two from the Inbox, now I have two of each “Home” and “FamilyRoom Thermostat” items; one Online and one Uninitialized. I removed the uninitialized ones but they’re sitting there in a Removing state.

Assuming that one thermostat thing in an Online state is good, do I need to do anything with Channels? Like enable Temperature, Humidity, Mode, Set Point, etc? When I go back to Habpanel, the widget I have for ambient temperature is returning a number from NestTStat_ambient_temperature_f in Celsius. Lastr Connection and Software Version are still returning NULL.

Fahrenheit support and last connection were added in OH 2.3.0-SNAPSHOT. There is no channel for the software version. I use the JSR223 scripting engine to update an item with the software version.

Strange, I remember Fahrenheit was supported and functional under v1.8.3.

I had problems running the update PowerShell script so I manually copied the 2.3.0 snapshot contents into c:\openhab. Ambient temp still displays in Celsius, and Mode and Humidity don’t display now. Is there a timetable when v2.3.0 will hit stable release?

The binding has been rewritten so it can make use of the new openHAB 2 features such as discovery and Paper UI account configuration.

You can still install the 1.x binding by first enabling Legacy 1.x Bindings via Paper UI > Configuration > System .

In 2.3.0-SNAPSHOT you also need to set the measurement system to “Imperial” via Paper UI > Configuration > Regional Settings > Show more

If you update from the 1.x to the 2.x binding you also need to update the channels in your .items files. See the binding documentation for the available channels and some examples.

In 2.3.0-SNAPSHOT you also need to set the measurement system to “Imperial” via Paper UI > Configuration > Regional Settings > Show more

I don’t see this option for Imperial unit of measurement in PaperUI. Here is what I have in my 2.3.0-SNAPSHOT:

Also, I’m not sure if I’m overlooking something, but after removing the old items file, the old channel names (“NestTStatFamilyRoom_whatever”) are still displaying in PaperUI and Habpanel. The new “Thermostat_” names that I copied from the link you provided don’t appear in any dropdown lists. There seem to be so many things that aren’t lining up, it’s hard to focus on one thing.

It doesn’t look like you are using a recent 2.3.0-SNAPSHOT version @keithm . This is what the “Regional Settings” section should look like on recent builds:

@wborn Thanks for your continued guidance on this. It’s much appreciated. So after consideration, I set up a brand new instance of the 2.3.0-SNAPSHOT and restarted from scratch. The flow seems to be better in this release. I’m also able to set the unit of measurement to Imperial here.

OH discovered the Home, Nest Account, and Thermostat Things no problem; and getting them online went smoothly. The problem I’m running into now is linking channels… specifically the temperature channel. When I linked Humidity and Mode, I was able to select the appropriate variable from the dropdown. But I’m having a problem with the Temperature channel. It doesn’t seem to find anything:

Capture

Also, back in Habpanel, I updated a few of the widgets, but they’re not returning expected results. I’m guessing that it has something to do with the formatting in my items file. I’m sure that I have the channel formatting incorrect. Is there any documentation on the syntax of the “channel=” to give some guidance on translation when using the examples?

Your channel binding don’t match what you have on your screen shot:
it should be:
{ channel="nest:thermostat:XXXXXX:xxxxxxxxxxxxxxxxxxxxxx:can_cool" }
You can copy the channel string from the paperUI

If you are on 2.3 SNAPSHOT, the Temperature channel of the nest wants a item of type Number:Temperature. It’s a new type of number that include the units.

So change your item definition to:

Number:Temperature Nest_Temp ......

And the item should be available in your dropdown to select

The openHAB documentation site still needs to be synched with the updated content. So currently it’s best to use the examples from the README on GitHub:

@wborn Thank you for the updated items example. Ambient temperature, set point, humidity, min/max set points are all working now!! Forward progress!

Two things I noticed that don’t work though are the mode and fan timer switches. Both return “No choices available - check widget config.” These are both using the Selection widget. Is that the correct widget to use in this case?

It should be possible for the selection widget to get the HVAC mode values. But it seems to fail for some reason.

I got both working by providing comma separated values with a selection widget: