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
Comments
This would be a very good idea since Somfy cloud service is not always reliable. |
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 |
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 |
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 ... |
What kind of bugs are they? I'm still running the preview-build you made and it still works without any issues for me. |
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... |
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 |
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. |
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
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 :-|. |
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:
|
The local mode still works perfectly. |
thanks for the feedback, here is the actual version, which should much better handle the fallback. I am not experiencing any problems with the stopped HttpClient, can you please restart the OH sytem before trying the latest version? |
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. |
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.
|
Hy, 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, |
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. |
What is the lifetime of the token? Probably not long. Probably hours and not days. Would be nice if they support true local mode with local authentication to gain a token. |
It seems to live 14 days according to this link I'd love a 100% local mode too. My Somfy devices have been more reliable and faster to respond now using the local mode. |
Hello everybody, |
Hi All, Excellent results thus far... :-) Just tried the local option of this SNAPSHOT binding Somfy / Tahoma discussed here COMMUNICATION_ERROR Solutions that were discussed in several other posts : 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. Remove the std binding using the OH UI. 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. After that , I connected my devices to the new binding and everything worked right from the start. Keep up the good work.... |
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). |
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: My system ist OH 3.3.0 Can you See the issue ? Ciao melki84 |
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. |
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 |
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 |
Hi, I'm experiencing the same and put the logging in DEBUG mode.
|
Here my log |
Thanks, I think I know what causes the instability - enumeration of action groups (scenarios) returns "Bus error" during the discovery. |
I do not have the latest SNAPSHOT installed. |
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... |
In my case everything works fine for let's say 6 - 12 hours, then suddenly the binding fails.
|
Now it works till now since i've deleted my scenarios. I'll you give feedback and will watch it. |
Please always report bugs found with the latest version. Here is the updated version - scenarios discovery gets skipped while on local mode. |
Thanks! I'll Install this now and give you Feedback:-) |
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.... |
here is the actual snapshot: https://www.dropbox.com/s/8tstagp8wfnivtn/org.openhab.binding.somfytahoma-3.4.0-SNAPSHOT.jar?dl=1 |
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 :-) |
Thx, will install and try if it works. |
Looks good so far, thanks for the great work! |
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? |
Till now, this Binding works great aswell in LAN Mode. I have no issues with it. Thx for this binding :-) |
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! |
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. |
Hi, the lastest version is here: |
Last version seems to work. What is new in this version? |
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. |
@octa22 : this can be closed by the PR merged today ? |
I guess so - it's a part of OH 3.4 |
Binding and gateway stops, more or less, after a week. Status: Refresh 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 |
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 |
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.
The text was updated successfully, but these errors were encountered: