Samsung AC


#1

I would like to see Samsung AC integrated into HA, I can see some work was done on it but looks like it has been disabled. Can we please get this implemented or a way to manually enable the feature if it already exists ?


Samsung AC Support, help needed
#2

I reviewed github.com code that disabled Samsung AC and undid all the changes. The result was that half of my previously discovered devices stopped being discovered and neither did it successfully find my Samsung AirCon.

I think the net result from my test suggests that the previous Samsung AC changes never worked anyway. So I changed code back to disable the Samsung AirCon. I’m using Hassbian on a raspberry pi 3.

I do wish it’d work too. If you’d like to try also look here https://github.com/home-assistant/netdisco/pull/67/files and restore all the code changes in RED and give it a go.


#3

I gave up trying to get this working. I’ve worked around it by buying a Broadlink RM mini 3 (very cheap ir blaster) and placed it near the AC.

I can now send the relevant IR signals via HASS to turn on and off the AC.


#4

I’ve never gone past the first discovery, there is a key that can be extracted from android app, but I’ve never been able to estabilish a connection.
I’m still interested in getting it to work without relaying on an IR blaster, maybe I’ll give it a second try


#5

Keep us posted if you succeed. Thanks


#6

Sure, first stop is SSL
the units use SSLv3 cyphers which are right now deprecated in openssl, so if I try to interrogate it using curl I get back

3069289680:error:14082174:SSL routines:SSL3_CHECK_CERT_AND_ALGORITHM:dh key too small:s3_clnt.c:3435:


#7

Ok most of my informations come from here:


I don’t know the status of the home-assistant component, so I start from the basic.

The first problem is that the AC uses a weak DH key, so in order to communicate we need to use the correct cipher, after some trial I’ve been able to ko past the dh key too small error with those:
-cipher 'HIGH:!DH:!aNULL'

so for curl:
curl -k --cert cert.pem https://192.168.1.166:2878 --ciphers 'HIGH:!DH:!aNULL'
and openssl:
openssl s_client -connect 192.168.1.166:2878 -cert cert.pem -cipher 'HIGH:!DH:!aNULL'

after I got an xml response now I have to understand how to request the token to authenticate


#8

another little progress, by using the ruby code I found here:


made by some people hacking on samsung ACs

I’ve been able to see token exchange, still got a lot of errors, but at least I’ve been able to communicate with the AC
The only modification needed is to add this line of code:
context.ciphers = 'HIGH:!DH:!aNULL'
in lib/samsung.rb, after:
context = OpenSSL::SSL::SSLContext.new

to force ruby to not expose DH key exchange methods, which are deprecated in modern SSL libraries

now the next task is to port all of this to python, and see how to integrate with home-assistant, I have to see if there is still some code that is already in place

EDIT
Today I retried using openssl s_client command, and instead of immediately close the session this time I can send commands, so using:

openssl s_client -connect 192.168.1.202:2878 -cipher 'HIGH:!DH:!aNULL'
(differently from what stated in the openhab link the app certificate is not needed)
and pasting

after
DRC-1.00
<?xml version="1.0" encoding="utf-8" ?><Update Type="InvalidateAccount"/>

I get the token back

`<?xml version="1.0" encoding="utf-8" ?><Response Type="GetToken" Status="Ready"/>`
`<?xml version="1.0" encoding="utf-8" ?><Update Type="GetToken" Status="Completed" Token="33965903-XXXX-XXXX-XXXX-373832354144"/>`

and sending the request with token:
<Request Type="AuthToken"><User Token="33965903-XXXX-XXXX-XXXX-373832354144" /></Request>
I can authenticate
<?xml version="1.0" encoding="utf-8" ?><Response Type="AuthToken" Status="Okay" StartFrom="2017-05-15/15:10:39"/>

and check for status or turn on the AC
<Request Type="DeviceState" DUID="XXXXXXXXXXXX"></Request>

Here there is a node version of the connection code:


The best thing is that there are defined command names.
So here is my checklist:

  • Port the basic auth and send command code to python (this should be fairly easy to do)

  • Implement this as a hass component (this is a little bit harder)

  • Code the autodiscovery part (this is supported from the unit, but for me it’s already difficult code the component part)


#9

Any updates on this ?


#10

Hi, How’s it going.

I’m the guy that originally broke the reliance on samsung servers back in 2014 with Daniel O’Connor, and I’ve been pretty quiet on that front ever since (I’ve simply been content to ssh into my server and run the 3 commands I need against my AC)

But now I’m back, I’ve discovered Hass (and am using it, in fact about half way though the house rewire), and MQTT.

I’m not the greatest fan of Python any more, but I’m thinking about making a MQTT bridge to cover the basic functions like on, off, mode, temperature select.

Depending on how I go, I might make a direct connector for HASS (would probably still require an external daemon)

Would anyone be interested in such a diversion?

I should add, that initially I will only be coding up support for my units, but that in theory should give us quite a bit of compatibility, as far as I know the protocol hasn’t changed much tho the handshake might have.


Samsung AC Support, help needed
#11

Hi Freman. I have a Samsung F-AR24FSSSBWK1 wi-fi AC (uses https://www.samsungsmartappliance.com).

I am interested to try your solution!


#12

id be very keen @Freman


#13

Hi,
I have my key, how can I control the air conditioner?

Thanks