openhab-addons icon indicating copy to clipboard operation
openhab-addons copied to clipboard

[somfytahoma] Implement new local API

Open lsiepel opened this issue 2 years ago • 38 comments

When trouble shooting this problem: https://community.openhab.org/t/somfy-tahomalink-cloud-problems/136878 . I discovered that since a short while Somfy/Tahoma supports a new local API under the TaHoma Developer Mode program. More details about the program https://developer.somfy.com/

API details https://github.com/Somfy-Developer/Somfy-TaHoma-Developer-Mode API Swagger: https://somfy-developer.github.io/Somfy-TaHoma-Developer-Mode/

Would it be possible to implement this to the existing binding and make it configurable (default current cloud) to choose between cloud/local api?

I would really be happy to get less dependent on cloud services.

lsiepel avatar Jun 25 '22 18:06 lsiepel

This would be a very good idea since Somfy cloud service is not always reliable.

BillGOH avatar Jul 02 '22 11:07 BillGOH

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/somfy-tahomalink-cloud-problems/136878/3

openhab-bot avatar Jul 02 '22 11:07 openhab-bot

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/io-homecontrol-velux-somethings-in-the-bush/11413/265

openhab-bot avatar Aug 15 '22 18:08 openhab-bot

Linking to https://github.com/openhab/openhab-addons/pull/12550, the PR containing the LAN mode support has been prepared. Unfortunately the local mode implementation has some bugs on the Somfy side and we need to wait for some fixes ...

octa22 avatar Sep 07 '22 20:09 octa22

What kind of bugs are they? I'm still running the preview-build you made and it still works without any issues for me.

hartmark avatar Sep 07 '22 21:09 hartmark

Unfortunaly the discovery is not working for devices (only action groups work) and action groups are not working at all. These issues block the usable funtionality at least for me, not speaking about the fact that lots of users reported that only some of their devices are supported...

octa22 avatar Sep 07 '22 21:09 octa22

If someone interested in testing, here is the latest snapshot https://www.dropbox.com/s/8tstagp8wfnivtn/org.openhab.binding.somfytahoma-3.4.0-SNAPSHOT.jar?dl=1 thanks

octa22 avatar Sep 08 '22 21:09 octa22

At first I could no longer control my somfy devices, but after digging in the logs I found that the local developer mode didn't find the gateway using mDNS.

It seems my mDNS docker instance was stuck. However it should work anyway as it should use the indirect control using cloud, right?

Then after getting mDNS working again it just works perfectly again.

hartmark avatar Sep 08 '22 23:09 hartmark

Thanks for the testing. Please check this out: https://www.dropbox.com/s/8tstagp8wfnivtn/org.openhab.binding.somfytahoma-3.4.0-SNAPSHOT.jar?dl=1

  • added fallback to cloud mode
  • reusing of local tokens during login (quicker initialization)

unfortunately I have found out, that my solar sensor by Somfy is not working in local mode and I have some rules based on its functinality, so I am switching back to cloud mode :-|. Please let me know if you want other functionality to the local mode. Thanks you

octa22 avatar Sep 10 '22 07:09 octa22

I'm unable to control anything when the local mode fails or if I disable local mode.

The stacktraces I get are also appearing when I'm on local mode so it must be some kind of concurrency problem.

Plus it would be nice if the log didn't contain the tokens in plain text, they can perhaps be on the trace level if needed and with a warning that it's sensitive information that might give others access to the system.

Log:

00:30:28.632 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - OAuth2 Access Token: <redacted>                                                                
00:30:28.637 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Starting mDNS discovery...                                                                                                                                                 
00:30:33.649 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Cannot switch to developer mode - gateway not found on LAN                                                                                                                 
00:30:33.651 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/events/register with data:                                                                   
00:30:33.824 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Events id:  <redacted>                                                                                                                            
00:30:33.829 [DEBUG] [ma.internal.SomfyTahomaHandlerFactory] - Creating handler for exteriorscreen                                                                                                                                        
00:30:33.830 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Initialize done...                                                                                                                                                         
00:30:33.830 [DEBUG] [ma.internal.SomfyTahomaHandlerFactory] - Creating handler for exteriorscreen                                                                                                                                        
00:30:33.831 [DEBUG] [ma.internal.SomfyTahomaHandlerFactory] - Creating handler for gateway                                                                                                                                               
00:30:33.832 [DEBUG] [ma.internal.SomfyTahomaHandlerFactory] - Creating handler for exteriorscreen                                                                                                                                        
00:30:33.833 [DEBUG] [ma.internal.SomfyTahomaHandlerFactory] - Creating handler for awning                                                                                                                                                
00:30:33.848 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Sending GET to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/setup/devices with data:                                                                      
00:30:33.855 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Sending GET to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/setup/gateways/ <redacted> with data:                                                      
00:30:33.953 [DEBUG] [ndler.SomfyTahomaRollerShutterHandler] - io:// <redacted>/6339376 updating RSSI channel with value: 42.0                                                                                                         
00:30:33.954 [DEBUG] [ndler.SomfyTahomaRollerShutterHandler] - io:// <redacted>/7958160 updating RSSI channel with value: 22.0                                                                                                         
00:30:33.954 [DEBUG] [ndler.SomfyTahomaRollerShutterHandler] - io:// <redacted>/5581605 updating RSSI channel with value: 66.0                                                                                                         
00:30:33.959 [DEBUG] [rnal.handler.SomfyTahomaAwningHandler] - io:// <redacted>/10756916 updating RSSI channel with value: 60.0                                                                                                        
00:30:33.978 [DEBUG] [ma.internal.SomfyTahomaHandlerFactory] - Creating handler for awning                                                                                                                                                
00:30:34.003 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Tahoma status: OK                                                                                                                                                          
00:30:34.006 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Tahoma protocol version: 2022.4.4                                                                                                                                          
00:30:34.014 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Sending GET to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/actionGroups with data:                                                                       
00:30:34.020 [DEBUG] [rnal.handler.SomfyTahomaAwningHandler] - io:// <redacted>/12536788 updating RSSI channel with value: 74.0                                                                                                        
00:30:41.488 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...                                                                                                                                                
00:30:41.492 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Sending PUT to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/setup/devices/states/refresh with data:                                                       
00:30:41.498 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Cannot call url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/setup/devices/states/refresh with params: !                                                      
java.util.concurrent.ExecutionException: java.util.concurrent.RejectedExecutionException: HttpClient@1ebadab{STOPPED} is stopped                                                                                                          
        at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]                                                                                                                         
        at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]                                                                                                                               
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:730) ~[?:?]                                                                                                                                                         
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:777) ~[?:?]                                                                               
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:766) ~[?:?]                                                                               
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendPutToTahomaWithCookie(SomfyTahomaBridgeHandler.java:756) ~[?:?]                                                                                  
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.invokeCallToURL(SomfyTahomaBridgeHandler.java:1092) ~[?:?]                                                                                           
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.forceGatewaySync(SomfyTahomaBridgeHandler.java:1020) ~[?:?]                                                                                          
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.refreshTahomaStates(SomfyTahomaBridgeHandler.java:717) ~[?:?]                                                                                        
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.lambda$2(SomfyTahomaBridgeHandler.java:211) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
        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) [?:?]                                                                                                                                                                          [32/16128]
Caused by: java.util.concurrent.RejectedExecutionException: HttpClient@1ebadab{STOPPED} is stopped
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:294) ~[?:?]
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:262) ~[?:?]
        at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:600) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.sendAsync(HttpRequest.java:778) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:765) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:726) ~[?:?]
        ... 13 more
00:30:43.830 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
00:30:43.832 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/events/ <redacted>/fetch with data: 
00:30:49.939 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
00:30:49.941 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Sending PUT to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/setup/devices/states/refresh with data: 
00:30:49.944 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Cannot call url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/setup/devices/states/refresh with params: !
java.util.concurrent.ExecutionException: java.util.concurrent.RejectedExecutionException: HttpClient@1c13d00{STOPPED} is stopped
        at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
        at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:730) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:777) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:766) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendPutToTahomaWithCookie(SomfyTahomaBridgeHandler.java:756) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.invokeCallToURL(SomfyTahomaBridgeHandler.java:1092) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.forceGatewaySync(SomfyTahomaBridgeHandler.java:1020) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.refreshTahomaStates(SomfyTahomaBridgeHandler.java:717) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.lambda$2(SomfyTahomaBridgeHandler.java:211) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
        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) [?:?]
Caused by: java.util.concurrent.RejectedExecutionException: HttpClient@1c13d00{STOPPED} is stopped
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:294) ~[?:?]
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:262) ~[?:?]
        at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:600) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.sendAsync(HttpRequest.java:778) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:765) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:726) ~[?:?]
        ... 13 more
00:30:54.160 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
00:30:54.164 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Sending PUT to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/setup/devices/states/refresh with data: 
00:30:54.167 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Cannot call url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/setup/devices/states/refresh with params: !
java.util.concurrent.ExecutionException: java.util.concurrent.RejectedExecutionException: HttpClient@98b62b{STOPPED} is stopped
        at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
        at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:730) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:777) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:766) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendPutToTahomaWithCookie(SomfyTahomaBridgeHandler.java:756) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.invokeCallToURL(SomfyTahomaBridgeHandler.java:1092) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.forceGatewaySync(SomfyTahomaBridgeHandler.java:1020) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.refreshTahomaStates(SomfyTahomaBridgeHandler.java:717) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.lambda$2(SomfyTahomaBridgeHandler.java:211) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
        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) [?:?]
Caused by: java.util.concurrent.RejectedExecutionException: HttpClient@98b62b{STOPPED} is stopped
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:294) ~[?:?]
        at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:262) ~[?:?]
        at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:600) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.sendAsync(HttpRequest.java:778) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:765) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:726) ~[?:?]
        ... 13 more

hartmark avatar Sep 12 '22 22:09 hartmark

The local mode still works perfectly.

hartmark avatar Sep 12 '22 22:09 hartmark

thanks for the feedback, here is the actual version, which should much better handle the fallback. https://www.dropbox.com/s/8tstagp8wfnivtn/org.openhab.binding.somfytahoma-3.4.0-SNAPSHOT.jar?dl=1

I am not experiencing any problems with the stopped HttpClient, can you please restart the OH sytem before trying the latest version? Regarding the tokens - it is harmless to print them. Either they are temporary and read only (cloud events) or local tokens generated by your gateway for the local mode control. Moreover both token types require your credentials for any usage... thanks.

octa22 avatar Sep 13 '22 20:09 octa22

Alright, I remember now it was also some cookie involved but it's good to know that just pasting the token is not enough to gain access to my system.

hartmark avatar Sep 13 '22 21:09 hartmark

The updated version has working fallback to cloud mode if lan mode was unsuccessful detecting using mDNS and just vanilla cloud mode works for me aswell in this version.

I have only one error left in the log, related to IPv6. It will fallback to the IPv4 address it also found with mDNS, But I think it would be nice to support IPv6 aswell.

23:41:31.522 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Cannot call url: https://[2001:9b1:dfc:a500:fa81:1aff:fe5c:6b1f]:8443/enduser-mobile-web/1/enduserAPI/events/register with params: !                                       
java.util.concurrent.ExecutionException: java.net.SocketException: Could not connect to /2001:9b1:dfc:a500:fa81:1aff:fe5c:6b1f:8443
        at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]                                                                                                                         
        at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]                                                                                                                               
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:730) ~[?:?]                                                                                                                                                         
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:780) ~[?:?]                                           
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendPostToTahomaWithCookie(SomfyTahomaBridgeHandler.java:749) ~[?:?]                                                                                 
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.invokeCallToURL(SomfyTahomaBridgeHandler.java:1101) ~[?:?]                                                                                           
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.registerEvents(SomfyTahomaBridgeHandler.java:413) ~[?:?]                                                                                             
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.login(SomfyTahomaBridgeHandler.java:294) ~[?:?]                                                                                                      
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.lambda$1(SomfyTahomaBridgeHandler.java:180) ~[?:?]                                                                                                   
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]                                                                                                                                                  
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]                                                                                                                                                                 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]                                           
        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) [?:?]                                                                                                                                                                                    
Caused by: java.net.SocketException: Could not connect to /2001:9b1:dfc:a500:fa81:1aff:fe5c:6b1f:8443                                                                                                                                     
        at org.eclipse.jetty.client.AbstractConnectorHttpClientTransport.connect(AbstractConnectorHttpClientTransport.java:114) ~[?:?]                                                                                                    
        at org.eclipse.jetty.client.HttpClient$1.connect(HttpClient.java:638) ~[?:?]                                                                                                                                                      
        at org.eclipse.jetty.client.HttpClient$1.succeeded(HttpClient.java:615) ~[?:?]                               
        at org.eclipse.jetty.client.HttpClient$1.succeeded(HttpClient.java:607) ~[?:?]           
        at org.eclipse.jetty.util.SocketAddressResolver$Async.lambda$resolve$1(SocketAddressResolver.java:186) ~[?:?]                                                   
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
        ... 1 more
Caused by: java.net.SocketException: Protocol family unavailable
        at sun.nio.ch.Net.connect0(Native Method) ~[?:?]
        at sun.nio.ch.Net.connect(Net.java:476) ~[?:?]
        at sun.nio.ch.Net.connect(Net.java:468) ~[?:?]
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:692) ~[?:?]
        at org.eclipse.jetty.client.AbstractConnectorHttpClientTransport.connect(AbstractConnectorHttpClientTransport.java:100) ~[?:?]
        at org.eclipse.jetty.client.HttpClient$1.connect(HttpClient.java:638) ~[?:?]
        at org.eclipse.jetty.client.HttpClient$1.succeeded(HttpClient.java:615) ~[?:?]
        at org.eclipse.jetty.client.HttpClient$1.succeeded(HttpClient.java:607) ~[?:?]
        at org.eclipse.jetty.util.SocketAddressResolver$Async.lambda$resolve$1(SocketAddressResolver.java:186) ~[?:?] 
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
        ... 1 more
23:41:31.572 [DEBUG] [rnal.handler.SomfyTahomaBridgeHandler] - Events id error: null

hartmark avatar Sep 13 '22 21:09 hartmark

Hy, I have tried it today and it works! Thank you very much! :)

I have just one question. I have also tried to run it on a local-only environment, meaning with no internet connection. Unfortunately this was not possible. Do you have an idea / a solution how it could work with the local API without any internet connection?

Greetings, Michael

Tackoa avatar Sep 17 '22 14:09 Tackoa

The authentication is done on somfy's servers, from there you get the token you can use on your local device. So after getting the initial handshake up I guess you'd not need any internet.

hartmark avatar Sep 17 '22 15:09 hartmark

What is the lifetime of the token? Probably not long. Probably hours and not days. So local mode is a very good start. More reliable, but it still relies on the Somfy servers. So for Somfy there is a benefit, less traffic/calls, but they remain in total controle as per token.

Would be nice if they support true local mode with local authentication to gain a token.

lsiepel avatar Sep 17 '22 16:09 lsiepel

It seems to live 14 days according to this link https://developer.somfy.com/apis-docs

I'd love a 100% local mode too. My Somfy devices have been more reliable and faster to respond now using the local mode.

hartmark avatar Sep 17 '22 16:09 hartmark

Hello everybody, this is very cool and very good news. I'm a fan of direct communication. Will it also be implemented in 3.3?

Quice2605 avatar Sep 26 '22 18:09 Quice2605

Hi All, Excellent results thus far... :-)

Just tried the local option of this SNAPSHOT binding Somfy / Tahoma discussed here after several issues with the connectivity to the cloud portal , www.tahomalink.com possibly due to the web site blocking the connection with error:

COMMUNICATION_ERROR Error logging in (check your credentials)

Solutions that were discussed in several other posts : Disable the binding for at least 24 hours so the block would be released by the cloud web-server Play around with lowering the number of retries by increasing the retry time in the std. binding parameters after the 24hours disable period. None of these helped for a longer period after which the binding failed to connect again.

Connecting to the www.tahomalink.com in Chrome showed the same kind of error.

The following solved my problem :

The installation done in my setup (OpenHabian 3.3.0.M6 - Milestone Build )

Go to the Somfy site and select your Tahoma device to enable the Development mode. For details see : https://developer.somfy.com/

Remove the std binding using the OH UI. openhab-binding-somfytahoma│ 3.3.0.M6 │ │ Uninstalled │ openhab-addons-3.3.0.M6 │ Somfy Tahoma Binding

Download the SNAPSHOT and put it in : /usr/share/openhab/addons

wget https://www.dropbox.com/s/8tstagp8wfnivtn/org.openhab.binding.somfytahoma-3.4.0-SNAPSHOT.jar

Create new binding and tick Show advanced to switch on the local approach. Switch on Development Mode. I left everything the default except the userid/passwd fields.. After activation of the binding the system automatically found and update the rest of the parms. :-)

After that , I connected my devices to the new binding and everything worked right from the start.

Keep up the good work....

janlinders avatar Sep 27 '22 18:09 janlinders

I am glad it works. Here is the new updated snapshot. Discovery should be working in the local mode as well (and works for the cloud mode too). https://www.dropbox.com/s/8tstagp8wfnivtn/org.openhab.binding.somfytahoma-3.4.0-SNAPSHOT.jar?dl=1 I am still missing firmware support for the action groups / scenarios, it does not work yet, but the local mode is getting more and more usable. Enjoy!

octa22 avatar Sep 28 '22 15:09 octa22

Hello,

i would use the LAN-Mode because the Cloud-Mode will stop all the time (to much refreshes). But the snapshot works bader als the original Binding. LAN -Mode stops very often, cloud-Mode the same.

I stoped oh, cleaned the Cache, rebootet, stoped oh again, cleaned Cache again, installed the snapshot, rebootet again, configured the Binding. For a short time i have a Connection to the Box and then: COMMUNICATION_ERROR or COMMUNICATION_ERROR unable to register events.

Here ist a pice from my OH-Log: 2022-09-29 20:01:45.127 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/somfytahoma:bridge:4fd913b901/config' java.lang.IllegalStateException: Thing with UID somfytahoma:bridge:4fd913b901 has no handler attached. at org.openhab.core.thing.internal.ThingRegistryImpl.updateConfiguration(ThingRegistryImpl.java:96) ~[?:?] at org.openhab.core.io.rest.core.internal.thing.ThingResource.updateConfiguration(ThingResource.java:498) ~[?:?] at jdk.internal.reflect.GeneratedMethodAccessor109.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) ~[bundleFile:3.4.5] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[bundleFile:3.4.5] at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) ~[bundleFile:3.4.5] at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) ~[bundleFile:3.4.5] at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) ~[bundleFile:3.4.5] at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) ~[bundleFile:3.4.5] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[bundleFile:3.4.5] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) ~[bundleFile:3.4.5] at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPut(AbstractHTTPServlet.java:234) ~[bundleFile:3.4.5] at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) ~[bundleFile:3.1.0] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273) ~[bundleFile:3.4.5] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) ~[bundleFile:9.4.46.v20220331] at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:74) ~[bundleFile:?] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[bundleFile:9.4.46.v20220331] at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:294) ~[bundleFile:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[bundleFile:9.4.46.v20220331] at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:90) ~[bundleFile:?] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [bundleFile:9.4.46.v20220331] at java.lang.Thread.run(Thread.java:829) [?:?] 2022-09-29 20:01:46.036 [WARN ] [ty.util.ssl.SslContextFactory.config] - Trusting all certificates configured for Client@1dec888[provider=null,keyStore=null,trustStore=null] 2022-09-29 20:01:46.038 [WARN ] [ty.util.ssl.SslContextFactory.config] - No Client EndPointIdentificationAlgorithm configured for Client@1dec888[provider=null,keyStore=null,trustStore=null] 2022-09-29 20:01:47.987 [WARN ] [ty.util.ssl.SslContextFactory.config] - Trusting all certificates configured for Client@1299a48[provider=null,keyStore=null,trustStore=null] 2022-09-29 20:01:47.989 [WARN ] [ty.util.ssl.SslContextFactory.config] - No Client EndPointIdentificationAlgorithm configured for Client@1299a48[provider=null,keyStore=null,trustStore=null] 2022-09-29 20:06:35.532 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/somfytahoma:bridge:4fd913b901/config' java.lang.IllegalStateException: Thing with UID somfytahoma:bridge:4fd913b901 has no handler attached. at org.openhab.core.thing.internal.ThingRegistryImpl.updateConfiguration(ThingRegistryImpl.java:96) ~[?:?] at org.openhab.core.io.rest.core.internal.thing.ThingResource.updateConfiguration(ThingResource.java:498) ~[?:?] at jdk.internal.reflect.GeneratedMethodAccessor109.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) ~[bundleFile:3.4.5] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[bundleFile:3.4.5] at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) ~[bundleFile:3.4.5] at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) ~[bundleFile:3.4.5] at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) ~[bundleFile:3.4.5] at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) ~[bundleFile:3.4.5] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[bundleFile:3.4.5] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) ~[bundleFile:3.4.5] at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298) ~[bundleFile:3.4.5] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPut(AbstractHTTPServlet.java:234) ~[bundleFile:3.4.5] at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) ~[bundleFile:3.1.0] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273) ~[bundleFile:3.4.5] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) ~[bundleFile:9.4.46.v20220331] at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:74) ~[bundleFile:?] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[bundleFile:9.4.46.v20220331] at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:294) ~[bundleFile:?] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[bundleFile:9.4.46.v20220331] at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:90) ~[bundleFile:?] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [bundleFile:9.4.46.v20220331] at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [bundleFile:9.4.46.v20220331] at java.lang.Thread.run(Thread.java:829) [?:?]

My system ist OH 3.3.0

Can you See the issue ?

Ciao melki84

melki84 avatar Sep 29 '22 20:09 melki84

Hello,

i would use the LAN-Mode because the Cloud-Mode will stop all the time (to much refreshes). But the snapshot works bader als the original Binding. LAN -Mode stops very often, cloud-Mode the same.

I stoped oh, cleaned the Cache, rebootet, stoped oh again, cleaned Cache again, installed the snapshot, rebootet again, configured the Binding. For a short time i have a Connection to the Box and then: COMMUNICATION_ERROR or COMMUNICATION_ERROR unable to register events.

Here ist a pice from my OH-Log: `2022-09-29 20:01:45.127 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/somfytahoma:bridge:4fd913b901/config' java.lang.IllegalStateException: Thing with UID somfytahoma:bridge:4fd913b901 has no handler attached. at org.openhab.core.thing.internal.ThingRegistryImpl.updateConfiguration(ThingRegistryImpl.java:96) ~[?:?] at org.openhab.core.io.rest.core.internal.thing.ThingResource.updateConfiguration(ThingResource.java:498) ~[?:?] at

hello, this seems to be some sort of UI exception, not related to the binding functionality - I guess this is an exception during configuration update from UI. Please, try to find another exceptions related to the somfytahoma binding. Thanks Ondrej

octa22 avatar Oct 02 '22 18:10 octa22

Hello,

i would use the LAN-Mode because the Cloud-Mode will stop all the time (to much refreshes). But the snapshot works bader als the original Binding. LAN -Mode stops very often, cloud-Mode the same.

I stoped oh, cleaned the Cache, rebootet, stoped oh again, cleaned Cache again, installed the snapshot, rebootet again, configured the Binding. For a short time i have a Connection to the Box and then: COMMUNICATION_ERROR or COMMUNICATION_ERROR unable to register events.

Here ist a pice from my OH-Log: [cut out]

My system ist OH 3.3.0

Can you See the issue ?

Ciao melki84

It would help if you put the binding in debug mode and write the log to a separate file.

Check https://www.openHAB.org/docs/administration/logging.html

lsiepel avatar Oct 02 '22 19:10 lsiepel

Hi,

sorry, i was at holiday last week. I installed yesterday a completely new raspbian on an RasPi 4b+ 4GB with a new Openhab 3.3.0 and only your LAN-Binding. cloudmode works as well, LAN-Mode now works exactly 60 minutes and then:

COMMUNICATION_ERROR unable to register events.

When i start the bridge after this error, the brigde will be online 1 hour again. And then: same error. When the brigde is offline, the ping to tahomalink is very often but i have never reconnect to LAN or Cloudmode.

Dont know how the debugmode works, i must read iyour link first

Ciao melki84

melki84 avatar Oct 11 '22 12:10 melki84

Hi,

I'm experiencing the same and put the logging in DEBUG mode. Here is the log, Let me know if you need more info.....

2022-10-11 14:58:46.161 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'somfytahoma:bridge:e0e021b046' changed from OFFLINE (COMMUNICATION_ERROR): unable to register events to OFFLINE (COMMUNICATION_ERROR) 2022-10-11 14:58:46.171 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'somfytahoma:bridge:e0e021b046' changed from OFFLINE (COMMUNICATION_ERROR) to OFFLINE (COMMUNICATION_ERROR): unable to register events 2022-10-11 14:58:46.235 [DEBUG] [org.eclipse.jetty.server.HttpOutput ] - write(array) s=OPEN,api=BLOCKING,sc=false,e=null aggregated !flush DirectByteBuffer@13b6c76[p=0,l=223,c=32768,r=223]={<<<event: message\ndata: {"to..."ThingStatusInfoEvent"}>>>ON_ERROR\\...alse},null 2022-10-11 14:58:46.236 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - sendResponse info=null content=DirectByteBuffer@13b6c76[p=0,l=223,c=32768,r=223]={<<<event: message\ndata: {"to..."ThingStatusInfoEvent"}>>>ON_ERROR\\...alse},null complete=false committing=false callback=Blocker@14439bd{null} 2022-10-11 14:58:51.062 [DEBUG] [org.eclipse.jetty.util.Scanner ] - scan accepted /var/lib/openhab/etc/overrides.properties mod=1665335575000 2022-10-11 14:59:06.212 [DEBUG] [org.eclipse.jetty.util.Scanner ] - scan accepted /var/lib/openhab/etc/overrides.properties mod=1665335575000 2022-10-11 14:59:16.164 [DEBUG] [clipse.jetty.client.HttpConversation] - Exchanges in conversation 1, override=null, listeners=[org.eclipse.jetty.client.util.FutureResponseListener@4dc1ee] 2022-10-11 14:59:16.948 [DEBUG] [clipse.jetty.client.HttpConversation] - Exchanges in conversation 1, override=null, listeners=[org.eclipse.jetty.client.util.FutureResponseListener@4dc1ee] DirectByteBufferR@1cb2928[p=329,l=679,c=16384,r=350]={HTTP/1.1 ...ive\r\n\r\n<<<{"access_token":"NGZlOTU5...TQyMDg5NTg4ZTQ4OGViZg"}>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00} 2022-10-11 14:59:17.025 [DEBUG] [clipse.jetty.client.HttpConversation] - Exchanges in conversation 1, override=null, listeners=[org.eclipse.jetty.client.util.FutureResponseListener@1f43c32] 2022-10-11 14:59:17.375 [DEBUG] [clipse.jetty.client.HttpConversation] - Exchanges in conversation 1, override=null, listeners=[org.eclipse.jetty.client.util.FutureResponseListener@1f43c32] DirectByteBufferR@1a64d83[p=460,l=512,c=16384,r=52]={HTTP/1.1 ...\n\r\n34\r\n<<<{"requestId":"c720c5d5-ac...e01-6399-5f11def994e6"}>>>\r\n0\r\n\r\nri...\x00\x00\x00\x00\x00\x00\x00} 2022-10-11 14:59:17.449 [DEBUG] [clipse.jetty.client.HttpConversation] - Exchanges in conversation 1, override=null, listeners=[org.eclipse.jetty.client.util.FutureResponseListener@f094a3] 2022-10-11 14:59:20.636 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'somfytahoma:bridge:e0e021b046' changed from OFFLINE (COMMUNICATION_ERROR): unable to register events to OFFLINE (COMMUNICATION_ERROR) 2022-10-11 14:59:20.639 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'somfytahoma:bridge:e0e021b046' changed from OFFLINE (COMMUNICATION_ERROR) to OFFLINE (COMMUNICATION_ERROR): unable to register events 2022-10-11 14:59:21.355 [DEBUG] [org.eclipse.jetty.util.Scanner ] - scan accepted /var/lib/openhab/etc/overrides.properties mod=1665335575000

janlinders avatar Oct 11 '22 13:10 janlinders

Here my log Deleted

melki84 avatar Oct 11 '22 13:10 melki84

Thanks, I think I know what causes the instability - enumeration of action groups (scenarios) returns "Bus error" during the discovery. It works well for me, maybe a different firmware? BTW do you have any action groups? Of course I can fix it by skipping the action group discovery in case of LAN mode... Thanks Ondrej

octa22 avatar Oct 11 '22 13:10 octa22

I do not have the latest SNAPSHOT installed. Would that solve it perhaps ?

janlinders avatar Oct 11 '22 13:10 janlinders

Thanks, I think I know what causes the instability - enumeration of action groups (scenarios) returns "Bus error" during the discovery. It works well for me, maybe a different firmware? BTW do you have any action groups? Of course I can fix it by skipping the action group discovery in case of LAN mode... Thanks Ondrej

Yes i had till now Action groups.i have they now deleted. I see in one hour what happens.. My Firmware is 2022.4.4-10. its up to date. German box...

melki84 avatar Oct 11 '22 14:10 melki84