I see. So squeezing another python script in, wouldn’t work, I gather?
Do you a suggestion how that problem could be circumvented?
I see. So squeezing another python script in, wouldn’t work, I gather?
Do you a suggestion how that problem could be circumvented?
You would need to implement code for steps 1. thru 4. above ..
And that would work without breaking the authentication of the binding?
Each application must start with acquiring its own device code, authentication tokens, and refresh tokens; you need to keep things separate.
Understood. (Fundamentally, not on how it actually works, but that’s a quest for another moment :))
Thanks. It helps.
Hi
i had to reinstall my oh with an old backup.
Now i see that i can’t use my todo addon.
I got this error message OAuthClientService errornull.
How can i fix it?
What OH version are you on? And can you please show your Tado Bridge configuration?
Hi, i use Oh 4.3.5.
In my tado bridge i had activate “Use oAuth RFC-8628” and a username and pw.
I need more information about your Bridge configuration. And also the full log messages.
19:04:27.562 [ERROR] [.oauth2client.internal.OAuthConnector] - grant type refresh_token to URL https://login.tado.com/oauth2/token failed with error code invalid_grant, description The refresh_token is invalid.
19:05:24.750 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.tado.internal.handler.TadoZoneHandler@1b717290': Zone pendingHvacChange not initialized
java.lang.IllegalStateException: Zone pendingHvacChange not initialized
at org.openhab.binding.tado.internal.handler.TadoZoneHandler.handleCommand(TadoZoneHandler.java:177) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:569) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [bundleFile:?]
at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
at jdk.proxy3468.$Proxy3706.handleCommand(Unknown Source) [?:?]
at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:95) [bundleFile:?]
at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [bundleFile:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:569) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [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:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
As you can see, the log says the refresh token is invalid. You said that you had restored from a backup, so I guess that the backup either did not contain a refresh token, or it was indeed invalid. As Tado now uses RFC8268 then you should NOT configure a user name or password; so please delete them. You may find that once you have deleted them, the authentication may start working again. But if not, then you will need to start again with the authentication process via the Tado Openhab UI servlet at http://oh-ip-address:8080/tado
i restore now also the old “StorageHandler.For.OAuthClientService.json” but again no luck.
then i reinstall Tado addon and try to start the authentication process again but still the same problem.
22:37:25.039 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.tado.internal.handler.TadoZoneHandler@719eac75': Zone pendingHvacChange not initialized
java.lang.IllegalStateException: Zone pendingHvacChange not initialized
at org.openhab.binding.tado.internal.handler.TadoZoneHandler.handleCommand(TadoZoneHandler.java:177) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor148.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:569) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [bundleFile:?]
at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
at jdk.proxy1741.$Proxy1902.handleCommand(Unknown Source) [?:?]
at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:95) [bundleFile:?]
at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [bundleFile:?]
at jdk.internal.reflect.GeneratedMethodAccessor147.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:569) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [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:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
Did you follow my instructions above?
hi,
yes i delete my username and PW in my Tado bridge config.
Then i also open the authenicatino process again http://oh-ip-address:8080/tado but still the same problem as you can see in my screenshot.
Ok. So your existing refresh token (encrypted in the StorageHandler.For.OAuthClientService.json file) is definitely no longer usable. Therefore you must completely delete that token from OH and start again:
StorageHandler.For.OAuthClientService.json in text editor, remove tado entries, savei follow your instruction and also delete the hole input of my document StorageHandler.For.OAuthClientService.jsonbut still the same error message.
20:25:17.869 [ERROR] [.oauth2client.internal.OAuthConnector] - **grant type refresh_token to URL https://login.tado.com/oauth2/token failed with error code invalid_grant, description The refresh_token is invalid.**
Should i delete the hole document StorageHandler.For.OAuthClientService.json ?
Edit: i also delete the hole file but it will not create again after a reboot.
Do not delete the JSON file
Please turn on
log:set TRACE org.openhab.core.auth
log:set TRACE org.openhab.binding.tado
.. and post the results.
i got the following Errors when i try to use it.
18:45:17.364 [ERROR] [.oauth2client.internal.OAuthConnector] - grant type refresh_token to URL https://login.tado.com/oauth2/token failed with error code invalid_grant, description The refresh_token is invalid.
18:45:38.354 [ERROR] [rnal.common.AbstractInvocationHandler] - **An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.tado.internal.handler.TadoZoneHandler@5972ae9b': Zone pendingHvacChange not initialized**
java.lang.IllegalStateException: Zone pendingHvacChange not initialized
at org.openhab.binding.tado.internal.handler.TadoZoneHandler.handleCommand(TadoZoneHandler.java:177) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor160.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:569) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [bundleFile:?]
at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
at jdk.proxy24385.$Proxy24546.handleCommand(Unknown Source) [?:?]
at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:95) [bundleFile:?]
at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [bundleFile:?]
at jdk.internal.reflect.GeneratedMethodAccessor159.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:569) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:147) [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:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
and also got the following when i try to open …/tado.
18:49:54.244 [DEBUG] [client.internal.OAuthStoreHandlerImpl] - Decrypting: AccessTokenResponse [accessToken=NfiI1f9yuoU9XofvxxxxxxxxxxxxxxaJRek0hTw, scope=offline_access, state=null, createdOn=2025-04-30T20:34:56.046199098Z]
18:49:54.249 [DEBUG] [client.internal.OAuthStoreHandlerImpl] - Decrypting: AccessTokenResponse [accessToken=NfiI1f9yuoU9Xofvhaxxxxxxxx7Q2BnL2Q08u9aJRek0hTwKFrN, scope=offline_access, state=null, createdOn=2025-04-30T20:34:56.046199098Z]
18:49:54.259 [DEBUG] [.oauth2client.internal.OAuthConnector] - Oauth request parameter grant_type, value refresh_token
18:49:54.264 [DEBUG] [.oauth2client.internal.OAuthConnector] - Oauth request parameter refresh_token, value L2ZZtNdxpadrApJlaEaxxxHEdiF3KiMROi-
18:49:54.268 [DEBUG] [.oauth2client.internal.OAuthConnector] - Oauth request parameter scope, value offline_access
18:49:54.271 [DEBUG] [.oauth2client.internal.OAuthConnector] - Setting authentication for clientId 1bb50063-6b0c-4d11-bd99-387fxxxxc46. Using basic auth false
18:49:54.424 [ERROR] [.oauth2client.internal.OAuthConnector] - grant type refresh_token to URL https://login.tado.com/oauth2/token failed with error code invalid_grant, description The refresh_token is invalid.
18:49:54.431 [DEBUG] [o.internal.handler.TadoHandlerFactory] - getAccessTokenResponse() error null
org.openhab.core.auth.client.oauth2.OAuthResponseException: null
at org.openhab.core.auth.oauth2client.internal.OAuthConnector.lambda$0(OAuthConnector.java:96) ~[?:?]
at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76) ~[?:?]
at com.google.gson.Gson.fromJson(Gson.java:1227) ~[?:?]
at com.google.gson.Gson.fromJson(Gson.java:1137) ~[?:?]
at com.google.gson.Gson.fromJson(Gson.java:1047) ~[?:?]
at com.google.gson.Gson.fromJson(Gson.java:982) ~[?:?]
at org.openhab.core.auth.oauth2client.internal.OAuthConnector.doRequest(OAuthConnector.java:368) ~[?:?]
at org.openhab.core.auth.oauth2client.internal.OAuthConnector.grantTypeRefreshToken(OAuthConnector.java:227) ~[?:?]
at org.openhab.core.auth.oauth2client.internal.OAuthClientServiceImpl.refreshTokenInner(OAuthClientServiceImpl.java:336) ~[?:?]
at org.openhab.core.auth.oauth2client.internal.OAuthClientServiceImpl.getAccessTokenResponse(OAuthClientServiceImpl.java:377) ~[?:?]
at org.openhab.binding.tado.internal.handler.TadoHandlerFactory.getAccessTokenResponse(TadoHandlerFactory.java:205) ~[?:?]
at org.openhab.binding.tado.internal.servlet.TadoAuthenticationServlet.serveStatusPage(TadoAuthenticationServlet.java:109) ~[?:?]
at org.openhab.binding.tado.internal.servlet.TadoAuthenticationServlet.doGet(TadoAuthenticationServlet.java:83) ~[?:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:497) ~[bundleFile:4.0.4]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:584) ~[bundleFile:4.0.4]
at org.ops4j.pax.web.service.spi.servlet.OsgiInitializedServlet.service(OsgiInitializedServlet.java:102) ~[bundleFile:?]
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656) ~[bundleFile:9.4.54.v20240208]
at org.ops4j.pax.web.service.spi.servlet.OsgiFilterChain.doFilter(OsgiFilterChain.java:113) ~[bundleFile:?]
at org.ops4j.pax.web.service.jetty.internal.PaxWebServletHandler.doHandle(PaxWebServletHandler.java:334) ~[bundleFile:?]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234) ~[bundleFile:9.4.54.v20240208]
at org.ops4j.pax.web.service.jetty.internal.PrioritizedHandlerCollection.handle(PrioritizedHandlerCollection.java:96) ~[bundleFile:?]
at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:731) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [bundleFile:9.4.54.v20240208]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [bundleFile:9.4.54.v20240208]
at java.lang.Thread.run(Thread.java:840) [?:?]