BInding with AC Air Conditioner seems not to work (as expcted)

1,206 views
Skip to first unread message

Luigi Saetta

unread,
Jun 8, 2015, 3:29:09 AM6/8/15
to ope...@googlegroups.com
I have tried integration between OpenHAB (last versione downloaded 1.7) and Samsung AirConditioner.

It seems to me that the binding is not working as expected accordingly to the binding documentation.

OS is MAC OS Yosemite

 

I have two Samsung AC internal Unit

 

 Discovery works lmost as expected from docs:


java -cp addons/org.openhab.binding.samsungac-1.7.0.jar org.binding.openhab.samsungac.communicator.SsdpDiscovery

Got the following response from Samsung Air Conditioner: {LOCATION=http://192.168.1.119, SERVICE_NAME=ControlServer-MLib, IP=192.168.1.119, MESSAGE_TYPE=DEVICEDESCRIPTION, FIRMCODE=01538A130723, HOST=255.255.255.255:1900, NTS=ssdp:alive, CACHE_CONTROL=max-age=60, NODE_ADDRESS=BC8CCD77D2BD0000, SPEC_VER=MSpec-1.00, MODELCODE=SAMSUNG_DEVICE, NICKNAME=536D61727420412F432842433843434437374432424429, SERVER=SSDP,SAMSUNG-AC-RAC_2013, MAC_ADDR=BC8CCD77D2BD, ROOT_ADDRESS=BC8CCD77D2BD0000, GROUP_ADDRESS=BC8CCD77D2BDFFFF}

 

java -cp addons/org.openhab.binding.samsungac-1.7.0.jar org.binding.openhab.samsungac.communicator.SsdpDiscovery

Got the following response from Samsung Air Conditioner: {LOCATION=http://192.168.1.109, SERVICE_NAME=ControlServer-MLib, IP=192.168.1.109, MESSAGE_TYPE=DEVICEDESCRIPTION, FIRMCODE=01538A140403, HOST=255.255.255.255:1900, NTS=ssdp:alive, CACHE_CONTROL=max-age=60, NODE_ADDRESS=BC8CCDB1B7E40000, SPEC_VER=MSpec-2.00, MODELCODE=SAMSUNG_DEVICE, NICKNAME=536D61727420412F432842433843434442314237453429, SERVER=SSDP,SAMSUNG-AC-RAC_2013, MAC_ADDR=BC8CCDB1B7E4, ROOT_ADDRESS=BC8CCDB1B7E40000, GROUP_ADDRESS=BC8CCDB1B7E4FFFF}


but sometimes it shows null.

 

In the console log, (start_debug.sh, I see sometimes:

 

20:03:58.792 [DEBUG] [.s.internal.SamsungTvActivator:34   ] - Samsung TV binding has been started.

20:04:00.300 [DEBUG] [.s.internal.SamsungAcActivator:34   ] - Samsung AC binding has been started.

20:04:00.311 [INFO ] [.b.s.internal.SamsungAcBinding:61   ] – active

 

tail -f openhab.log |grep AirConditioner

 

show nothing. No mention regarding the TOKEN that should be requested, issued the first time

 

My openhab.cfg

 

###### MQTT

mqtt:mybroker.url=tcp://localhost:1883

mqtt:mybroker.clientId=OHAB1

 

samsungac:Livingroom.host=192.168.1.109

samsungac:Livingroom.mac=BC8CCDB1B7E4

 

samsungac:Livingroom.host=192.168.1.119

samsungac:Livingroom.mac=BC8CCD77D2BD

 

Sometimes, after starting openhab runtime I get the following stack in the console.log

 

./start_debug.sh |grep SamsungAcBinding

20:28:38.235 [INFO ] [.b.s.internal.SamsungAcBinding:61   ] - active

20:28:38.236 [INFO ] [.b.s.internal.SamsungAcBinding:187  ] - No refresh interval configured, using default: 60000 ms

20:28:38.236 [DEBUG] [.b.s.internal.SamsungAcBinding:193  ] - Configuration key is: Livingroom.host

20:28:38.237 [DEBUG] [.b.s.internal.SamsungAcBinding:193  ] - Configuration key is: Livingroom.mac

20:28:38.237 [DEBUG] [.b.s.internal.SamsungAcBinding:193  ] - Configuration key is: service.pid

20:28:38.237 [DEBUG] [.b.s.internal.SamsungAcBinding:239  ] - There is no existing Samsung AC binding configuration => refresh cycle aborted!

no libsigar-universal64-macosx.dylib in java.library.path

org.hyperic.sigar.SigarException: no libsigar-universal64-macosx.dylib in java.library.path

    at org.hyperic.sigar.Sigar.loadLibrary(Sigar.java:172)

    at org.hyperic.sigar.Sigar.<clinit>(Sigar.java:100)

    at org.openhab.binding.systeminfo.internal.SysteminfoBinding.initializeSystemMonitor(SysteminfoBinding.java:409)

    at org.openhab.binding.systeminfo.internal.SysteminfoBinding.updated(SysteminfoBinding.java:403)

    at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183)

     at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)


willing to debug, obviously when I'm at home (evening, CET)

watou

unread,
Jun 8, 2015, 3:47:12 AM6/8/15
to ope...@googlegroups.com
Hi Luigi,

I don't know anything about this specific binding, but I would think that using the key "Livingroom" for both ACs 192.168.1.109 and 192.168.1.119 would be a problem.  You would instead want to use two distinct names, like:

samsungac:Livingroom.host=192.168.1.109
samsungac
:Livingroom.mac=BC8CCDB1B7E4
samsungac
:Bedroom.host=192.168.1.119
samsungac
:Bedroom.mac=BC8CCD77D2BD

Luigi Saetta

unread,
Jun 8, 2015, 9:00:43 AM6/8/15
to ope...@googlegroups.com
Hi Watou, I totally agree, it's a mistake. I'll change today.

But I have also tried with only one binding.... only for the first address, and the behaviour doesn't change

Stein Tore Tøsse

unread,
Jun 15, 2015, 2:11:31 AM6/15/15
to ope...@googlegroups.com
Hi,

sorry about not seeing these messages earlier. 

You should not log by grepping after one specific line, I think the line about the token is about different. Try just to tail the log, without the "grep"-command. 
If you see too many log-statements then you can alter your logback.xml to add the following line:
<logger name="org.openhab.binding.samsungac" level="DEBUG" />

and start openhab as normal, then it should log less, but log all required lines for the samsung ac binding.

Try this and let me know!


/Stein

Piotr_23

unread,
Jul 7, 2015, 11:07:24 AM7/7/15
to ope...@googlegroups.com
Hi, I have the same problem: cannot get the token for Samsung Aircon:

16:57:41.485 [DEBUG] [.s.internal.SamsungAcActivator:34   ] - Samsung AC binding has been started.
16:57:41.499 [DEBUG] [i.internal.GenericItemProvider:341  ] - Start processing binding configuration of Item 'ac_current_temp (Type=NumberItem, State=Uninitialized)' with 'SamsungAcGenericBindingProvider' reader.
16:57:41.502 [INFO ] [.b.s.internal.SamsungAcBinding:61   ] - active
16:57:41.503 [INFO ] [.b.s.internal.SamsungAcBinding:187  ] - No refresh interval configured, using default: 60000 ms
16:57:41.504 [DEBUG] [.b.s.internal.SamsungAcBinding:193  ] - Configuration key is: PIOTR.host
16:57:41.504 [DEBUG] [.b.s.internal.SamsungAcBinding:193  ] - Configuration key is: PIOTR.mac
16:57:41.505 [DEBUG] [.b.s.internal.SamsungAcBinding:193  ] - Configuration key is: service.pid
16:57:41.505 [INFO ] [.service.AbstractActiveService:169  ] - Samsung Air Conditioner service has been started
16:57:41.506 [INFO ] [.b.s.internal.SamsungAcBinding:261  ] - Broken connection found for 'PIOTR', attempting to reconnect...
16:57:41.573 [DEBUG] [.b.s.internal.SamsungAcBinding:267  ] - java.lang.Exception: Cannot connect to 192.168.0.70:2878 : javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
16:57:41.574 [INFO ] [.b.s.internal.SamsungAcBinding:268  ] - Reconnect failed for 'PIOTR', will retry in 60s

I followed these instructions:

But cannot get the "NO TOKEN SET! Please switch off and on the air conditioner within 30 seconds"

Please help | P

Stein Tore Tøsse

unread,
Jul 10, 2015, 1:47:52 AM7/10/15
to ope...@googlegroups.com
Hi again,

which java-version are you running?

Could you also run openhab in debug-mode to check if there's more information output in the logs then?

/Stein

Adrian Andrei

unread,
Jul 20, 2015, 5:23:54 PM7/20/15
to ope...@googlegroups.com
Hi!
Same here:
Any help will be appreciated. :(

----------- Device discovery--------
...... SERVER=SSDP,SAMSUNG-AC-RAC_2013 .....

-----------Log Debug----------

2015-07-21 00:14:37.505 [INFO ] [.service.AbstractActiveService] - Samsung Air Conditioner service has been started

2015-07-21 00:14:37.506 [INFO ] [.b.s.internal.SamsungAcBinding] - Broken connection found for '<Living>', attempting to reconnect...

2015-07-21 00:14:37.556 [INFO ] [.service.AbstractActiveService] - NTP Refresh Service has been started

2015-07-21 00:14:37.580 [INFO ] [.service.AbstractActiveService] - HTTP Refresh Service has been started

2015-07-21 00:14:37.661 [INFO ] [runtime.busevents             ] - Date state updated to 2015-07-21T00:14:37

2015-07-21 00:14:38.016 [DEBUG] [.b.s.internal.SamsungAcBinding] - java.lang.Exception: Cannot connect to 192.168.1.177:2878 : javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

2015-07-21 00:14:38.016 [INFO ] [.b.s.internal.SamsungAcBinding] - Reconnect failed for '<Living>', will retry in 60s


---------------Config---------

# Host and port of the first AC to control

samsungac:<Living>.host=192.168.1.177

samsungac:<Living>.mac=XXXXXXXXXXXX

#samsungac:<Living>.token=


--------Java version -------

java -version

java version "1.8.0_51"

Java(TM) SE Runtime Environment (build 1.8.0_51-b16)

Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)


Also tried with java 1.6.


Thank you!

Adrian Andrei

unread,
Aug 4, 2015, 8:45:12 AM8/4/15
to openhab
Hi Stein,

Can You please help me bind my ac?

You can see my problem in my post. :(

Thank You!

Stein Tore Tøsse

unread,
Aug 4, 2015, 8:57:21 AM8/4/15
to openhab
Hi!

It seems like Samsung has changed their API/communication method for the AC's. Mine is working still, but I'm currently looking into this, as
reported as a bug on github: https://github.com/openhab/openhab/issues/2863

Does this command return an exception?

java -cp org.openhab.binding.samsungac-1.7.1.jar org.binding.openhab.samsungac.communicator.SsdpDiscovery

Adrian Andrei

unread,
Aug 4, 2015, 9:07:03 AM8/4/15
to openhab
If I am not mistaken this is the device discovery comand?
If so, the discovery process works properly. You can see in my post part of the returned info. Model, etc.

If it's not the discovery one, I'll try it when I will arrive home.

Alexandru-Constantin Nita

unread,
Aug 5, 2015, 8:21:22 AM8/5/15
to openhab

Hello,

I have the same problem and I executed the command :

$ java -cp org.openhab.binding.samsungac-1.7.1.jar org.binding.openhab.samsungac.communicator.SsdpDiscovery
java.io.IOException: Invalid argument
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:698)
at org.binding.openhab.samsungac.communicator.SsdpDiscovery.sendNotify(SsdpDiscovery.java:112)
at org.binding.openhab.samsungac.communicator.SsdpDiscovery.discover(SsdpDiscovery.java:59)
at org.binding.openhab.samsungac.communicator.SsdpDiscovery.main(SsdpDiscovery.java:46)
Got the following response from Samsung Air Conditioner: {}


Stein Tore Tøsse

unread,
Aug 10, 2015, 2:38:32 AM8/10/15
to ope...@googlegroups.com
Could you please try to discover your Air Conditioner with the attached file?
Just a test to see if it is improving.

/Regards
Stein Tore
org.openhab.binding.samsungac_1.7.0.SNAPSHOT.jar

Piotr_23

unread,
Aug 11, 2015, 4:09:12 AM8/11/15
to openhab
The response is:

piotr@piotr:~/openhab/addons$ java -cp org.openhab.binding.samsungac_1.7.0.SNAPSHOT.jar org.binding.openhab.samsungac.communicator.SsdpDiscovery
Got the following response from Samsung Air Conditioner: {}

:(

Adrian Andrei

unread,
Aug 11, 2015, 5:00:11 AM8/11/15
to openhab
Regarding the discovery problem. Just upgrade the java version. Pay special attention if you are on Mac! Because even if it will look like upgraded, it will still use the old one.
Use this info:http://superuser.com/questions/740064/how-to-install-java-1-7-runtime-on-macos-10-9-mavericks
I fixed the discovery like this, but still I'm unable to connect to it. :(

Piotr_23

unread,
Aug 11, 2015, 5:04:22 AM8/11/15
to openhab
piotr@piotr:~/openhab/addons$ java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.15.04.1)
OpenJDK Server VM (build 24.79-b02, mixed mode)

Adrian Andrei

unread,
Aug 11, 2015, 5:05:56 AM8/11/15
to openhab
After the discovery process is successfully, I receive this

Stein Tore Tøsse

unread,
Aug 16, 2015, 2:34:39 AM8/16/15
to openhab
Hi,

as I've understood, Samsung has updated the firmware of some of the air conditioners and they have changed their certificate, but I'm working on a solution to fix this.

Regards
Stein Tore

Stein Tore Tøsse

unread,
Aug 24, 2015, 1:54:57 PM8/24/15
to openhab
Hi,

I've just created a pull request to fix the SsdpDiscovery-issue and to improve the stability of the binding.
This does NOT solve the handshake-issue.
https://github.com/openhab/openhab/pull/3093

Regards
Stein

Simone Urbani

unread,
Sep 1, 2015, 2:25:33 PM9/1/15
to openhab
Hello,
i don't know if is the right way, but i try this:
i root my nexus tablet and then i go find information in the app folder and i found this:

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="Token-MAC_address">U2FsdGVkX1/V5pno6jBmmEP0TUFQUrhMkX3IQTdn0jhBXK9rLJOeK1BdfO+2J7P9uqXNgp+fn2U=</string>
</map>

i don't know if this could help, anyway it lookslike a different format!
Thanks for your help.

Simone Urbani

unread,
Sep 1, 2015, 6:04:40 PM9/1/15
to openhab
I try also with my second AC unit, and the on the file there is a new token. So could be the right way.
I try using this token: U2FsdGVkX1/V5pno6jBmmEP0TUFQUrhMkX3IQTdn0jhBXK9rLJOeK1BdfO+2J7P9uqXNgp+fn2U=

but i got this error:

00:01:15.032 [INFO ] [.b.s.internal.SamsungAcBinding:261  ] - Broken connection found for 'Cucina', attempting to reconnect...
00:01:15.805 [DEBUG] [.b.s.internal.SamsungAcBinding:267  ] - java.lang.Exception: Cannot connect to 10.1.1.246:2878 : java.net.SocketException: Software caused connection abort: recv failed
00:01:15.810 [INFO ] [.b.s.internal.SamsungAcBinding:268  ] - Reconnect failed for 'Cucina', will retry in 60s

Thanks!!!

Stein Tore Tøsse

unread,
Sep 2, 2015, 5:46:12 AM9/2/15
to openhab
Hi,

are you using the latest snapshot-version of the binding?
Please download this: https://openhab.ci.cloudbees.com/job/openHAB/lastSuccessfulBuild/artifact/distribution/target/distribution-1.8.0-SNAPSHOT-addons.zip
And replace the existing binding with this one.

Then run openHAB in debug-mode, or set the samsung-binding to debug, please post the resulting logs when openhab is trying to connect.

Thanks!

/Regards
Stein Tore
Reply all
Reply to author
Forward
0 new messages