Question: How to set setColor custom attribute?

I am trying to control RGBW LED Strip connected to the Zigbee 3.0 Generic RGBW Controller.
And the Driver is "Advanced Zigbee RGBW Bulb".
From the Device Page everything seems to be functional. But from the RM rule(s) the control
is very messy and inconsistent. I believe, I can make it working right if I switch to Custom Actions.
But I cannot figure out what will be a correct command for setting up setColor attribute.
From the Device Page it looks like this:
image

and a command line looks like this: [hue:0,saturation:100,level:100]

But I cannot figure out (nothing what I tried worked) how to create a correct Custom Command.
What it should be: single string or 3 combined strings or numbers or etc. ???
Please advice what is a correct syntax for this custom command?

It takes a single parameter of type Map which I do not think you can send from RM custom actions.

You could try one of these formats as a string and possibly it will accept it as the map.

[hue:0,saturation:100,level:100]
hue:0,saturation:100,level:100

If not it should throw an error in the logs, seeing that error might spark another idea...

1 Like

In RM... you could use the "set dimmers and bulbs" -> "Set color" and "Set color temperature" actions.

This was my first choice. However no matter what I tied I could not get a consistent results.

This is how I pass in similar values to the presetColor custom command on my CocoHue bulbs, maybe something like this would work (the format of the parameter I mean).

Here's the text:

{"hue": 0, "saturation": 98, "level": 14}

Actually I tried this but line without brackets around did not work.
And for some reason I cannot add these brackets.
The command is created with brackets


but in actual rule brackets are missing:

and both versions looks the same.

This is likely to work, I forgot about trying the { }. Groovy is a strange language sometimes.

1 Like

I guess it is doing the translation from JSON to a map automatically

Probably not. CoCoHue has some magic to parse this out of a JSON string, just to make things like this easier, but it's not standard, so I wouldn't count on other drivers necessarily doing it.

But for "Set Color," there's really reason you should need to--RM just calls this command with the values you specify (possibly converting to HSL if that's not how you put the values in in the first place). If they don't work but the same ones do on the device detail page, there is something else going on.

1 Like

Ah, fair enough, we are spoilt with Coco-Hue :slight_smile:

Here is a log:

The command seems to be passed to the device but unfortunately the device did not respond.
Strange. It works just fine from the device page. Corror setting is actually RGB but is is translated to the HSL.

Yeah I guess using the JSON is a special feature of just CoCoHue as pointed out above. There is probably no way to get it to work and send it as a "map" from RM unfortunatly.

OK, from the Device Page everything looks OK and works as expected.
Here is my RM rule in question:

When rule is triggered by MS very first thing it should turn on LED Bar with White color.
However it randomly does who knows what. About 50% it does right things. The rest 50%
it could be a random color or nothing at all. The log is always somewhat correct.
Actually before this Zigbee toy I tried Fibaro Zwave RGBW controller. Guess what: The behavior
was about the same. This tells me something is not quite right either with RM or the device
drivers. Frankly ih a past I tried many different RGB(WW) controllers. Neither one was doing
right things correctly. So, I replaced all my LED strips with Bit-Addresable LEDs driven by
PixelBlaze and using @zranger1 very nice HE driver. This way i have many very nice lighting projects. For this project I don't need bit addressable LEDs and control should be easy and
straight forward. But no, I cannot get it working reliably.