NEST Binding Could Not Make It To Work

After numerous attempts I can’t still make it to work. I followed everything from this binding page and still not pulling any data from my nest thermostat. Both Nest account and thermostat thing are online, though I noticed in events log the the nest account keeps on getting OFFLINE then ONLINE again. This is the only binding not working for me so far. Any help is greatly appreciated. Thanks.

OH_eventsLog

Did you try increasing the logging level in karaf?

Hi,

I tried the log:set DEBUG command and I see that there are data from NEST API but not reflected/posted in my .items file.

OHlog_dataOHlog_debug

Perhaps we could copy what is in those screenshots into code fences on here as your first screenshot is quite difficult to read?

I’m also not sure how you pulling data from the API if your item file and/or thing file does not have an entry for the API calls?

Other useful info would be which version of OpenHAB you are running, file configs vs Paper UI, etc.

I really don’t know how the binding pull the data. I installed the binding, created nest developer acct, add a product with ID, secret code, pin code. Add nest acct thing, add thermostat thing in openhab. And at the of it all, it doesnt work for me.

I think i have to give up on this one.

You didn’t need to manually create a thermostat Thing. Once your account is communicating with the Nest API it will automatically detect your devices and create the Things in your inbox. Looking at the screenshot shows that your account is working but your manually created thermostat Thing isn’t (likely because it’s not properly associated with the account Thing).

Tha’s what I know too but the binding could not discover my thermostat when I tried to add it so I end up adding it manually. And when I do that the channel binding configuration is not correct, but when I create a separate .thing file like this example given here the channel config is correct. Like I said on my first post the status of my nest account and thermostat thing goes ONLINE and OFFLINE like it gets disconnected and reconnects again.

Bridge nest:account:demo_account [ productId="8fdf9885-ca07-4252-1aa3-f3d5ca9589e0", productSecret="QITLR3iyUlWaj9dbvCxsCKp4f", accessToken="c.6rse1xtRk2UANErcY0XazaqPHgbvSSB6owOrbZrZ6IXrmqhsr9QTmcfaiLX1l0ULvlI5xLp01xmKeiojHqozLQbNM8yfITj1LSdK28zsUft1aKKH2mDlOeoqZKBdVIsxyZk4orH0AvKEZ5aY" ] {
    camera         fish_cam           [ deviceId="qw0NNE8ruxA9AGJk3KeUiJaONWKiH9Gh3RwwhHClonIeufQ" ]
    smoke_detector hallway_smoke      [ deviceId="Tzvibaa3lLvpi9OQeCz5rfkBAV" ]
    structure      home               [ structureId="20wKjydArmMV3kOluTA7JRcZg8zTR-G_2nRXuIN1Bd6la" ]
    thermostat     living_thermostat  [ deviceId="ZqAKzSv6TO6PjB9LSI_z5rfkBAV" ]
}

Firstly I would remove your product Id, product secret and access token from your post.

Secondly, what version of OH2 are you using? Is it up to date?

Thirdly I would remove the .things file, ensure your Nest Account Thing is still showing as Online and then try and investigate why it’s not pulling through your devices from your account.

The information I gave here were from the github example but I can edit it.

OH version is 2.3

Thirdly, I uninstalled the NEST binding because of the fact that I can’t get it to work.

Thank you for you response though.

If they’re demo stuff then don’t worry, I thought they were your own personal detailw. We (the community) can probably get you up and running if you stick with it.

I mentioned this in my previous reply regarding connection issue, for some reason the BRIDGE gets OFFLINE then RECONNECTs again.

This is from the events.log

2018-07-05 17:18:13.944 [hingStatusInfoChangedEvent] - 'nest:account:agecrahome' changed from ONLINE: Streaming data connection established to OFFLINE (COMMUNICATION_ERROR): Streaming data disconnected
2018-07-05 17:18:13.954 [hingStatusInfoChangedEvent] - 'nest:thermostat:mythermostat' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE)
2018-07-05 17:18:15.300 [hingStatusInfoChangedEvent] - 'nest:account:agecrahome' changed from OFFLINE (COMMUNICATION_ERROR): Streaming data disconnected to ONLINE: Streaming data connection established
2018-07-05 17:18:15.307 [hingStatusInfoChangedEvent] - 'nest:thermostat:mythermostat' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

This one is from openhab.log

2018-07-05 17:40:04.751 [DEBUG] [nternal.rest.NestStreamingRestClient] - Connected to streaming events
2018-07-05 17:40:04.763 [DEBUG] [nternal.rest.NestStreamingRestClient] - Data has changed (or initial data sent)
2018-07-05 17:40:34.706 [DEBUG] [nternal.rest.NestStreamingRestClient] - Check: Receiving streaming events, millisSinceLastEvent=29959
2018-07-05 17:41:04.711 [DEBUG] [nternal.rest.NestStreamingRestClient] - Check: Receiving streaming events, millisSinceLastEvent=59964
2018-07-05 17:41:34.714 [DEBUG] [nternal.rest.NestStreamingRestClient] - Check: Disconnected from streaming events, millisSinceLastEvent=89966
2018-07-05 17:41:34.721 [DEBUG] [nternal.rest.NestStreamingRestClient] - Reopening EventSource
2018-07-05 17:41:34.747 [DEBUG] [nternal.rest.NestStreamingRestClient] - Succesfully closed existing EventSource
2018-07-05 17:41:34.750 [DEBUG] [nternal.rest.NestStreamingRestClient] - Opening new EventSource

All my items/things are connected just fine except for NEST

Nest Account is ONLINE
nest_account

Thermostat not found

Normally you should either receive data from Nest or a keep alive event every 30 seconds. If the binding hasn’t received anything for 90 seconds it reconnects.

It could either be a permission issue or an issue with the Nest API itself. Maybe you can check/update your product permissions or create a new product in your Nest developer account to see if that fixes it.

Hi Wouter,

I’m a very new OH user and having very similar issues to the OP and was looking for any advice that might help.

OpenHabian 2.3.0-1
Nest Binding 2.3.0

I’ve followed the binding instructions and successfully created my Nest Developer Account and gotten my Nest Account Thing to show ‘Online’ like Home_Agecra has shown above. Just like he stated above, Paper UI does not find any additional Things once the account has come online. It appears that I’m getting no data from the Nest API regarding my devices.

I followed the Nest Dev instructions to attempt to get my device id’s using Postman but there is no return.
https://developers.nest.com/documentation/cloud/how-to-read-data#read_structures_and_devices

Do you think recreating my Nest Dev Product might help solve this issue? Any other info I can provide to better debug the issue? (FYI openhab.log is empty, no errors. Shows the Nest account going Unknown->Online and then no further items)

Thanks in advance!

Hi,

It seems I’m not the only one experiencing this issue. I tried recreating my Nest Dev products but still OH binding could not discover my Nest things. I even tried opening the port(443, 9553) thru firewall and port forwarding and still not working.

Are your openhab server running on RPi(Linux)? If so, try increasing the log level(debug) by opening karaf bu running these commands.

sudo su (press enter)
ssh openhab@127.0.0.1 -p 8101 (press enter then your password)

if you supplied the correct password you will see this prompt
openhab>

from that prompt type this then hit enter
log:set DEBUG org.openhab.binding.nest

then type logout, then type exit, then check your openhab log and events by typing this
tail -f /var/log/openhab2/openhab.log -f /var/log/openhab2/events.log

check and observe your OH log and events.

Goodluck, I am still struggling to make this to work.

Just getting the following in the debug log:

2018-07-10 13:36:31.866 [DEBUG] [nternal.rest.NestStreamingRestClient] - Check: Receiving streaming events, millisSinceLastEvent=29855

2018-07-10 13:36:32.011 [DEBUG] [nternal.rest.NestStreamingRestClient] - Received 'keep-alive' event, data: null

2018-07-10 13:36:32.017 [DEBUG] [nternal.rest.NestStreamingRestClient] - Received message to keep connection alive

2018-07-10 13:37:01.871 [DEBUG] [nternal.rest.NestStreamingRestClient] - Check: Receiving streaming events, millisSinceLastEvent=29860

2018-07-10 13:37:02.011 [DEBUG] [nternal.rest.NestStreamingRestClient] - Received 'keep-alive' event, data: null

2018-07-10 13:37:02.016 [DEBUG] [nternal.rest.NestStreamingRestClient] - Received message to keep connection alive

I went and double checked my Nest Dev Project to make sure I had permissions granted. My account only had two Nest cameras attached to it but I granted the project broad permission. Do any of these look wrong?

ThermoStat = Read/write V6
Camera = Camera + Images read/write v4
Other = Away Read/write v2, ETA Read v1, ETA write v2, Structure Read/write v1

Yes, I’m running on RPi 3 B+

If you update the product permissions after adding the Account in openHAB you need to do the authentication part again. Just delete the Account thing and readd it with the Client ID/Product Secret/New Pincode.

You can also reuse an existing Account thing with a New Pincode but then you first need to delete the existing Access Token. Otherwise the pin code will simply be ignored since you already have an Access Token configured.

To see/copy/edit the Access Token from your Nest Account: open the Account Thing configuration in Paper UI and click the Advanced button:

Then you can use the Access Token with one of the methods of the API Read Examples, e.g. using curl:

curl -v --location-trusted \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -X GET "https://developer-api.nest.com/"

If you don’t receive any data using that token you have a connection or permission problem.

Yea, I’m still not getting a connection. I will try to just delete everything and start with a fresh Nest product and then a fresh OH Thing. Even the return from the curl is null <>

Hopefully this will fix the issue. I’ll report back once I’ve had the chance to attempt. Thanks for the feedback

1 Like

So I’ve had a chance to create an entirely new Nest Developer Project with a new separate Client ID, Client Secret, and Pincode. OH is getting the Access Token appropriately but still unable to receive any data.

curl response is still empty <>.

Any other ideas about what I may have messed up or could try? OH debug log is showing valid ‘keep-alive’ events every ~5ms or so, so I believe the account is valid and communicating I just don’t have any permissions to receive anything from the NEST end.

My new Nest Project has the following permissions set:

ThermoStat = Read/write V6
Camera = Camera + Images read/write v4
Other = Away Read/write v2, ETA Read v1, ETA write v2, Structure Read/write v1

My actual Nest account only has two cameras on it presently with a thermostat coming in about a month. Most discussions I see on these forums regarding Nest accounts involve thermostats and smoke alarms, do cameras pose any additional issues or requirements to gain access to?

Thanks in advance for any insights!

Camera’s should work just fine. I have several. :slight_smile:

Maybe you can search the Nest developer forums or open a topic there? It already has some topics that cover this matter, e.g.:

1 Like

Wouter! It works, cheers!

Thank you so much, this first article you linked mentioned that you had to be the original owner of the nest structure. This got me thinking and it turned out that my wife had signed up initially under her account. So her account had to grant the WWN connection.

FYI to all those who experience this issue. If your account is linked under the Nest family structure you will be granted a token but will not have access to any json data. The family account owner, ie the original account the devices where associated with, must be the signed in account when you follow the authorization link from the Nest Developer Page.

1 Like