How to set a HSL color like "(0,0,0)", as a command option?

I want to add command options to a light color item in HSL format like this:

  options: '(0,0,0)=black'

As expected, the commas inside the HSL color are parsed as separators, which produces three command options: “(0”, “0”, “0)=black”.
Escaping the commas like ‘(0\,0\,0)=black’ doesn’t work.
How can I escape the commas?

To escape charcters use the \ symbol (NOT /) try

That’s what I already tried (looks like \'s need to be escaped here, too :smiley:), but it doesn’t work.

I use the following for RGB

output = (r * 255) +","+ (g * 255) +","+ (b * 255)
output = "{\"rgb\":\"" + output + "\"}"; 

so for you maybe

myHSL = H + "," + S + "," + L
output = "options: \'(" + myHSL + ")=black"

and insert that into


I’m not sure of the formatting of you output - is it yaml?

Unfortunately, I don’t think there’s a direct solution for this problem yet. Your best bet is to use a proxy item with simple options and a rule to react to those options by sending the actual commands.

See here: