Samsung AirComditioner (2019) - Samsung Smart Things

Unfortunately I bought the AC but it is not live yet (issues with workers… timeline)…

Therefore must try later :frowning:
Did You?

Thanks for your reply! No, not yet.

I got the 2021 model of Samsung Windfree and it´s quite complicated.

I´m using also Alexa and that´s the only way at the moment how I can turn it on from Openhab side. But all other settings (fanspeed, mode, …) are not available in Alexa.

So I want to use now the Rest APi but this topic is completely new to me. So I´m reading a lot of documentations and playing around with different settings. So far no success…

Ah okay keep me updated :slight_smile:

I worked with REST API’s some years ago. Not with Open Habmore at business side.

Do You have documentation?

For me OpenHab is more to connect it to HomeKit :slight_smile:

THX

Hello!

Last night I made a big step forward → I was able to use the software Postman to turn on and off my Samsung AC unit while using Rest APIs.
In the software there is also an option to convert the API call into Python format which is perfect - so I can use this directly in openhab. I connected with SSH to my openhabian and ran the command → it´s working!

Now my new challenge:
How to setup the API Rest Calls in combination with items to switch things on / off (or change mode like cooling / heating / fan) and to receive the updated value and store it back into my items.

I already did some research and I thing the exec binding aswell the http binding should work in this situation.

My idea is to store the API calls in python script files to be more flexible.

Any advice or tips how to setup this scenario?

Thanks!

Hi unfortunately I am not actively using openhab yet. Just stack at the state to setup Zigbee / Hue network and rebuild house :slight_smile:

Therefore no really good help at this state now. But I will forward to a friend. :slight_smile:

Stefan

1 Like

Hello everyone,

at the moment I am building my items and python scripts to read the status and also set new ones.

In first instance I am trying to read the power status (is the ac unit on or is it off?) and also set the power status to ON with a switch.

I created two exec things because in the http binding I was not able to add e.g. my token beaver which is needed to authenticate.

The first one is switching the AC unit on with a Rest API code which is stored in the python script file:

The second exec is getting the status every 10 seconds. It could be that the AC unit was turned on by the remote control…
In this case I also mapped the returned value to an Item.

These are my defined items -

First one: a Switch (which gets triggered every 10 seconds to receive the updates)
Second one: Displays the actual status:
Third one: The switch which triggers the Rest API to power on the AC unit.

Switch Klima_Essbereich_Switch_Akt "Klima Essbereich Status aktualisieren" {channel="exec:command:170d6e6a:run"}

String Klima_Essbereich_Switch "Klima Essbereich Status" {channel="exec:command:170d6e6a:output"}

Switch Klima_EG_Switch "Klima EG Switch" {channel="exec:command:1625dcdf:run"}

The actual value of the Status Item looks like this:

So I get back the whole string which I want to parse to display only the value “ON” or “OFF” in my sitemap / habpanel.

Any ideas how to do this? I tried some mapping with an *.js mapping file with no success.

Also when I hit the Switch to switch on my AC unit the device turns on - but as soon as the python script ends the switch get´s back to it´s initial status “OFF”.

Summarized I think I´m almost heading into right direction but I´m asking myself is this could be done easier than I am planning to do?
At least I will need lots of (dummy) items for holding status information. I guess also many rules are necessary to get this fully working.

Any input is much appreciated.

Thanks and best regards,
Mario

Hi Mario,
Did you manage to control your Samsung ACs with the Rest API?

Hello,

yes, all of my 3 AC units are fully integrated in my OH installation. I am using most of the time my own built “auto mode” where the temperature is defined in OH and AC turns on / off when needed.

I´m not really good in programming and maybe my solution is a little bit complicated (and it can be done much easier) but I´m happy at least that everything is up and running.

Do you need any input from my side?

Cheers

Wonderful!
I have limited knowledge in programing, so I could definitely use your help to follow the same steps you took.
Are you familiar with a tutorial that explains how to use the Rest API to configure the AC’s?
Or if no tutorial exists, could I trouble you to explain the steps you took? :pray:

Hi Mario sounds great. Unfortunately my renovation of the house is so slow and still not finished. Therefore hopefully we can stay in contact.

Good luck and stay healthy

Hello! Sorry for the delay…

My solution is for sure not state of the art but at least it´s working the way I wanted it.

I can provide in a first step an overview of what I´m capable to control / automate with openhab and afterwards I can give you (if your´re still interested) detailled information on how to do it.

Will try to post my AC solution tonight.

Cheers,
Mario

1 Like

Thanks for your efforts Mario.
I too have a Samsung AC and I’ve been lurking this thread for some time. Needless to say I’ll be happy to test as well.

Thanks Mario,
I would really appreciate a description of your solution :pray::pray:

Hello,

so the goal for my Samsung AC solution was to have an automation for cooling down the room temperatures automatically. I have a small boy and the room temperature in our bedroom should be right when he is going to bed. I don´t want to turn on the AC when he is sleeping in the same room. So for sure I would forget from time to time to turn on the AC to cool the room down in advance - that´s why I was looking for an automation.

I´m using a Split Samsung AC system with 3 indoor units - model “Windfree”. In first step I installed the Samsung Smart Things app on my mobile phone and registered all AC devices.
Finally I started to read a lot instructions of Rest API and in general the documentation for the Smart Things Rest API to get used to it.

Here are two screenshots of my sitemap (not integrated in OH 3 UI for now - it´s on my to do list) which i´m using on my mobile (I´m from Austria so everything is in German):


I implemented a general switch for AC automation and also one for every AC unit. If I turn on the switch then the temperature gets monitored automatically and if the setpoint is lower than the actual temperature the AC turns on - and off again (of course) if the setpoint is reached.
Therefore I´m not using a hysterese but the average temperature of the last 45 minutes.

I´m also able to read the actual temperature set by remote directly from the AC, change the operating mode (normal, windfree, fast and windfreesleep were the one I would like to use), turn the AC´s on and off and also get an status update if one of the AC´s was turned on also by remote. Therefore I have some update rules running.

I´m not fully done now - sometimes my rules are not working 100% and also the visualisation is work in progress.

So that´s what I can offer to you guys. If you are interested in how i achieved this I can share all the details.

Cheers,
Mario

1 Like

Thanks.

I apologise in advance for any less than smart questions… I’m a simple network/infra guy, not a coder. :blush:

Are you using the binding that Jan Grønlien posted connecting directly to the inverter, or did you write your own code connecting to the SmartThings cloud api?

As my first use case is to simply assert control over the inverter through OpenHAB so I can start automating things. Details are definitely of use.
I’ll see if I can replicate parts of your implementation during my vacation later this summer.

I would be more than interested as i got also a windfree version and face issues using Jan’s binding. Maybe you guys could all bring it together into one solution?
Looking forward to your details!

Hello,

no, I´m not using the binding from Jan as my windfree models are too new to use it with. I am only using the Rest API from Smart Things.

Just FYI, came across this SmartThings API tool in case helpful.

Okay - here we go. As the solution needs several different steps (and also my time is quite limited) I´m splitting it up.

  • First step: Make sure to have all your AC devices registered in your Samsung Smartthings APP - logged in with your Samsung account.

  • Second step: Generate a personal access token here and save it somewhere: https://account.smartthings.com/tokens

  • Download software “Postman” (it´s for free) here: https://www.postman.com/downloads/

  • Start Postman to get your Device ID´s - this is how you do it:

GET
URL: https://api.smartthings.com/v1/devices
Tab Authorization - Type - Bearer Token - add your personal Token

It should look like this:

  • Click SEND

As a result you should get in the “body section” all your devices listed.

Copy all the Device ID´s and save it.

Now you are able to control the device directly from Postman (or command line in Windows using command “curl”). Please see the API documentation here: https://smartthings.developer.samsung.com/docs/api-ref/capabilities.html
and here: SmartThings API

So for an example this is how to switch your AC on with Rest API:

Method: POST
URL: https://api.smartthings.com/v1/devices/yourDeviceID/commands

Don´t forget to add your Authorization bearer

Add the capability under “Body” Tab:
[{“component”:“main”,“capability”:“switch”,“command”:“on”}]

Click SEND to submit your request.

So that´s the first step to get the integration into OH. If this step is working you should be safe to continue.

More is coming soon!

2 Likes

Thank you for much for taking the time to explain everything :pray::pray::pray:
I will try it during the weekend :muscle: