IKEA LED Driver and ZigBee2MQTT

Hi, i am using an IKEA Tradfri LED Driver with ZigBee2MQTT. Its connected and i get states and so on. But my only problem is, that the brightness gets wrong transmitted to the driver.

If i set my dimmer item to 100, the driver gets 1, instead of 100. If i set it so 28, it gets 0.28 instead of 28. Hope, someone can help me.

.things

Thing mqtt:topic:IKEA_Treiber_1 "Z2M: IKEA Treiber 1" (mqtt:broker:823098e4c9) {
    Channels:
    Type number : light "Licht" [stateTopic="zigbee2mqtt/IKEA_Treiber_1/get", commandTopic="zigbee2mqtt/IKEA_Treiber_1/set", formatBeforePublish="{\"brightness\": \"%s\"}"]
}

.items

Dimmer Z2M_IKEA_Treiber_1 "IKEA Treiber 1" <light> {
    channel="mqtt:topic:IKEA_Treiber_1:light"
}

MQTT.fx output (after sending 47)

{"brightness":0.47,"linkquality":87,"state":"ON","update":{"installed_version":65538,"latest_version":65538,"state":"idle"}}

Driver is found here:

If i can send the state multiplied by 254, it may work. But how do i add multiplications in the .things file?

I hope someone can help me.

Changing Type number to dimmer fixed it partially.

Thing mqtt:topic:IKEA_Treiber_1 "Z2M: IKEA Treiber 1" (mqtt:broker:823098e4c9) {
    Channels:
    Type number : light "Licht" [stateTopic="zigbee2mqtt/IKEA_Treiber_1/get", commandTopic="zigbee2mqtt/IKEA_Treiber_1/set", formatBeforePublish="{\"brightness\": \"%s\"}"]
}

Now i am getting a range from 0 to 100. But i need 0 to 254. I dont want to modify the item, because i still want to use 0% to 100% in the item.

Is there a way to multiply the received state by 2.54 to get the right state sent to the driver?

There are parameters on the dimmer channel that lets you specify a minimum and maximum value and the binding will do the multiplication for you.

I don’t like looking stuff like this up so I don’t use text based configs (in the UI all the parameters are right there with explanation) but I’m pretty sure they’re covered in the docs.

Thank you so much. You did help me. I like the text based configs way more the the UI stuff. With your help i found these informations:

  1. Instead of using brightness, you can use brightness_percent. With this it works flawless. But thats nowhere mentioned.
Thing mqtt:topic:IKEA_Driver "Z2M: IKEA Driver" (mqtt:broker:823098e4c9) {
    Channels:
    Type dimmer : light "Light" [stateTopic="zigbee2mqtt/IKEA_Driver/get", commandTopic="zigbee2mqtt/IKEA_Driver/set", formatBeforePublish="{\"brightness_percent\": \"%s\"]
}
  1. define a range at the end of the dimmer config. min=0, max=254 did the trick.
Thing mqtt:topic:IKEA_Driver "Z2M: IKEA Driver" (mqtt:broker:823098e4c9) {
    Channels:
    Type dimmer : light "Light" [stateTopic="zigbee2mqtt/IKEA_Driver/get", commandTopic="zigbee2mqtt/IKEA_Driver/set", formatBeforePublish="{\"brightness\": \"%s\"}", min=0, max=254]
}

Both solutions work as i wanted it in the first place.

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