colorControl capability and COLOR_MAP type

Does anyone know how to get this to work? The official documentation seems to just leave out what key/value pairs are accepted:

I’m using the pysmartthings api and have posted in its Github, but getting the format of this type would be super helpful!

Hello @dakewlmoncoding,

Below you can find an example of the command sent to a device that has the colorControl capability, the values of Hue and Saturation must be between 0 and 100.

  "commands": [
      "component": "main",
      "capability": "colorControl",
      "command": "setColor",
      "arguments": [{

If this answers your question, can you please mark it as solved? If not, let me know what’s going on and I can dig in further.

I see! This is not how it is documented. I don’t know if you have access to the official documentation, but it does not have the proper syntax defined (it’s missing the {} and does not mention that it should be in the format of a dictionary) and it has no key/value pairs mentioned. Thanks for your help!

The Data Types section in the ‘new’ documentation could probably be updated to better reflect that it’s a JSON object as it looks like it was copied over from the old documentation where [hue: 50, saturation: 60] is the accurate definition of a map/dictionary in Groovy.

That being said, it looks like the setColor method definition in the Color Control capability does indicate that it’s an object. Unfortunately, it’s not super clear about what’s required and what’s optional.

Color control devices are supposed to allow an object with hue and saturation as the COLOR_MAP data type indicates:

{"hue": 50, "saturation": 60}

And optionally allow specifying additional parameters:

{"hue": 50, "saturation": 60, "level": 100}

And some optionally allow using a hex value instead:

//hex property in the object
{"hex": "#FF0000"}
//and some even allow a string input though that's not defined in the spec!