Google Nest Device Access Console now available

I had the same problem with the first version of the binding. When I moved to the second version (with pubsub support) this issue was gone.

Hey thereā€¦ Sorry for the delayed responseā€¦ I believe this issue is addressed with the latest version of the binding. Can you verify that you have the latest download? @McFly had a similar issue and he verified it when I put a fix in with a time/format issue a few days ago.

BTW, I have updated the binding with some simple bug fixes. Stuff that I caught in my testing. Feel free to update again and shoot over the log again if the issue persists. Iā€™m not having this problem on the latest buildā€¦ Thanks againā€¦

https://drive.google.com/file/d/1yOJKfhFmVVEx17ZfhrQBQDNKJdD8LCmz/view?usp=sharing

Correctā€¦ The pubsub will mask the issue because it provides another avenue to get updates to the thermostat. This works but I would like to find out if there is a bug in refreshChannelā€¦ I will remove pubsub support from a test build and see if I can reproduceā€¦ Of course, if @Grzegorz_Wojciechows can update to the latest build and verify the log entries that he had are still showing errors, then that will help as wellā€¦

-Should explain futher- The reason is that the later build allow pubsub and refreshChannels to work. I coded it this way for folks that donā€™t want to use the Google pubsub functionalityā€¦

Thanks again for helping others on the forum with what you saw and appreciate the assistance!

Hi Brian,

Many thanks for your ongoing effort to develop this. Much appreciated.

Just updated my binding and did a few tests. My Nest thermostat is discovered well and after I add the Nest thermostat thing, I am seeing regular event updates.

However, when I try to change the refreshInterval of the Nest thermostat I get an error 500: Internal Server Error message.

The openhab.log shows the following:

2020-11-17 20:11:41.182 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at ā€˜things/nestdeviceaccess:nest-device-thermostat:/configā€™
java.lang.NullPointerException: null
at org.openhab.binding.nestdeviceaccess.internal.thermostat.NestThermostatHandler.initialize(NestThermostatHandler.java:212) ~[?:?]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.handleConfigurationUpdate(BaseThingHandler.java:106) ~[?:?]
at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.updateConfiguration(ThingRegistryImpl.java:93) ~[?:?]
at org.eclipse.smarthome.io.rest.core.internal.thing.ThingResource.updateConfiguration(ThingResource.java:438) [bundleFile:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_265]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_265]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_265]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) [bundleFile:?]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) [bundleFile:?]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) [bundleFile:?]
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) [bundleFile:?]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) [bundleFile:?]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) [bundleFile:?]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) [bundleFile:?]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) [bundleFile:?]
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [bundleFile:?]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [bundleFile:?]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [bundleFile:?]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [bundleFile:?]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [bundleFile:?]
at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [bundleFile:?]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [bundleFile:?]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [bundleFile:?]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [bundleFile:?]
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [bundleFile:?]
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [bundleFile:?]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [bundleFile:?]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [bundleFile:?]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [bundleFile:?]
at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76) [bundleFile:?]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544) [bundleFile:9.4.20.v20190813]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [bundleFile:?]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307) [bundleFile:9.4.20.v20190813]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) [bundleFile:?]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [bundleFile:9.4.20.v20190813]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [bundleFile:?]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.Server.handle(Server.java:494) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]

After this error message there are no more event updates and I need to remove and rediscover the Nest thermostat to resolve. The same thing happens when I update the location field of the Nest thermostat thing.

What could be wrong?

Actuallyā€¦ Great timing as I JUST fixed that bugā€¦ I updated the JAR within the last 20m.

For those programmers, the bug was a complete oversight on my partā€¦ I looked for refreshInterval under the thing properties vs parametersā€¦ Iā€™ve updated the code on my github and placed the new binding for downloadā€¦

Thanks again and let me know if that latest binding has any issuesā€¦ Appreciate the testing help

Just downloaded the JAR from the google drive URL that you provided earlier (https://drive.google.com/file/d/1yOJKfhFmVVEx17ZfhrQBQDNKJdD8LCmz/view?usp=sharing).

The file size didnā€™t seem to have changed and the refreshInterval issue still exists. Did I use the right link?

hmmā€¦ Yes, that is the correct linkā€¦ The size should be similar. There was definitely a bug in the refreshInterval collection that I fixed and updated in the code. In fact, I had the same error. i.e 500: internal server error and it was fixed after making the updateā€¦

I retried the version that I have and updated the refreshInterval a few times.

I sent you a PM with a debug build that you can useā€¦ it will print messages around where I fixed the codeā€¦ If the error happens elswhere, then we have a bug and troubleshoot it :wink:

Good news: it works :grinning:

Did a fresh download and install. Changed both the refreshInterval and the location. No error message and the timer keeps on processing for updating thing channels. Also changing the target temperature and turning the thermostat off is working well.

On a separate note: I noticed a termostatHvac trait in the Device Access API documentation. This provides the current HVAC status of the thermostat (OFF, HEATING, COOLING). I would like to use this in some of my openhab rules, but I donā€™t think it is currently included as a channel, right? If so, could you please add this?

This is GREAT to hear! Thanks for the feature request on HVACStatusā€¦ Funny thing is that I put the code to retrieve the value but didnā€™t expose it. Iā€™ve added the channel, refreshChannel and PubSub plumbing work now. I have only tested on my local dev branchā€¦ Since a new channel was added for HVACStatus, youā€™ll need to delete the thermostat thing and rediscover (Should be simple to do and your item links will remain.)

Let us know if there are any issues and Iā€™ll update the main link that Iā€™ve been sharing with folks. Here is the dev link for HVACStatus updates:

Hello thereā€¦
When I added the Google PubSub functionality, I introduced 3 new variables

I covered it in the documentation update but it may have not been clearā€¦

Updated nestdeviceaccess.cfg template is on my Github hereā€¦

Thanks a lot, added the 3 new variable as empty and working perfectly now.

Thanks so much @BHigg and @wborn for the work on this Nest Binding!
Do you think it will make the cutoff for OH3 M3?

Thanks,
Randy

Hello @randye007! It will probably not make it into OH3 M3 because that would require reviews to be almost finished while there is still work to do before Iā€™ll request a review from the other maintainers.
The current code would result in many review comments so Iā€™d rather save the reviewers some time by fixing anything I know they would comment on before requesting a review. :wink:

I did already rework the binding so it contains both the existing WWN and SDM code nicely seperated from eachother.

The binding has also become huge because it now contains many dependencies 25MB (!), so hopefully we can put it on a diet. :smile:

Makes sense @wborn.
Does the SDM code you added include the Nest Camera support @BHigg added?

Thanks,
Randy

Not yet but Iā€™ll make sure cameras are supported because I also have some cameras. :slight_smile:

2 Likes

Iā€™ve tested the binding with my nest thermostat incl. Pubsub and the new hvac status feature over the last few days and everything is working fine. No errors are occuring anymore in my openhab.log and the channels are behaving as expected (with exception of a few hours when there was a nest outage at google :slight_smile:). Many thanks!

1 Like

Hi all,

Iā€™ve been struggling for some time, to get the pub/sub function to play along. I can see that some of you already have this working. Could I plz ask for some guideance?

This is my error, after iā€™ve rediscovered my nest doorbell and camera:

2020-11-21 11:07:15.410 [DEBUG] [nternal.doorbell.NestDoorbellHandler] - starting pubsub doorbell [Inngangsparti]...

2020-11-21 11:07:16.014 [DEBUG] [nternal.doorbell.NestDoorbellHandler] - starting pubsub doorbell [Barnerom]...

2020-11-21 11:07:17.799 [hingStatusInfoChangedEvent] - 'nestdeviceaccess:nest-device-doorbell:AVPHxxxxxxxxxxxx9A' changed from UNKNOWN to ONLINE

	at org.openhab.binding.nestdeviceaccess.internal.doorbell.NestDoorbellHandler.pubSubEventHandler(NestDoorbellHandler.java:476) ~[?:?]

	at org.openhab.binding.nestdeviceaccess.internal.doorbell.NestDoorbellHandler.lambda$1(NestDoorbellHandler.java:235) ~[?:?]

2020-11-21 11:07:18.416 [hingStatusInfoChangedEvent] - 'nestdeviceaccess:nest-device-doorbell:AVPHxxxxxxxxxxxxQw' changed from UNKNOWN to ONLINE

	at org.openhab.binding.nestdeviceaccess.internal.doorbell.NestDoorbellHandler.pubSubEventHandler(NestDoorbellHandler.java:476) ~[?:?]

	at org.openhab.binding.nestdeviceaccess.internal.doorbell.NestDoorbellHandler.lambda$1(NestDoorbellHandler.java:235) ~[?:?]

The pub/sub subscription ID is pulling events in the google cloud consoleā€¦

Best regards
Christian

Hello Guys
I am having a really hard time setting this thing up.

I created a new project @ https://console.developers.google.com/ called Nest Thermos
Next, I enabled APIs and SERVICES
On API selection page, i selected Smart Device Management API, I also enabled it.
Next, I created credentials for OAuth Client ID, selected as aplication type Web application set up a name Web client 2
I also created a consent screen for that by addomg app name, user support email and developer support email and not selecting anything else.
I did not authorized any java origins or redirect url.
Got the Client ID and Secret credentials
Next, I went to Device Access console, created a new project:
Nest Thermos
Added the OAuth client ID i just created
Next, I enabled the Events
And project was succesfully created in sandbox.

Now, on the device access thing, i filled all fields, except authorization token as i couldnā€™t find it.

What am i doing wrong?
Thank you.

Recommend that you follow the steps outlined here: https://developers.google.com/nest/device-access/authorize
Step 6 shows how to get an authorization code in other to obtain an authorization/access token in subsequent steps.

All, I know Brian is working on the OH3 binding to dump the token in the logs. But any help in running the Curl command on a windows pc.

  • Windows 2010
  • Java 11
  • Openhab 3

Regards