I am trying to figure out how to define a Zigbee2MQTT Ledvance item in OpenHab 4. I have several Hue Color lights working in OpenHAB via Zigbee2MQTT, but I cannot figure out how to control the color of the Zigbee2MQTT light below. The Hue devices I have working are using the color_mode=xy, but Ledvance seems to be using the type “color_temp”. Anyone got this working?
Can anyone give me a hint on how to get this working?
Also, may I kindly ask for a config snippet from your brightness/dimmer configuration. I am starting to believe that my item configuration for zigbee2mqtt lights are configured far from ideal, though dimming seems to work for me.
The config below works, but I suspect that the topics are quite from ideal?
- id: brightness
channelTypeUID: mqtt:dimmer
label: Brightness
description: null
configuration:
commandTopic: zigbee2mqtt/vilde/lights/color/set/brightness
min: 0
stateTopic: zigbee2mqtt/vilde/lights/color/brightness
max: 254
off: OFF
on: ON
Should I have used “FormatBeforePublish” in this config as well?
Now I have rewritten the config as follows. I am not sure if the “get” part is correct? I can adjust brightness from OpenHAB, but direct changes via the dashboard in Zigbee2MQTT is not reflected in OpenHAB. Is that by design, or is my config still not ideal?
- id: brightness
channelTypeUID: mqtt:dimmer
label: Brightness
description: null
configuration:
min: 0
formatBeforePublish: '{"brightness": %s}'
max: 254
commandTopic: zigbee2mqtt/vilde/lights/color/set
stateTopic: zigbee2mqtt/vilde/lights/color/get
transformationPattern: '{"brightness": %s}'
off: OFF
on: ON
Everything seems to be working for me now. The only thing I am not 100 percent sure about is if my OpenHAB should be able to pick up changes made directly via the Zigbee2MQTT GUI? If I change a value directly in the Z2MQTT, the value in OpenHAB isn’t adjusted accordingly. Is that a configuration problem, or is it by design?
Yes, I think you are right. I must be a configuration issue. I am able to receive data from the PIR sensors in Z2M so it should be possible to get info from the light back to OpenHAB via Z2M. I don’t need to be able to control the light directly via Z2M, so I think I will manage just fine. Thanks for your help.