Samsung Smart Air Conditioner - OpenHAB 2.0

Hi and Merry Christmas to you all,

I have the exact same problem as @vaillan (Jun 11), I can successfully connect to the AC but I cannot get a token because even via openSSL directly the console always blurts out “400 Bad Request” coded with HTML tags.

Is there any news regarding this binding? This is extremely frustrating for me because I have an older AC working flawlessly and I am struggling with the newer one…

Thank you in advance!

Hi,

i had a Problem with the Right cert.pem file.
Here is mine - whitch works:

Bag Attributes
    friendlyName: ac14k_m
    localKeyID: 54 69 6D 65 20 31 34 35 35 34 39 32 33 35 32 36 39 36
Key Attributes: <No Attributes>
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDeXvhcsqRFWfQt
Qr2TGW+ePJzrKQVNOZmCGFXrBmOKa2gcZvXqDe71upkCmbXxDZbsqU1nFox6WtKy
za+JE1EaWIjVFV/D0hnnF+CA56851rFjAx7YYVtd9TwJYV1lSfJaQBU/ecUys0SX
lKZJtjIoJ/PyLREE79TjOqTxXMXnDpiAt3oiwApZMweJ5z2QViqtRepkI33GDgYc
LzamIengSG6WZkEUr2roY0il4aVXf3IRVRX+5cJ2L5462kFPKm/UnrXrSsrLwbF9
ltSlNA8FgpHN3d9ZyqB3MB46oGYyxYYU7a+/R3RAx0joNfVPFe8riQXQcoNEgalb
c8f7N4HPAgMBAAECggEABL80QA5UMWLNMpYlI9m8Jz2V//MdONvM6hkI5H57a34F
d+2+vCNWAYrdL1AGsUGgAidPDq9NimMb8lMvtxZhedV//kR5id2XTfaVhUrs06hA
myN66hWR9LyCbpTUgJAGi2Soz3US/5USFsZGknZANdk8fOP3ZAqWmc8rrDdVxivg
Z3qjiqgIZg24XsZmnK/QJejP4FLMqm6YUouH//u9xSKvTwkg89qxvygW9xNBNfi/
LrBHip/k8LnynKRE2odQWt74HcTjbZW4rxXrJ0tqDSIh8bUB23mRjFh1k4aKXnz3
Y/CDsfxvAutVi85/zyxYaIT6daP+PxvywwgjVhYHIQKBgQDyMxmGdi5kk3ePv0lM
lC28gVNhgKfhsXL8xIzcd/UM3eEK4baA+AKI9p6ifZ8g90NUJGuHxCp8/9yOKcmk
tY5toE45nH4fH9Z3j9NtWHMhXJDGWV+DjeiWmshbUqd7/OoIl1vig1npQqX+PXJR
pwDHnjkQbkyum4k8/IruHx813wKBgQDrCqK0rBkMaarr5eyOJ9BxhCej8i5kCzm7
XSaNgXtpBIQ4Y4r412M2JWaSLnDxlAc0iUhNGnIn4zkEP2HzX5JU4Yto9YAlRZnu
NQSvuVgyLiBCbS7WrRAlsNpTeCU3m+c5QNXBzBlHCiTdw3WS4bINOftsB3xnlJ+D
y/0YZozSEQKBgQCgWV5z3Dh40/0bSVyA+7WQENsgOWpsjOwBFyvfJvgxLZC5gJgw
qIIdJZH/KEY7MBj+UyJx/1jV6xudb2MVzjHeuHwxvj7t4kk+XRVwVlfa5YrgFvma
glBTrWQquf0ypE5Zo8PsomPbgAmf2hSepH9qqYFENJJGI6lnnBdq8WXbZwKBgQCR
p3ye5At9wrnWCB0pFwk4X4JFOd5/xukW8CnlBTmaId9iJmXHwYpM0q6Wpkr9mhNA
/lYc2eemSkxaEoE71Z0UFtVSzNiFwHUcxiRKVVyPdEAvigO9q2/XO5qAoXLG3ElV
FJWizD1Z5bJk7yycQlsZkTX6g0UX12VmwnHsvhhEUQKBgF0AVToAk+/OPxlA3N4A
Xn624Ktxzy/58NSLUfQ57AtL2zivoJzfmhUwgYkPsp+63Wklpcq7X7Q2NB7WscC4
rICqHxNow/KSzwuR6L3u/kewvlsrgTIM2Pp//+QdTK9GGU3HHAZKaNiB8m20k1Bs
NTANFxBk7alY0G7ZUhuzWkg6
-----END PRIVATE KEY-----
Bag Attributes
    friendlyName: ac14k_m
    localKeyID: 54 69 6D 65 20 31 34 35 35 34 39 32 33 35 32 36 39 36
subject=/C=KR/O=Samsung Electronics/CN=AC14K_M/emailAddress=AC14K_M@samsung.com
issuer=/C=KR/O=Samsung Electronics/CN=RemoteAccessCA(CE)
-----BEGIN CERTIFICATE-----
MIIDmzCCAoOgAwIBAgIBCTANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQGEwJLUjEc
MBoGA1UECgwTU2Ftc3VuZyBFbGVjdHJvbmljczEbMBkGA1UEAwwSUmVtb3RlQWNj
ZXNzQ0EoQ0UpMCIYDzE5NjAwMTAxMDAwMDAwWhgPMjA2MDAxMDEwMDAwMDBaMGEx
CzAJBgNVBAYTAktSMRwwGgYDVQQKExNTYW1zdW5nIEVsZWN0cm9uaWNzMRAwDgYD
VQQDFAdBQzE0S19NMSIwIAYJKoZIhvcNAQkBFhNBQzE0S19NQHNhbXN1bmcuY29t
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3l74XLKkRVn0LUK9kxlv
njyc6ykFTTmZghhV6wZjimtoHGb16g3u9bqZApm18Q2W7KlNZxaMelrSss2viRNR
GliI1RVfw9IZ5xfggOevOdaxYwMe2GFbXfU8CWFdZUnyWkAVP3nFMrNEl5SmSbYy
KCfz8i0RBO/U4zqk8VzF5w6YgLd6IsAKWTMHiec9kFYqrUXqZCN9xg4GHC82piHp
4EhulmZBFK9q6GNIpeGlV39yEVUV/uXCdi+eOtpBTypv1J6160rKy8GxfZbUpTQP
BYKRzd3fWcqgdzAeOqBmMsWGFO2vv0d0QMdI6DX1TxXvK4kF0HKDRIGpW3PH+zeB
zwIDAQABo3MwcTAdBgNVHQ4EFgQUXzEjosLzA6xbR1KAqnmAp3BNM6MwHwYDVR0j
BBgwFoAU/12TkC/BOF7xDaZZWJ+DGN6nMxcwDAYDVR0TBAUwAwEB/zAhBgNVHREE
GjAYggtzYW1zdW5nLmNvbYIJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4IBAQBW
0mStlbdvrHqDJ+KOKVf0C/y9FKTODqo/6/wJNZeZ+8ezPza4nFq70MwQYTpSbZhz
5w8bQP9fwSAoa2Vki8ZwcSd85Vi2tHz9O4C7d7zBA3FU8AL3NoEMFv6OGWGPnTY5
mG/Hn+LxuwQddlysfbRDds1LBY8DBUJNAmIeeWqA5Eg8DW6xJUwHeXUElJpSXHW6
XGvpWgAhXqoIf6TirdCrPY6+IzV/FcuVtBDGi+JoxgrMfMLgLEVjeSY96DJinHgZ
RT0FkA5e06Z+fqHh9Btu+aed+kuGSmya/A5wStOkGeKEbezbbN2gtW07lN6VxX3J
OCgygA+hmnBVnRDA8Jzu
-----END CERTIFICATE-----
Bag Attributes
    friendlyName: CN=RemoteAccessCA(CE),O=Samsung Electronics,C=KR
subject=/C=KR/O=Samsung Electronics/CN=RemoteAccessCA(CE)
issuer=/C=KR/O=Samsung Electronics/CN=CECA
-----BEGIN CERTIFICATE-----
MIIDUTCCAjmgAwIBAgIBADANBgkqhkiG9w0BAQUFADA6MQswCQYDVQQGEwJLUjEc
MBoGA1UECgwTU2Ftc3VuZyBFbGVjdHJvbmljczENMAsGA1UEAwwEQ0VDQTAiGA8x
OTYwMDEwMTAwMDAwMFoYDzIwNjAwMTAxMDAwMDAwWjBIMQswCQYDVQQGEwJLUjEc
MBoGA1UECgwTU2Ftc3VuZyBFbGVjdHJvbmljczEbMBkGA1UEAwwSUmVtb3RlQWNj
ZXNzQ0EoQ0UpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtatz9GvV
qbV395Whnad9MC9TEOiXuwnw37QHvQUwOTFgc6AenX5SORfb4UTw+0ApFNba9DlY
Xx/K9E5b5DGasDVGGTn+z+6MPB7GuAjkP+WSRwHMjrHRNqrBOr1YJUw3SIbMkRoT
460k9AD9DQDBORRtGBGwcBw6BvdasA+/L3Q63aJ7pDoj3qxocdcgk/zFq0OrxFDL
PMTL7a+a9DS8G10K73XGgES0RBwwhlXXVuLUprD6RgbeLHFsPpIq5vzzEpAYMCF6
vkZKjDGEW7JVTgUu0E37niN3NQv1gIXlJusDH6RWfFQxENZsdFkT/l+kTuY283Ga
2Ei1HsW3Xpt88QIDAQABo1AwTjAdBgNVHQ4EFgQU/12TkC/BOF7xDaZZWJ+DGN6n
MxcwHwYDVR0jBBgwFoAURwF9jkihypJa2u6zRwKrZwRlACswDAYDVR0TBAUwAwEB
/zANBgkqhkiG9w0BAQUFAAOCAQEAZkjxN4O92e1RTaXx1mpazyT98sJVl46R51s1
CTPq35HVfTiBOAu0C5MR6a9vIIFJScy5h69VN4OwDDbMhe/k3m6EfAutlL7lRrre
OT853HJahxdavzaXJ7tcrI/yDJI0X5GbQ8W74mmDt2/5rXsaB+h+NrToGqf6Hvf/
m7ZhUnCAt0hhLmltxTVYS25s9KoiIH0rXOb9cqUFsmBMEG2pHWC5AiSc0cXJm+kU
3z0B2GS+4IjGdVr3FTPzzTXrpqq/X1cIVKAum5WfsFMS0CRvqTVNVwYg52n69T2B
NPCCEpp9rsIieZ58jsnc506Uc+1Vp+NmBI2A/ecypZxSb6v9gg==
-----END CERTIFICATE-----
Bag Attributes
    friendlyName: CN=CECA,O=Samsung Electronics,C=KR
subject=/C=KR/O=Samsung Electronics/CN=CECA
issuer=/C=KR/O=Samsung Electronics/CN=ROOTCA
-----BEGIN CERTIFICATE-----
MIIDRTCCAi2gAwIBAgIBBDANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGEwJLUjEc
MBoGA1UECgwTU2Ftc3VuZyBFbGVjdHJvbmljczEPMA0GA1UEAwwGUk9PVENBMCIY
DzE5NjAwMTAxMDAwMDAwWhgPMjA2MDAxMDEwMDAwMDBaMDoxCzAJBgNVBAYTAktS
MRwwGgYDVQQKDBNTYW1zdW5nIEVsZWN0cm9uaWNzMQ0wCwYDVQQDDARDRUNBMIIB
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtv1WJJ7tTs/aa1ZZRjMPPLeb
n/Ev0Y28CSBj/6P031/veZSg/2z65QZUvPjv8MZnIgNoMpxMGbPPO4Dxj+QJthBk
WydWRPguPyE+w3U4SdayZXWpLZTpKfHco3CklFwEqZtG/wTxHD1oOvtT0e2g5c79
hNQt9lQ4Wwzqa3MvQd0JyeB4syy2zRLo5NjJZl1BVn2oTt4xGCjjtAXtAqqHEbEf
pcvB3hPdIpFe6M8zuN22kROKaQ5i4XP4CyEpbFlgKRcWBGQFX3I5f5TdD3Yw1Ril
OLLL9wFsJ+iWLka9tAIcJKCNOf48p7aXm6COFwmjtCNu4wjQozwi6cycKUgxNQID
AQABo1AwTjAdBgNVHQ4EFgQURwF9jkihypJa2u6zRwKrZwRlACswHwYDVR0jBBgw
FoAU7andrmFFrxYM8+93lrn/Fq47sXMwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B
AQUFAAOCAQEATexseQBXSfUR7fFTFxq6aAvHWIN+h3QLeN1sq8KCM4fbdkH3lOUP
rKW3w1ag62bnJVNjT4xPtzH/DyrqlzQUPTb7S0PfIXt2mu/VURnrmuXidS2grNwv
eu10gURZaz9N2UZEhY7E80tUZwcjAV+YP8+x3/iRQSrWvcMma/r01eUnwrF4xaE9
EYtJ/jTRre8MpEH/lg06m+rZf9Lk/yhG6at0YnUAIytThqFV4Cj8T8jBX+KG8BCo
VyUsFyrO+D6X98gMdTZnLqC1P1iWuxyrOWZTgsf44f5GXzmLqe5KLPvkDb4MywTa
nXrSOPSkcIgvS6WYw2Rii+e6lfVzqmhAmg==
-----END CERTIFICATE-----
Bag Attributes
    friendlyName: CN=ROOTCA,O=Samsung Electronics,C=KR
subject=/C=KR/O=Samsung Electronics/CN=ROOTCA
issuer=/C=KR/O=Samsung Electronics/CN=ROOTCA
-----BEGIN CERTIFICATE-----
MIIDRzCCAi+gAwIBAgIBADANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGEwJLUjEc
MBoGA1UECgwTU2Ftc3VuZyBFbGVjdHJvbmljczEPMA0GA1UEAwwGUk9PVENBMCIY
DzE5NjAwMTAxMDAwMDAwWhgPMjA2MDAxMDEwMDAwMDBaMDwxCzAJBgNVBAYTAktS
MRwwGgYDVQQKDBNTYW1zdW5nIEVsZWN0cm9uaWNzMQ8wDQYDVQQDDAZST09UQ0Ew
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCd67g2hzhbIeSBoFfeqbXi
tzbO4dCWeCigVfmwEDhR1SDA0MfHOVlFpvuFr3WyFPvQZ0ccNrsTpBs5YieI/jZi
FYWO0ktbqQorL1CIFqBL9kAF+34BYtpl98PgJ1grLOH5T3GugJA7Irw0plEFmOfs
IydlUIQHl3oqyMIWPa2nIZ/FGi3hAquEPrvzHZB+QO4c+6tV1WLIaCjn88xkYuwz
uGYxaqJpnGdqhjZRIuHb2DEZPlP1VGdTTAttno36CyWqeHrSC8fXCSu55Zk+1rbC
Py/phOJjSyce2qk0IebETAYLCLqU7ABJxUxrolMrP37OB+Kqe4RWovaeMcdcNOOt
AgMBAAGjUDBOMB0GA1UdDgQWBBTtqd2uYUWvFgzz73eWuf8WrjuxczAfBgNVHSME
GDAWgBTtqd2uYUWvFgzz73eWuf8WrjuxczAMBgNVHRMEBTADAQH/MA0GCSqGSIb3
DQEBBQUAA4IBAQBkwK95x8JCAnY0F2bMwG5+7QfY+ci8s8m1ODi3v19HECS6nG9j
SXgwihEtQ3HqvUler+n7aOeAZlgm+BymM2GvuicveYN/nevIvzlpMOn2L6xU19/H
zM2eoDVfS49+i/cwoi/A7fcZmIYggZho2UJR/GvKc79g6EAhT7/i5alBZF0enMsA
9okzakb/aohQE9SzsEHnhVKpGAjvu0/TJK9WwX6mkiIEJY+mzQMWgEeQt6WWIgAb
gSX9NueH80tpZ9KqFnqnOoLxTAa7k0RPBRwyUO9CDhSnlWIEcsD9sqR2M+niOFnT
KBHcLDDiEU3llprD8FRV3unYrl0F0B2GGdRk
-----END CERTIFICATE-----

Here is my python:

from http.server import HTTPServer, BaseHTTPRequestHandler
import ssl

class RequestHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        request_path = self.path

        print("\n----- Request Start ----->\n")
        print("Request path:", request_path)
        print("Request headers:", self.headers)
        print("<----- Request End -----\n")

        self.send_response(200)
        self.send_header("Set-Cookie", "foo=bar")
        self.end_headers()

    def do_POST(self):
        request_path = self.path

        print("\n----- Request Start ----->\n")
        print("Request path:", request_path)

        request_headers = self.headers
        content_length = request_headers.get('Content-Length')
        length = int(content_length) if content_length else 0
        #body = self.body

        print("Content Length:", length)
        print("Request headers:", request_headers)
        print("Request payload:", self.rfile.read(28))
        print("Body:", self)
        print("<----- Request End -----\n")

        self.send_response(200)
        self.end_headers()

    do_PUT = do_POST
    do_DELETE = do_GET

def main():
    port = 8889
    print('Listening on localhost:%s' % port)
    server = HTTPServer(('', port), RequestHandler)
    server.socket = ssl.wrap_socket(server.socket, certfile='/etc/openhab2/services/cert.pem', server_side=True)
    server.serve_forever()

if __name__ == "__main__":
    main()

you have to put the cert.pem to the Folder: /etc/openhab2/services/cert.pem

And here my acttest file:

import requests
s = requests.Session()
headers = {'content-type': 'text/xml'}
resp = s.post("https://AC IP:8888/devicetoken/request", data={"DeviceToken":"xxxxxxxxxxx"}, headers=headers, stream=True, verify=False, cert='/etc/openhab2/services/cert.pem')

then you have to do theses steps:

  1. Connect the ac with Samsung smart App to your WLAN
  2. Create a cert.pem
  3. start the python Server
  4. start the act script
  5. Turn on the ac

hope you get the token now.

best regards
vaillan

for all of you who have the new windfree AC:

i am using two more Options in my script - you have to put them under modes:

windfree|Windfree|WINDFREE)
        if [ $arg2 = "1" ] ; then
        curl -s -X PUT -d '{"options": ["Comode_2Step"]}' -k -H "Content-Type: application/json" -H "Authorization: Bearer Your Token" --cert /etc/openhab2/services/cert.pem --insecure https://AC IP:8888/devices/0/mode
        fi
		if [ $arg2 = "2" ] ; then
        curl -s -X PUT -d '{"options": ["Comode_Nano"]}' -k -H "Content-Type: application/json" -H "Authorization: Bearer your Token" --cert /etc/openhab2/services/cert.pem --insecure https://AC IP:8888/devices/0/mode
        fi

2_Step means logically the 2_step mode
Comode_Nano is the windfree Option - which i am using at night

Hi noppa6, All,

can you please paste here your relevant item and sitemap configuration as well?
Were you able to get the token from the openhab.log, or some other way?

I seem to be able to connect with openssl, but all I got is this(seems to be an older model, as it uses TCP port 2878)

openssl s_client -connect 192.168.0.102:2878 -cert /etc/openhab2/services/mycert.pem

DPLUG-1.6
<?xml version="1.0" encoding="utf-8" ?><Update Type="InvalidateAccount"/>
<Request Type="GetToken"/>
<?xml version="1.0" encoding="utf-8" ?><Response Type="GetToken" Status="Ready"/>
<?xml version="1.0" encoding="utf-8" ?><Response Status="Fail" Type="Authenticate" ErrorCode="301" />

also here is my openHAB configuration, in case someone might be able to help pointing out the issue:

samsungac.cfg:

emelet.host=192.168.0.102
emelet.mac=bc8ccd77d5f8
emelet.token=
#emelet.password=something
emelet.certificate=/etc/openhab2/services/mycert.pem

samsungacdemo.items

Number ac_current_temp “Current temp [%.1f]” (AC) { samsungac=“[emelet|AC_FUN_TEMPNOW]” }
Switch ac_power (AC) { samsungac=“[emelet|AC_FUN_POWER]” }
Number ac_mode “Convenience mode” (AC) { samsungac=“[emelet|AC_FUN_COMODE]” }
Number ac_op_mode “Operation mode” (AC) { samsungac=“[emelet|AC_FUN_OPMODE]” }
Number ac_set_temp “Set temp [%.1f]” (AC) { samsungac=“[emelet|AC_FUN_TEMPSET]” }
Number ac_direction “Direction” (AC) { samsungac=“[emelet|AC_FUN_DIRECTION]” }
Number ac_windlevel “Windlevel” (AC) { samsungac=“[emelet|AC_FUN_WINDLEVEL]” }

default.sitemap

sitemap default label=“My first sitemap”
{
Frame label=“Air conditioner”{
Text item=ac_current_temp icon=“temperature” label=“Current temp [%.1f °C]”
Setpoint item=ac_set_temp minValue=16 maxValue=28 step=1 icon=“temperature”
Switch item=ac_power icon=“heating”
Switch item=ac_mode label=“Mode” icon=“sofa” mappings=[0=“Off”, 1=“Quiet”, 2=“Sleep”, 3=“Smart”, 4=“SoftCool”, 5=“TurboMode”, 6=“WindMode1”, 7=“WindMode2”, 8=“WindMode3”]
Switch item=ac_op_mode icon=“sofa” mappings=[0=“Auto”, 1=“Cool”, 2=“Dry”, 3=“Wind”, 4=“Heat”]
Switch item=ac_direction icon=“wind” mappings=[1=“SwingUD”, 2=“Rotation”, 3=“Fixed”, 4=“SwingLR”]
Switch item=ac_windlevel icon=“wind” mappings=[0=“Auto”, 1=“Low”, 2=“Mid”, 3=“High”, 4=“Turbo”]
}
}

I can’t see anything relevant in the log, maybe the log level should be changed, but to be honest I don’t know what might be the proper log setting.

Based on the tcpdump my AC is an older model using TCP port 2878

I’ve been working on a binding for the newer Samsung Smart Air Conditioner.
The binding is quit stable. The binding supports following channels:
Power On/Off
Autoclean On/Off
Beep On/Off
Set Temperature
Measured Temperature
Inverter Temperature
Wind Direction
Wind Speed
Operating Mode
Comfort Settings
Hours Running
Total Power Consumption
Calculated Hourly Power Consumption
Running Time since last Cleaning
Alarm Text

If more people would like to test, I can make it available.

4 Likes

Hi Jan

I would love to try this binding out!

i would like to test it too

The jar file can be downloaded from here, https://www.dropbox.com/s/w25nhf03hemnvdk/samsungDI.jar?dl=0

You have to obtain the token for your device, as described in this thread.
Please leave me some feedback, if any problems, or anything need to be changed.

/Jan

2 Likes

It’s been a long time and I cannot remember how I got the token…
But how did you install the binding? I didn’t get the binding working at first when installed from paper UI. After adding it to addons.cfg it started properly:
binding=samsungac1

My samsungac.cfg is almost similar. I have MAC address typed with caps (shouldn’t be any issue) and I have also added attribute myac.port=2878 (shouldn’t also be any problem as port is hard coded in bindig itself)

Is there anything related to ac binding in the logs when you start OH?

I’m using a MIM-H02 to connect to my Samsung Ducted & it looks like it communicates on port 2878. I have the token already & tried to get the binding to connect but get the following error:

java.security.cert.CertificateException: No subject alternative names matching IP address 192.168.10.232 found

The binding may not work for my model but it was worth a try.

How does your cert file look? It should be like a vaillan has posted above.

It’s identical…

unfortunately nothing in the log about the SamsungAC binding. Probably I have changed my logging settings, and now I am unable to set those back to the defaults.

But I have managed to get the token manually eventually:

root@ivanszky-ThinkCentre-M83:/etc/openhab2/services# openssl s_client -connect 192.168.0.102:2878 -cert /etc/openhab2/services/mycert.pem

output omitted

    Start Time: 1554645200
    Timeout   : 7200 (sec)
    Verify return code: 19 (self signed certificate in certificate chain)
    Extended master secret: no
---
DPLUG-1.6
<?xml version="1.0" encoding="utf-8" ?><Update Type="InvalidateAccount"/>
<Request Type="GetToken"/>
<?xml version="1.0" encoding="utf-8" ?><Response Type="GetToken" Status="Ready"/>

At this point I have switched off the AC, then I’ve received the token:

<Update Type="GetToken" Status="Completed" Token="xxxxxxxxxxxxxxxxxxxxxxxxx"/>

You can use openhab console to modify logging levels

Hi guys
Just installed my new Windfree dual-Split and want to connect it to OH. The Samsung App works already.

I have one question to the people who did make this binding working - does Samsung AC send indoor temperature updates while it is off, or only when it‘s on? Reason: would like to use the AC as a room temperature sensor for heating as well.

Thanks for feedback

It does send temperature updates while it is off - I know because I used it for the exact same purpose for a while. However, do not rely too much on this feature. Because:

  1. It is not very accurate (as a guesstimate, I would say +/- 1 degree Celsius)
  2. If you try to poll the AC interface often, it will stop responding after a while. In my case, I was polling it every 5 minutes or so, and my logs would show long stretches of time (several hours) in which all connections to the AC IP/port were rejected.

So in the end I just gave up and I added my own room temperature sensor(s) :slight_smile:

Hi everyone - I’ve been using SamsungAC binding for a while now (since OpenHABb 1.8.3) and I just migrated to OpenHAB 2.0 pretty much painlessly.
The main reason I migrated was to enable Google Assistant integration.
Given how limited it appears to be, I’ve only managed to use the “Switchable” tag with the AC_FUN_POWER function, like this:
Switch acLivingAuto "Living Room Air Conditioning" (googleAssistant) [ "Switchable" ] { samsungac="[Living|AC_FUN_POWER]" }
And this works pretty well. I can say Ok Google, turn on the living room air conditioning and it turns the AC on to whatever was set before. I really have to make sure I call it “air conditioning” because if I call it "air conditioner it doesn’t work anymore. Basically, Google thinks I have a lamp called “Living Room Air Conditioning” and it can turn it on or off.

I see, however, there is a possibility to set a thermostat object for Google Integration. It’s basically a group that needs to have (at least) an Item with “homekit:HeatingCoolingMode” tag and two more Numbers with “CurrentTemperature” & “TargetTemperature” tags.
For the latter I can use AC_FUN_TEMPNOW and AC_FUN_TEMPSET, but the “homekit:HeatingCoolingMode” number needs to be either a Number in Zwave THERMOSTAT_MODE Format or a String with values “on, off, cool, heat”.
I haven’t been able to find what is the “THERMOSTAT_MODE” format for Zwave - this post is the closest I’ve ever come but I wanted an accurate source.
I haven’t attempted the other way (using a String) yet, but I think both approaches will need a transformation/translation between the Number/String and a pairing of AC_FUN_POWER and AC_FUN_OPMODE something like:
"off" <---> AC_FUN_POWER = 0
"heat" <--> AC_FUN_OPMODE= 4
"cool" <--> AC_FUN_OPMODE= 1
"on" <----> AC_FUN_POWER = 1

Has any of you attempted to use these yet? Or do you have experience with these kind of transformations?

I did a bit more digging and experimenting and this is what I found out.
First of all, samsungac binding does NOT like multiple Items being set to the same AC unit and function. I previously had two items for Living|AC_FUN_POWER (one for the old control using Openhab Basic UI, and a separate one for Google Assistant integration) and only one of them got updated. I solved this by using the same Item for both controls.
Then I changed my Number for the mode to a String and got rid of the “homekit:” in the tag so it basically looks like this:

Group	gLivingThermostat	"Living Room Thermostat"	(googleAssistant)	[ "Thermostat" ]
  String	living_Mode	"Living Room Heating/Cooling Mode"	(gLivingThermostat)	[ "HeatingCoolingMode" ]
  Number	living_crtTemp "Living Room Current Temperature"	(gLivingThermostat, acLiving)	[ "CurrentTemperature" ]	{samsungac="[Living|AC_FUN_TEMPNOW]"}
  Number	living_tgtTemp	"Living Room Target Temperature"	(gLivingThermostat, acLiving)	[ "TargetTemperature" ]	{samsungac="[Living|AC_FUN_TEMPSET]"}

And created 4 rules for the mode:

rule "Google Thermostat 'on'"
when
	Item living_Mode received command "on"
then
	logInfo("Google", "Received command on")
	acLivingAuto.sendCommand(ON)
	logInfo("Google", "Set acLivingAuto to {}", acLivingAuto.receivedCommand)
end

rule "Google Thermostat 'off'"
when
	Item living_Mode received command "off"
then
	logInfo("Google", "Received command off")
	acLivingAuto.sendCommand(OFF)
	logInfo("Google", "Set acLivingAuto to {}", acLivingAuto.receivedCommand)
end

rule "Google Thermostat 'heat'"
when
	Item living_Mode received command "heat"
then
	logInfo("Google", "Received command heat")
	livingOpMode.sendCommand(4)
	logInfo("Google", "Set livingOpMode to {}", livingOpMode.receivedCommand)
end

rule "Google Thermostat 'cool'"
when
	Item living_Mode received command "cool"
then
	logInfo("Google", "Received command cool")
	livingOpMode.sendCommand(1)
	logInfo("Google", "Set livingOpMode to {}", livingOpMode.receivedCommand)
end

These rules work well when trying them out in the console with smarthome:send living_Mode on (the AC turn on/off and changes from cooling to heating) but unfortunately, in the Google Assistant I can only set the temperature (the mode appears to be always “heat”). Is there something I’m missing?

Thanks for the binding.
I’ve installed it and testing with some problems. But first of all, can You post here your things/items/sitemaps files for this binding? It would help a lot.

The binding is written for OH 2. You don’t need config files. The configuration is done in habmin.
As soon as the binding is configured, thing and items will be available.