MQTT binding problem with Habpanel button


I have:


in Habpanel. When I press the button my event log shows:

2019-11-20 20:32:28.666 [ome.event.ItemCommandEvent] - Item ‘mqtt_topic_886f08d9_EntryChandelier1Color’ received command 255,0,0
2019-11-20 20:32:28.676 [nt.ItemStatePredictedEvent] - mqtt_topic_886f08d9_EntryChandelier1Color predicted to become 255,0,0

but I see this on published on the network:

[20:31:25] pi@openHABianPi:~$ mosquitto_sub -t '#' -v
control/arduino_Chandelier/entry/lamp1/color 0,0,0

Am I missing something? Bug with MQTT? If it is a bug can you help me with how to report it on github?



I should mention that this button worked with the 1.X MQTT binding, but not with the new one.

Can you post the channel config please?

Color EntryChandelierLamp1 “Entry Chandelier Lamp 1 Color” {channel=“mqtt:topic:886f08d9:EntryChandelier1Color”}

Thank you for the item config
Can you post the channel config please?

The other items at the bottom are blank

And your thing screenshot, please with the list of channels, thanks

When you add a color channel there are two choices:

Looks like your color get converted

I’m not sure I understand your point, but the color type I added was Color Value (Red,Green,Blue). That is the kind of message my chandelier expects to see: RGB decimal values comma separated.

Ok, The logs your reported above:

2019-11-20 20:32:28.666 [ome.event.ItemCommandEvent] - Item ‘mqtt_topic_886f08d9_EntryChandelier1Color’ received command 255,0,0
2019-11-20 20:32:28.676 [nt.ItemStatePredictedEvent] - mqtt_topic_886f08d9_EntryChandelier1Color predicted to become 255,0,0

Refer to an item: ‘mqtt_topic_886f08d9_EntryChandelier1Color
The channel is linked to the item: EntryChandelierLamp1

Change the openhab item in the habpanel config to EntryChandelierLamp1

Thanks for your help!

I changed the habpanel config. Now, when I press the button I get:

2019-11-21 07:50:43.813 [ome.event.ItemCommandEvent] - Item ‘EntryChandelierLamp1’ received command 255,0,0
2019-11-21 07:50:43.826 [nt.ItemStatePredictedEvent] - EntryChandelierLamp1 predicted to become 255,0,0


[07:50:03] pi@openHABianPi:~$ mosquitto_sub -t ‘#’ -v
control/arduino_Chandelier/entry/lamp1/color 0,0,0

There are conversions going on here. openHAB knows HSB and only HSB. 255,0,0 HSB is black. So your HABPanel is setting the color to 255,0,0 HSB. The MQTT binding receives that HSB value and converts it to R,B,G because of the Channel type you chose. Black for R,B,G is 0,0,0 and that is what get’s published.

If you want red you need to use 0,100,100 for the command value which is the HSB equivalent to RBG 255,0,0.

See,0,0 for a handy converter.

Alternatively, you can use a Text type Channel and send the String 255,0,0 which is how it appears your MQTT 1.x configuration worked.

If you keep it set up with a Color you have the option to put a Color Picker on your HABPanel instead of a discrete set of predefined colors.

Bingo! I see your answers on so many threads, thanks so much for your help on this and all of the other issues you help folks out with.

That should be in the documentation somewhere. Maybe it is and I just missed it, but with my Thing being RGB type in Paper UI, I assumed that it was speaking RGB, not translating from HSB.

I do use Color Picker already, but I find it’s impossible to get pure red (or any color) by clicking around in there so I like to have the buttons for when I just want the red LEDs on.

Thanks again!

It is. Look at the Items pages (once the docs pages come back online). The only state a Color Item can have is HSB. The RGB Channel only links to a Color Item so there has to be translation.

But if there is some clarification that you can think of that makes sense to the binding docs or the main docs, please do file a PR. This is the only way the docs will get better.