Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[somfytahoma] Implement new local API #13013

Closed
lsiepel opened this issue Jun 25, 2022 · 52 comments · Fixed by #13411
Closed

[somfytahoma] Implement new local API #13013

lsiepel opened this issue Jun 25, 2022 · 52 comments · Fixed by #13411
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@lsiepel
Copy link
Contributor

lsiepel commented Jun 25, 2022

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 lsiepel added the enhancement An enhancement or new feature for an existing add-on label Jun 25, 2022
@BillGOH
Copy link

BillGOH commented Jul 2, 2022

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

@openhab-bot
Copy link
Collaborator

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
Copy link
Collaborator

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

@octa22
Copy link
Contributor

octa22 commented Sep 7, 2022

Linking to #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 ...

@hartmark
Copy link

hartmark commented Sep 7, 2022

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

@octa22
Copy link
Contributor

octa22 commented Sep 7, 2022

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
Copy link
Contributor

octa22 commented Sep 8, 2022

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

@hartmark
Copy link

hartmark commented Sep 8, 2022

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.

@octa22
Copy link
Contributor

octa22 commented Sep 10, 2022

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

@hartmark
Copy link

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
Copy link

The local mode still works perfectly.

@octa22
Copy link
Contributor

octa22 commented Sep 13, 2022

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.

@hartmark
Copy link

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
Copy link

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

@Tackoa
Copy link

Tackoa commented Sep 17, 2022

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

@hartmark
Copy link

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.

@lsiepel
Copy link
Contributor Author

lsiepel commented Sep 17, 2022

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.

@hartmark
Copy link

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.

@Quice2605
Copy link

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?

@janlinders
Copy link

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....

@octa22
Copy link
Contributor

octa22 commented Sep 28, 2022

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!

@melki84
Copy link

melki84 commented Sep 29, 2022

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

@octa22
Copy link
Contributor

octa22 commented Oct 2, 2022

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

@lsiepel
Copy link
Contributor Author

lsiepel commented Oct 2, 2022

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

@melki84
Copy link

melki84 commented Oct 11, 2022

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

@janlinders
Copy link

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

@melki84
Copy link

melki84 commented Oct 11, 2022

Here my log
Deleted

@octa22
Copy link
Contributor

octa22 commented Oct 11, 2022

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

@janlinders
Copy link

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

@melki84
Copy link

melki84 commented Oct 11, 2022

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...

@ljucam
Copy link

ljucam commented Oct 11, 2022

In my case everything works fine for let's say 6 - 12 hours, then suddenly the binding fails.

openhab.log-39037-2022-10-11 16:53:02.927 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39039-2022-10-11 16:53:31.190 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39040-2022-10-11 16:53:31.221 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39041-2022-10-11 16:53:32.930 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39042-2022-10-11 16:54:01.442 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39043-2022-10-11 16:54:01.445 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39044-2022-10-11 16:54:01.556 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Got event: DeviceStateChangedEvent
openhab.log-39045-2022-10-11 16:54:01.558 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - States for device io://2022-3796-3788/11048849 : [{name='core:ManufacturerSettingsState', type=11, value={current_position=51200.0}}]
openhab.log-39046-2022-10-11 16:54:01.560 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Updating status of thing: Sun Screen Wintergarden
openhab.log-39047-2022-10-11 16:54:02.935 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39049-2022-10-11 16:54:31.562 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39050-2022-10-11 16:54:31.571 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39051-2022-10-11 16:54:32.937 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39052-2022-10-11 16:55:01.877 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39053-2022-10-11 16:55:01.887 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39054-2022-10-11 16:55:02.941 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39056-2022-10-11 16:55:32.045 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39057-2022-10-11 16:55:32.054 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39058-2022-10-11 16:55:32.946 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39059-2022-10-11 16:56:02.289 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39060-2022-10-11 16:56:02.300 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39061-2022-10-11 16:56:02.951 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39063-2022-10-11 16:56:32.415 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39064-2022-10-11 16:56:32.430 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39065-2022-10-11 16:56:32.955 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39066-2022-10-11 16:57:03.571 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39067-2022-10-11 16:57:03.582 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39068-2022-10-11 16:57:03.620 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39070-2022-10-11 16:57:28.317 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Enabling reconciliation
openhab.log-39071-2022-10-11 16:57:35.235 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39072-2022-10-11 16:57:35.242 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39073-2022-10-11 16:57:35.245 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39074-2022-10-11 16:58:07.049 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39075-2022-10-11 16:58:07.144 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39076-2022-10-11 16:58:07.146 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39141-2022-10-11 16:58:37.063 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39142-2022-10-11 16:58:37.270 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39143-2022-10-11 16:58:37.274 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39144-2022-10-11 16:59:07.463 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39145-2022-10-11 16:59:07.584 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39146-2022-10-11 16:59:07.587 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39151-2022-10-11 16:59:38.729 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39152-2022-10-11 16:59:38.734 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39153-2022-10-11 16:59:38.737 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39160-2022-10-11 17:00:09.811 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39161-2022-10-11 17:00:09.818 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39162-2022-10-11 17:00:09.821 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39176-2022-10-11 17:00:39.818 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39177-2022-10-11 17:00:40.038 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39178-2022-10-11 17:00:40.042 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39185-2022-10-11 17:01:11.010 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39186-2022-10-11 17:01:11.015 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39187-2022-10-11 17:01:11.020 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39198-2022-10-11 17:01:41.020 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39199-2022-10-11 17:01:41.179 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39200-2022-10-11 17:01:41.184 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39207-2022-10-11 17:02:11.051 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39208-2022-10-11 17:02:11.413 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39209-2022-10-11 17:02:11.419 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log:39211:2022-10-11 17:02:41.084 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log:39212:2022-10-11 17:02:41.547 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log:39213:2022-10-11 17:02:41.552 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39214-2022-10-11 17:03:11.121 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39215-2022-10-11 17:03:11.801 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39216-2022-10-11 17:03:11.815 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39218-2022-10-11 17:03:41.125 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39219-2022-10-11 17:03:42.030 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39220-2022-10-11 17:03:42.034 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/events/f1ad5dfa-db7c-419f-8304-54c73cc48bda/fetch with data:
openhab.log-39221-2022-10-11 17:03:58.214 [DEBUG] [very.SomfyTahomaItemDiscoveryService] - Starting scanning for things...
openhab.log-39222-2022-10-11 17:03:58.216 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending GET to url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/setup with data:
openhab.log-39223-2022-10-11 17:03:58.300 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Cannot call url: https://192.168.2.192:8443/enduser-mobile-web/1/enduserAPI/setup with params: !
openhab.log-39224-java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@1587414::DecryptedEndPoint@74b8f8{l=/192.168.2.110:35332,r=/192.168.2.192:8443,OPEN,fill=-,flush=-,to=15998/0}
openhab.log-39225-      at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
openhab.log-39226-      at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
openhab.log-39227-      at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:730) ~[?:?]
openhab.log-39228-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:761) ~[?:?]
openhab.log-39229-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:750) ~[?:?]
openhab.log-39230-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendGetToTahomaWithCookie(SomfyTahomaBridgeHandler.java:735) ~[?:?]
openhab.log-39231-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.invokeCallToURL(SomfyTahomaBridgeHandler.java:1068) ~[?:?]
openhab.log-39232-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.getSetup(SomfyTahomaBridgeHandler.java:489) ~[?:?]
openhab.log-39233-      at org.openhab.binding.somfytahoma.internal.discovery.SomfyTahomaItemDiscoveryService.runDiscovery(SomfyTahomaItemDiscoveryService.java:127) ~[?:?]
openhab.log-39234-      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
openhab.log-39235-      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
openhab.log-39236-      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
openhab.log-39237-      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
openhab.log-39238-      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
openhab.log-39239-      at java.lang.Thread.run(Thread.java:829) [?:?]
openhab.log-39240-Caused by: java.io.EOFException: HttpConnectionOverHTTP@1587414::DecryptedEndPoint@74b8f8{l=/192.168.2.110:35332,r=/192.168.2.192:8443,OPEN,fill=-,flush=-,to=15998/0}
openhab.log-39241-      at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.earlyEOF(HttpReceiverOverHTTP.java:376) ~[?:?]
openhab.log-39242-      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1614) ~[?:?]
openhab.log-39243-      at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.shutdown(HttpReceiverOverHTTP.java:259) ~[?:?]
openhab.log-39244-      at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:181) ~[?:?]
openhab.log-39245-      at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:79) ~[?:?]
openhab.log-39246-      at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:131) ~[?:?]
openhab.log-39247-      at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:169) ~[?:?]
openhab.log-39248-      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[?:?]
openhab.log-39249-      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[?:?]
openhab.log-39250-      at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:540) ~[?:?]
openhab.log-39251-      at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:395) ~[?:?]
openhab.log-39252-      at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:161) ~[?:?]
openhab.log-39253-      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[?:?]
openhab.log-39254-      at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) ~[?:?]
openhab.log-39255-      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) ~[?:?]
openhab.log-39256-      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) ~[?:?]
openhab.log-39257-      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) ~[?:?]
openhab.log-39258-      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) ~[?:?]
openhab.log-39259-      at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:383) ~[?:?]
openhab.log-39260-      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:882) ~[?:?]
openhab.log-39261-      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1036) ~[?:?]
openhab.log-39262-      ... 1 more
openhab.log-39263-2022-10-11 17:04:11.157 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Refreshing Tahoma states...
openhab.log-39264-2022-10-11 17:04:11.162 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Doing relogin
openhab.log-39265-2022-10-11 17:04:11.281 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending GET to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/config/2022-3796-3788/local/tokens/devmode with data:
openhab.log-39266-2022-10-11 17:04:11.440 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Received unexpected status code: 401
openhab.log-39267-2022-10-11 17:04:11.442 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Cannot call url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/config/2022-3796-3788/local/tokens/devmode with params: !
openhab.log-39268-java.util.concurrent.ExecutionException: Unknown http error 401 while attempting to send a message.
openhab.log-39269-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:780) ~[?:?]
openhab.log-39270-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:750) ~[?:?]
openhab.log-39271-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendGetToTahomaWithCookie(SomfyTahomaBridgeHandler.java:735) ~[?:?]
openhab.log-39272-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.invokeCallToURL(SomfyTahomaBridgeHandler.java:1068) ~[?:?]
openhab.log-39273-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.initializeLocalMode(SomfyTahomaBridgeHandler.java:336) ~[?:?]
openhab.log-39274-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.login(SomfyTahomaBridgeHandler.java:284) ~[?:?]
openhab.log-39275-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.reLogin(SomfyTahomaBridgeHandler.java:979) ~[?:?]
openhab.log-39276-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.refreshTahomaStates(SomfyTahomaBridgeHandler.java:696) ~[?:?]
openhab.log-39277-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.lambda$2(SomfyTahomaBridgeHandler.java:211) ~[?:?]
openhab.log-39278-      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
openhab.log-39279-      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
openhab.log-39280-      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
openhab.log-39281-      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
openhab.log-39282-      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
openhab.log-39283-      at java.lang.Thread.run(Thread.java:829) [?:?]
openhab.log-39284-2022-10-11 17:04:11.448 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Exception during local mode initialization, falling back to cloud mode
openhab.log-39285-java.lang.NullPointerException: null
openhab.log-39286-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.initializeLocalMode(SomfyTahomaBridgeHandler.java:339) ~[?:?]
openhab.log-39287-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.login(SomfyTahomaBridgeHandler.java:284) ~[?:?]
openhab.log-39288-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.reLogin(SomfyTahomaBridgeHandler.java:979) ~[?:?]
openhab.log-39289-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.refreshTahomaStates(SomfyTahomaBridgeHandler.java:696) ~[?:?]
openhab.log-39290-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.lambda$2(SomfyTahomaBridgeHandler.java:211) ~[?:?]
openhab.log-39291-      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
openhab.log-39292-      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
openhab.log-39293-      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
openhab.log-39294-      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
openhab.log-39295-      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
openhab.log-39296-      at java.lang.Thread.run(Thread.java:829) [?:?]
openhab.log-39297-2022-10-11 17:04:11.453 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending POST to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/events/register with data:
openhab.log-39298-2022-10-11 17:04:11.483 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Received unexpected status code: 401
openhab.log-39299-2022-10-11 17:04:11.485 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Cannot call url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/events/register with params: !
openhab.log-39300-java.util.concurrent.ExecutionException: Unknown http error 401 while attempting to send a message.
openhab.log-39301-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:780) ~[?:?]
openhab.log-39302-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendPostToTahomaWithCookie(SomfyTahomaBridgeHandler.java:730) ~[?:?]
openhab.log-39303-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.invokeCallToURL(SomfyTahomaBridgeHandler.java:1074) ~[?:?]
openhab.log-39304-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.registerEvents(SomfyTahomaBridgeHandler.java:395) ~[?:?]
openhab.log-39305-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.login(SomfyTahomaBridgeHandler.java:291) ~[?:?]
openhab.log-39306-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.reLogin(SomfyTahomaBridgeHandler.java:979) ~[?:?]
openhab.log-39307-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.refreshTahomaStates(SomfyTahomaBridgeHandler.java:696) ~[?:?]
openhab.log-39308-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.lambda$2(SomfyTahomaBridgeHandler.java:211) ~[?:?]
openhab.log-39309-      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
openhab.log-39310-      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
openhab.log-39311-      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
openhab.log-39312-      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
openhab.log-39313-      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
openhab.log-39314-      at java.lang.Thread.run(Thread.java:829) [?:?]
openhab.log-39315-2022-10-11 17:04:11.488 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Events id error: null
openhab.log-39316-2022-10-11 17:04:12.299 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Getting Tahoma Updates...
openhab.log-39317-2022-10-11 17:04:12.306 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Doing relogin
openhab.log-39318-2022-10-11 17:04:12.326 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Sending GET to url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/config/2022-3796-3788/local/tokens/devmode with data:
openhab.log-39319-2022-10-11 17:04:12.357 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Received unexpected status code: 401
openhab.log-39320-2022-10-11 17:04:12.359 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Cannot call url: https://www.tahomalink.com/enduser-mobile-web/enduserAPI/config/2022-3796-3788/local/tokens/devmode with params: !
openhab.log-39321-java.util.concurrent.ExecutionException: Unknown http error 401 while attempting to send a message.
openhab.log-39322-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:780) ~[?:?]
openhab.log-39323-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendMethodToTahomaWithCookie(SomfyTahomaBridgeHandler.java:750) ~[?:?]
openhab.log-39324-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.sendGetToTahomaWithCookie(SomfyTahomaBridgeHandler.java:735) ~[?:?]
openhab.log-39325-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.invokeCallToURL(SomfyTahomaBridgeHandler.java:1068) ~[?:?]
openhab.log-39326-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.initializeLocalMode(SomfyTahomaBridgeHandler.java:336) ~[?:?]
openhab.log-39327-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.login(SomfyTahomaBridgeHandler.java:284) ~[?:?]
openhab.log-39328-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.reLogin(SomfyTahomaBridgeHandler.java:979) ~[?:?]
openhab.log-39329-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.getTahomaUpdates(SomfyTahomaBridgeHandler.java:530) ~[?:?]
openhab.log-39330-      at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.lambda$4(SomfyTahomaBridgeHandler.java:221) ~[?:?]
openhab.log-39331-      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
openhab.log-39332-      at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
openhab.log-39333-      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
openhab.log-39334-      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
openhab.log-39335-      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
openhab.log-39336-      at java.lang.Thread.run(Thread.java:829) [?:?]
openhab.log-39337-2022-10-11 17:04:12.366 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Exception during local mode initialization, falling back to cloud mode
openhab.log-39338-java.lang.NullPointerException: null

@melki84
Copy link

melki84 commented Oct 11, 2022

Now it works till now since i've deleted my scenarios. I'll you give feedback and will watch it.

@octa22
Copy link
Contributor

octa22 commented Oct 11, 2022

Please always report bugs found with the latest version. Here is the updated version - scenarios discovery gets skipped while on local mode.
https://www.dropbox.com/s/8tstagp8wfnivtn/org.openhab.binding.somfytahoma-3.4.0-SNAPSHOT.jar?dl=1

@melki84
Copy link

melki84 commented Oct 11, 2022

Thanks! I'll Install this now and give you Feedback:-)

@melki84
Copy link

melki84 commented Oct 12, 2022

Since i've added your new version from yesterday it works till now. I've tested it without scenarios. But now, i have created an scenario and i will wait what happens....

@octa22
Copy link
Contributor

octa22 commented Oct 12, 2022

here is the actual snapshot: https://www.dropbox.com/s/8tstagp8wfnivtn/org.openhab.binding.somfytahoma-3.4.0-SNAPSHOT.jar?dl=1
It should be more stable and more resilient with an ability to relogin if any error occurs. Unfortunately the local API behaves differently than the cloud one, so it takes some time to find and fix all the issues...

@melki84
Copy link

melki84 commented Oct 13, 2022

Thanks. Both versions work as well without errors for me rill now.I will be watching it.my scenario in the tahomabox doesnt make trouble anymore. You did an great job my friend :-)

@ljucam
Copy link

ljucam commented Oct 13, 2022

Thx, will install and try if it works.

@ljucam
Copy link

ljucam commented Oct 15, 2022

Looks good so far, thanks for the great work!

@BillGOH
Copy link

BillGOH commented Oct 16, 2022

First of all, thanks for the great work!

I use the binding with Somfy Connectivity Kit, which does not (yet?) support local mode. However, I regularly get the error "bad credentials" or "COMMUNICATION_ERROR" and the bridge thing goes offline. If I then start the Tahoma app it doesn't work either (wants to start a new installation). If I disable the bridge thing in openHAB for some time, everything works again.

Maybe this issue is similar to https://community.openhab.org/t/authentication-issue-since-past-week-in-somfy-binding/129359/10?

Anyone else having the same problem? I tried to increase the refresh interval to 600, but no success yet. Maybe a dirty workaround would be to disable the bridge thing during the night?

@melki84
Copy link

melki84 commented Oct 25, 2022

Thanks. Both versions work as well without errors for me rill now.I will be watching it.my scenario in the tahomabox doesnt make trouble anymore. You did an great job my friend :-)

Till now, this Binding works great aswell in LAN Mode. I have no issues with it. Thx for this binding :-)

@BillGOH
Copy link

BillGOH commented Oct 31, 2022

I use the binding with Somfy Connectivity Kit, which does not (yet?) support local mode. However, I regularly get the error "bad credentials" or "COMMUNICATION_ERROR" and the bridge thing goes offline. If I then start the Tahoma app it doesn't work either (wants to start a new installation). If I disable the bridge thing in openHAB for some time, everything works again.

I got a reply from Somfy regarding my problem. They say that the connection gets blocked if there are too many requests from the openHAB side. Is there a possibility to reduce the number of requests to the cloud? As I mentioned before I tried to increase the refresh interval which did not really work.

Thanks for any help!

@lsiepel
Copy link
Contributor Author

lsiepel commented Oct 31, 2022

the binding with Somfy Connectivity Kit, which does not (yet?) support local mode. However, I regularly get the error "bad credentials" or "COMMUNICATION_ERROR" and the bridge thing goes offline. If I then start the Tahoma app it doesn't work either (wants to sta

About to give it a try, this is still the most recent one? i see a new PR from only a few days ago. Please add the jar, so i can test it and review the PR.

@octa22
Copy link
Contributor

octa22 commented Nov 20, 2022

@hartmark
Copy link

Last version seems to work. What is new in this version?

@octa22
Copy link
Contributor

octa22 commented Nov 21, 2022

Thanks for testing. The latest version just contains improvements under the hood for better overall stability and improved documentation - it is a must before it can be merged into main branch.

@lolodomo
Copy link
Contributor

@octa22 : this can be closed by the PR merged today ?

@octa22
Copy link
Contributor

octa22 commented Dec 11, 2022

I guess so - it's a part of OH 3.4

@octa22 octa22 closed this as completed Dec 11, 2022
@panis16
Copy link

panis16 commented Mar 3, 2023

Binding and gateway stops, more or less, after a week.

Status:
OFFLINE
COMMUNICATION_ERROR
unable to register events

Refresh
7200
Status Timeout
6000
Retries
1
Retry delay
20000

LAN mode and developer mode active with last release.

what are appropiate values for refresh and status timeout?

thx

@lsiepel
Copy link
Contributor Author

lsiepel commented Mar 3, 2023

Binding and gateway stops, more or less, after a week.

Status: OFFLINE COMMUNICATION_ERROR unable to register events

Refresh 7200 Status Timeout 6000 Retries 1 Retry delay 20000

LAN mode and developer mode active with last release.

what are appropiate values for refresh and status timeout?

thx

Please open an issue as that gets more attention then this merged PR

@maisun
Copy link

maisun commented Mar 27, 2023

Ok I got the similar problem - the binding works fine for weeks but every noun and then my account gets blocked by Somfy. I have now switched on local mode and reduced the frequency to poll from cloud. I'm 99% sure the binding somehow triggered the account lock. One thing I find: looks like even with local mode enabled, it still tries to connect to cloud otherwise the binding is "offline", is it supposed to work like that?

@lsiepel
Copy link
Contributor Author

lsiepel commented Mar 27, 2023

Ok I got the similar problem - the binding works fine for weeks but every noun and then my account gets blocked by Somfy. I have now switched on local mode and reduced the frequency to poll from cloud. I'm 99% sure the binding somehow triggered the account lock. One thing I find: looks like even with local mode enabled, it still tries to connect to cloud otherwise the binding is "offline", is it supposed to work like that?

Please open an issue as that gets more attention then this merged PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.