Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single channel MagicHome Controller not working #33899

Closed
phcella opened this issue Apr 9, 2020 · 52 comments · Fixed by Danielhiversen/flux_led#116, #57353 or #57458
Closed

Single channel MagicHome Controller not working #33899

phcella opened this issue Apr 9, 2020 · 52 comments · Fixed by Danielhiversen/flux_led#116, #57353 or #57458

Comments

@phcella
Copy link

phcella commented Apr 9, 2020

The problem

I have only white led Magic Home controller, and I can't control it through HA. When I try to turn it on, it blinks, freezes and doesn't turn on.
I have already posted on comunity Link
The other 2 RGB Magic Home controller are working correctly.

Environment

  • Home Assistant Core release with the issue: 0.108.1
  • Last working Home Assistant Core release (if known):
  • Operating environment (Home Assistant/Supervised/Docker/venv): Home Assistant
  • Integration causing this issue:
  • Link to integration documentation on our website:

Problem-relevant configuration.yaml

light:
  - platform: flux_led
    devices:
      192.168.0.185:
        name: flux_pedro
        mode: "rgb"
      192.168.0.186:
        name: flux_bia
        mode: "rgb"
      192.168.0.183:
        name: flux_cortineiro
        mode: "w"

Traceback/Error logs

Additional information

@teamsuperpanda
Copy link

Can you control the LED strip from the Magic Home app?
Might sound obvious but is the IP address correct?
The third light '.0.183' has mode 'w' so the strip only has white leds on it?
The magic home controllers are RGB or RGBW so what type are each of them?

@Ybbet
Copy link

Ybbet commented Apr 16, 2020

The third light '.0.183' has mode 'w' so the strip only has white leds on it?
The magic home controllers are RGB or RGBW so what type are each of them?

As said in the documentation, we could have 3 types: RGB, RGBW and W.
Cf. https://www.home-assistant.io/integrations/flux_led/

It seems that the problem exists since version 0.97. #26779
Someone find a solution : https://community.home-assistant.io/t/flux-led-magiclight-dont-work-since-few-updated/145179/5 && https://gist.github.com/aptonic/5135800bdd558b7e24337bcb0f09531e

@phcella
Copy link
Author

phcella commented Apr 21, 2020

Can you control the LED strip from the Magic Home app?

It works perfectly

Might sound obvious but is the IP address correct?

The IP is correct, I fixed it on my router config

The third light '.0.183' has mode 'w' so the strip only has white leds on it?
The magic home controllers are RGB or RGBW so what type are each of them?

My problem is only on the last led, "flux_cortineiro". The other are working perfectly.
My controller is a single color controller like the image below.

And here are the video

      192.168.0.183:
        name: flux_cortineiro
        mode: "w"

image

@annikovk
Copy link

annikovk commented Jul 1, 2020

Do you have other flux_led devices which are offline at the moment you are trying to enable this one? If so, see #33275

@phcella
Copy link
Author

phcella commented Jul 2, 2020

Do you have other flux_led devices which are offline at the moment you are trying to enable this one? If so, see #33275

I saw yout issue too, and I got this error
"WARNING (MainThread) [homeassistant.helpers.entity] Update of light.flux_cortineiro is taking over 10 seconds".

And I have 2 others RGB stripes and I have no errors. The problem is with thin White Controller

@stale
Copy link

stale bot commented Oct 4, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 4, 2020
@phcella
Copy link
Author

phcella commented Oct 5, 2020

I'm on 0.115.6 and my problem wasn't fixed on this last updates.

@stale stale bot removed the stale label Oct 5, 2020
@Ybbet
Copy link

Ybbet commented Oct 5, 2020

Hi, I confirm the problem.

@GoNzCiD
Copy link
Contributor

GoNzCiD commented Nov 7, 2020

I have the same MagicHome device and the same problem.
From the Android MagicHome mobile application it works, but from HA not. I have also other MagicHome controllers that work but they are RGBW. Also the IP is correct.

Any solution @phcella? I'm in 0.117.2

@phcella
Copy link
Author

phcella commented Nov 7, 2020

I still have the problem only with the only white LED controller, with RGB controllers work perfectly.
And I'm in 0.117.5.

@Ediste
Copy link

Ediste commented Nov 7, 2020

i have the same problem (HA: 0.117.5). Any solution?

@GoNzCiD
Copy link
Contributor

GoNzCiD commented Dec 13, 2020

I finally flash it with tasmota and works like a charm via mqtt...

@phcella
Copy link
Author

phcella commented Dec 16, 2020

i have the same problem (HA: 0.117.5). Any solution?

I'm on 2020.12.0, and I still have problem.

I finally flash it with tasmota and works like a charm via mqtt...

I should work without need to flash with Tasmota. I sometimes use the Magic Home app, and if I flash, it won't work anymore.

@GoNzCiD
Copy link
Contributor

GoNzCiD commented Dec 16, 2020

I should work without need to flash with Tasmota. I sometimes use the Magic Home app, and if I flash, it won't work anymore.

If you use Magic Home app, alternative firmware is not an option for you. I only use HA to manage it, and works quick and without fail.
Yes the integration should work....

@fvztdk
Copy link

fvztdk commented Dec 19, 2020

I'm on 0.118.5 and have the same problem with the same magic home as pointed above, other the color ones works without a problem (the ip is correct on my config and I can control the leds via magic home app and their integration with google home)
*EDIT: updated to Home Assistant 2020.12.1 and the problem persist

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Mar 19, 2021
@phcella
Copy link
Author

phcella commented Mar 19, 2021

The problem is not solved for me yet.

@github-actions github-actions bot removed the stale label Mar 19, 2021
@gitothy
Copy link

gitothy commented Mar 29, 2021

Still an issue on 2021.3.4 for the "w" controller. RGB working fine.

@phcella a semi-workaround I'm using is to set the single channel controller to "rgb" mode instead of "w". Not exactly right but you can turn it on and off and do some of the brightness. Won't go past about 50% though and anything with colours screw it up so won't be good in a group. I did also test the "rgbw" mode and that does also give some control but is worse than rgb.
Edit: also tested the ledenet protocol setting and that makes no difference.

@phcella
Copy link
Author

phcella commented Mar 29, 2021

@gitothy thanks for your tip, configuring it lake a "rgb" is better than "w", but it still have some delay to update de status and if you turn on / off fastly, it will not work correctly. But at least I can use it. Thanks!! And still waiting for correction o Hassio.

@gitothy
Copy link

gitothy commented Mar 29, 2021

There's also an almost complete solution I found today, it's a bit manual but resolves all of the issues here.
https://github.com/CorneliousJD/flux_led

Tbh I'll probably flash the buggers to esphome rather than this code change but these are the options.

@phcella
Copy link
Author

phcella commented Mar 30, 2021

@gitothy Did you test it? Because it says it is for RGB Controllers.
If it worked for you, i will do it here

@gitothy
Copy link

gitothy commented Mar 31, 2021

No haven't tested it yet and I don't want to go down that road.

Another 'non-flashing' solution is here. Looks good but you need to have Homebridge set up.
https://community.home-assistant.io/t/flux-led-magiclight-dont-work-since-few-updated/145179/66

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jun 29, 2021
@gitothy
Copy link

gitothy commented Jul 1, 2021

@phcella is this solved in the latest version of HomeAssistant for you?

@aheath70
Copy link

aheath70 commented Sep 4, 2021

I haven't tested it recently, as I am running the code I pasted above, installed under the "custom_components" directory. It is working perfectly for my single colour controller. I don't know whether the changes that I made would break RGB or RGBW controllers, as I have neither.

It was certainly still a problem under 2021.6 and as far as I can tell from the release notes, there have been no changes to the flux_led component in the 2 versions since.

@icemanch
Copy link
Contributor

icemanch commented Sep 4, 2021

I haven't tested it recently, as I am running the code I pasted above, installed under the "custom_components" directory. It is working perfectly for my single colour controller. I don't know whether the changes that I made would break RGB or RGBW controllers, as I have neither.

It was certainly still a problem under 2021.6 and as far as I can tell from the release notes, there have been no changes to the flux_led component in the 2 versions since.

I know which problem you're talking about now. I've been trying to get code finished to fix it for a few months now but, I had to work on a different project for the last two months so nothing moved. The component is almost completely re-written (there were other bugs and updates it needed) but, I need to figure out where I left off and test everything again so that it can get published. :)

@bdraco
Copy link
Member

bdraco commented Oct 7, 2021

Do you know of a vendor that will ship the US that sells these controllers?

Can you post the flux_led info lines for the device?
Example:

% flux_led -i 192.168.107.91
Unknown ID [192.168.107.91] OFF  [Warm White: 0% raw state: 129,53,36,97,1,5,88,178,0,0,7,0,240,66,]

We can add it to the database so its detected properly in the next release
https://github.com/Danielhiversen/flux_led/blob/master/flux_led/models_db.py

Thanks

@aheath70
Copy link

aheath70 commented Oct 7, 2021

When state of light is on and at full brightness:

Unknown ID [192.168.0.196] ON  [Color: (255, 0, 0) Brightness: 255 raw state: 129,65,35,97,65,1,255,0,0,0,2,0,0,137,]

When state of light is on and at 50% brightness:

Unknown ID [192.168.0.196] ON  [Color: (128, 0, 0) Brightness: 128 raw state: 129,65,35,97,65,1,128,0,0,0,2,0,0,10,]

When state of light is on and at 10% brightness:

Unknown ID [192.168.0.196] ON  [Color: (26, 0, 0) Brightness: 26 raw state: 129,65,35,97,65,1,26,0,0,0,2,0,0,164,]

When state of light is off and its last state was full brightness:

Unknown ID [192.168.0.196] OFF  [Color: (255, 0, 0) Brightness: 255 raw state: 129,65,36,97,65,1,255,0,0,0,2,0,0,138,]

When state of light is off and its last state was 50% brightness:

Unknown ID [192.168.0.196] OFF  [Color: (128, 0, 0) Brightness: 128 raw state: 129,65,36,97,65,1,128,0,0,0,2,0,0,11,]

When state of light is off and its last state was 10% brightness:

Unknown ID [192.168.0.196] OFF  [Color: (26, 0, 0) Brightness: 26 raw state: 129,65,36,97,65,1,26,0,0,0,2,0,0,165,]

@bdraco
Copy link
Member

bdraco commented Oct 8, 2021

Thanks. So it uses the 'RED' channel for everything

@aheath70
Copy link

aheath70 commented Oct 8, 2021

Yes, it uses the red channel to set the brightness. My custom component that I have written (code above) keeps the brightness attribute the same as the red channel, so it reports the brightness through home assistance correctly as well.

@bdraco
Copy link
Member

bdraco commented Oct 8, 2021

If you go into the Magic Home Pro app and long press on the device (iOS) do you can an option to change device type?

@bdraco bdraco changed the title Only white MagicHome Controller not working Single channel MagicHome Controller not working Oct 8, 2021
@aheath70
Copy link

aheath70 commented Oct 8, 2021

If you go into the Magic Home Pro app and long press on the device (iOS) do you can an option to change device type?

No. I get options to "Add To Group" or "Rename".

FYI, I just ran the same "flux_led -i" commands after adjusting the brightness and switching on and off using the Magic Home app, and it resulted in the same outputs as above with the red channel and brightness kept in sync by the Magic Home app.

@bdraco
Copy link
Member

bdraco commented Oct 8, 2021

That's unfortunate that it maps to the red channel

We have to support channel remapping, I started a PR here Danielhiversen/flux_led#116

There's a lot of work going on with this integration at the moment so the pr will have to wait until merges calm down a bit because of merge conflicts

@bdraco
Copy link
Member

bdraco commented Oct 8, 2021

Found this one https://www.amazon.com/gp/product/B07JC7YR9J/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1 which doesn't have a 5 week delivery time. 👍

@bdraco
Copy link
Member

bdraco commented Oct 10, 2021

Can someone test the remapping support with ?

#57353
and
Danielhiversen/flux_led#116

@bdraco bdraco mentioned this issue Oct 10, 2021
22 tasks
@bdraco bdraco reopened this Oct 11, 2021
@bdraco
Copy link
Member

bdraco commented Oct 11, 2021

device showed up.

#57353 fixed the brightness reporting, but not the setting.

This needs a bit more work to remap the channel before set_levels

@aheath70
Copy link

Agreed. I just downloaded the new component about 10 mins ago and was testing, and it wasn't working properly. Reverted back to my custom component in the meantime.

@bdraco
Copy link
Member

bdraco commented Oct 11, 2021

Turns out a little more work was needed to map where we set the levels as well

Confirmed working with

#57458 and Danielhiversen/flux_led#124

@aheath70 Can you give it another go?

@aheath70
Copy link

@bdraco - My Github skills are pretty rudimentary, and I don't know how to merge the pull requests and get done what I need to get done in order to test. If it is straightforward, if you can walk me through what I need to do, then I am more than happy to test. Sorry!

@icemanch
Copy link
Contributor

@bdraco - My Github skills are pretty rudimentary, and I don't know how to merge the pull requests and get done what I need to get done in order to test. If it is straightforward, if you can walk me through what I need to do, then I am more than happy to test. Sorry!

I'll see if I can walk you through it. You need to get the component and the latest flux_led. Just as a warning I'm going to walk you through how to do it but, if you're doing it on a production system you may mess it up. I've done it several times and not had a problem but, I"m just trowing it out there as a just in case. Make sure you backup.

Get the component first.
These commands need to be run inside your home assistant container.

  1. Go to an empty folder that you want to download into.
  2. Run "Git Clone https://github.com/bdraco/home-assistant"
  3. change directory in "home-assistant"
  4. Run "Git Switch fix_single_channel_flux"
  5. Run "Git Fetch"
  6. change directory to "homeassistant/componets"
  7. Run "cp -r flux_led /usr/src/homeassistant/homeassistant/componets/"
  8. change directory to "/usr/src/homeassistant/homeassistant"
  9. Run "python3 -m script.hassfest"

Restart home assistant.

Now you need to get the latest flux_led api.
These commands need to be run inside your home assistant container.

  1. Go to an empty folder
  2. Run "Git Clone https://github.com/Danielhiversen/flux_led"
  3. change directory into "flux_led"
  4. Run "Git Fetch"
  5. Run "python3 -m pip show flux_led" ***This will show you were flux_led lives. Should be something like /usr/local/lib/python3.9/site-packages
  6. You need to copy the python files to the location given above. So if it matches you would run "cp -r flux_led /usr/local/lib/python3.9/site-packages/"

Restart home assistant again.

Everything should be on the latest and you can begin testing to see if it works.

There might be an easier way but, this is how I do it. I'm rather new to the process as well but, it's worked everytime so far.

@aheath70
Copy link

OK. I only have a production system. I might see if I can create a new test system and work on it, but it may be a little while before I get that done - work is smashing me at the moment.

@bdraco
Copy link
Member

bdraco commented Oct 12, 2021

It can also be installed as a custom component once we do a new release of flux_led. I'll post instructions once that is done

@aheath70
Copy link

It can also be installed as a custom component once we do a new release of flux_led. I'll post instructions once that is done

I think I would definitely be more comfortable installing it as a custom component.

@bdraco
Copy link
Member

bdraco commented Oct 12, 2021

Testing steps:

mkdir -p /config/custom_components
cd /config/custom_components
git clone https://github.com/bdraco/flux_led_custom flux_led

Restart

To revert to the version in core, delete /config/custom_components/flux_led

@aheath70
Copy link

OK. Tested. It automatically configured the integration. I had to rename the ensuing entity to what it used to be. All operations (on, off and brightness) working well.

Awesome stuff, @bdraco.

@bdraco
Copy link
Member

bdraco commented Oct 18, 2021

Support for the 0x21 models added here #57934

Was reported Danielhiversen/flux_led#132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet