Samsung Smart Air Conditioner - OpenHAB 2.0

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.

Hi Jan,
Thank you for your binding! I was using some custom script and the exec binding to control mine but I was searching for something more reliable :slight_smile:
I’m going to test it soon with my AC.
Do you have also some documentation on the possibile values for those items who can set something on the AC?
For example Win Direction and Wind Speed are read only or you can set some value back to the AC? If it’s the last…which are the possible values?

Thank you

Channels

The information from the Samsung Digital Inverter:

Channel ID Item Type Description
power Switch Power On/Off the Inverter
autoclean Switch Enable/Disable Autoclean
beep Switch Enable/Disable Beep on the unit
setpoint_temperature Number:Temperature Desired Temperature
temperature Number:Temperature Measured Temperature
outdoor_temperature Number:Temperature Outdoor Unit Temperature
winddirection String Set Wind Direction Automatic=All, Up and Down=Up_And_Low, Fixed=Fix
windspeed Number Set windspeed Auto=0, Low=1, Medium=2, High=3, Turbo=4
operation_mode String Set operating mode Auto, Heat, Cool, Dry, Wind
comode String Comfort Settings: Normal=Comode_Off, Quiet=Comode_Quiet, Comfort=Comode_Comfort, Smart=Comode_Smart, 25Step=Comode_25Step
filtertime Number Operating hours since last Filter Cleaning
filteralarmtime Number Set Thershold for Filter Cleaning INterval
alarm String Device Alarm Status

Hi.
I use time events to set comode, Comode_Quiet, in the evening to silence the air conditioner when using the TV

Thank you very much!
I’ll test it ASAP.

Yes, but I have everything configured via files versioned in git. So maybe You have working thing file?
It should be like "Thing samsungdigitalinverter:sdi:369f82e8 “SamsungAC” [ missing_variables ]

PS. Sorry for late answer, but holiday time :wink:

I don’t have a “thing” file, or I’m not sure what you mean by thing file when using an OH2 plugin.
My config is stored in the jsondb.

Have you seen the previous post, regarding the channels, I have listed channel-id’s and Item Types?
thing.xml (1.7 KB)

Yes, I’ve seen it. And I have working items file (with channels) and sitemap file.
You can setup your OH2 via PaperUI or via files. I prefer files.
According to documentation, in things file should be:
" Thing <binding_id>:<type_id>:<thing_id> “Label” @ “Location” [ parameters ] "
So I need the names of parameters , in this case token, ip, port and keystore.

I uploaded thing.xml (copy of config.xml)thing.xml (1.7 KB) , I think you have all you need there.

Yes, That’s it!
Works perfectly!

My files, maybe someone will benefit.

samsungac.things:

Thing samsungdigitalinverter:sdi:samsalonac "Klimatyzacja Samsung" @ "Salon" [ bearer="xxxxxxxxxx", ip="1.1.1.1", port="8888", keystore="/etc/openhab2/samsung-ac/cert.p12"]

samsungac.items:

Group gSamsungAC "Klimatyzacja Samsung"

Switch              SamsungACPower                  "Zasilanie wł/wył"               (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:power"}
Switch              SamsungACAutoclean              "Czyszczenie wł/wył"             (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:autoclean"}
Switch              SamsungACBeep                   "Dźwięk wł/wył"                  (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:beep"}
Number:Temperature  SamsungACSetpointTemperature    "Oczekiwana temp"                  (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:setpoint_temperature"}
Number:Temperature  SamsungACTemperature            "Aktualna temp"                (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:temperature"}
Number:Temperature  SamsungACOutdoorTemperature     "Zewnętrzna temp"                 (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:outdoor_temperature"}
String              SamsungACWinddirection          "Kierunek wiatru"                (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:winddirection"}
String              SamsungACWindspeed              "Prędkość wiatru"                (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:windspeed"}
String              SamsungACOperationMode          "Tryb pracy"                     (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:operation_mode"}
String              SamsungACComode                 "Komfort"                        (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:comode"}
Number:Time         SamsungACRunningTime            "Godziny działania [%.1f h]"     (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:running_time"}
Number:Power        SamsungACPowerUsage             "Całkowite zużycie energii"      (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:power_usage"}
Number:Power        SamsungACPowerUsageDifference   "Zużycie energii od włączenia"   (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:power_usage_difference"}
Number:Time         SamsungACFiltertime             "Czas od ostatniego czyszczenia [%.3f h]" (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:filtertime"}
Number:Time         SamsungACFilteralarmtime        "Czas do czyszczenia filtra"     (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:filteralarmtime"}
String              SamsungACAlarm                  "Alarm"                          (gSamsungAC) {channel="samsungdigitalinverter:sdi:samsalonac:alarm"}

samsungac.sitemap:

sitemap samsungac label="Klimatyzacja Samsung"
{
	Frame label="Klimatyzacja Samsung"{
        Default item=SamsungACPower
        Default item=SamsungACAutoclean
        Default item=SamsungACBeep
        Default item=SamsungACTemperature icon="temperature"
        Setpoint item=SamsungACSetpointTemperature minValue=20 maxValue=30 step=1 icon="temperature"
        Default item=SamsungACOutdoorTemperature icon="temperature"
        Switch item=SamsungACOperationMode mappings=[Auto=Auto, Cool=Chlodzenie, Dry=Oszuszanie, Wind=Wentylator, Heat=Ogrzewanie]
        Switch item=SamsungACWinddirection mappings=[All=Auto, Up_And_Low=GoraDol, Left_And_Right=LewoPrawo, Fix=Staly] icon="fan"
        Switch item=SamsungACWindspeed mappings=[0=Auto, 1=Low, 2=Medium, 3=High, 4=Turbo] icon="fan_box"
        Switch item=SamsungACComode mappings=[Comode_Off=Normal, Comode_Quiet=Quiet, Comode_Comfort=Comfort, Comode_Smart=Smart, Comode_25Step=25Step] icon="flow"
        Default item=SamsungACAlarm icon="alarm"
        Default item=SamsungACFilteralarmtime icon="alarm"
        Default item=SamsungACFiltertime icon="time"
        Default item=SamsungACRunningTime icon="time"
        Default item=SamsungACPowerUsage icon="energy"
        Default item=SamsungACPowerUsageDifference icon="energy"
	}
}
2 Likes

Hi Guys

I managed to get my airconditioner working in Home Assistant so my token is correct via the following url (setup HA just to test this)
https://community.home-assistant.io/t/climate-ip-climatedevice-for-ip-based-units-not-only-samsung-ac/106510
but I was only able to get it to work by disabling the ssl cert check. I have installed the Samsung Digital Inverter binding and can get it to connect but get the following error

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

Is there anyway to disable the ssl cert check? I am running OpenHab 2.4 on Windows 10

Hi Everyone,

I tried to install this binding, but I get the following error:

2019-10-13 17:15:05.120 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab2/addons/samsungDI.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.samsungdigitalinverter [26]
Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.eclipse.smarthome.io.net

Any idea how I can fix it?

Josh