ZigBee2MQTT Color channel and brightness

Hey, i am experiencing a problem and find no way to solve it.

I am adding this Hue bulb via ZigBee2MQTT

Thing mqtt:topic:E27Birne_Aquarium_4 "Z2M: Licht Aquarium 4" (mqtt:broker:823098e4c9) [availabilityTopic="zigbee2mqtt/E27Birne_Aquarium_4/availability", payloadAvailable="online", payloadNotAvailable="offline", transformationPattern="JSONPATH:$.state"] {
    Channels:
    Type dimmer : brightness "Helligkeit" [stateTopic="zigbee2mqtt/E27Birne_Aquarium_4", commandTopic="zigbee2mqtt/E27Birne_Aquarium_4/set/brightness", transformationPattern="JSONPATH:$.brightness", min=0, max=254]
    //Type color : color "Farbe" [stateTopic="zigbee2mqtt/E27Birne_Aquarium_4", commandTopic="zigbee2mqtt/E27Birne_Aquarium_4/set", formatBeforePublish="{\"color\":{\"h\":%s,\"s\":%s}, \"brightness\":%s}", colorMode="HSB"]
    //Type color : color "Farbe" [stateTopic="zigbee2mqtt/E27Birne_Aquarium_4/color", commandTopic="zigbee2mqtt/E27Birne_Aquarium_4/set",formatBeforePublish="{\"color\": {\"rgb\": \"%s,%s,%s\"}}", colorMode="RGB"]
}

As you can see i uncommented 2 channels. The brightness channel works as expected, the color channels do not.

Type color : color "Farbe" [stateTopic="zigbee2mqtt/E27Birne_Aquarium_4", commandTopic="zigbee2mqtt/E27Birne_Aquarium_4/set", formatBeforePublish="{\"color\":{\"h\":%s,\"s\":%s}, \"brightness\":%s}", colorMode="HSB"]

works for this bulb. Unfortunately the B from HSB (brightness) has a maximal value of 100. the brightness needs a value between 0-254. When changing the color via a sitemaps Colorpicker, the maximum brightness it gets is 100 or 39% in total.

Type color : color "Farbe" [stateTopic="zigbee2mqtt/E27Birne_Aquarium_4/color", commandTopic="zigbee2mqtt/E27Birne_Aquarium_4/set",formatBeforePublish="{\"color\": {\"rgb\": \"%s,%s,%s\"}}", colorMode="RGB"]

works too, but does not transmit a brightness value at all… So its impossible for me to update the brightness via a Colorpicker in the sitemap.

I know, i can just slide the brightness channel up. But that seems like a unnecessary step i want to avoid.

Even for rules neither of these channels is good to work with.
Am i too dumb to use the channels correctly?

After hours of testing and searching i just played around in my items file and discovered, when i link the brightness channel AND the color channel to one item the Colorpicker works flawless. (when using the RGB-type channel)

Unfortunately this is not the best solution for rules. When sending an RGBType to one of these items, when the bulb is off, they change the color, but dont update the brightness. So the old brightness gets restored.

e.g: Bulb is white and 10% brightness. → we turn bulb off → we turn it back on, by sending 0,0,255 (blue) → Bulb turns blue with 10% brightness

For it to get the right color AND brightness, i need to send it a brightness value first. This is not good for my case.

Color Z2M_Aquarium_4 "Licht Aquarium 4" {
    channel="mqtt:topic:E27Birne_Aquarium_4:color",
    channel="mqtt:topic:E27Birne_Aquarium_4:brightness"
}

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.