Samsung OCF Washer

Hello
I connect my Samsung OCF Washer to smartthings app, now I am trying to change the temperature using API.
I have the device id and I see custom.washerWaterTemperature capabilities,
But I can’t find what is the body request to change the temperature
Please help!

Maybe @nayelyz can help with this.

1 Like

Thanks @Jake_Mohl, how should I contact her?

Tagging her in here will do. Just be patient.

Hi, @Amir_Avidan

First, something important to consider about OCF devices is that they might not work correctly with commands through the API because they work on the application level. There are some that don’t process those commands as expected but it is related to their controller’s configuration. This is just a heads-up in case you see something strange.

You can see the structure of any capability if you know its ID, which in this case is custom.washerWaterTemperature if you use the CLI command:

smartthings capabilities custom.washerWaterTemperature  -j

There you will find the attributes and commands supported, considering this capability’s definition:

  1. The command supported is setWasherWaterTemperature
  2. This command only accepts values in items.enum (“none”, “20”, “30”, “40”, “50”, “60”, “65”, etc.)
    It says the argument is “object” type so, I don’t know if it requires a specific syntax, it would be useful if you saw the current value of this capability in the device to take a reference from it (device status)

If you use the CLI to send a command, the structure should be similar to:

smartthings devices:commands deviceID 'componentName:capabilityID:commandName(argument)'

//For example:
smartthings devices:commands deviceID 'main:thermostatHeatingSetpoint:setHeatingSetpoint(25)'

If you make a request directly to the API, the syntax would be similar but in JSON format:

{
  "commands": [
    {
      "component": "componentName",
      "capability": "capabilityID",
      "command": "commandName",
      "arguments": [argument]
    }
  ]
}

//for example:
{
  "commands": [
    {
      "component": "main",
      "capability": "colorControl",
      "command": "setColor",
      "arguments": [{hue:53,saturation:45}]
    }
  ]
}

The argument’s data type is specified in the capability’s definition as well, so, that value must be one of the accepted ones.

Just curious what’s your use case for this?

I have Samsung OCF Washer machine and I want to improve my developer skill so I want to create my own website which control the machine, in the backend side I want to send request but couldn’t find
custom.x capabilities.
BTW I don’t understand how did you found the capabilityID, only by using the cli? @nayelyz
Thank you for all the help!

aah ok, so, the CLI is just a tool that helps you interact with the ST API (see the reference here) using REST requests
To know which capabilities are included in your device, you need to get its details which can be done by getting the devices list or using the deviceId in the request, for example:

//API request (list all devices)
https://api.smartthings.com/v1/devices

//CLI command (list all devices)
smartthings devices

//API request (see only one device)
https://api.smartthings.com/v1/devices/deviceId

//CLI command (see only one device)
smartthings devices deviceId -j

You shared the ID above:

Have you tried sending a command to that capability?

You can also use the API Browser+ from @TAustin to see a device’s capabilities. They are listed under the “Profile” for a selected device.

1 Like

@h0ckeysk8er Thank you so much! I found the capabilities, but where can I see the request body? where do I find what the capability expect to see in the POST request?

Here you fonud that the command supported is setWasherWaterTemperature and the items.enum
is there a way to find it without using the CLI??

Thanks every one!!!
I didn’t get it that the id is custom.washerWaterTemperature
So a simple call to: https://api.smartthings.com/v1/capabilities/custom.washerWaterTemperature/1
would give me the information I need to sent the POST request!
Thanks everybody!!!

1 Like