Google Nest Device Access Console now available

Right now I’ve my Nest thermostat inside OpenHab! Thank you guys!

1 Like

I’ve updated the 2.5.x binding to now include Doorbell class and Google PubSub capabilities.

Note: Due to the PubSub update, you will be required to remove and rediscover things after you make the pubsub configuration updates. This is due to how the karaf configuration is imported into the thing (i.e. Doorbell and Thermostat.)

The doorbell class adds the following capability:

doorbellSoundEventImage Image This is a generated image based on a Sound event. The event has an event ID that is required to generate the image.
doorbellMotionEventImage Image This is a generated image based on a Motion event. The event has an event ID that is required to generate the image.
doorbellPersonEventImage Image This is a generated image based on a Person event. The event has an event ID that is required to generate the image.
doorbellChimeEventImage Image This is a generated image based on a Chime event. The event has an event ID that is required to generate the image.
doorbellChimeLastEventTime Text This is the time a door Chime event was last received
doorbellChimeEvent Switch This is a switch that flips when a Chime event is received
doorbellPersonEvent Switch This is a switch that flips when a Person event is received
doorbellPersonLastEventTime Text This is the time a Person was detected by the doorbell
doorbellMotionEvent Switch This is a switch that flips when a Motion event is received
doorbellMotionLastEventTime Text This is the time a Motion event was last received
doorbellSoundEvent Switch This is a switch that flips when a Sound event is received
doorbellSoundLastEventTime Text This is the time a Sound event was last received
doorbellLiveStreamUrl Text This is the generated Live Stream URL when a motion is detected. Note: The URL includes a token that can be used to view an rtsps stream…
doorbellLiveStreamExpirationTime Text This is the Live Stream Expiration time when the token and URL must be generated again
doorbellLiveStreamExtensionToken Text This is the Live Stream Extension Token that is used to request an extension to the initial LiveStreamUrl embedded Token.
doorbellLiveStreamCurrentToken Text This is the Live Stream Current Token that is embedded in the LiveStreamURL.

There is further setup for your Google project in order to get the PubSub created and a service account assigned privileges. Once that is done, you will put a JSON file that you download from the service account creation into your openhab instance and a file path is added to the nestdeviceaccess.cfg file.

This is explained in the README on my github here…

The latest jar is available:
https://drive.google.com/file/d/1yOJKfhFmVVEx17ZfhrQBQDNKJdD8LCmz/view?usp=sharing

1 Like

Dear Brian, I have OH 2.5.10 on Debian 10 (Raspberry) and your latest jar

I get this error
> [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.nestdeviceaccess-2.5.5-SNAPSHOT.jar

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.nestdeviceaccess [278]

  Unresolved requirement: Import-Package: com.sun.jndi.dns; resolution:="optional"

  Unresolved requirement: Import-Package: android.net; resolution:="optional"

  Unresolved requirement: Import-Package: android.net.ssl; resolution:="optional"

  Unresolved requirement: Import-Package: com.squareup.okhttp; resolution:="optional"

  Unresolved requirement: Import-Package: com.squareup.okhttp.internal.http; resolution:="optional"

  Unresolved requirement: Import-Package: com.oracle.svm.core.annotate; resolution:="optional"

  Unresolved requirement: Import-Package: lzma.sdk; resolution:="optional"

  Unresolved requirement: Import-Package: lzma.sdk.lzma; resolution:="optional"

  Unresolved requirement: Import-Package: net.jpountz.lz4; resolution:="optional"

  Unresolved requirement: Import-Package: net.jpountz.xxhash; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.asn1; version="[1.54.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.asn1.ocsp; version="[1.54.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.asn1.oiw; version="[1.54.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.asn1.x500; version="[1.54.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.asn1.x509; version="[1.54.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.cert; version="[1.65.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.cert.jcajce; version="[1.65.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.cert.ocsp; version="[1.65.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.crypto; version="[1.54.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.crypto.digests; version="[1.54.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.crypto.io; version="[1.54.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.jce.provider; version="[1.54.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.openssl; version="[1.65.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.operator; version="[1.65.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.operator.jcajce; version="[1.65.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.bouncycastle.x509.extension; version="[1.54.0,2.0.0)"; resolution:="optional"

  Unresolved requirement: Import-Package: org.conscrypt; resolution:="optional"

  Unresolved requirement: Import-Package: org.eclipse.jetty.alpn; resolution:="optional"

  Unresolved requirement: Import-Package: org.eclipse.jetty.npn; resolution:="optional"

  Unresolved requirement: Import-Package: org.jboss.marshalling; resolution:="optional"

  Unresolved requirement: Import-Package: reactor.blockhound; resolution:="optional"

  Unresolved requirement: Import-Package: reactor.blockhound.integration; resolution:="optional"

  Unresolved requirement: Import-Package: sun.security.ssl; resolution:="optional"

  Unresolved requirement: Import-Package: sun.security.x509; resolution:="optional"

  Unresolved requirement: Import-Package: sun.security.util; resolution:="optional"

  Unresolved requirement: Import-Package: io.perfmark.java9; resolution:="optional"

  Unresolved requirement: Import-Package: io.grpc.override; resolution:="optional"

  Unresolved requirement: Import-Package: com.sun.nio.sctp

	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]

	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]

I cannot see the binding from PaperUI :pensive:

Thanks for the report. It is possible that I excluded a required library for your software setup… Let me go back and compare against my prior releases (Assuming here that the prior JAR worked for you?)

Also, can you confirm what version of Java that you have installed? Thanks

Also the prior version, same error!

openjdk version “11.0.9” 2020-10-20
OpenJDK Runtime Environment (build 11.0.9+11-post-Raspbian-1deb10u1)
OpenJDK Server VM (build 11.0.9+11-post-Raspbian-1deb10u1, mixed mode)

Thanks

You are running openHAB 3? Perhaps the binding has not (yet) been converted for OH3.

OpenHAB 2,x requires Java 8.

Bruce thanks. The problem was that the newer installation of OPENHAB 2.5.10 comes with JAVA11! Installed JAVA8 and now it function :grinning:

openHAB does not come with any Java.

openHABian lets you install Java 8 or 11 I believe.

Excellent… Glad installing Java 8 worked. I have not tested the binding on Java 11 as of yet… I’ve added it to my todo list :wink:

This is correct… The binding was only tested for 2.5.x. I believe @wborn converted a prior/stable version of the binding to OH3. I would treat this newer release with the doorbell and pubsub/eventing functionality as a testing build. Once confirmed, I’m sure we’ll merge it or create an OH3 compatible binding for it.

I’m almost wrapped up with the binding development because I found out that the camera class is unnecessary. That is, the camera traits are already coded into the doorbell class. So I can just add the supported camera type and let the doorbell handler work for the camera. I bought a camera yesterday to test this out. So with any luck, I’ll have camera support as well soon :wink:

1 Like

Yes, Bruce you’re right. My installation was for a new PI4 with a new Debian 10 with a preinstalled JAVA11. OH 2.5.10 support JAVA11 and this is the reason why I’ve in my installation only JAVA11 and not JAVA8.
Thanks also to Brian for this great work! :wink:

Dear Brian, now I can see thing, but when I’ve added, this errors happens in console.log

2020-11-12 19:45:11.140 [DEBUG] [cess.internal.nesthelper.NestUtility] - NestUtility constructor failed to parse date Unparseable date: "Thu Nov 12 20:45:00 CET 2020"

2020-11-12 19:45:11.143 [DEBUG] [cess.internal.nesthelper.NestUtility] - NestUtility constructor failed to parse date Unparseable date: "Thu Nov 12 20:45:00 CET 2020"

==> /var/log/openhab2/events.log <==

2020-11-12 19:45:11.149 [hingStatusInfoChangedEvent] - 'nestdeviceaccess:nest-device-thermostat:AVPHwEuxxNazINGoWQ3klCN1F-YmCpLzWIdFoTjS8VifzKjjr7Y_jVzxiuYcSmL-v2K45FHhwuzPb6T7c2wAVhKnwRddtQ' changed from UNINITIALIZED to INITIALIZING

==> /var/log/openhab2/openhab.log <==

2020-11-12 19:45:11.163 [DEBUG] [nal.thermostat.NestThermostatHandler] - Start initializing device Zona Notte

2020-11-12 19:45:11.165 [DEBUG] [nal.thermostat.NestThermostatHandler] - Finished initializing device Zona Notte

2020-11-12 19:45:11.165 [INFO ] [nal.thermostat.NestThermostatHandler] - refreshChannels process a timer for Updating thing Channels for:nestdeviceaccess:nest-device-thermostat:AVPHwEuxxNazINGoWQ3klCN1F-YmCpLzWIdFoTjS8VifzKjjr7Y_jVzxiuYcSmL-v2K45FHhwuzPb6T7c2wAVhKnwRddtQ

==> /var/log/openhab2/events.log <==

2020-11-12 19:45:11.170 [hingStatusInfoChangedEvent] - 'nestdeviceaccess:nest-device-thermostat:AVPHwEuxxNazINGoWQ3klCN1F-YmCpLzWIdFoTjS8VifzKjjr7Y_jVzxiuYcSmL-v2K45FHhwuzPb6T7c2wAVhKnwRddtQ' changed from INITIALIZING to UNKNOWN

==> /var/log/openhab2/openhab.log <==

2020-11-12 19:45:11.167 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 

java.lang.NullPointerException: null

	at org.openhab.binding.nestdeviceaccess.internal.nesthelper.NestUtility.isAccessTokenExpired(NestUtility.java:138) ~[?:?]

	at org.openhab.binding.nestdeviceaccess.internal.nesthelper.NestUtility.getAccessToken(NestUtility.java:116) ~[?:?]

	at org.openhab.binding.nestdeviceaccess.internal.nesthelper.NestUtility.getDeviceInfo(NestUtility.java:171) ~[?:?]

	at org.openhab.binding.nestdeviceaccess.internal.thermostat.NestThermostat.getThermostatInfo(NestThermostat.java:465) ~[?:?]

	at org.openhab.binding.nestdeviceaccess.internal.thermostat.NestThermostatHandler.refreshChannels(NestThermostatHandler.java:169) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_212]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:1.8.0_212]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_212]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:1.8.0_212]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]

2020-11-12 19:45:11.167 [DEBUG] [nal.thermostat.NestThermostatHandler] - Initialize() caught an exception null

The status of the Things added is UNKNOWN
P.S. My locale settings are:

LANG=it_IT.UTF-8
LANGUAGE=it_IT.UTF-8
LC_CTYPE=“it_IT.UTF-8”
LC_NUMERIC=“it_IT.UTF-8”
LC_TIME=“it_IT.UTF-8”
LC_COLLATE=“it_IT.UTF-8”
LC_MONETARY=“it_IT.UTF-8”
LC_MESSAGES=“it_IT.UTF-8”
LC_PAPER=“it_IT.UTF-8”
LC_NAME=“it_IT.UTF-8”
LC_ADDRESS=“it_IT.UTF-8”
LC_TELEPHONE=“it_IT.UTF-8”
LC_MEASUREMENT=“it_IT.UTF-8”
LC_IDENTIFICATION=“it_IT.UTF-8”
LC_ALL=it_IT.UTF-8

grear to hear!

as promises I started to test…

I get a null pointer error while starting the binding - is this a known bug?:

  createHandler reporting nestdeviceaccess:nest-device-doorbell
2020-11-12 21:41:57.222 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while calling thing handler factory 'org.openhab.binding.nestdeviceaccess.internal.nestdeviceaccessHandlerFactory@1b20c32': null
java.lang.NullPointerException: null
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:878) ~[?:?]
	at com.google.api.client.util.Preconditions.checkNotNull(Preconditions.java:125) ~[?:?]
	at com.google.api.client.auth.oauth2.RefreshTokenRequest.setRefreshToken(RefreshTokenRequest.java:142) ~[?:?]
	at com.google.api.client.googleapis.auth.oauth2.GoogleRefreshTokenRequest.setRefreshToken(GoogleRefreshTokenRequest.java:120) ~[?:?]
	at com.google.api.client.googleapis.auth.oauth2.GoogleRefreshTokenRequest.setRefreshToken(GoogleRefreshTokenRequest.java:75) ~[?:?]
	at com.google.api.client.auth.oauth2.RefreshTokenRequest.<init>(RefreshTokenRequest.java:95) ~[?:?]
	at com.google.api.client.googleapis.auth.oauth2.GoogleRefreshTokenRequest.<init>(GoogleRefreshTokenRequest.java:86) ~[?:?]
	at org.openhab.binding.nestdeviceaccess.internal.nesthelper.NestUtility.refreshAccessToken(NestUtility.java:184) ~[?:?]
	at org.openhab.binding.nestdeviceaccess.internal.nesthelper.NestUtility.<init>(NestUtility.java:70) ~[?:?]
	at org.openhab.binding.nestdeviceaccess.internal.doorbell.NestDoorbellHandler.<init>(NestDoorbellHandler.java:69) ~[?:?]
	at org.openhab.binding.nestdeviceaccess.internal.nestdeviceaccessHandlerFactory.createHandler(nestdeviceaccessHandlerFactory.java:82) ~[?:?]
	at org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory.registerHandler(BaseThingHandlerFactory.java:126) ~[?:?]
	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.doRegisterHandler(ThingManagerImpl.java:587) ~[?:?]
	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.registerHandler(ThingManagerImpl.java:564) ~[?:?]
	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.registerAndInitializeHandler(ThingManagerImpl.java:1056) ~[?:?]
	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.lambda$10(ThingManagerImpl.java:1039) ~[?:?]
	at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:895) ~[?:1.8.0_265]
	at java.util.concurrent.CopyOnWriteArraySet.forEach(CopyOnWriteArraySet.java:404) ~[?:1.8.0_265]
	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.lambda$9(ThingManagerImpl.java:1036) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:1.8.0_265]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_265]
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[?:1.8.0_265]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_265]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_265]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:1.8.0_265]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:1.8.0_265]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_265]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) ~[?:1.8.0_265]
	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.handleThingHandlerFactoryAddition(ThingManagerImpl.java:1035) ~[?:?]
	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.onReadyMarkerAdded(ThingManagerImpl.java:1023) ~[?:?]
	at org.eclipse.smarthome.core.internal.service.ReadyServiceImpl.lambda$0(ReadyServiceImpl.java:52) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) [?:1.8.0_265]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_265]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) [?:1.8.0_265]
	at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699) [?:1.8.0_265]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_265]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) [?:1.8.0_265]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) [?:1.8.0_265]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) [?:1.8.0_265]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_265]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) [?:1.8.0_265]
	at org.eclipse.smarthome.core.internal.service.ReadyServiceImpl.notifyTrackers(ReadyServiceImpl.java:79) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.service.ReadyServiceImpl.markReady(ReadyServiceImpl.java:52) [bundleFile:?]
	at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.registerReadyMarker(XmlDocumentBundleTracker.java:432) [bundleFile:?]
	at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.finishBundle(XmlDocumentBundleTracker.java:378) [bundleFile:?]
	at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.processBundle(XmlDocumentBundleTracker.java:401) [bundleFile:?]
	at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.access$6(XmlDocumentBundleTracker.java:393) [bundleFile:?]
	at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker$2.run(XmlDocumentBundleTracker.java:363) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_265]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_265]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_265]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_265]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]

Thanks Markus,
This looks like a null value for one of the three variables to refresh the access token:
refreshToken, clientId, clientSecret

The log shows this pretty well… Thanks for providing the details…

The NestUtility class is initializing and it finds a null accessTokenExpiration value (Which basically means it wasn’t stored/read from the thing properties.) That is OK because when that happens, it calls refreshAccessToken to get a new access token from scratch.

   googleAccessToken = refreshAccessToken(refreshToken, clientId, clientSecret);

In the call to refreshAccessToken, the null value is encountered in this call to the Google API:
TokenResponse response = new GoogleRefreshTokenRequest(new NetHttpTransport(), new JacksonFactory(), refreshToken, clientId, clientSecret).execute();

I believe the null value is in “refreshToken”, “clientId”, or “clientSecret”

If you can confirm the following:
Were you adding a device or just starting the binding?
If starting the binding, the thing should have the above three values under the “Properties” section of the thing (In this case, the doorbell.) If those don’t exist, then insufficent information exists to start the thing (i.e. retrieve an access token for the SDM API.) You can always remove the thing, rediscover and it will pull the required fields from your karaf/nestdeviceaccess.cfg settings.

You can check in openhab-cli console via:
config:list “(service.pid=org.openhab.nestdeviceaccess)”

if there isn’t a valid refreshToken, clientId, projectId, or clientSecret, then insufficient configuration exists to discovery create the thing properties.

PM me if we need to look at configs or anything but at this moment, it sounds like the config setup is not done possibly. Thanks for your help on testing.

The error is pretty descriptive in the log. Thanks for sending.

What is happening here is the access token expiration date that was read from the “thing” (Thermostat) is “Thu Nov 12 20:45:00 CET 2020”. For what it is worth, I took this exact string and ran it in my openhab instance and the string was converted successfully… More on that in a sec…

The string “Thu Nov 12 20:45:00 CET 2020” is required to build a properly formatted GoogleAccessToken. The stack trace shows that as the “refreshChannels” method is called, a call is being made to retrieve device information from Google. As it walks the tree, it checks the validity of the access token by pulling the expiration date (This is where the null value occurs because the AccessToken wasn’t fully built yet…)

What we need to do is find out why this date/time string isn’t parsing on your instance, but it did without issues on my side…

Can you check your “Thing” (Thermostat) properties for accessTokenExpiration and make sure it is formatted like this “Thu Nov 12 20:45:00 CET 2020”… You can also remove the thermostat, rediscover it and add it back again to see if the new value work correctly as well.

If it is still failing, I can send you a debug build that converts the string successfully and outputs it as a test… This will verify that there isn’t a format read issue.

Thanks for the test and hopefully we can get this fixed quickly for you…

Thanks Brian.
The date in the Thing properties was
Thu Nov 12 20:45:00 CET 2020 (copy and pasted)

After re-discover, this is the new date
Fri Nov 13 10:59:51 CET 2020

I’ll wait your debug version so I can help to debug this

Hi all. Need help here please. I’ve created my project and now have a project ID. What is the next step in getting the Product ID?

I’ve updated the binding to now allow Nest Camera and Displays to work. I’m testing the binding right now but thought I’d update here for others to pitch in… The update fixes @Fraltav issue with the date/time conversion.

I basically reused the doorbell handler and updated the supported types to include Nest Cameras and Displays. Displays are things like Nest Hub Max’es from what I’ve read but I don’t have one to test ;( I would expect someone here can run it through a few tests. :slight_smile:

The main thing that I’m looking into is where the images, and event date/times are updated on both cameras and Displays. Note: This binding is a test binding and will have more outputs to DEBUG log than necessary for testing purposes.

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

hi Brian,

I’ve been using binging for couple of days and I see this behavior occuring on regular basis. I start OH and binding starts and keeps refreshing channels according to refresh interval - all good. However sometimes I get some exception like the one below (but it could be other within refreshChannels method):

2020-11-16 12:46:16.780 [INFO ] [nal.thermostat.NestThermostatHandler] - refreshChannels process a timer for Updating thing Channels for:nestdeviceaccess:nest-device-thermostat:****

2020-11-16 12:46:16.786 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:

java.lang.NumberFormatException: For input string: “Net”

at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]

at java.lang.Integer.parseInt(Integer.java:580) ~[?:?]

at java.lang.Integer.parseInt(Integer.java:615) ~[?:?]

at org.openhab.binding.nestdeviceaccess.internal.nesthelper.NestUtility.getDeviceInfo(NestUtility.java:132) ~[?:?]

at org.openhab.binding.nestdeviceaccess.internal.thermostat.NestThermostat.getThermostatInfo(NestThermostat.java:416) ~[?:?]

at org.openhab.binding.nestdeviceaccess.internal.thermostat.NestThermostatHandler.refreshChannels(NestThermostatHandler.java:148) ~[?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]

at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

at java.lang.Thread.run(Thread.java:748) [?:?]

and after that, refreshChannel stops being executed in a loop.

after I click ‘HEAT’ on a sidemap it get refresh but only once for this particular request but it does not work on a loop anymore

==> /var/log/openhab2/events.log <==

2020-11-16 15:23:48.458 [ome.event.ItemCommandEvent] - Item ‘NestDiningRoomThermostat_CurrentMode’ received command HEAT

2020-11-16 15:23:48.485 [nt.ItemStatePredictedEvent] - NestDiningRoomThermostat_CurrentMode predicted to become HEAT

==> /var/log/openhab2/openhab.log <==

2020-11-16 15:23:48.514 [DEBUG] [nal.thermostat.NestThermostatHandler] - handleCommand reporting thermostatCurrentMode,HEAT

2020-11-16 15:23:49.619 [DEBUG] [cess.internal.nesthelper.NestUtility] - deviceExecuteCommand reporting access token is expired…

2020-11-16 15:23:49.817 [DEBUG] [cess.internal.nesthelper.NestUtility] - deviceExecuteCommand reporting access token refresh successful…

2020-11-16 15:23:51.446 [INFO ] [nal.thermostat.NestThermostatHandler] - Thermostat: Living Room set command nestdeviceaccess:nest-device-thermostat:*****

2020-11-16 15:23:54.451 [INFO ] [nal.thermostat.NestThermostatHandler] - refreshChannels process a timer for Updating thing Channels for:nestdeviceaccess:nest-device-thermostat:*

==> /var/log/openhab2/events.log <==

2020-11-16 15:23:56.410 [vent.ItemStateChangedEvent] - NestDiningRoomThermostat_HumidityPercentage changed from 58 to 62

2020-11-16 15:23:56.440 [vent.ItemStateChangedEvent] - NestDiningRoomThermostat_AmbientTemperature changed from 22.75 to 23.25

And when it does not work within a loop it does not pick state refresh from NEST on ambient temphumidity or set target temp.

So I need to restart OH and then it works back again but this makes it not usable on the long run

Got the same error and command

show all the 3 variable are not null, anything else to check?