Weird behavior of Dimmer in combination with a Generic MQTT Thing


I am currently trying to set up my very first equipment in openHAB. The device is a light bulb from IKEA; the exact description can be found here: “IKEA LED1624G9 control via MQTT | Zigbee2MQTT

I have successfully added the Thing to openHAB and created an ON/OFF switch which was able to command the light bulb.

However, I faced difficulties when trying to realize the dimmer. According to stdout of zigbee2mqtt (which I am using in combination with mosquitto), the broker is receiving mqtt messages. Almost everything seems to be correct with the messages, except the number that I have injected to the string via %s. The “Outgoing Value Format” was set to {“update_available”:true,“state”:“ON”,“brightness”:250,“color_temp”:%s}. Later I figured, that the update_available was unneccessary :wink:
When I have prepared the dimmer from the range 0 to 100, however, the log did not show “color_temp”=61 but “color_temp”=0.61 instead. I thought, that this was some kind of additional calculation (divided by 100), but moving the min and max of the channel did not solve the issue. The behavior was the following: Whenever I pulled the handle to a number over 100, it did not send any messages anymore, but always jumped back to the previously set value below 100:

Does anyone know what could be the reason for this? I have tripple-checked the configurations and the code, but I did not find any obvious mistake from my side. Is there any solution for this? Or a workaround if this is actually a bug?

You might find this discussion illuminates your difficulty.

A Dimmer Item has a percent type state / command, which is not just a number.

Thank you a lot!

Do you maybe have an alternative suggestion to a dimmer? Because it would be nice if I could send out numbers via UI > 1

Here’s how I do it:

Make note of the section starting

We have to make one small adjustment to the Item created for the Dimmer Channel:

That was the bit that took me a little while to work out!

1 Like

I don’t think you understood the thread I linked you to; the problem there was linking a Dimmer type Item to a number type channel. Try a matching dimmer channel type instead (which I think the GUI may still call ‘percent type’).