Samsung AC

PR opened. There’s some weirdness, which I think has to do with the heatpump and/or the Wi-Fi kit controller itself - In Heat and Cool modes, you can set the temperature, but when in Auto mode, the temperature set is rejected and set to -1000. I checked using curl and there the command is also rejected, so I think this is some hardware peculiarity.

Also, the min and max temperatures are different for the different modes:

  1. In cooling temperature range is 16 to 25
  2. In heating the range is 25 to 55

I guess these ranges can’t be set dynamically, although they can be retrieved from the controller itself, as it returns them in the Get /device/DEVICE_ID/temperatures/DEVICE_ID array.

-1000 means that value returned by device is not a number - it is in my code. I’ve added this for debugging to know that returned value was wrong. I can pass value returned by device but then, in such case, template responsible for value conversion will throw an exception :wink:

If those values are returned by device then it should just work, values should be read from device.
If those values are defined by you in configuration file, you can specify more complex template (in template, check current mode and return correct value)

I noticed this. But the device itself is returning the -1000! For whatever reason the returned JSON temperatures are -500 or -1000 in particular cases. They must be communicating some special meaning

Indeed they do out of the box, since the device reports them (except for auto mode)!

I switched to master branch. I believe it is a good time for that. I’ve started a thread in “Share you projects” category. I think we can continue discussion on new thread. What do you think?

Hello. I’m tryng to get the AC TOKEN and is getting the same error. In your next messages you reply it works… What did you made?! I cant find the "settings"to include the https. Can you help me please?! Thks

So to get the “access token” follow these steps:
1- Download files from here: FILES and put them in a easy accessible folder from terminal.
2- Open the file “actest.py” with a editor and change the SAMSUNG.IP to your AC ip adress and save the file.
3- Power off your AC Device. IMPORTANT STEP!
4- Open a terminal and navigate to the folder where you have the (previously downloaded) files.
5- Execute: python3 server.py keep this terminal open.
6- Open another terminal and navigate to the same folder as in step 4.
7- Execute: python3 actest.py in this second terminal.
8- Go to your first terminal and check the output there you should have something like: “DeviceToken”:“XXXXXXXXXX” where the “XXXXXXX” is your token.
9- Save your token somewhere save, like a text file (for later). Now you can close both terminals.

What happend to me was that my Samsung AC changed ip adress after step 3.
So I had to set it as static ip on my router.

1 Like

Yes… i tried all this, I can start the server, but i got the error, the same error you wrote, when i run the actest.py

The issue I had was the ip adress (i had wrong one in step 2).
The log says that it couldn´t connect to the ip and port.
Check your settings from step 2 and don´t forget step 3.

@rodrigowa Which port does you ac use. 2878 or 8888?

Hello @joelFORCE the port is 8888.

@rodrigowa arh righto. Thought I could help if yours used 2878.

Hi @joelFORCE

I have a problem retrieving the token. I tried acdc from @massive but it says:

pi@raspberry:~/Downloads/token/lib $ node cli token
coonnecting to: 192.168.1.30
coonnecting to: 192.168.1.28
coonnecting to: 192.168.1.29
Error: 4113765760:error:14082174:SSL routines:ssl3_check_cert_and_algorithm:dh key too small:s3_clnt.c:3641:

login error: 4113765760:error:14082174:SSL routines:ssl3_check_cert_and_algorithm:dh key too small:s3_clnt.c:3641:

Error: 4113765760:error:14082174:SSL routines:ssl3_check_cert_and_algorithm:dh key too small:s3_clnt.c:3641:

login error: 4113765760:error:14082174:SSL routines:ssl3_check_cert_and_algorithm:dh key too small:s3_clnt.c:3641:

Error: 4113765760:error:14082174:SSL routines:ssl3_check_cert_and_algorithm:dh key too small:s3_clnt.c:3641:

login error: 4113765760:error:14082174:SSL routines:ssl3_check_cert_and_algorithm:dh key too small:s3_clnt.c:3641:

I tried before with 8888 but no response, so it is confirmed it is an old version of Samsung AC (AR07HSFNBWKN)

UPDATE: the install of acdc @massive is showing this:

npm install

[email protected] install /home/pi/Downloads/token/node_modules/node-expat
node-gyp rebuild

make: se entra en el directorio ‘/home/pi/Downloads/token/node_modules/node-expat/build’
CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlparse.o
…/deps/libexpat/lib/xmlparse.c: In function ‘gather_time_entropy’:
…/deps/libexpat/lib/xmlparse.c:780:7: warning: variable ‘gettimeofday_res’ set but not used [-Wunused-but-set-variable]
int gettimeofday_res;
^~~~~~~~~~~~~~~~
CC(target) Release/obj.target/expat/deps/libexpat/lib/xmltok.o
CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlrole.o
AR(target) Release/obj.target/deps/libexpat/libexpat.a
COPY Release/libexpat.a
CXX(target) Release/obj.target/node_expat/node-expat.o
SOLINK_MODULE(target) Release/obj.target/node_expat.node
COPY Release/node_expat.node
make: se sale del directorio ‘/home/pi/Downloads/token/node_modules/node-expat/build’
npm WARN [email protected] No repository field.

added 74 packages from 82 contributors and audited 88 packages in 7.153s
found 0 vulnerabilities

@Patrul If your aircon uses 2878 port use this method to get token
https://www.npmjs.com/package/homebridge-plugin-samsung-air-conditioner

1 Like

Excelent!
Working. Great job

Exactly the same problem.
I have two 2018 windfree AR07NXWXCWKNEU.
They appear as “wisol” on the network.
I can’t telnet port 8888.
actest.py can’t connect to host.
did you find any explanation/solution?

I’ve ended up using HA SmartThings instead, which works pretty well for me, and it was all almost zero setup.
Even though that it needs to travel out into the internet through Samsung cloud to connect back to the AC on the local network :man_facepalming:

Ah ok… what makes me mad is that I can’t understand why our units look different from others, why I found only you with same problem as me.
Can you please tell me what do you ACs look like on the network? Are they shown as samsung? Or maybe “wisol” as mine?
I tried to look everywhere for port or API information, but I can’t find anything.

Hi.
Since I can’t find anybody but you having the same problem as me, and so no help, I chose to try Smartthings HA integration.
It works, I can control the unit, but sensors (and on/off state) never get updated.
Can you please share your config?

I am sorry, it is not working with the new version of HA, where climate component has been totally redefined

@lucac81 I havesame problem how I can solve?