Tahoma Binding compatible with OH2

No problem,

I am developing this version against 2.5.0M1 and having this milestone as my production installation as well.

I haven’t seen any major differencies between 2.4 and 2.5M1 so far, but I would recommend to test it on 2.5 version.

Thanks

Ondrej

Sorry, but I don’t know what you are asking for.
Just disable/uninstall the bundled somfytahoma binding and copy the new version to the addons directory of your OH2 installation.

No extra config required, everything stays the same…
thanks
Ondrej

I asked for the way to make the config file manuelly …
But now I found it in the things file :smile:

Now the state updates after 300 Seconds and when I try to change the timeout time I get an 409-error conflict from the Paper UI

Or can I change this in the things file ?
In the example is only refresh and no timeout ?

Bridge somfytahoma:bridge:237dbae7 "Somfy Tahoma Bridge" [ email="my@email.com", password="MyPassword", refresh=30 ] {

In PaperUI I can´t save this and it also says that 60 seconds is the minimum …
Is that right ? 60 seconds are much to long. When my wife uses the external button to close the rollershutter the window should close before the rollershutter is down. But when openhab knows that only 60 seconds later it is to late :grimacing:
Regards
Jörg

I found another problem…

When I make a rule like this for a rollershutter:

when
Item r_max received command DOWN
then
r_max.sendCommand(STOP)
end

The Stop - Command is not recognized, but in the events.log it is shown.
Regards
Jörg

Hi, the parameter is called
statusTimeout

so you may use:
Bridge somfytahoma:bridge:237dbae7 "Somfy Tahoma Bridge" [ email="my@email.com", password="MyPassword", refresh=10, statusTimeout=30 ]
It means that the binding get every 10s events from cloud and once per 30s the status is synchronized with yout box. (and that will provide you with the events generated by remotes)

Don’t set it too low since it might freeze your box or you might experience "too many requests’ error.
Ondrej

1 Like

Hi Ondrej,

i finally installed your latest binding > thanks a lot > works fine for me.
Do you need the log files from my installation? As far as i see, i do not have any login issues (for now :wink: )
After a change in my things file, i had an “cannot get login cookie” error, but after a reboot everything works fine.

Is a reboot after an update of the things file necessary or only a “service openhab2 restart”?
This is the only point to mention for now.

Thanks a lot.

regards Christoph

Sorry it took me so long. Today, I installed a clean, non-dockered OH2.5M2 installation, put your latest jar into it, and only my bridge defined in a things file. Nothing else, just the “standard” setup of bindings immediately after installing. I still get the header error:

2019-08-16 13:35:51.460 [DEBUG] [nal.handler.SomfyTahomaBridgeHandler] - Cannot get login cookie!
    java.util.concurrent.ExecutionException: org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
        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:683) ~[?:?]
        at org.openhab.binding.somfytahoma.internal.handler.SomfyTahomaBridgeHandler.login(SomfyTahomaBridgeHandler.java:150) ~[?:?]

For completeness purpose, I might check the same setup with M1, but I do not expect much difference.

hakan@wallaby:.../openhab-2.5.0.M2/userdata/logs$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

No, reboot is not necessary, restarting the OH2 service is enough.
But the things file update seems to be a bit tricky to me. When I change something in the things file, only the first change is applied and OH2 reflects this, more changes need restart, because OH2 ignores them. I don’t know why.

thanks.
Ondrej

thanks Hakan. Not good message anyway :frowning:
You have connexoon or tahoma? Is your login to www.tahomalink.com working fine? The binding uses exactly the same way/API to login user as this portal.
I know there were some issues with the httpclient in the past (exacly with this protocol violation), but I am unable to figure out, why this happens only to some portion of users.

thanks.
Ondrej

Tahoma, “Version 1” I believe. Should have no direct impact whether the OH binding can put a request to the Somfy servers, no?

For some level of “fine”. There, I get the “too many logins” from time to time, but mostly when OH is running and has also got into the error state.

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.