Hi,
since i updated to hass 0.7 the white channel of my “Magic Light” (flux_led) controllers aren´t working anymore.
I have 3 lightstrips in use and everything worked fine, the brightness slider in HA did turn the white channel up/down (if i remember correcty), but now i only can control rgb with HA.
Mostly they get triggered by an automation with a light i setup in the MagicHome app, so HA normally just turns them on/off. Now when the automation gets triggered, the strip flashes rgb"white" on 100%, then gets dark, but is still “on”.
I tried to set the “rgbw” value in my config, but that didn´t change anything.
Even did a new install of hass.io but still can´t get the white channel to work again.
Ok…solved it.
Just had to put all strips in one “light” component in the config.
Seems like hassio doesn´t like them to be seperated anymore.
I don’t think this really is solved. @oblogic7 I think this problem was introduced in 0.7 between bugs https://github.com/home-assistant/home-assistant/pull/14476 and https://github.com/home-assistant/home-assistant/pull/13985
I’m currently on 0.77.3 and since about 0.7 these Flux Leds haven’t worked right. The white channel isn’t working at all, and setting colors and brightness is inconsistently working.
What Flux controller/bulb are you using? I am currently investigating an issue with RGBW bulbs where the W channel is not able to be controlled independently. Do you have an example service call of what inconsistent behavior you are seeing with color and brightness?
I’m using the originals this flux_led component was designed around. (MagicLight/Flux WiFi Color LED Light Component) It is the v5 bulb from Flux.
It is a bulb that has two “channels,” the color and the warm, according to the Magic Home app.
At this point, behavior is completely erratic. Prior to version ~ 0.7, when I turned on the light and changed brightness, it would use the warm channel. Following that, it would use the color channel. Haven’t been able to use HA to switch on the warm channel at all. I can turn on and off the bulbs. The colors don’t respond, either. Effects do work. Sometime in the last couple of versions, brightness settings don’t do anything.
I don’t have example service calls. Been a while (since around ~0.53) since I’ve been knee deep in this system, and I’m a bit rusty on the in’s and out’s. If you have something you want me to try, detail it out and I’ll be happy to try and give you feedback.
OK, I think I fixed it.
The issue is in the flux_led.py component file, in the turn_on() method.
There is a handler for rgbw mode bulbs, but it doesn’t work correctly.
The original code looks like this:
# handle RGBW mode
elif self._mode == MODE_RGBW:
self._bulb.setRgbw(*tuple(rgb), w=white, brightness=brightness)
The problem is passing w=white to set white value doesn’t work and breaks calls to changing the color.
The solution is to change that code to look like this:
# handle RGBW mode
elif self._mode == MODE_RGBW:
#check if setting warm white or rgb value
if 'white_value' in kwargs.keys():
self._bulb.setWarmWhite255(white)
else:
self._bulb.setRgbw(*tuple(rgb), brightness=brightness)
We need to check if we are setting warm white, or if we are setting rgb & brightness, and make a different library call for each condition.
I will submit a pull request to fix this in a future release but for now you can test this on your own machines. If you do, reply back so I know if the fix works for you or not.
Thanks for your work on this btreecat, its something I’ve struggled with for a while but don’t have enough understanding of the python code to fix myself.
I’ve got magic home bulbs as well, and had a lot of the same problems as the OP. I tested your new code, and it does seem to be an improvement. Now I can independently adjust the “color brightness” by selecting a color on the wheel and/or adjusting the brightness slider, as well as the “warm white brightness” by sliding the white value slider.
There are however a couple problems still.
1.The main issue - If I set the bulb to “warm white” mode by sliding on the white value slider, I get the desired effect. However if I turn the bulb off, then back on, the color is defaulted to white (rgb 255.255.255), and the brightness and white_value 0.
- Would be nice to also be able to set the cool white brightness.
It would also be nice to be able to define which brightness control (white or rgb) controls whether the state is on or off. Very annoying turning RGB to 0 and having it turn off when I want just pure white, so I end up having to leave RGB very low but still on.
Or it could be an or situation, ideally, by default.
Yes!!! That did it! Thank you!
It works now. I can turn on and off the lights. I can change colors and switch back to white from color mode by turning up the white value.
But when I tell Google to set the brightness of the light to 10%, when it is on white mode, brightness settings turns it back to rgb mode. I would expect brightness to change the white level if it is in white mode.
This sort of does what I want. But switching between white and rgb mode needs to turn the light on and off.
# handle RGBW mode
elif self._mode == MODE_RGBW:
#check if setting warm white or rgb value
if 'white_value' in kwargs.keys():
self._bulb.setWarmWhite255(white)
# Called a change to white level
elif 'brightness' in kwargs.keys() and white > 0:
self._bulb.setWarmWhite255(brightness)
# Called a change to brightness in white mode
else:
self._bulb.setRgbw(*tuple(rgb), brightness=brightness)
# Called a change to something else
I made a custom component to test this and it works great, thank you! Any chance you or @btreecat will submit a pull request?