Can't change LED color on MagicHome LED controller

Hi Guys,

same problem here. On/Off and discover works perfectly, changeing the Color not.

Anything i can help to sort it out.

My controller: Controller

@simpat1zq
Did you already could solve your Problem?

It is working fine here with my devices, so not much I can do for debugging.

Have you tried the patch suggested by henryk ?

Yes. I did try the patch he suggested but it made no difference. I suspect that there might be slight variations with these magic home based units where they might require different codes sent to them depending on who made it.

I guess you are right, so you probably need to capture packets send from your phone app to a bulb, and compare it with data send from the flux_led library.

He Guys,

a get one Step ahead.

as discussed in this Thread:

I made some changes in the Flux-LED Component:

First of all I updated my HA to 0.32.2

After the Update i change the Line 641 and 664 to 0x00 in /home/hass/.homeassistant/deps/flux_led/init.py

After a restart of HA Color Changer is working, also Lamp-Symbol change the Color to the choosen color.

Brithness-Slider is not working at the moment. Any Ideas on this?

In my HomeMagic-App the Modell-Typ of my controler says ACCF239EFD08, v3 → Maybe it’s help someone for figuring out the Problem.

Thanks for help

BR

Lukas

@outrun You can try the new brightness control, that I am working on: https://github.com/home-assistant/home-assistant/issues/4303#issuecomment-259239596

I am not sure how we should add support for different byte signals.
But first I will try to see we your change also works for my bulbs. If we are lucky, the value does not matter for me bulbs.

@Danielhiversen I will give it try - maybe on Weekend. I’ll come back with the results.

Thanks

BR

@Danielhiversen

I just updated my file, and setting the mode to RGB appears to have worked. I can’t fully confirm because I’m actually doing this remotely right now. But when I make a change in HA, the app(using an Android emulator on my home PC) updates to whatever change I made in HA.

That said, for my particular model, I also had to make a change to line 616 to say “msg.append(0xf0)” instead of ‘0x0f’. After making that change and the other changes to lines 641 and 664 mentioned previously. I learned that via packet caps.

And as for the bytes, I’m not really sure what the best way to do that would be. It appears that there are at least 3 variations of ‘bytes’ that work for slightly different models.

For reference, in the MagicHome app, mine says version 1. @outrun mentioned that his said version 2. If anyone else reads this post, could you post what version yours says there? I’m wondering if the app uses that version number to determine what type of packet to send.

@simpat1zq mine says Version 3, just to avoid some mistakes.

@simpat1zq:
Could you make a pull request with your changes to the flux led library https://github.com/Danielhiversen/flux_led ?
I do not promise to merge it, but that will make it easier to track the different variations.

@Danielhiversen

I was able to test it further, and it looks like it’s working good enough, but whenever I slide the brightness slider, the lights change as the should. However, the slider itself, most of the time, but not always, goes back to 100%, but the light stays at the correct brightness that I set it at. Any ideas as to why that is happening?

I’ll try and figure out how to do a pull request later today. I may need your help with that, as I don’t really know what that is. But I will let you know if I can’t figure it out.

Ok, I will have a look at it.

The easiest way to make a pull request is to go here; https://github.com/Danielhiversen/flux_led/edit/master/flux_led/init.py
Make your changes and choose < Create a new branch for this commit and start a pull request.>

I’ve been having the same issues as mentioned here. I have two types of these controllers. I can confirm that the changes suggested work for me on a V3 controller but do not work on a V1 controller. I’m very excited by this progress. One thing I notice on my V3 is when using the slider, it turns off any RGB settings and adjusts the W. If I manually select a color, the white turns off. Is this expected behavior or should the slider adjust the white indipentant of the color and leave the color setting the same?

@Kbeesnees Is the V1 controller working with the current implementation?

Yes, it is expected behavior with the current version of hass.
From the next release, it will be possible to set “mode: rgb” : Add support for rgb light in flux led lights, fixes issue #4303 by Danielhiversen · Pull Request #4332 · home-assistant/core · GitHub

Thanks Daniel. The V1 controller only turns on and off. Setting color in the frontend or running init.py manually in the console doesn’t work. I only have an RGB strip on the V1 controller at the moment and haven’t tested current on the W channel so I’m not sure what impact the slider has for white. I’ll have to test that later today as I’m headed to work.

@Danielhiversen

I made the pull request, and made the change to the 3 lines and submitted it. In doing that, I actually realized that at line 664, I had an extra 0x00. So I removed it. But that broke my installation. When I put it back in, it works, but I still have that issue with the slider.

@Danielhiversen

And I just figured out one more thing about the slider issue. It seems that it only happens the first time after it has been about 3 seconds since it happened.

For example, if I start up HA, and move the slider, it will move to 100, even though it correctly set the brightness. Then, I can keep moving the slider around, without issue, for 3 more seconds. After those 3 seconds are up, the next time I move the slider, it will go to 100.

And in addition to that, if I were to wait around 12 seconds, it doesn’t happen. So it appears to happen between about 3 and 12 seconds after the last time it happened.

I hope my description of the issue makes sense.

@simpat1zq:
Could you test if the new brightness function solves your problem: https://github.com/home-assistant/home-assistant/compare/dev...flux_led_brightness?expand=1#diff-e210dea810eca09f715430251856b713R116
(This is untested code, so there might be some bugs there)

Everyone:
Could you confirm that:
For V1 this is working: https://github.com/Danielhiversen/flux_led/pull/8/files
For V3 this is working: https://github.com/Danielhiversen/flux_led/compare/master...Patch_v3?expand=1

@Danielhiversen

The changes you made definitely did something. I’m seeing almost the same issue, except instead of it going to 100%, it going to almost zero. Some it seems to go right on zero, but sometimes it’s probably around 3% or somewhere in between. And in addition, around 15 seconds later, it seems to drop down there on it’s own.