Tahoma Binding compatible with OH2

by the way, is this the most current version I should be testing?

openhab> bundle:list -u | grep somfy
210 x Active x  80 x 2.5.0.201908101940    x file:/.....

The root cause might be issue 1555 on github, which should already be part of jetty 9.4.10 (we are on .18):

jetty-9.4.10.v20180503 - 03 May 2018
 + ...
 + 1555 AuthenticationProtocolHandler unable to parse Digest WWW Header
 + ...

could you perhaps check whether you can dump the headers coming from the upstream server? I am thinking that maybe somfy has multiple servers which are not totally in sync, and I am hitting the one which gives slightly broken answers?

Also, if I could see the POST request in the log (via log.trace() perhaps), I could run the same request on the shell, maybe this would help debugging, too.

Hi Hakan,

I have upgraded to OH2 2.5M2 and guess what - I have started facing the same Protocol Violation error as you have.
I’ve found out, that I cannot login to tahomalink.com portal either, I am getting the Too many requests error.

So the HttpClient is unable to parse the 401 error and throws the ExecutionException with Protocol Violation error.

HTTP/1.1 401
Date: Fri, 16 Aug 2019 18:09:52 GMT
Server: overkiz
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Type: application/json;charset=UTF-8
Access-Control-Allow-Origin: https://www.tahomalink.com
Access-Control-Allow-Methods: POST,GET,OPTIONS,DELETE,PUT
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type
Keep-Alive: timeout=5, max=49
Connection: Keep-Alive
Transfer-Encoding: chunked

Somfy response is wrong, because it does not have the WWW-Authenticate header which the RFC requires.

With this version, the binding logs in successfully in a couple of minutes, because it suspends login for two minutes before retrying. Can you try it as well, please?

https://www.dropbox.com/s/milfiftoww77p1e/org.openhab.binding.somfytahoma-2.5.0-SNAPSHOT.jar?dl=1

thanks.
Ondrej

With the latest jar from dropbox, the HTTP header error seems to be fixed, at least, my system can initialize the binding again (I went directly for the dockered setup)

Now I see in my logs the “skipping login due to too many requests” error, and after some minutes “Enabling login”. Now I can send messages again. I’ll continue to observe for some more days, hopefully the dreaded “too many logins” will never happen again…

Thank you so very much for this improvement :smile:

Hi @Ondrej_Pecta ,

I must admit that I lost track what the current state of the binding is. Is the jar from your dropbox still the most current one or did we get the changes merged in the meantime?

Not pushing or anything, I just want to know the current state of things :smile:

Regards,
Hakan

Hi @hakan,

the merging to the master is a bit slow, but these two versions exist:

The latest V1 includes:

  • shared HTTP client (saving OH2 resources)
  • correct handling of gateway states
  • proper updating of thing states (less communication with the same result)
  • proper managing of executions (less communication with the same result)
  • improved detection of gateway type (Tahoma, Connexoon, …)
  • overall better performance

According to my opinion the V1 version is still more stable and the recommended one, since the V2 had caused weird issues to some users.
I plan to request merging of the V1 version to the master soon, but other commits (bringing support for new things) still wait for merging…

Feel free to test :slight_smile:
Regards,
Ondrej

1 Like

Thank you, I guess I will stay with V1 for the time being. In two days, a big remodeling of my home will be done (switching 4 RTS motors to 9 iocontrol ones), so I want to get things working nicely first before experimenting with new APIs :grin:

Regards,
Hakan

I have now also bought the connexoon. But like some before me here, I also have the problem that I can’t register on https://www.tahomalink.com I get the error message Wrong username or password. I have already changed my password several times, but I just can’t log in.
Somehow Somfy seems to me to be very error-prone with its products, if I had known that, I would have left my fingers off it…

I would like to draw your attention to a mail I received from Somfy stating that I still use an old version of the API and that it will expire on Dec 3. Since I’m using OpenHab 2.4, I guess the binding version in this release still contains the old API. Is there any way to upgrade to the new API (within the stable OpenHAB 2.4? Someone opened a dedicated post for this: Somfy / Tahoma old API

I’ve noticed Somfy’s registrations are by locality. Where did you buy your box from vs. where are you living?
For reference I’m in Australia but bought my box in the UK and had to register it as a UK box with a UK address.

Thanks for the info, had no idea this is going to happen so soon.
So I’ve returned to the v2 version branch and I’ll be glad if we can test it…

https://www.dropbox.com/s/rkoyppxqaom1gee/org.openhab.binding.somfytahoma-2.5.0-SNAPSHOT.jar?dl=1

Thanks.
Ondrej

I’m happy to help testing. Just let me know what you need to see and I’ll get it sorted/started this weekend.

Just test the reliability, please. It should be working, but API change is always a bit risky.
Thanks :slight_smile:

Hello, I have copied the new version to the directory Addons. After I restarted the system, the addon in the Paperui under Configuration / Bindings is no longer displayed and things show an error. Version V1 continues to work without any problems.

OH2.4? Please check log file. I needed to install dependency google gson 2.8.5 jar.

Hi, sorry - I haven’t emphasized that for OH 2.4 you need either

  1. upgrade to OH2.5 first
  2. to manually install a newer gson jar
  3. edit the MANIFEST.MF file in META-INF dir in the provided jar, so the newer gson is not required (the code works with the bundled gson in OH 2.4 as well)
    change
    com.google.gson;version="[2.8,3)"
    to
    com.google.gson;version="[2.4,3)"

thanks
Ondrej

Hi, Step 3 works for me!

Thanks, please create an issue, so I can add support for the Camera thing.

Regarding the warning - type id switch has been replaced by system.power, I guess you need to restart OH2 and if it does not work out, clear the caches…

thanks
Ondrej

I’ve updated to the latest Somfy Tahoma 2.5.0 binding snapshot. @Ondrej_Pecta I used your 3rd method to get the binding to work on OH2.4 Stable.

So far all good, all blinds (roller shutters x 9) have initialised and are online but will await until my rules kick in to check if everything is behaving as expected.

Hello Ondrej,
I installed also the newest tahoma binding after the update of the TahomaBox.
The binding works for my rollershutters, roofwindowblinds, roofwindow and enocean windowhandle.
I wanted to ask, if it is possible to see the status of the rollershutters (and others) via the binding? (when i use the switch next to the windows or the remote control)

thanks for your effort and your answers in advance

regards
wu3mi