I struggled the same way Dave
but now I finally solved it for my home. I started to copy wild some code snippets, but finally it worked. I hope my solution is helping you, or not totally rubbish as soon someone else is looking at it. On the alert and effekt problem I don’t have a solution, as my device is not supporting this.
Item
Dimmer LightbulbE27RGBW1GFLivingRoomColorTemperature "Color temperature" (ZigbeeKitchenBulb) { channel="mqtt:topic:MQTTBroker:Lightbulb_E27_RGBW_1_GF_LivingRoom:color_temperature" }
Thing
Thing topic Lightbulb_E27_RGBW_1_GF_LivingRoom "Lightbulb_E27_RGBW_1_GF_LivingRoom" {
Channels:
Type switch : switch "GF_LivingRoom_Lightbulb_E27_RGBW_1" [stateTopic="zigbee2mqtt/GF_LivingRoom_Lightbulb_E27_RGBW_1", commandTopic="zigbee2mqtt/GF_LivingRoom_Lightbulb_E27_RGBW_1/set", transformationPattern="JSONPATH:$.state", transformationPatternOut="JS:switch2Zigbee2mqtt.js"]
Type dimmer : dimmer "GF_LivingRoom_Lightbulb_E27_RGBW_1_Dimmer" [stateTopic="zigbee2mqtt/GF_LivingRoom_Lightbulb_E27_RGBW_1", commandTopic="zigbee2mqtt/GF_LivingRoom_Lightbulb_E27_RGBW_1/set", min=0, max=100, step=1, transformationPatternOut="JS:openhabdimmer2zigbeebridge.js", transformationPattern="JS:huewhite2openhab.js" ]
Type colorHSB : color "GF_LivingRoom_Lightbulb_E27_RGBW_1_Color" [stateTopic="zigbee2mqtt/GF_LivingRoom_Lightbulb_E27_RGBW_1", commandTopic="zigbee2mqtt/GF_LivingRoom_Lightbulb_E27_RGBW_1/set", transformationPatternOut="JS:HSBtoRGB.js" ]
Type number : color_temperature "GF_LivingRoom_Lightbulb_E27_RGBW_1_Color Temp" [stateTopic="zigbee2mqtt/GF_LivingRoom_Lightbulb_E27_RGBW_1", commandTopic="zigbee2mqtt/GF_LivingRoom_Lightbulb_E27_RGBW_1/set", transformationPatternOut="JS:openhab2hueColortemp.js"]
}
openhab2hueColortemp.js
(function(x) {
var result = new Object();
result.color_temp = x*350+150
return JSON.stringify(result);
})(input)