The API token for my Google Nest SDM project this weekend. I reset the API token and re-entered it into the Nest SDM Account thing. It shows the SDM account and my 2 thermostats as “ONLINE”, but OpenHAB cannot communicate with them. My attempts to run rules result in “Device not found” errors such as this:
2021-07-13 19:30:13.670 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.nest.internal.sdm.handler.SDMThermostatHandler@16ea82e': null
java.lang.NullPointerException: null
at org.openhab.binding.nest.internal.sdm.handler.SDMThermostatHandler.setTargetTemperature(SDMThermostatHandler.java:297) ~[?:?]
at org.openhab.binding.nest.internal.sdm.handler.SDMThermostatHandler.handleCommand(SDMThermostatHandler.java:136) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor68.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
at com.sun.proxy.$Proxy210.handleCommand(Unknown Source) [?:?]
at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:80) [bundleFile:?]
at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
at jdk.internal.reflect.GeneratedMethodAccessor67.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
2021-07-13 19:31:01.812 [WARN ] [binding.nest.internal.sdm.api.SDMAPI] - SDM API error: Device enterprises/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/devices/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx not found.
The item viewer in OpenHAB portal will show the new item state, but that state is not represented in the thermostat. Further, changing the setpoint or other settings on the thermostat hardware does not change any of the item states in OpenHAB.
I even tried resetting the API authorization token again, and re-entered it into the SDM Account thing. Again, it shows that the Account and thermostats are “ONLINE”, but it won’t actually communicate with them, and the log shows “bad request” errors:
2021-07-13 19:40:32.570 [ERROR] [oauth2client.internal.OAuthConnector] - grant type authorization_code to URL https://accounts.google.com/o/oauth2/token failed with error code invalid_grant, description Bad Request
I remember the Nest - Bindings documentation saying that I can change the “Publishing Status” of the app on the OAuth consent screen. But this app is not intended to be publicly available. It’s for an internal pilot program, so I don’t want to configure it to be published to the public.
So I guess I have 3 questions:
1.) How do I configure Google Nest SDM API so that the authorization token does not expire every week or 2?
2.) Is there a way to configure the authorization token to not expire, without making the entire app publicly available and having to submit to Google’s verification process?
3.) How do I reconnect my thermostats to OpenHAB after updating the expired API token?