HSB Colorpicker sets 50% Brightness when color is "picked"

This is remarkably simple.
Clicky-slidy user actions at the UI generate commands to openHAB Item.
All Item commands are shown by default in your events.log
So for your problem above, a simple events.log extract will do.

Via Tasmota’s web interface I set color to red with full saturation and brightness.


The corresponding log looks like this:
2020-10-21 15:12:13.923 [vent.ItemStateChangedEvent] - BTL_bulb_1_color changed from 359,63,100 to 359,100,100
When I open the colorpicker after an reload, it shows correct values:

After changing the color 1 or multiple times, brightness jumps to 50%.

The log does not give any hints in this:
2020-10-21 15:17:01.278 [ome.event.ItemCommandEvent] - Item ‘BTL_bulb_1_color’ received command 238,92,100
2020-10-21 15:17:01.327 [vent.ItemStateChangedEvent] - BTL_bulb_1_color changed from 359,100,100 to 238,92,100
2020-10-21 15:17:05.348 [ome.event.ItemCommandEvent] - Item ‘BTL_bulb_1_color’ received command 116,6,100
2020-10-21 15:17:05.427 [vent.ItemStateChangedEvent] - BTL_bulb_1_color changed from 238,92,100 to 116,6,100
2020-10-21 15:17:08.384 [ome.event.ItemCommandEvent] - Item ‘BTL_bulb_1_color’ received command 46,98,100
2020-10-21 15:17:08.424 [vent.ItemStateChangedEvent] - BTL_bulb_1_color changed from 116,6,100 to 46,98,100
2020-10-21 15:17:09.315 [ome.event.ItemCommandEvent] - Item ‘BTL_bulb_1_color’ received command 303,82,100
2020-10-21 15:17:09.391 [vent.ItemStateChangedEvent] - BTL_bulb_1_color changed from 46,98,100 to 303,82,100

Additionally, when the colorpicker is closed and opened again, it shows a white color:


Closing the colorpicker and reloading the page solves this issue.

So, from standard log events I don’t see a hint why the GUI misbehaves.
I tried to set log level to debug, but I’m flooded with logs in this case.

Okay, that’s good. openHAB is doing everything it should.

That’s not going to reveal anything about what the UI is doing independently.

So, which UI are we talking about? One of the sitemap based ones it seems. If it is BasicUI, everything in that old post still applies. Try it on ClassicUI to see if that is better behaved. The BasicUI colorpicker widget is deficient, and no-one has logged a github issue for it.

BasicUI in order to enable the iOS app.

Yes, looks like.

I cross checked it with HABPanel, which works fine.

Does it make sense to raise an issue on github, since OH3 is on it’s way?

Not a fair comparison since it does not use sitemaps.

I would say so. Might be a trivial fix. Might get ignored “won’t fix”. Might have carried forward the same code in OH3 UI.

Github issue: https://github.com/openhab/openhab-webui/issues/427

1 Like

Two years later (almost 3) the color picker is in the same situation.
Is it there any other way to choose color from the sitemap? sliders? something?

There were no contribution during this time to replace the existing color picker.

See this [BasicUI] HSB Colorpicker sets 50% brightness when color is “picked” · Issue #427 · openhab/openhab-webui · GitHub

=> can you please let us know if your items have a state presentation part in their labels?

Color	LuzRGBHUE     	"Color luces RGB TODAS"        	                <colorlight>  {channel="mqtt:topic:local:RGB:LampRGB", channel="mqtt:topic:local:RGB2:LampRGB2", channel="mqtt:topic:local:TV_RGB:LampRGB3"}	
Switch	LuzRGBSwitch    "Switch luces RGB TODAS"    	                <lightbulb>	  {channel="mqtt:topic:local:RGB:LampSwitch", channel="mqtt:topic:local:RGB2:LampSwitch2"}
Dimmer  LuzRGBCT        "Temp Fria/Calida TODAS [%d]"                   <lightbulb>	  {channel="mqtt:topic:local:RGB:LampCT", channel="mqtt:topic:local:RGB2:LampCT2"}
Dimmer  LuzRGBbrillo    "Brillo TODAS"                                  <lightbulb>	  {channel="mqtt:topic:local:RGB:LampRGBbrillo1", channel="mqtt:topic:local:RGB2:LampRGBbrillo2", channel="mqtt:topic:local:TV_RGB:LampRGBbrillo3"}

Ok. That destroys my hypothesis :frowning:

@elcosomalo is it correct that you have these four separate channels? If so then the problem is perhaps not in the color picker but rather in your channels themselves.

In particular if you have one channel that is RGB, then you need to be aware that this does not contain brightness information. An you have another seperate Brightness channel that does not contain colour information.

By contrast the OH color picker contains BOTH color and brightness in one channel. This is encoded as an HSB value. So if you want to use the color picker, the you need some way that converts your input RGB color value together with your input brightness value to create a single combined HSB channel whose data can be used with the color picker. You will also need to split the HSB output of the color picker into two parts that you send to the device as RGB and brightness separately again.

There is a similar issue with the Color Temperature. A white lamp can have a Color Temperature (cold … warm) which represents a very specific locus in the RGB or HSB color space. Whereas a full color lamp has a large range of capabilities. Normally you can/should only use either CT and brightness, or RGB and brightness, controls on a given lamp. Mixing them up does not really make any sense.

EDIT: and can you please explain how your items seem to be connected to two mqtt channels?

Names are just “RGB” because that’s what the lamps are after all. I’m using the “Color” type so I think thats enough. I’ve tried ColorHSB but I also had the problem with the color picker.
Two of the lamps are RGB + CT. One is a led strip with no CT.

EDIT: and can you please explain how your items seem to be connected to two mqtt channels?

Simple, they control 3 devices with one single item since I want all those to have the same values.

I am frightened by your use of the words “just” and “simple” … you think it should simply just work but evidently something doesn’t… ??

How does the item look in the main UI (e.g. below)? Do you have valid values for all three HSB elements (H=0…360, S=0…100, B=0…100)?

And to be more specific, if you use an external manual control of the lamp, do the respective values move on the UI? If any of the values are ‘stuck’ this tells you that the problem arises from how the channel reads your data from MQTT…

Hmm. I would nevertheless advise you to use one item per channel, at least until the issue is resolved.

The conventional way to do this is to link three devices with three individual Items, and in addition manage them with a Group. This prevents unwanted interactions, and also still allows individual control if required.

For example, consider a single Item can only have one state. With three links, its going to hold the last state reported - but not all devices might be the same, especially if there is some change in progress and they’re all reporting various things at various times.
Note that the UI widget is linked to this (poorly defined) state.

Anyway, that’s background. I think for your immediate problem you should look into your events.log and see what happens to your Item - commands, state changes - because this is really needed to understand widget behaviour.

The conventional way to do this is to link three devices with three individual Items, and in addition manage them with a Group

Thanks, I know that (more or less…) but my home is small and I don’t have many rooms / devices so the extra effort to make the groups is not worth for me, besides, this “shortcut” works perfectly well after all, the devices controlled with that “shortcut” are all using tasmota and they “understand” the commands given. The issue with the color picker has been there from the start, even with “correct” items (I have the same issue even with one item, and many people do), I’m having the exact same issue than OP.

Please lets not deviate from the color picker issue, my bad coding is not the culprit here (at least not for this issue) and there are many comments saying the color picker is broken. Don’t want to sound mean but its just to cut this here, since I see that this is already starting to go the path of the “scapegoat” (aka, “its your fault”).

I am frightened by your use of the words “just” and “simple” … you think it should simply just work but evidently something doesn’t… ??

Check OP, he has the exact same issue; I doubt he has the same item bad config that I have.

Everything works as intended from the basic ui. Just want to get a working color picker on the sitemap.

If it helps in any way, this same issue happens with the openhab app from MS store (that I stopped using long ago to favor sitemap web ui)

(deleted post was because I replied to myself)

^
If you just want to rant, then I can’t help.

EDIT: I don’t mean this badly, but if you do not want to provide further information, then there is no way forward to find a solution.

To resolve problems like this means first to diagnose, “what is going wrong”? Many things are happening in this situation, most of them not part of the problem, A valid approach is to simplify, removing clutter to gain a view of the real issue.
You know this. Apparently you do have a simpler example that also goes wrong in the same way, so just present that.

I suppose that it is worth mentioning that I discovered this issue for myself two days ago, (rather than two years ago), and that I did a lot of debugging on my own use case, and was brilliantly supported by @Lolodomo as a sparring partner and code guru. And the result is that in these two days @Lolodomo has kindly generated three PRs that address and solves, at least my own use case.

It may or may not be that these fixes also solve the OP’s use case, or @elcosomalo 's use case. Who knows? But I can only suggest that more information on those use cases, coupled with a dialog, and dedicated hard work, can probably solve them too.