Samsung Smart Air Conditioner - OpenHAB 2.0

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

What version of OH do you have?
Mine is working with 2.4 but when I tested on the latest milestone 2.5M3 I got the same error.

Maybe itā€™s not ready for the new version of OH as they changed a lot under the hood reintegrating all the ESH stuff back into OH.

Iā€™m using the latest 2.5 snapshot

So could be a version related problem as stated before.

Iā€™ve already reported it to @jag , hopefully he will look into it when he has time and can upgrade his dev environment.

I hit a snag today. Iā€™ve been running the samsungac binding on openHAB2 on my Raspberry Pi without issue all summer, but for some unrelated reason, I upgraded the OS on Raspberry Pi from Ubuntu Mate 16 (LTS) to Ubuntu Mate 18 (LTS). Most things worked fine, including openHAB as a whole, but the binding now fails when I try to command my ACs.

Excrept from the log file:

2019-10-21 21:34:30.137 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=openhab/command/acLivingAuto] {item=acLivingAuto, bridgemarker=true, command=ON, timestamp=1571682870131} | {org.osgi.service.event.EventHandler, org.osgi.service.cm.ManagedService}={service.id=358, service.bundleid=199, service.scope=bundle, event.topics=openhab/*, service.pid=org.openhab.samsungac, component.name=org.openhab.binding.samsungac.activebinding, component.id=216} | Bundle(org.openhab.binding.samsungac_1.13.0 [199])]
java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.ssl.TrustMaterial
    at org.apache.commons.ssl.SSL.<init>(SSL.java:166) ~[?:?]
    at org.apache.commons.ssl.SSLClient.<init>(SSLClient.java:59) ~[?:?]
    at org.openhab.binding.samsungac.internal.AirConditioner.connect(AirConditioner.java:282) ~[?:?]
    at org.openhab.binding.samsungac.internal.AirConditioner.login(AirConditioner.java:76) ~[?:?]
    at org.openhab.binding.samsungac.internal.AirConditioner.writeLine(AirConditioner.java:238) ~[?:?]
    at org.openhab.binding.samsungac.internal.AirConditioner.sendCommand(AirConditioner.java:332) ~[?:?]
    at org.openhab.binding.samsungac.internal.SamsungAcBinding.sendCommand(SamsungAcBinding.java:136) ~[?:?]
    at org.openhab.binding.samsungac.internal.SamsungAcBinding.internalReceiveCommand(SamsungAcBinding.java:90) ~[?:?]

Reading about the exception itself (Could not initialize class org.apache.commons.ssl.TrustMaterial) it seems like a library is missing (not-yet-commons-ssl)
Iā€™ve tried a lot of things:

  • installed libnot-yet-commons-ssl as a .deb package in ubuntu mate (it was in the official repositories for Ubuntu Mate 16 but not for 18ā€¦)
  • uninstalled the binding and reinstalled it
  • ran openhab-cli clean-cache

To no avail. Iā€™ve looked in the logs and it seems there is a not-yet-commons-ssl library installed within openhab:

2019-10-21 21:30:34.945 [INFO ] [internal.service.FeaturesServiceImpl] -       mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.not-yet-commons-ssl/0.3.11_1
2019-10-21 21:34:02.391 [INFO ] [internal.service.FeaturesServiceImpl] -     org.apache.servicemix.bundles.not-yet-commons-ssl/0.3.11.1 (Should be wired to: org.apache.servicemix.bundles.commons-httpclient/3.1.0.7 (through [org.apache.servicemix.bundles.not-yet-commons-ssl/0.3.11.1] osgi.wiring.package; resolution:=optional; filter:="(osgi.wiring.package=org.apache.commons.httpclient.params)"))

And of course everything was working fine before updating Ubuntu (fortunately I have a backup which I might just go to if I canā€™t fix this).
Maybe OpenHAB picked up a newer version of the lib which does not have that class anymore (documentation seems to mention version 0.3.6 or 0.3.9 - this is version 0.3.11.1ā€¦)

Any ideas?

Hi,
It was working quiet well until nowā€¦
I get this error every couple of minutes

java.lang.ArithmeticException: Division undefined
	at java.math.BigDecimal.divide(BigDecimal.java:1667) ~[?:?]
	at org.openhab.binding.samsungdigitalinverter.handler.SamsungDigitalInverterHandler.lambda$0(SamsungDigitalInverterHandler.java:181) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

Any clue?

Thanks

@jag Where can we find the source code of your binding? Any Github repo?
Thanks!

Does anyone got it working with a 2.5 environment? I tried to test it on a Milestone some time ago without successā€¦Iā€™m afraid to lose it with the upcoming 2.5 stable.

Sorry for not following up.
The project is currently hosted on gitlab.

@jag Iā€™m sorry but the link you provided is the link to the authentication page on gitlab.com.