Samsung AirComditioner (2019) - Samsung Smart Things

Hi @Mario084 and @mjeshurun,
Just to report back on progress as I am investing some time today.
Below an example using the HTTP binding and “GET”'ing the AC status:

HTTP Thing Definition

Replace the black bars with your deviceID and token.


Channel

Item

Channel & Item is pretty straight forward.

At the same time I am also trying to get this working only with ECMA scripts and the HTTPUtil, whereas I still did not figure out the correct syntax I think:

ECMA test code

//Initialize variables

var telegramAction = actions.get(“telegram”,“telegram:telegramBot:telegram”);
var Log = Java.type(“org.openhab.core.model.script.actions.Log”);
var ZonedDateTime = Java.type(“java.time.ZonedDateTime”);
var ScriptExecution = Java.type(“org.openhab.core.model.script.actions.ScriptExecution”);
var HttpUtil = Java.type(“org.openhab.core.io.net.http.HttpUtil”);

var timeofday = itemRegistry.getItem(“ntp_timeofday”).getState ();
var homestatus = itemRegistry.getItem(“presence_home”).getState ();
var presence = itemRegistry.getItem(“presence_bedroom_master”).getState ();
var scene = itemRegistry.getItem(“scene_bedroom_master”).getState ();

var headers = new testProperty();
headers.put(“Authorization”,“Bearer TOKEN”);

//Actions

HttpUtil.executeUrl(“POST”, “https://api.smartthings.com/v1/devices/ID/commands”, headers,“application/JSON”, { “component”: “main”, “capability”: “switch”, “command”: “off” });

ECMA test code Try 2

var token = “TOKEN”

var headers = ;
headers[“Authorization”] = "Bearer " + token;

var url = “https://api.smartthings.com/v1/devices/ID/commands”;
var jsondata = ‘{“component”: “main”, “capability”: “switch”, “command”: “on”}’;
var result = HTTP.sendHttpPostRequest(url, “application/json”, jsondata, headers,15000);

ECMA test code Try 3 - **WORKING**

var token = “TOKEN”

var headers = ;
headers[“Authorization”] = "Bearer " + token;

var url = “https://api.smartthings.com/v1/devices/ID/commands”;
var jsondata = ‘[{“component”: “main”, “capability”: “switch”, “command”: “off”}]’;
var result = HTTP.sendHttpPostRequest(url, “application/json”, jsondata, headers,15000);

If anyone got some pointers there, appreciated.
Hope above helps a bit for standard setup, will try another one with command channel next.

EDIT2: Added ECMA test code 2 which gives me no log errors but also does not send the command :frowning:

EDIT3: Got it working with simple POST code!! (see ECMA test code Try 3)
EDIT4: Now also implemented 2 rules to turn off/on the AC which works - still trouble getting it into one rule, but that’s more of an OH rule thing that I need to figure out (brain freeze :slight_smile: )

EDIT 5: OK, made some progress, I got the following GETs running, in case you want to have the GET URLs, let me know:

image

Looking at your list of capabilities (which btw is exactly the same that I got) it seems that you cannot control the light via the REST API. Might be wrong here as in the app you got options like “Lighting” and “Sound Effects”, maybe they are not exposed via capabilities?

1 Like

Thank you for taking the time to look into my question :pray:
And thank you for taking the time to describe your HTTP solution.
As I’m a noob in these matters, I would appreciate if you could share the GET/POST URL’s and POST commands you used.
Also, if there is no privacy issue, could you share your Things, Items, Rules and Sitemap settings?
I’m hoping that by having your initial definitions, I could just enter my Samsung AC’s Device ID’s and Token Bearer, thus making your definitions work for my devices :pray: :pray: :pray:

Hi @mjeshurun, please see below, I hope they help:

Thing:


2 Channel Examples (the concept is the same for all of them):

On/Off:


Set Temperature:

Item Example:

image

My On/Off rules (currently 2 rules, not sure why my if, else is not working if combined:)

Turn On:


Turn Off:


The GET codes I currently implemented, the POST code (on/off) is visible in above rule, I did not implement any more yet:

Stats - On/Off: https://api.smartthings.com/v1/devices/ID/components/main/capabilities/switch/status
Set Temp: 
https://api.smartthings.com/v1/devices/ID/components/main/capabilities/thermostatCoolingSetpoint/status
AC Mode: https://api.smartthings.com/v1/devices/ID/components/main/capabilities/custom.airConditionerOptionalMode/status
AirQuality: https://api.smartthings.com/v1/devices/ID/components/main/capabilities/airQualitySensor/status
Humidity:
https://api.smartthings.com/v1/devices/ID/components/main/capabilities/relativeHumidityMeasurement/status
Room Temp:
https://api.smartthings.com/v1/devices/ID/components/main/capabilities/temperatureMeasurement/status
AC Fan Mode:
https://api.smartthings.com/v1/devices/ID/components/main/capabilities/airConditionerFanMode/status

A thing I saw though is that the values in OH did not auto update, because the SmartThings APP did not auto refresh somehow. I had to open the app and refresh so that the AC is shown as turned on. Did you experience something similar @Mario084? Or Is there a setting to turn on auto refresh? (seems it worked over night, maybe just a Wifi drop-out)

1 Like

I started working on using the HTTP binding as command channel, whereas I cannot figure out how to structure the commands.

Below some thoughts (yellow marked are the areas that I guess are needed?):

In Postman, the following command works:

POST: https://api.smartthings.com/v1/devices/ID/commands
Body: [{ “component”: “main”, “capability”: “switch”, “command”: “off” }]

Looking further into the API documentation, it seems not to be possible to structure the POST URL further than “/commnds”.

In a rule I can send the command without issues:

Question here I guess is how to translate the JSON body into something that the HTTP binding can work with.

He guys, a quick status update as I just figured out how to “POST” the commands via the binding, without rules.

  1. Channel setup - using a MAP transformation to generate the JSON string:

  1. Write the .map file in your /etc/openhab/transform folder:

image

That is all that was needed. I can now use the item’s switch to turn on/off the AC via the REST API.

EDIT:

Another update, after playing around with several “set” commands. Below the .map commands I got till now (will update with more commands on the fly; the temperature once are not yet tested, I will try to use a .map instead of some formula for now):



# Turn AC on/off
on=[{"component":"main", "capability":"switch", "command":"on"}]
off=[{"component":"main", "capability":"switch", "command":"off"}]

# Set AC cooling mode
auto=[{"component":"main", "capability":"airConditionerMode", "command":"setAirConditionerMode","arguments":["auto"]}]
cool=[{"component":"main", "capability":"airConditionerMode", "command":"setAirConditionerMode","arguments":["cool"]}]
dry=[{"component":"main", "capability":"airConditionerMode", "command":"setAirConditionerMode","arguments":["dry"]}]
fan=[{"component":"main", "capability":"airConditionerMode", "command":"setAirConditionerMode","arguments":["fanOnly"]}]
heat=[{"component":"main", "capability":"airConditionerMode", "command":"setAirConditionerMode","arguments":["heat"]}]

# Set AC temperature
20=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[20.0]}]
20.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[20.5]}]
21=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[21.0]}]
21.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[21.5]}]
22=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[22.0]}]
22.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[22.5]}]
23=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[23.0]}]
23.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[23.5]}]
24=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[24.0]}]
24.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[24.5]}]
25=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[25.0]}]
25.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[25.5]}]
26=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[26.0]}]
26.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[26.5]}]
27=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[27.0]}]
27.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[27.5]}]
28=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[28.0]}]
28.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[29.5]}]
29=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[29.0]}]
29.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[29.5]}]
30=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[30.0]}]

# Set AC operation mode
sleep=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "sleep"]}]
quiet=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "quiet"]}]
smart=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "smart"]}]
speed=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "speed"]}]
windFree=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "windFree"]}]
windFreeSleep=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "windFreeSleep"]}]

# Set AC fan mode
fan_auto=[{"component":"main", "capability":"airConditionerFanMode", "command":"setFanMode","arguments":["auto"]}]
low=[{"component":"main", "capability":"airConditionerFanMode", "command":"setFanMode","arguments":["low"]}]
medium=[{"component":"main", "capability":"airConditionerFanMode", "command":"setFanMode","arguments":["medium"]}]
high=[{"component":"main", "capability":"airConditionerFanMode", "command":"setFanMode","arguments":["high"]}]
turbo=[{"component":"main", "capability":"airConditionerFanMode", "command":"setFanMode","arguments":["turbo"]}]

Hope it helps!

1 Like

This is great, @chrismast !
I will try your method next week when I’m back home :pray::pray::pray:

Got a proof of concept working!

I can turn on and of my AC and I can plot a usage chart in grafana as well based on the status.

What remains to do are all the other items and make it usable through Pages and Sitemaps. And I’ll probably try to move the config from UI to files as well.

I’ll try not to misspell the url:s in the future. I managed to get the log severely hosed with raw HTML. :roll_eyes:

Thanks @chrismast and @Mario084 for all your prior work to get this working. :grinning_face_with_smiling_eyes:

1 Like

I’m trying to set this up for a client, thought I would share my version of the Python script, it takes the device id as an argument, for e.g

python3 /etc/openhab2/scripts/test.py {{DeviceID}}

the script itself looks like this

#!/usr/bin/python3
import requests
import sys
import json

if len(sys.argv) < 2:
    print("Error: needs the device ID as an argument")
    quit()
DEVICE_ID = sys.argv[1]

url = "https://api.smartthings.com/v1/devices/" + DEVICE_ID + "/components/main/capabilities/"

payload = ""

headers = { 'Authorization': 'Bearer {{APIToken}}' }

paths = [[ "switch/status", "switch" ], [ "thermostatCoolingSetpoint/status", "coolingSetpoint" ], [ "custom.airConditionerOptionalMode/status", "acOptionalMode" ]]

data = {}

for x in paths:
    response = requests.request("GET", url + x[0], headers=headers, data=payload)
    status = json.loads(response.text)
    data[x[1]] = status[x[1]]['value']

print(data)

don’t forget to replace

{{APIToken}}

to your actual token, the braces aren’t needed

The response looks like this

{'switch': 'off', 'coolingSetpoint': 19.0, 'acOptionalMode': 'off'}

I will try to share my .rules and other files when I get to them

P.S this is for status reading and it was my first proper script with python :smiley:

1 Like

as for the sending script, this is what i came up with

#!/usr/bin/python3
import requests
import sys
import json

if len(sys.argv) < 4:
    print("Error: needs the device ID, command type and command as arguments")
    quit()

DEVICE_ID = sys.argv[1]
COMMAND_TYPE = int(sys.argv[2])
COMMAND = sys.argv[3]

url = "https://api.smartthings.com/v1/devices/" + DEVICE_ID + "/commands"

headers = { 'Authorization': 'Bearer {{APIToken}}' }

paths = [["airConditionerMode", "setAirConditionerMode"], ["thermostatCoolingSetpoint", "setCoolingSetpoint"], ["custom.airConditionerOptionalMode", "setAcOptionalMode"]]

if COMMAND_TYPE == 0:
    payload = '[{\"component\":\"main\",\"capability\":\"switch\",\"command\":\"' + COMMAND + '\"}]'
else:
    if COMMAND_TYPE != 2:
        COMMAND = '\"' + COMMAND + '\"'
    payload = '[{\"component\":\"main\",\"capability\":\"' + paths[COMMAND_TYPE-1][0] + '\",\"command\":\"' + paths[COMMAND_TYPE-1][1] + '\",\"arguments\": [' + COMMAND + ']}]'

response = requests.request("POST", url, headers=headers, data=payload)

as towards launching it the syntax is like this

python3 samsung_send_command_room.py {{DeviceID}} {{CommandType}} {{Argument}}

command types are the following:
0 - switch on/off
1 - Air Conditioner Mode
2 - Thermostat Cooling Setpoint
3 - Air Conditioner Optional Mode

arguments are the commands itself for e.g on/off

Hi Everyone,
Just want to share a big thank you to @chrismast for helping me set up the Windfree AC’s control into OpenHAB. I couldn’t have done it without him :pray: :pray: :pray:

To those of you that own 2019 Windfree AC’s, there are a few POST commands that we didn’t find (such as: 2-Step, Comfort, Fast Turbo, Single User, Good Sleep, Purify, Display), but other than those, OpenHAB is able to set the AC on/off, cooling mode, fan speed, temperature level, and windfree mode.
It’s really great be able to control all the smart home appliance with the OpenHAB app, without the need to open the Samsung Smartthing app :slight_smile:
Many thanks to @chrismast and to all other developers and users that maintain this awesome platform and community! :pray:

1 Like

Thanks for the shoutout @mjeshurun! Always happy to help follow SmartHome enthusiasts, and forward what I received by other users here, even if it takes half a day or more via Skype :slight_smile:.

1 Like

Hey guys, small question.
This might be obvious to some, but is there a particular reason we should not set the HTTP binding’s Thing refresh interval for the AC’s status to less than 30sec?
Say 10-15sec?

Hi all, had some time to run through a few more command options (see end of the list):

# Turn AC on/off
on=[{"component":"main", "capability":"switch", "command":"on"}]
off=[{"component":"main", "capability":"switch", "command":"off"}]

# Set AC cooling mode
auto=[{"component":"main", "capability":"airConditionerMode", "command":"setAirConditionerMode","arguments":["auto"]}]
cool=[{"component":"main", "capability":"airConditionerMode", "command":"setAirConditionerMode","arguments":["cool"]}]
dry=[{"component":"main", "capability":"airConditionerMode", "command":"setAirConditionerMode","arguments":["dry"]}]
fan=[{"component":"main", "capability":"airConditionerMode", "command":"setAirConditionerMode","arguments":["fanOnly"]}]
heat=[{"component":"main", "capability":"airConditionerMode", "command":"setAirConditionerMode","arguments":["heat"]}]

# Set AC temperature
20=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[20.0]}]
20.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[20.5]}]
21=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[21.0]}]
21.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[21.5]}]
22=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[22.0]}]
22.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[22.5]}]
23=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[23.0]}]
23.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[23.5]}]
24=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[24.0]}]
24.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[24.5]}]
25=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[25.0]}]
25.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[25.5]}]
26=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[26.0]}]
26.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[26.5]}]
27=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[27.0]}]
27.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[27.5]}]
28=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[28.0]}]
28.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[29.5]}]
29=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[29.0]}]
29.5=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[29.5]}]
30=[{"component":"main", "capability":"thermostatCoolingSetpoint", "command":"setCoolingSetpoint","arguments":[30.0]}]

# Set AC operation mode
sleep=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "sleep"]}]
quiet=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "quiet"]}]
smart=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "smart"]}]
speed=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "speed"]}]
windFree=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "windFree"]}]
windFreeSleep=[{"component":"main","capability":"custom.airConditionerOptionalMode","command":"setAcOptionalMode", "arguments":[ "windFreeSleep"]}]

# Set AC fan mode
fan_auto=[{"component":"main", "capability":"airConditionerFanMode", "command":"setFanMode","arguments":["auto"]}]
low=[{"component":"main", "capability":"airConditionerFanMode", "command":"setFanMode","arguments":["low"]}]
medium=[{"component":"main", "capability":"airConditionerFanMode", "command":"setFanMode","arguments":["medium"]}]
high=[{"component":"main", "capability":"airConditionerFanMode", "command":"setFanMode","arguments":["high"]}]
turbo=[{"component":"main", "capability":"airConditionerFanMode", "command":"setFanMode","arguments":["turbo"]}]

----UPDATE

# GET and POST audio volume of aircon:
GET: https://api.smartthings.com/v1/devices/YOURID/components/main/capabilities/audioVolume/status
POST: https://api.smartthings.com/v1/devices/YOURID/commands => [{"component":"main", "capability":"audioVolume", "command":"setVolume","arguments":[0]}] <= 0=off, 100=on

#Dust Filter Status
GET: https://api.smartthings.com/v1/devices/YOURID/components/main/capabilities/custom.dustFilter/status
=> 100 equals you need to change the dust filter

#Software Update Status
GET: https://api.smartthings.com/v1/devices/YOURID/components/main/capabilities/samsungce.softwareUpdate/status

I still did not find though the “Lighting” mode On/Off GET/POST.

EDIT: I finally found the LED control! (@mjeshurun), the following command controls the LED (on/off)

POST: https://api.smartthings.com/v1/devices/YOURID/commands
Payload:
On: [{"component":"main", "capability":"execute", "command":"execute","arguments":["mode/vs/0",{"x.com.samsung.da.options":["Light_Off"]}]}]
Off: [{"component":"main", "capability":"execute", "command":"execute","arguments":["mode/vs/0",{"x.com.samsung.da.options":["Light_On"]}]}]

And yes, Light_off = ON etc., it is not a typo; credit for the commands goes here.

1 Like

As always, @chrismast , you are awesome!
Thank you so much for remembering and finding the solution :pray: :pray: :pray:

hi,
im from Vienna / Austria and have a little experience with programming and API calls.

Im new to openHAB and searched the internet for controlling my AC (Windfree) of Samsung with another app than smartthings, since the app (in iOS) is REALLY slow!! (it takes several seconds to responds whereas the postman command - the RESTful API request - works nearly instant!)

Since im new to openHAB i just got the python version of @Mario084 to work (at least when i activate the “thing” in openhab and let it run every 15seconds, my AC responds), but would prefer the more “cleaner” version of @chrismast where you only have to create a map and than adjust everything in openhab. So far i am not able to “activate” the AC from the openHAB webinterface with the latter one.

Can someone of you give me a full example of how to activate the AC (thing, item, rule, complete code - everything i need for this specific task) so i can adjust it for my purpose :slight_smile: .
I didnt get it to work by just “copying” the version of chrismast :frowning: and already invested a lot of hours :-D, but cant find the problem.

greets,
nordx

ps.: Light_off doesnt work for me :frowning: @chrismast , tried the command with postman - its accepted, but doesnt do anything. (with my local remote console the display turns off - so in my unit the function exists)

Hi @nordx, will post a few screenshots later today.
Had a “longer” break of OH and need to re-look into it.

That would be awesome :slight_smile: !

Hello again, @chrismast :slight_smile:
I have a small question.
The calibration and control of my two windfree Samsung ac’s you helped me with is still working great.
However, there is one small thing that is working oddly.
When I set an ac’s operation mode to “quiet”, the openhab app will properly show I put the AC into quiet mode, but a few seconds later the operation mode in the app will change back to “off”.
The AC will still function in quiet mode, but the app won’t show it.
However, when I set the AC to “windfree” mode, the app continues to properly show the AC is in windfree mode, until I change it.

Is there a way to make the “quite” operation mode stay properly shown in the app until I actually change it?

Sorry for the delay, had some other stuff coming up.
Will try to post everything as compact and simple as possible.

Thing & Channels (pictures and code)
  1. Pictures of the Thing setup:



  1. Code (might be easier for some):
UID: http:url:samsung_ac_windfree
label: Samsung Windfree AC
thingTypeUID: http:url
configuration:
  authMode: BASIC
  headers:
    - Authorization=Bearer **YOURTOKEN**
  ignoreSSLErrors: false
  baseURL: https://api.smartthings.com/v1/devices/**YOURTOKEN**/
  delay: 0
  stateMethod: GET
  refresh: 60
  commandMethod: POST
  contentType: application/json
  timeout: 3000
  bufferSize: 2048
location: Children's Bedroom
channels:
  - id: status
    channelTypeUID: http:switch
    label: Status - On/Off
    description: ""
    configuration:
      mode: READWRITE
      onValue: on
      commandTransformation: MAP:samsung.map
      offValue: off
      stateExtension: components/main/capabilities/switch/status
      commandExtension: commands
      stateTransformation: JSONPATH:$.switch.value
  - id: temperature
    channelTypeUID: http:number
    label: Temperature
    description: ""
    configuration:
      mode: READWRITE
      commandTransformation: MAP:samsung.map
      stateExtension: components/main/capabilities/thermostatCoolingSetpoint/status
      commandExtension: commands
      stateTransformation: JSONPATH:$.coolingSetpoint.value
  - id: operating_mode
    channelTypeUID: http:string
    label: Operating Mode
    description: ""
    configuration:
      mode: READWRITE
      commandTransformation: MAP:samsung.map
      stateExtension: components/main/capabilities/custom.airConditionerOptionalMode/status
      commandExtension: commands
      stateTransformation: JSONPATH:$.acOptionalMode.value
  - id: air_quality
    channelTypeUID: http:number
    label: Air Quality
    description: ""
    configuration:
      mode: READONLY
      stateExtension: components/main/capabilities/dustSensor/status
      stateTransformation: JSONPATH:$.fineDustLevel.value
  - id: room_temperature
    channelTypeUID: http:number
    label: Room Temperature
    description: ""
    configuration:
      mode: READONLY
      stateExtension: components/main/capabilities/temperatureMeasurement/status
      stateTransformation: JSONPATH:$.temperature.value
  - id: humidity
    channelTypeUID: http:number
    label: Humidity
    description: ""
    configuration:
      mode: READONLY
      unit: "%"
      stateExtension: components/main/capabilities/relativeHumidityMeasurement/status
      stateTransformation: JSONPATH:$.humidity.value
  - id: fan_mode
    channelTypeUID: http:string
    label: Fan Mode
    description: ""
    configuration:
      mode: READWRITE
      commandTransformation: MAP:samsung.map
      stateExtension: components/main/capabilities/airConditionerFanMode/status
      commandExtension: commands
      stateTransformation: JSONPATH:$.fanMode.value
  - id: cool_mode
    channelTypeUID: http:string
    label: Cool Mode
    description: ""
    configuration:
      mode: READWRITE
      commandTransformation: MAP:samsung.map
      stateExtension: components/main/capabilities/airConditionerMode/status
      commandExtension: commands
      stateTransformation: JSONPATH:$.airConditionerMode.value
  - id: dust_filter_status
    channelTypeUID: http:number
    label: Dust Filter Usage Status
    description: ""
    configuration:
      mode: READONLY
      stateExtension: components/main/capabilities/custom.dustFilter/status
      stateTransformation: JSONPATH:$.dustFilterUsage.value
  - id: software_update
    channelTypeUID: http:string
    label: Software Update
    description: ""
    configuration:
      mode: READONLY
      stateExtension: components/main/capabilities/samsungce.softwareUpdate/status
      stateTransformation: JSONPATH:$.newVersionAvailable.value
  - id: light
    channelTypeUID: http:string
    label: Light - On/Off
    description: ""
    configuration:
      mode: WRITEONLY
      commandExtension: commands
      commandTransformation: MAP:samsung.map

The map file is shown above in its latest state, did not further look into finding more commands.
The items are simple items that I think you can derive from above.

@nordx
Would you mind helping me to understand where the issue with on/off might be?
I understand that the command works for you via Postman?
Any log messages showing errors?
As you can see from above post history, there is not really any rule running. It all works via the map file, thing, channel and items.
Might also help if you post maybe some screenshots from your end.

1 Like