Clivar / magichome-adapter

Magic Home bulb adapter for WebThings Gateway.
Mozilla Public License 2.0
0 stars 0 forks source link

[FEATURE REQUEST] RGBCW support #2

Closed Zaacis closed 3 years ago

Zaacis commented 3 years ago

Describe the bug This isn't so much a bug as it is a limited functionality report. I don't have control over the white element of my rgbcw lights

To Reproduce Steps to reproduce the behavior:

  1. It all works for color.
  2. There is no option to get to white mode.

Expected behavior Ideally I would have 4 sliders. White and 3 for RGB. Last touched decides the mode.

Which Magic Home device

Additional context I have played with socket control on this device and discovered that there are two modes. White and RGB. They cannot be used simultaneously. In other words if I have a red element on, even at only 1% white must be off always. If I turn white on, even to only 1%, then R G B will be off. While I can combine the RGB to make a pseudo-white it is not nearly as bright nor warm as the white element.

Clivar commented 3 years ago

It seems it is not detecting the ledstrip as RGBW. I assume the bytes pattern during discovery matches only the RGB variants. This package uses flux_led internally with some of my own fixes for the devices I had on hand. They also don't seem to list RGBCW as supported.

Expected behaviour in my eyes would be the addition of a white temperature slider on top of the color selector (not 4 sliders). Both can't be combined sadly, The controller (at least mine) does not allow me to set a white value on top of an RGB value. As you said: the last touched setting would win.

I will look into adding a debug mode so you can pass me more information about the controller during discovery. I suspect they will only be minorly different over the RGBWW controllers.

Zaacis commented 3 years ago

I am looking at the code and you are exactly right about the detection being inaccurate. A small modification to flux_led may be enough to fix it however I will follow up there. At around line 600 it detects the light type and this light responds that it is a 01 type(WW) whereas to truly determine mode and account for the type it needs to probably analyze device type as well as device mode.