Update field with API call

Hi all! I’m Diego and this is my first post!
I have a Samsung EHS with MWR-WW10N cable command and the Samsung Wifi Kit. Could I change some values with the API? In the documentation I found the two values that I want to change: components.main.airConditionerMode.airConditionerMode.value (the supported values are “eco”, “std”, “power” and “force”) and components.main.samsungce.ehsFsvSettings.fsvSettings.value (in this case I want to change the value inside the array cell with the ID “2021”). I found the Update Capabilites part in the API Doc, but I don’t understand how to use it.

Please someone help me!

First you need to see if there are commands to change those capabilities. Check to see if there are commands to change/update those capabilities in the ST Advanced Web App. If there are, continue below.

Next, you need to create a Personal Access Token (PAT) to allow API access here. You add the PAT to a header with “Authorization” as the header key and “Bearer xxxxx-xxxxx-xxxx-xxxx” as the header value. Here is an example using Postman:

Next, you need to know the proper format for the HTTP body in JSON format to use the commands that update those capabilities. The airConditionerMode capability is documented here, but there is no documentation on the fsvSettings capability. I find the easiest way to determine the proper format for the JSON is to use developer tools in a web browser while executing the API command from the ST Advanced Web App. For example, here is the body of a request to turn off the icemaker on my fridge viewed in the Firefox developer extension:

Clipboard02

and the raw JSON for that request:

{"commands":[{"component":"icemaker","capability":"switch","command":"off"}]}

Then build the complete HTTPS request using the URL https://api.smartthings.com/v1/devices/“deviceID”/commands with the authorization header and the JSON body and submit as a POST.

3 Likes

Say thank you is not enough, I should probably build a statue in your honor!! In a single message you show me every part/doc/step that I need to find a solution!!
I just tried the call with postman and everything works!

1 Like