Hello community, I bought an Osram Lightify Flex RGBW led stripe about two weeks ago. Until yesterday I had it paired with my Hue hub. But now I want it to use it with my CC2531 and zigbee2mqtt.
I already have 4 Osram SmartPlugs, 2 Aqara door/window contacts and a Aqara MagicCube working perfectly with this setup.
But I don’t know how to find out the correct topics for color, brightness, saturation…
So far I can only set it ON and OFF.
Many thanks! Brightness is working now.
Next step would be to get a channel of type “colorRGB” (which seems to be in the format (51,52,53)) to publish something like that:
{“color”: {“r”:50,“g”:51,“b”:52}}
Can this be achieved too by using “formatBeforePublish”?
I only know it through the paper ui with an outgoing transformation and a an colorRGB channel of a generic MQTT Thing. You could use a JS Transformation like this:
That format before publish will probly not give you the needed transformation and it’s for color temp which is a single numeric value.
I tested the Javascript Transformation and it works as expected but you need the 2.5M1 release for this. It outputs exactly this format from an openhab color item :
What’s working too - at least most of the time - is (after experimenting for hours):
{"color":{"rgb":"51,52,53"}}
That’s why I put this in my things file:
Type colorRGB : colorRGB "Color RGB"
[ commandTopic="zigbee2mqtt/lightifyflex01/set", formatBeforePublish="{\"color\":{\"rgb\":\"%s\"}}" ]
But it seems I have problems with my zigbee range and I don’t want to tear off the led stripe from my sideboard for testing.
The response in zigbe2mqtt is:
zigbee2mqtt:info 4/7/2019, 8:22:51 AM MQTT publish: topic 'zigbee2mqtt/lightifyflex01', payload '{"state":"ON","brightness":20,"linkquality":0,"color_temp":50,"color":{"x":0.314,"y":0.3241}}'
Ah if zigbee2mqtt doesnt actually need the “r”:,“g”:,“b”: prefixes in the json and can just accepts and parse a 123,123,123 format that would indeed be easier and less cpu intensive than a JS transform.
I use the Osram RGBW led strip with the Openhab Zigbee binding and I have the same range problems, I think the Osram stripe in general just hasnt got the best range compared to other zigbee products.
I know there are some Bulbs which have two modes, one CT and one Color. Maybe zigbee2mqtt uses the same json format for all color/ct product but as the osram strip doesnt have a ct mode the setting doesnt actually do anything. But this is just guessing as I dont use zigbee2mqtt.
If a change the color i get following error msg from openhab.
2019-12-19 20:30:35.316 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '{x=0.1707, y=0.7139}' not supported by type 'ColorValue': {x=0.1707, y=0.7139} is not a valid RGB syntax
and change the color using this colorpicker.
No mqtt message is generated.
and I get the message i showed in openhab.log
2019-12-19 23:53:23.336 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '{x=0.3158, y=0.3252}' not supported by type 'ColorValue': {x=0.3158, y=0.3252} is not a valid RGB syntax