Tahoma Binding compatible with OH2

Hi Ondrej

In openhab.log I do always find groups of 4 warnings about “somfytahoma:position”. However, I have checked and found no position channels (of old somfy tahoma binding) in my environment. So, I have looked into your jar file and found in ESH-INF/thing/exteriorscreen.xml :

<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="somfytahoma" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
	xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">

	<thing-type id="exteriorscreen">
		<supported-bridge-type-refs>
			<bridge-type-ref id="bridge"/>
		</supported-bridge-type-refs>
		<label>Somfy Exterior Screen</label>
		<channels>
			<channel id="position" typeId="position"></channel>
			<channel id="control" typeId="control"></channel>
		</channels>
		<config-description-ref uri="thing-type:somfytahoma:device"/>
	</thing-type>

</thing:thing-descriptions>

I think the position channel should be removed, right?

Best regards,
Manfred

Yes, you are right.
I’ll remove it :slight_smile:
thanks
Ondrej

Hi Manfred,

what about the temperature sensors?
Still not working? Please let me know if it’s OK so I can merge it to master or send me the debug log so I can fix it.

Thanks.
Ondrej

Hi Ondrej

Sometimes the temperature sensors do switch between the real value and 1% of it.

Please find the entries from openhab.log and event.log when such a switch had occured:
events.log.json (545 Bytes)
openhab.log.json (75.3 KB)

I hope you can find what is going wrong.

Regards,
Manfred

Hi Manfred,

thank you very much, I think I’ve found the problem. In status response, one of your temperature sensors sends the value as a percent type, the other one as a decimal type.

{"name":"core:TemperatureState","type":1,"value":22}
{"name":"core:TemperatureState","type":2,"value":22.200000000000045}

Since the events do not bear any type

   {
      "name": "core:TemperatureState",
      "value": "22"
    }

we got mixure of percent & decimal states.
Please try this version and let me know, the state is forced to decimal for the TemperatureSensor

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

Thanks.
Ondrej

I have a Connexoon and as far as I understand from this thread many people succeeded in using the Tahoma Binding to use this in OH2.
My log-file states I can’t get a log-in cookie.

When I try to log-in via https://www.tahomalink.com/enduser-mobile-web/steer-html5-client/tahoma/ I can’t get a connection. When I log in via the Android-app it works flawless. I use a pasword-manager, so I’m pretty sure I use same credentials.
Anybody any hints?

Hi Ondrej

I couldn’t detect any percent values given by the temperature sensors with latest version. Therefore, I declare the problem as fixed.

Thanks for your support!

Regards,
Manfred

Had same problem. I logged into https://www.somfy.nl/inloggen and used those credentials in the bridge. It worked flawless. But somehow the same credentials don’t work in tahomalink.com and tahomalink site doesn’t offer a password reset option.

Hi,
have you tried https://accounts.somfy.com/login ? At least for me the credentials are the same and there is the posibility of “lost password”.
Ondrej

I can login on that site but when clicking on the Tahoma I am directed to tahomalink.com and there I have the same issue again.

One user reported problem with Tahomalink and he has solved it by changing the password. He has confirmed he was using some special characters in his password. Isn’t this your case as well?
Thanks
O.

Nope just 22 random letters and digits

It may sound stupid, but try a shorter password. Maybe someone decided Passwords are at max 15 characters long and cuts your password on the somfy.com login form but not at tahomalink.

I keep trying.

@Ondrej_Pecta, can you confirm that it is a requirement for the binding to work that I’m able to log in (manually) to https://www.tahomalink.com/enduser-mobile-web/steer-html5-client/tahoma/

He, it’s solved! I’ve been resetting my password couple of times and now it’s working.
I now have a 8 character long password.

Hi Ondrej,

I was having this issue before and now it seems to be returning - the binding seems to miss a login cookie. :neutral_face:

2018-11-10 17:42:15.834 [ERROR] [oma.handler.SomfyTahomaBridgeHandler] - Cannot get login cookie!

java.io.IOException: Server returned HTTP response code: 403 for URL: https://www.tahomalink.com/enduser-mobile-web/externalAPI/json/login

	at sun.reflect.GeneratedConstructorAccessor517.newInstance(Unknown Source) [?:?]

	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?]

	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [?:?]

	at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1944) [?:?]

	at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1939) [?:?]

	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1938) [?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1508) [?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) [?:?]

	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263) [?:?]

	at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.login(SomfyTahomaBridgeHandler.java:140) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]

	at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.updateThingState(SomfyTahomaBridgeHandler.java:435) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]

	at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.updateTahomaStates(SomfyTahomaBridgeHandler.java:424) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]

	at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.access$0(SomfyTahomaBridgeHandler.java:411) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]

	at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler$1.run(SomfyTahomaBridgeHandler.java:98) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: https://www.tahomalink.com/enduser-mobile-web/externalAPI/json/login

	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) ~[?:?]

	at sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey(HttpURLConnection.java:3053) ~[?:?]

	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderFieldKey(HttpsURLConnectionImpl.java:316) ~[?:?]

	at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.login(SomfyTahomaBridgeHandler.java:133) ~[?:?]

	... 11 more


Kurt

Hi,

the lastest version introduced again getting values by calling getState command for each thing because some users were facing problems with updating states in cases when remote controls were used.

Is there any error or exception prior to getting 403 error during getting login cookie? How many Somfy things are you having? And is this the very first login cookie getting or after some time of usage?

Thanks.
Ondrej

@Marijn_Oudijk: I had the same problem with the password. Seems PW length is max 20 characters, at least that’s the max that worked for me

Hi Ondrej,

I am operating 11 RTS rollershutters via the Tahoma Homebox.
It is after some time of usage, that the login doesn’t work anymore.

good lead - indeed the getStates Command seems to be the root cause (?).

2018-11-10 07:49:46.120 [ERROR] [oma.handler.SomfyTahomaBridgeHandler] - Cannot send getStates command!
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1002) [?:?]
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) [?:?]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) [?:?]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397) [?:?]
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) [?:?]
        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:846) [?:?]
        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678) [?:?]
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1587) [?:?]
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) [?:?]
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263) [?:?]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.sendDataToTahomaWithCookie(SomfyTahomaBridgeHandler.java:551) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.getAllStates(SomfyTahomaBridgeHandler.java:299) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.updateThingState(SomfyTahomaBridgeHandler.java:436) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.updateTahomaStates(SomfyTahomaBridgeHandler.java:424) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.access$0(SomfyTahomaBridgeHandler.java:411) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler$1.run(SomfyTahomaBridgeHandler.java:98) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.io.EOFException: SSL peer shut down incorrectly

and then resulting in the logs I posted above:

2018-11-10 07:51:12.078 [ERROR] [oma.handler.SomfyTahomaBridgeHandler] - Cannot get login cookie!
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1002) [?:?]
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) [?:?]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) [?:?]
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397) [?:?]
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) [?:?]
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) [?:?]
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334) [?:?]
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309) [?:?]
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:259) [?:?]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.login(SomfyTahomaBridgeHandler.java:127) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.updateThingState(SomfyTahomaBridgeHandler.java:435) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.updateTahomaStates(SomfyTahomaBridgeHandler.java:424) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler.access$0(SomfyTahomaBridgeHandler.java:411) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at org.openhab.binding.somfytahoma.handler.SomfyTahomaBridgeHandler$1.run(SomfyTahomaBridgeHandler.java:98) [220:org.openhab.binding.somfytahoma:2.2.0.201712031935]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.io.EOFException: SSL peer shut down incorrectly
        at sun.security.ssl.InputRecord.read(InputRecord.java:505) ~[?:?]
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) ~[?:?]
  

Kurt

It seems you are facing an exception during SSL handshake, which is not directly bound to this binding but network layer.

Try setting the bridge’s Status timeout property to higher value (3600+) so it lowers the communication frequency with Tahoma cloud. If you want, I can update the binding so the value of 0 disables sending the getStatus completely.

Thanks
Ondrej