Can't change LED color on MagicHome LED controller

@simpat1zq I gave it a try… Unfortantly same behavior you are describing. My Slider moves to 100℅ if a use it freuqent.

BR

Lukas

@outrun
I believe you said you had a V1 and a V3. Do you see that same behavior for both of them, or just the V1.

@simpat1zq no i have only v3, i think @Kbeesnees has a v1 and a v3

I assumed my V1 is the same as others and unless I’m missing something, the changes that have worked for others haven’t work for me. I am using RGBW strips with these controllers as well, I did try the mode RGB on both and on my V3, the brightness control works but it does have the same bug that @simpat1zq mentioned with resetting the slider to 100% while leaving the LEDs at the correct setting. I noticed after the update and not using RGB mode, I’m not able to control the white with the slider. Sorry I’m not a coder so I know I’m not the most helpful. Does anyone know if might be possible to include the white in the color selector and have the brightness slider effect RGBW? I’ll be looking into trying to packet capture sometime early this week.

I had a chance to do a bit more testing and found my error. I misread the changes for the V1 and didn’t realize it needed a third 0x00. Sorry if I caused any confusion. I can confirm the V1 revisions work on the V1 and the V3 revisions work on the V3. I do get the same effect with the brightness slider bug on both.

It seems that we need to support different protocols for different versions of the bulb.
I hope we can find a way to detect the version of the bulb. Since the is able to detect the version, we should also be able to do so.

It would be great if some people with different versions of the bulb could dowloand the latest version of the lib https://github.com/Danielhiversen/flux_led/blob/master/flux_led/init.py and run
python __init__.py --scan --scanresults --info
Then post the output and the version of the bulb here.

The script will print the received bytes for each bulb.
Some of the bytes in the received message are already known: https://github.com/Danielhiversen/flux_led/blob/master/flux_led/init.py#L512

With the latest version of Hass (0.32.3) you specify the mode for each bulb.

  • mode: “rgbw” is the default and the same behavior as before. If you change the brightness slider, the bulb will go to the white-mode.
  • mode: “rgb” will keep the color but change brightness when the brightness slider is changed.

@Danielhiversen heres the output for my v3

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,]

@Danielhiversen

Results from V1
pi@raspberrypi:/home/hass/.homeassistant/deps/flux_led $ python latest__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,]

Results from V3 Getting an error. Tried with the V1 on the network and by itself. Same result.
pi@raspberrypi:/home/hass/.homeassistant/deps/flux_led $ python latest__init__.py --scan --scanresults --info
Traceback (most recent call last):
File “latest__init__.py”, line 1416, in
main()
File “latest__init__.py”, line 1392, in main
print("{} [{}] {}".format(info[‘id’], info[‘ipaddr’],bulb))
File “latest__init__.py”, line 516, in str
pattern = rx[3]
TypeError: ‘NoneType’ object has no attribute ‘getitem

I have the XSOURCE controller here: http://amzn.to/2eeWLDm

python init.py --scan --scanresults --info
ACCF23C98FC4 [192.168.1.133] False [Custom pattern (Speed 67%) raw state: 129,37,36,96,33,11,1,173,82,0,1,0,90,177,]

Wanted to update the V1 byte information for warm white. The RGB function works with the config you posted but the warm white/brightness slider doesn’t. I found for my controller the config should be the following, line 616 = (0x00), line 617 = (0x00), line 618 = (0x0f). If anyone else is using a V1 with a RGBW strip it would be great if this config could be tested on other devices.

My controller is a “XSOURCE” branded one from Amazon. The Magic Home app identifies it as a V1. I have a RGBW strip hooked up to it.

The only function that works from Home Assistant is on/off. Neither color change or brightness does anything. Strangely however, if I change the color with the Magic Home app, the new color shows on the bulb icon in Home Assistant.

I did some packet captures from the Magic Home app doing various functions.

master on - 71:23:0f:a3
blue - 31:00:00:ff:00:00:f0:0f:2f
green - 31:00:ff:00:00:00:f0:0f:2f
red - 31:ff:00:00:00:00:f0:0f:2f
blue - 31:00:00:ff:00:00:f0:0f:2f
blue brightness change - 31:00:00:82:00:00:f0:0f:b2
rgb brightness to 0 - 31:00:00:00:00:00:f0:0f:30
white on - 31:00:00:00:ff:00:0f:0f:4e
white off - 31:00:00:00:00:00:0f:0f:4f
white on - 31:00:00:00:ff:00:0f:0f:4e
white brightness change 25% - 31:00:00:00:3f:00:0f:0f:8e
master off - 71:24:0f:a4

Looking at the code again, I just realized the packet captures have a extra byte in them compared to the flux_led code! I added the extra byte to both the “SetWarmWhite255” and “SetRGB” functions and now they work from Home Assistant!

Only issue now is the brightness slider… it only changes the brightness of the white LEDs (which is fine), however setting it to 0 turns both the white and color LEDs off. So I can’t totally turn the white LEDs off.

I believe the reason for the extra byte is because this controller supports RGBWW. A RGB strip with both independently controllable cool white and warm white LEDs. You have to manually set your wiring configuration inside the app. Changing the wiring configuration shows/hides various functions inside the app. See the below screen shot.

The software does seem to know the controller requires the extra bytes. As it sends the extra bytes regardless of what wiring configuration you select.

1 Like

He Guys,

not really for this Topic, but is there a List which Service Commands(color, on/off and so on) are working with the Controller?

Thanks for looking into this peeps!!

It is now added support for a new protocol: https://github.com/home-assistant/home-assistant/pull/5097/files
This also make it easier for others to add an own protocol.

1 Like

Thanks @Danielhiversen. How would I make use of this? I have the v1, and currently I have to edit the code to change the bytes that are sent. And I have to do that every time I update HA it seems. Will this change make it so that I don’t have to do that?

Also, as it stands now, I don’t think I could purchase a v3 and have both of them work at the same time. Would this allow me to do that?

The work is done by @bah2830

It will be in the next release, and here is the documentation https://github.com/home-assistant/home-assistant.github.io/pull/1669/files

The protocol is called LEDNET, you can see the changes made here:
https://github.com/Danielhiversen/flux_led/blob/master/flux_led/init.py#L675
It is possible to add more protocols.

It think it should be possible to add lights with different protocols:

light:
  - platform: flux_led
    devices:
      192.168.1.10:
        name: NAME
        protocol: 'ledenet'

ligh 2t:
  - platform: flux_led
    devices:
      192.168.1.10:
        name: NAME
        

If that is not working, I think we can make another solution.

DId anyone get this working? I am using a RoHS wifi module for some LED light strips. They are configured as RGB in the Magic Home app and works fine, but I can also only turn it on and off via Home Assistant. I have tried color_name and rgb_color with no luck. This thread seems to be going down the right path…

1 Like

It looks like it may be best to wait until the next update. But one thing you may want to try is to set the mode: “rgb” in your configuration. It’s in post 25 on this thread.