How to use channels correct

Hello poeple,

hope you can help me with my beginner problem:
I dont unterstand how to use the channels correct. For example my Items for a Yeelight looks like this:

Switch  Light_YeeLight1_OnOff               "Kugellampe"                <wallswitch>        (gYeelight1,gWohnzimmerlicht_Schalten)                                  {channel="yeelight:wonder:0x000000000531dd46:color"}
Color   Light_Yeelight1_Color               "Kugel Farbe"               <colorpicker>       (gYeelight1,gWohnzimmerlicht_Farbe)                ["Lighting"]         {channel="yeelight:wonder:0x000000000531dd46:color"}
Dimmer  Light_Yeelight1_Brightness          "Kugel Helligkeit"          <slider>            (gYeelight1)                                                            {channel="yeelight:wonder:0x000000000531dd46:color"}
Dimmer  Light_Yeelight1_Farbtemperatur      "Farbtemperatur"            <slider>            (gYeelight1)                                                            {channel="yeelight:wonder:0x000000000531dd46:colorTemperature"}

So i use different Items for the same channel. The advantage for me is, that over the Group it will automatically displayed in mein Sitemap (which is only a bunch of groups). I know, that for example the Color-Item support OnOff like the switch Item, but than in the Sitemap i will miss an OnOff-Switch, if i “generate” the Sitemap-Items over Groups. Until now there was no Problem, but now i use Habpanel.

In HabPanel i defined a widget “Colorpicker” (associated with Color-Item) to pick the color and another widget “Slider” also associatet with the Color-Item, so that in can choose color with the colorpicker and can control the brightness of the color with the slider. Then the following occurs:
If i use the colorpicker an choose a color, the light/item will be the color with the choosen brightness. Then if i use the slider to control the brightness, for example to 33, and the light will be at brightness 33. But then the slider or the colorpicker moves automatically to different values. It seems they interact to each other. (But only the widgets, not the item itself)

To make it Clear:
If i choose a color over the color picker with a brightness of 90, the light do what it should to. Then ich choose over the slider a brightness of 20. The light will go on a brightness of 20. But then the slider goes automatically back to that 90 (but the item/light stays at 20). So at this point the slider-value differs from the real value.

Do you have any idea?

I hope it is understandable :smiley:

Thank you very much!

Preamble: I am not using yeelight myself.
However, for other systems, not all controls are available for all devices; and in most other cases you cannot mix and match the brightness and the color channels in all bulb modes. For yeelights, please see here: https://www.openhab.org/addons/bindings/yeelight/#channels
You don’t tell us which yeelight you are using (please read: How to ask a good question / Help Us Help You) but in the docs (first link) it states that brightness is available on thing type dolphin and ceiling; and color is available on thing type wonder and stripe.
I have other bulbs (different manufacturers) where I can use brightness only if the bulb is in white mode and need to adjust brightness with the colorpicker when the bulb is in colormode.
Judging by the docs and taking it all together, the yeelights do not offer different modes, but it appears that you have to use the controls in the following combinations:

  • Yeelight LED White Bulb (Thing type dolphin ): use brightness NOT color
  • Yeelight LED Color Bulb (Thing type wonder ): use color NOT brightness
  • Yeelight LED Color Stripe (Thing type stripe ): use color NOT brightness
  • Yeelight LED Ceiling Light (Thing type ceiling ): use brightness NOT color

Hello Markus,

thank you for your answer. I think you misunderstood me. The lights itself works as expecetd. (Info: It is a color bulb an i use the correct channels). The Problem is not that the light bulb is reacting wrong on commands, it is that the interface (here habpanel) sends (only display) “wrong/unexpected” commands.

Cause i am a beginner, i thought maybe i use a wrong item-configuration / item-combination.

Maybe in other words:
I want to use in Habpanel a colorpicker-widget (for picking color) and a slider (to control the brightness of that color i picked with the colorpicker-widget) on that panel at the same time (sequential of couse).

AND

On the other side i want to use comfortable options of the sitemap, to create all items automatically with the group. For this bulb: Switch for OnOff, Colorpicker for color, Dimmer for Brightness.

All that above is working fine, the only problem is the “display-problem” in habpanel: If use the slider to put the light on any brightness value, the brightness value of the light go to that what i choose (correct). But than the slider seems to take on the value of the colorpicker-widget (so it automatically get back to that value). So the light has the correct brightness, but the slider shows the “old” value.

Greetings

Sorry, still think the above applies. Certain channels are available with certain bulbs only. I am not using HabPanel either, but your “display problem” may have to do with the fact that you are trying to use channels that according to the docs are not supported. Using BasicUI you can adjust colors and brightness through the color picker and do not need an extra dimmer, I would want to believe that it works similar on Habpanel.

As mentioned above, no unsupported channels are used and the channels are working as expected.

It seems that the Sitemap-Colorpicker sends other values (maybe hsb?) than the slider (maybe percenttype?). The Device status show:
status = DeviceStatus [isPowerOff=false, r=14, g=244, b=95, color=980063, brightness=91, ct=3764, hue=141, sat=94, isFlowing=false, delayOff=-1, mFlowItems=null, mode=MODE_COLOR, isMusicOn=false, name=]

If i use the Color-Picker-Slider (under the color ring / Sitemap) the first value changes. (as above b=95)
For me that represents the b in rgb-value, so i dont see a correlation to “brightness”)

If i use the Slider the second value changes. (as above brightness=91)

Both items have the channel “yeelight:wonder:0x000000000531dd46:color”. The first is a color-item and the second a dimmer-item.

that is correct; some things can accept different types though: Things | openHAB

You keep insisting that all the channels are supported, but the docs clearly spell out which channels are supported for which types (and which not); which is different from your claim. Sorry, as I do not have yeelights, I cannot experiment and can’t help you there anymore.

Yes i read that documents, thats the source of that claim. Thank you anyway for your support.

Maybe there is somebody with yeelights.

Greetings

I can’t help with your specific problem but I can explain a bit the RGB/HSB.

Both are ways to represent color and brightness. In RGB, when you increase brightness, all three values will increase in tandem. In HSB, the color is represented differently. The first value is the Hue, the second is the Saturation, and the third is Brightness. When you increase the brightness only the last value will change.

It is possible to convert between the two representations of color, but only one or the other would be used. Also, there is loss of precision since brightness only goes from 0 to 100 but RGB values usually go to 256.

I read into HSB-Type before and i think you are right, there is some transformationen problem.

The picture shows it. With the circle in the colorpicker (red) i can control the three rgb-values. With the slider under the colorpicker (blue) i can control the “b”-value.
So with the colorpicker i have no chance to change the brightness-value of that bulb.

With the second item (Dimmer) which creates the slider (green), i can control the brightness value. But then begins the dilemma as described above ;(

The hope is, that there is something i dont understand -> there is a solution :wink:

Thank you for your help.

I will try again. When I am using a colorpicker it operates in HSB values, the circle (red in your pic) controls H and S (hue and saturation), the slider underneath controls B (brightness). As you picture shows, you picked green as color and the slider underneath changes the brightness from green (100% to black 0%). If you were to pick the center of the color wheel, the lamp would go white.
By the way the up and down arrow in your sitemap (next to the palette, at the very top right in your pic) will also work as a dimmer. With a short and long press action (on/off vs dimming).

What you have circled on the left are rgb values (where b stands for blue). I am not exactly sure how the yeelight binding is implemented, but I would believe that if your slider below the color wheel does not operate as a dimmer regulating the intensity of whatever color you picked in the color wheel (and the bar will dynamically change color to match the one you picked), you may have found a bug.

And, lastly, color lamps cannot operate a color temperature channel (which just returns a value from 0-100). You need to select the color in the color picker. There are exceptions, e.g., Shelly bulbs, who need to be set explicitly in either a white mode or a color mode and then operate either exclusively over the dimmer and color temperature OR exclusively through the color picker, but never both at the same time.

Yes i think what you describe is correct. I wonder how other people solved that.

The exception you describe is for yeelight the channel “colorTemperature”, where i can control the white led. The mode-switch is automatic and the channel works as expected.

After your answers i think its something in the binding source code to change, but thats outside my skills :slight_smile:

Thank you for your help.

1 Like

Hello again,

maybe someone is interested in that simple workaround:

I have unbound the Dimmer Brightness Item from the color channel and wrote a “Workaround-Rule” in which i send Percenttype to the Color Item. That solved the problem.

rule "Yeelight1_Debug"
when 
  Item Light_Yeelight1_Brightness changed 
then 
  Light_Yeelight1_Color.sendCommand((new PercentType(Light_Yeelight1_Brightness.state.toString).toString))
end

Greetings