Zigbee2mqtt revisited: No more ugly transformations

I also have an Osram RGBW Bulb but unfortunately, your solution doesn’t work for me :frowning:

I have set the same “formatBeforePublish” pattern but only the first value of the color state is being published. For example the color state is 230,100,100 then only 230 is inserted as the %s inside the format.

I just found the solution:
When we have a comma separated string, the first %s in the format represents the first value, the second %s the second and so on.
Example (you can set the outgoing value format via PaperUI and it will do the necessary escapes for you):
color state: 230,100,100
outgoing value format: {"color": {"hsb": "%s"}}
result: {"color": {"hsb": "230"}}
… doesn’t work!

outgoing value format: {"color": {"hsb": "%s,%s,%s"}}
result: {"color": {"hsb": "230,100,100"}}
… exactly what we need :slight_smile:

I also made a pull request to update the readme of the mqtt-binding.

3 Likes