Flux_led (aka MagicLight) BROKEN in latest release

Hi all,

I’ve been running HA for a couple of years now. My setup consists of Zwave, MagicLights (bulbs and controllers), Nest (was integrated…enough said :frowning:), Yale lock, MyQ Garage Controller, sliding door sensors, 4n1 sensors, and a Ring doorbell.

I recently reloaded my RPI3 with the .99 release and redid all of the integrations, mostly due to lovelace and the new entity integration and the new configuration files.

I’ve been trying to figure out why my lights started to act strangely, sometimes not turning on, couldn’t change colors, interface wouldn’t respond…I thought it was due to me not knowing Lovelace or misunderstanding the configuration file.

Now I’m seeing that the flux_led driver/interface(?) is throwing an error:

2019-10-01 10:35:53 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1684899408] 
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
    connection.context(msg),
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/core.py", line 1234, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/core.py", line 1259, in _execute_service
    await handler.func(service_call)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/light/__init__.py", line 310, in async_handle_light_on_service
    await light.async_turn_on(**pars)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/flux_led/light.py", line 336, in turn_on
    self._bulb.setRgbw(*tuple(rgb), w=white, brightness=brightness)
  File "/srv/homeassistant/lib/python3.7/site-packages/flux_led/__main__.py", line 869, in setRgbw
    raise Exception
Exception

I used the flux_led in standalone mode and see it performs correctly.

rene@matrix:~/Development/flux/flux_led$ python -m flux_led 192.168.1.225 -w 100
Setting warm white mode, level: 100%

SO, what the heck changed?? I also saw someone else report the same error in Github. Do we have an idea of what the change is and how/when can this be fixed? I’ll keep digging around but I’m not that well versed as to exactly how to do it, so I might take a while to figure this out. In the meantime, my house light setup SUCKS…

Anyone have any ideas?

1 Like

Replying to my own note…
I found that if I just use light.on and light.off, it works.

What doesn’t seem to happen is any action where I try to set the brightness, color, etc.
It seems that it throws an error due to (I Think…) setting up color AND whiteness at the same time. I saw a comment a while agon about lights with rgb and warm white and white and how to handle them. It seems the code changed awhile back to accommodate this.

I think it was a bug that got fixed. Try moving up to a newer version.

Hmm, I’m running 99.2, did it just get fixed?

Just tested:

  1. lights set to “rgb”, color changes work
  2. change from “rgb” to “rgbw”
  3. lights turn off, don’t turn on

FAILED…

I have been having the same issue lately. My first installation of HA, around 2 month ago controlled my 3 MagicLights perfectly, on, off, color and brightness. As it was my first time I started experimenting with HA to reinstall everything like 2 weeks later. My lights, which are working perfectly with the MagicHome app, cannot be switched on from HA.
When switched on, nothing happen in the bulb and the switch goes off in HA after a second or so. When I switch on and off quickly, I see a flash in the bulb, but nothing else.
However, when I switch the lights on with the app, HA show them on, and I am able to change the color and switch them off in HA.
I’m currently using the latest HASSIO 0.99.3

I have the same issue. Lights work correctly with the MagicHome app, but not in HA. When I try to turn the lights on in HA, they flash one quickly and then turn off even though the switch is set to “on”. However, If I change the effect to something like strobe, it works as it should. It seems like only the effects work through HA. Simply turning the lights on or off doesn’t work.
This issue started occurring for me sometime after I upgraded around v0.95 (I don’t remember exactly when). I’m currently running 0.99.3.

I have a sort of fix. Just set your devices as rgb or w. Then the automations seem to work.

RGBW makes it go crazy.

Unfortunately I have tried multiple times with rgb or rgbw or omitting this setting (defaults to rgbw I believe) but haven’t noticed any difference…

I have also been trying a couple of modified ‘flux_led/lights.py’ I have found in Github, creating custom_components with them to override the original one, but still no differences. I know a bit of coding but this is my first experience with HA or Python so I am not able to understand how it works and debug it.

The Ledenet controllers running v8 firmware don’t seem to work, the ones with v6 do.

If anyone is still having the light immediately turns off in HA after turning it on issue with the Magic Home/Ledenet controllers I’ve posted a possible fix for it here:

Seems like this is still a problem. I’ve had a v4 controller running fine and able to be controlled as expected for about a year. Bought another one last week, a v8, and it didn’t work. I have to power cycle the controller, then it appears as on in HA. Once on, I can change the color and brightness, but if I turn it off then I lose control. I can try to turn it on again but it only goes to the dimmest red setting, then I can’t turn it off unless I quickly click it like three times. No real control after that, never goes to what I had it set to, only that dim red color after playing with the button. Weird part is if I quickly hit the toggle then it briefly flashes the set color/brightness before turning off. If I power cycle the controller it boots up to what I had it set to initially then, and I can then control the color/brightness again until I turn it off.

I thought it might be just the one controller, so I returned it for a different brand but it’s the same behavior.

I do have to try John32’s fix.

Any word on a possible fix from within the component/integration in HA?

I purchased two this week with the same problem. Works fine in Google Home, but if I turn off I lose control and I have to power cycle to get the devices to work i.e. unusable.

I really hope someone fixes as they were very cheap and I’ll be buying more if they work 100%.

I have the same issue as DZMM. native app or google home work fine. Once HA powers off I’ve lost control and have to cycle power the supernight wifi ledcontroller.

I’ve tried the above fix but the supernight leds still do not turn on

Hello guys,

FYI i just recieve a v8 controller from aliexpress and i got the same issue, i have uploaded recommanded configuration from : https://github.com/CorneliousJD/flux_led and it all work fine regarding ON/OFF function but there is still a “one tap lag” when i try to adjust oher settings like brightness or color (for exemple when i switch the color from blue to green on the home assistant app, when i click on green the led strip color change but it stay stuck on blue in the app, and if i change the color again for red it will be set on green color on home assistant app).

so i think there is an overall issue with some states in the wifi controller, but since i’m pretty new on home assistant i will not spent time on this right now and i will consider the tasmota option later.

1 Like

Anybody managed to fix these lights?

I only managed to fix this by flashing Tasmota.

Sadly wthere is a ZJ-WFMN-D V1.2 version out which cant be flashed with the esp or testamota.