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

I have good news and bad news :slight_smile:

The good news, is overnight, I had a couple of times when the binding disconnected from Nest, and did reconnect itself.

The bad news, is that it only reconnected itself when I sent a command to it. This meant that for ~4 hours, one room was cooling down way below its target temperature, until another room cooled enough to trigger the rule which updates the Nest’s target temperature!

The other couple of times it’s logged a disconnection, due to the way my rules are configured, it is sending multiple commands, it’s gone back online immediately - the first command detects it’s offline, the 2nd command a split second later re-initiates the connection.

Thats is bad news indeed! :grimacing:

What would help is if we see what is happening when the data is no longer updating. Maybe you can enable the debug logging of the Nest Binding via the Console so we can see whats happening?

You can enable debug logging in the console with the command:

log:set debug org.openhab.binding.nest

It will then log if it is connected, trying to reconnect and all received data and keep alives that Nest sends through the connection.

Disabling the debug logging is done by setting the log level back to info with:

log:set info org.openhab.binding.nest

I had just shut down laptop, but saw the email just as I was about to go up to bed so have fired it up again and have enabled the logging.

Will give it a shot overnight.

I have also added a rule running every 10 minutes to send the target temperature to the Nest - hopefully this means a maximum of 20 minutes without a proper update!

Will report back with some logging in the morning if it fails overnight again :slight_smile:

Cheers!

1 Like

That was indeed the issue, I think it was on v4 from an old integration. I updated the permissions and it now works fine.

1 Like

Hi,

Same here, nest structure, account and thermostat goes offline.
I can control Nest itself with android app, so it can send / receive data.
After I restart Openhab, nest is online in Things meniu again, after arround 3,5 h it went offline again.
Now it happens when i switched my routers, with the old one as I remember it was always online.

Can’t enable log as you wrote, maybe doing it not in the right place, see:
image

Did you also test with openHAB 2.2.0 that got released today @Justas?

Some additional bug fixes were merged just before the openHAB 2.2.0 release was made. Time will tell if they solve all connection issues.

The old (1.x) binding was using a polling mechanism (max 1 update per minute due to Nest API rate limits) whereas the new binding is now using Server-sent Events (SSE). So you should instantly have the data when it is sent by your devices to Nest. Especially with a fire/smoke alarm that can make a big difference (when it works ofcourse :roll_eyes:).

The Jersey library used by the binding for SSE seems to have some issues when connections disconnect for which a workaround was created.

Those commands are executed in the Console. :slight_smile:

I’ve created another org.openhab.binding.nest-2.2.0-fahrenheit.jar with all the features and fixes as in the final openHAB 2.2.0 release but using Fahrenheit instead of Celsius.

The code is in the same nest-fahrenheit branch on GitHub.

3 Likes

I was just about to ask about this. Thanks!!

Successfully running.

Thanks for the help in this post, I finally got the Nest working for me, but I would like to know if there is a way that the binding can report the temperatures in Fahrenheit (in the US, we rarely use Celsius)?

Thanks,

~John

3 posts above you… :slight_smile:

Don’t know how I missed it, got it installed… now to work on some custom icons :grinning:

Just upgraded to 2.2, so I thought I’d try the new nest binding, but no luck.

I still have the old nest1 binding running - can I have both? or just one?

I added the nest binding to my addons.cfg, and the Thing shows up. I enter my prodict id, and secret, then enter the one-time pin (from the website), but it mostly wont save. The thing just sits there marked “uninitialized”. Even on the one or two occasions when I have got it to save, it still just says “uninitialized” with no OAuth code and the PIN shown.

Most people seem to have this working, so I must be doing something stupid.

What am I missing?

Does it list the Nest 2.2.0 binding in “Paper UI → Configuration → Bindings” and as Active in the Console?

openhab> bundle:list | grep Nest                                                                                                                                              
228 │ Active   │  80 │ 2.2.0                  │ Nest Binding

Yes to both, the binding is listed, and shows as active in the console.

When I delete the Thing, and re-add it, I get this in the log:

2017-12-22 14:15:58.449 [WARN ] [ore.thing.internal.ThingRegistryImpl] - Cannot create thing. No binding found that supports creating a thing of type 'nest:account'.

I also get:

Status: UNINITIALIZED - HANDLER_REGISTERING_ERROR org.eclipse.smarthome.core.thing.internal.ThingImpl cannot be cast to org.eclipse.smarthome.core.thing.Bridge

OK, I think I figured out what is the problem.

You cant have nest1 and nest loaded at the same time, it’s one or the other. I uninstalled nest1, installed nest (v2.2), and bingo! the account is now online.

Now have to figure out the channels…

Hmmm, don’t seem to be anywhere near as many channels as the documentation says. Maybe I’ll try the latest SNAPSHOT see if that helps.

There’s also a “Show More” button at the right of the listed channels. :slight_smile:

So There is! didn’t see that.

Thanks,

Trying to uninstall the default 2.2.0 addon via PaperUI (so I can install the Fahrenheit addon), but it just sits with the wheel spinning forever? I’ve commented out my Nest things, but that hasn’t helped either. Nothing showing an error in events.log…

Thanks for the help getting this working.

I’m havjng trouble getting a switch to respond to the hvac state and mode. These are String channels, so I should be able to map a Switch to the various values, which are “heating”, “ cooling”, “heat/cool”, and “off” I believe.

This is my sitemap:

Switch item=dining_room_hvac_mode mappings=["heating"="Heat","cooling"="Cool","heat/cool"="Auto","off"="Off"]
Switch item=dining_room_hvac_state mappings=["heating"="Heat","cooling"="Cool","off"="Idle"]

Where the items are String types. This construct works fine elsewhere, and the channels are not mapped to other values at all. Is this an openhab 2.2 issue, or am I missing something?

Also I see that there are no channels for the Nest Protect that give the date/time of the last connection, or last manual test (just manual test in progress as a switch). It’s hard to tell if the smoke alarms are connected without this information, can I vote for including these channels (they were in the V1.0 binding).

Thanks.