Samsung Smart Air Conditioner - OpenHAB 2.0

Thank you @kumy :pray: :pray:
You are correct. I neglected the “i” when I copy-pasted the relevant token.py commands.
Now I fixed it, but I’m still getting an error message when I run python3 server.py .
I just realized I didn’t create the cert.pem file.
In what folder should I create that file?
And what commands should I put in it?
Maybe the error message I’m seeing when I run server.py is related to the currently missing cert.pem file?

@mjeshurun IIRC you have to extract the certificate from the apk (or use a search engine and look for ac14k_m.pem :slight_smile:)

1 Like

Thank you. I found this project which has the ac14k_m.pem file GitHub - cicciovo/homebridge-samsung-airconditioner: a script to communicate whit samsung airconditioner
However, I’m still seeing an error message when I run python Server8889.py :frowning:
Here are the error messages I’m seeing:

I’m getting this error message when I run python3 Server8889.py:

pi@raspberrypi:/tmp/homebridge-samsung-airconditioner-master $ python3 Server8889.py
Traceback (most recent call last):
  File "Server8889.py", line 1, in <module>
    from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
ModuleNotFoundError: No module named 'BaseHTTPServer'

I get this error message when I run python Server8889.py

pi@raspberrypi:/tmp/homebridge-samsung-airconditioner-master $ python Server8889.py
Listening on localhost:8889
Traceback (most recent call last):
  File "Server8889.py", line 53, in <module>
    main()
  File "Server8889.py", line 47, in main
    server.socket = ssl.wrap_socket(server.socket, certfile='/usr/local/lib/node_modules/homebridge-samsung-airconditioner/ac14k_m.pem', server_side=True)
  File "/usr/lib/python2.7/ssl.py", line 931, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 542, in __init__
    self._context.load_cert_chain(certfile, keyfile)
IOError: [Errno 2] No such file or directory

Is there a chance you could help me solve this problem?

@mjeshurun For you error with python3, you are missing a module. Try pip3 install AdvancedHTTPServer. However I’m not sure if this is really this package or not https://pypi.org/project/AdvancedHTTPServer/

For your python2 error, it’s quite self explanatory, the file /usr/local/lib/node_modules/homebridge-samsung-airconditioner/ac14k_m.pem seems missing :slight_smile:

Hi @jag

I want to report a possibly buggy behavior:

My AC looses the wifi connection from time to time, when it happens the thing in openhab goes into a CONFIGURATION ERROR state. Once the AC comes back online the thing remains in that state, the only way for me to get it working again is to disable and re-enable the thing.

Does it happen to me alone? Do you think it’s fixable?

ps. do you plan to upgrade the binding to OH 3 ?

Hi there, I have reverse engineered the communication protocol between my AC and the WIFI module. This may open us to build some custom wifi module based on cheep and open source hardware but also to add missing features like MQTT, a web interface, wifi configuration, RestAPI…

I’ve started a project with my findings, are there some people interested in such project?

Hi Kumi,
Thank you for your engagement!
Just a trivial question, why focusing on a new hardware/firmware and not contributing to the binding to help on stability, improve the initial configuration steps and new devices?!

Hi @alexxio: here are some of my reasons:

  • it was really fun and challenging!
  • I learned a lot
  • open source matter a lot for me
  • generally I don’t like connected proprietary devices (black boxes)
  • The initial wifi configuration was a real pain (I don’t have a device with Google Play to install the really old app just to configure wifi settings)
  • There is a lot of people asking how to connect to the device, SSL certificates, token retrieval, it’s not that easy…
  • The module didn’t accepted my wifi password (it was too long and truncated without notice ; I had to reconfigure all my network and devices just for this f*** device)
  • the device is missing functionalities, a web interface, MQTT support etc…
  • No unattended upgrade from third parties
  • I think with access to the firmware, things may be quite simple for integration with other systems
  • Provide a cheap alternative for people don’t willing to invest more than $100 for such module

There can be many more but those are the most important one for me :slight_smile:

That sounds cool.

I’m interested in working on replacing wifi module in the newest ones (e.g. windfree AR12NXCXAWKN ) because currently they only allow to steer unit via smartthings cloud, meaning giving full access to the devices, which is a no go for any sane person :wink:

If this is a case (can you comment on this?), then I’m definitely interested and I’m willing to help (have few available ESPs laying around and some skills).

@rdslw great! I’ve created an issue for your model, please continue there to not pollute this thread :wink:

Hi, I have a Samsung VRF AC (2019 line) and I’m considering buying a WIFI adapter -
https://www.samsunghvac.com/Controls-NASA-Wi-Fi-2/mim-h04un-wi-fi-adapter

I know that there are alternatives like CoolAutomation, Intesis, and Samsung’s own DMS 2.5, but this one seems to be much cheaper. It requires a SmartThings control android app.

I have followed this thread and haven’t figure out if this module is already supported by any OH binding. Can you help?
Any alternatives would also be appreciated.

Thanks!

Going the Intesis way, you will find a binding ready to use with local control, no cloud needed.

Yeah…
Intesis is really expensive though (INMBSSAM008O000 for 8 indoor units - 1150 USD + tax). I have to find something cheaper. But didn’t try to derail this thread.

I found this project that aims to control the HVAC without any additional module. I have to try this.

He all, i got a Samsung windfree AC and thought about connecting it to OH3. Is there any progress on an OH3 binding?

Binding for OH3, 3.0.0 only Download 3.0.0
Binding for OH3 3.0.1 only Download 3.0.0

Leave the downloaded fil in /usr/share/openhab/addons/, and you should be good to go.
There is one problem, every time OH3 is booted, the downloaded file has to be “update”, fro OH3 to pick up the binding.

touch /usr/share/openhab/addons/org.openhab.binding.samsungdigitalinverter-3.0.1.kar

Should do the trick.

Thanks Jan!
Assume we need to follow the same instructions regarding certs etc. you have outlined on your git and mjeshurun outlined here?

Hi Jan,
I got the binding imported successful in OH3.0.1 but I am a bit stuck with getting the token.
What I did so far:

  1. Created (and formatted) the server.py and token.py inside /usr/share/openhab/addons
  2. Pulled the ac14k_.pem from here and renamed it to cert.pem
  3. Moved cert.pem to /etc/openhab/services
  4. I then executed `sudo python3 server.py’ whereas see following errors/output:
Error code

Traceback (most recent call last):
File “server.py”, line 1, in
from http.server import HTTPServer, BaseHTTPRequestHandler
File “/usr/lib/python3.7/http/server.py”, line 100, in
import shutil
File “/usr/lib/python3.7/shutil.py”, line 22, in
import bz2
File “/usr/lib/python3.7/bz2.py”, line 17, in
from threading import RLock
File “/usr/lib/python3.7/threading.py”, line 8, in
from traceback import format_exc as _format_exc
File “/usr/lib/python3.7/traceback.py”, line 5, in
import linecache
File “/usr/lib/python3.7/linecache.py”, line 11, in
import tokenize
File “/usr/lib/python3.7/tokenize.py”, line 35, in
from token import *
File “/usr/share/openhab/addons/token.py”, line 1, in
import requests
File “/usr/lib/python3/dist-packages/requests/init.py”, line 43, in
import urllib3
File “/usr/lib/python3/dist-packages/urllib3/init.py”, line 8, in
from .connectionpool import (
File “/usr/lib/python3/dist-packages/urllib3/connectionpool.py”, line 3, in
import logging
File “/usr/lib/python3.7/logging/init.py”, line 210, in
_lock = threading.RLock()
AttributeError: module ‘threading’ has no attribute ‘RLock’

I am a bit stuck :roll_eyes:

1 Like

I’m having the same issue. Hoping someone can help us :pray:

Try renaming your server.py, to something else, like sd_server.py. I think there is a conflicting module in python, named server.py

1 Like