Zigbee2mqtt revisited: No more ugly transformations

the new version zigbee2mqtt 1.9.0 supports: “color values in HSB/HSV/HSL notation”

    // Hue, saturation, brightness (in HSB space)
    "hsb": "360,100,100"

At the moment it seems you can not set HSB/HSV/HUE value directly. You still have to use JSON with surrounding ‘color’ tag. So it’s now working with a small formatting, but without ugly transformation.

here is the working configuration for my Osram RGBW bulb:

.things

    Thing topic osramrgbbulb "osramrgbbulb" {
    Channels:
        Type switch : power "Power" [ stateTopic = "zigbee2mqtt/0x7cb03eaa00ada0df/state", commandTopic = "zigbee2mqtt/0x7cb03eaa00ada0df/set/", on="ON", off="OFF" ]
        Type string : color "Color" [  stateTopic = "zigbee2mqtt/0x7cb03eaa00ada0df/color-hsb", commandTopic="zigbee2mqtt/0x7cb03eaa00ada0df/set" , formatBeforePublish="{\"color\":{\"hsb\": \"%s\"}}" ]
    }     

.items

String WZ_OSRAM_Bulb_Color  "WZ_OSRAM_Bulb_Color"  <light> { channel="mqtt:topic:mosquitton:osramrgbbulb:color"}

.sitemap

Colorpicker item=WZ_OSRAM_Bulb_Color
9 Likes