Can't change LED color on MagicHome LED controller

Hi Guys, Hi @Danielhiversen

sorry for late response.

Today i updated to 0.36.1 and tried the new stuff with the LEDENET-Protocol.

Unfortunately for my v3 it is/was not working.

I did some comparing of the code with the old file

I had to comment one line (Line 709) in the setRgb Section (sorry if Section is wrong, I’m not a developer so i don’t know the real Word for this Python-Stuff :smile: )

Here is what i change

def setRgb(self, r,g,b, persist=True, brightness=None, retry=2):
    if brightness != None:
        (r, g, b) = self._calculateBrightness((r, g, b), brightness)
    if persist:
        msg = bytearray([0x31])
    else:
        msg = bytearray([0x41])
    msg.append(int(r))
    msg.append(int(g))
    msg.append(int(b))

    if self.protocol == "LEDENET":
        msg.append(0x00)

msg.append(0x00) --> to comment out (# is not working here in the Forum for me)
msg.append(0x00)
msg.append(0x0f)
try:
    self._send_msg(msg)
except socket.error:
    if retry:
        self.connect()
        self.setRgb(r,g,b, persist, max(retry-1, 0))

It looks like, there is one msg.append(0x00) too much.

Anyone here can confirm?

Heres my complete File after changes:

http://pastebin.com/bq5A5pee

BR

Lukas

If I’m not mistaken, the update was designed for the V1 controllers only. I haven’t used my V3 in a while and I bought several V1’s that I’m currently using. The update that came with .36 does allow color changing on V1 LEDENET controllers. I suspect there will be a need to add an additional param to specify the version number of the controller since they use a slightly different syntax.

@Danielhiversen, looks like @outrun is using a V3. Earlier in this thread we ran the scan to retrieve the raw info from our controllers. Looks like the 11th value in the raw data states the version number of the controller. Not sure how easy this would be to implement to auto discover the device version.

V1
python init.py --scan --scanresults --info
ACCF23DEDA14 [192.168.0.18] False [Color: (255, 255, 255) raw state: 129,37,36,97,33,1,255,255,255,0,1,240,240,43,]

V3
python init.py --scan --scanresults --info
ACCF239EFD08 [192.168.0.73] ON [Color: (180, 20, 17) raw state: 129,4,35,97,33,16,180,20,17,0,3,0,0,22,]

Or maybe it could be manually configured with something like…

light:
  - platform: flux_led
    devices:
      192.168.1.10:
        name: NAME
        protocol: 'ledenet'
          version: 'v3'
1 Like

Hi,

I have the same problem. Can only use HA to turn on/off the led. However, it works flawlessly with the magic home app. My controller is as below. (sorry there’s some Chinese in the link :slight_smile:)
https://item.taobao.com/item.htm?spm=a1z09.2.0.0.tOt3L2&id=520136167094&_u=q1vetme92964

I cannot do any coding but can definitely help to test if needed.

Thanks!

So glad I’m not the only one with these problems. I felt like I was taking crazy pills!

I’ve been doing some troubleshooting myself, and have been trying to modify the init.py for flux_led in an attempt to get my lights working.

Looks like the protocol for the V3 hubs.

Let me know if I can be of help on testing or anything!

With modifications, the v3 is already working. You could create a custom component or modify the existing init.py

Above, in this thread should be the information you need.

There is work in progress to add support for more devices: https://github.com/Danielhiversen/flux_led/pull/23

So if you want make sure that your device will be supported, you should test the pull request and add support for the protocol needed by your lights if it is missing.

@Danielhiversen Thanks for the update. I try to follow upcoming changes but I missed this one. The activity on this is looking good. Thanks again.

Hi,

I am using a UFO type LED controller. Before the 0.38 updates, i was using the LEDENET protocol. The color wouldnt change but on/off works very well.
After the update,

  1. if i do not use LEDENET protocol, the color/ brightness can be changed.
  2. no matter which protocol i use, the on/ off is very irresponsive and often times after i first switch on the LED, the HA status wont be updated and i cannot turn it off anymore.

Any one is experiencing the same issue?

He @yungling,

For my ufo it is working flawless. Here is my Config for thr device:

 - platform: flux_led
  devices:
    192.168.0.73:
      name: 'TV Ambiente'
      mode: "rgb"

Hope it helps you out.

BR

Lukas

Hi @outrun,

After one night, the LED magically works very smoothly…
Have no idea what has been changed. But now it seems very normal and responsive.
I will keep monitoring and report if anything odd. Thanks for the help!

I found the change i made in these two scenarios.
When i turn off “discovery”, the LED works perfectly.
But after i turn it back on, the lag happens again. Not sure if they are 100% related but the result can be reproduced.

@yungling
I also have discovery disabled, but if i turn discovery on the LED also works without issues.

BR

Lukas

We have a known problem with discovery caused by the flux_led discovery support recently added. You can track the problem here and here. A fix is coming shortly.

Thanks for informing! I keep the auto discovery off for now. :slight_smile:

Is there any way to make these fade on and off instead of an instant on/off?

EDIT: After redeploy HA 0.39.3 everthing works again.

After upgrade to HA 0.39.x my v3 controller is not working anymore. I think it has to do with the effect changes on the Flux-LED Component. At the moment on is possible. Nothing else

Please, report it here: https://github.com/home-assistant/home-assistant/issues/new

@Danielhiversen after redeploy 0.39.3 everthong works fine. Looks like something got wrong on the update cycle

1 Like

I have a v1 controller that has been working great. So I decided to buy another one. Here’s a link to it. However, it is not working right. I can change the brightness on it, but whenever I do, it changes to white. If I set the color to something else, it goes to 100% brightness on that color, and then changes back to white when I change the brightness.

Another weird thing is that no matter what I change the colors or brightness to, the States page always shows rgb_color: 255,255,255 and brightness: 13

I also decided to use the HomeBrige-MagicHome plugin for HomeBridge, and that works perfectly for both lights.

Does anyone have any idea as to why this is happening? That homeBridge addon is also written in python. It may be a good idea to borrow code from that. It works very well. It is able to automatically detect the type of controller that is being used. Any help would be greatly appreciated.

Another thing I noticed on the second controller is that when I click on it in Hass, it has a drop down for effects. The old one doesn’t have that. It’s like it is treating as a different model even though they are clearly the same.