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.
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!
"#FF0000"