-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
WS2812B RGB not working with Flux_LED #22161
Comments
Can you try on 0.89.2 to confirm whether it is beta related issue? |
I tried with 0.89.1 (snapshot was available) ... I was able to switch on/off (was not able with beta 0.90.0b3) but nothing in the effect list (effect list was not shown) and brightness was not possible to control. |
Normal RGB stripes and RGB bulb works fine ... I have only the issue with this MagicHome controller 👍 |
Can you run |
To be clear, does it work with 0.89 or is this a new strip that you just got? |
It is a new strip with a new MagicHome controller ... so I would guess it never works correct before ... |
@Obicom I forgot, you should see the errors in the log, at |
@autinerd: maybe I did something wrong but found no related error in my home-assistant.log |
@Obicom You can find the log at |
Now I see the problem. Your device is in your homeassistant config configured as RGBW, but it only can RGB. You have to change it, then it should work. |
@Obicom I looked at the code again and yeah, you are right! This line of code leads to the bad behaviour: That line says that automatically found devices are always RGBW controllers. I will make a pull request which just removes the line, because there is a automatic recognition whether the controller is RGBW or RGB, which is overwritten by this line. Interesting that nobody faced this problem in the 2 years of existence 😂 |
Thank you very much for your effort to investigate ... is there a way for me to fix it by my self in the meantime? (Edit a file or something else) I use hassio on raspbian ... |
@Obicom Remove the line from the file in your local installation or put your controller explicitly into the config. |
I have a similar "magic home led spi controller" and see a similar issue. I've already experimented with manually adding the device and changing the I suspect the problem is that the underlying I've not yet had a chance to experiment with this further myself yet though. I'll try to supply you with relevant logs when I next have access to the device. |
@autinerd I guess I am not able to remove the line from the code ... I use hassio in a docker container and would expect that the flux component it part of the docker container ... if not please let me know. |
@Obicom ah, okay, then the only thing you can do is manually put the controller into the config. |
@lstg I didn't even know that these controllers exist! How do they look like in the Magic Home App? As one light? If possible, a packet capture from the phone to the controller and back would be fine. |
@autinerd is it posible to combine the local definition for the new WS2812B led stripe and automatic_add for the rest together in one light entry or how should I do? |
@autinerd I tried a combination of automatic and single entry, also only single entry only for the one new RGB light, without success. Mostly when I switch the light on the switch goes back to off after 5 seconds. I was a short time able to switch on/off and change brightness but not to use one of the effects. I do not know why it works partly for a view minutes ... but 90% of testing nothing works. I guess here is a bigger bug for this controller inside. Here some screens: Mostly if I tried to switch on the it switched back to off after a view seconds: for some minutes (but effects doesn't works): |
@Obicom I just see you have the python file version before my and @amelchio changes, so these can't be the problem at all. I'm wondering why raw_state is None. Are effects supported by the "Magic Home" app for this controller? Are you using an Android phone with the "Magic Home" App? If yes, can you install Packet Capture (https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture), let it capture while you turn on, change the color, select an effect and turn off the controller with the "Magic Home" app. Then you should have "Magic Home" in the list of captured packages Then open it, press the download button in the upper right and select "Save pcap" Then post the .pcap here, so I can look if this is a protocol not fully supported by the module. |
@autinerd I've collected some initial packet captures from the magic home app. Firstly, here's the packet capture when going device information screen on the magic home app. Appears to make a device status request (
Followed by a time sync (
In fact the above 2 packets seem to happen whenever focus goes back to the magichome app. Additionally the following information is sent as a post request to the magichome server
The following screen is available to configure the LED strip The following packet is sent when going to the above screen (this appears to be a currently undocumented command)
Here's turning off then turning on (this looks like the standard format).
The functions screen has a list of about 300 different patterns This is the packet sent when selecting one
Note that it looks like there's an extra byte sent after the usual
Some other examples of the device info message with different patterns selected : Previous pattern :
All red:
It looks like what is usually the pattern code in position 3 is 0x00 and the pattern code is offset into position 4 (eg 0x61 is the pattern code for "color" mode) I'll try and capture some more relevant packets this evening (though I've got a young child which can make finding an opportune moment awkward!) |
I seem to be able to switch my Magic Home devices on and off, but not adjust brightness on the two that are just white dimmers. I get this in the log: |
@paularmstrong no real dev here so not sure how to test it because you're not talking about adding it to HA as custom component to overrule the component |
Just a note, Home Assistant 0.97 has reverted flux_led to the HA 0.89 state. This should fix the regressions that @alexvandervegt mentioned above. This issue remains open since AFAIU it is actually about an unsupported model and the regressions were a bit of a tangent. |
Been having the same issue, with the same controller.
I also do not have any color options, but do have a brightness option. I have the following config: light:
- platform: flux_led
devices:
<LEDIP>:
name: stue_lys
mode: "rgb" Any pointers on where I best start to solve this issues. I am thinking about solving it in two steps. @autinerd maybe you have some pointers on where to start? |
Have you forgotten about this problem without solving it? |
I gave up on waiting for the fix and flashed mine with Tasmota - now they work well |
And what settings on tasmata do you use, what configuration? |
Just flashed - used one of the templates for MagicHome or Arilux and set for autodiscovery in HA |
Do you have a controller for tape ws2812b? |
Flashing worked for me for the RGB versions of magic home but not for the WS2812 where you can control 3 or 1 leds independent |
I just have the RGBW MagicHome controllers |
I think the solution to the problem in this topic is relevant only for ws2812b controllers (maybe ws2811) because, having flashed my controller on esphome and tasmota, I could not configure it to make it work. |
Possibly, I think my issue got merged into this one. My problem was specifically around the MagicHome RBGW. Apologies, I didn't spot that. |
This issue unfortunately has ended up being quite confusing as it seems to have ended up covering 2 separate problems :
As far as I'm aware, there is no support for Tasmota on the "magic home led spi controller" which this issue originally covered. See xoseperez/espurna#1437 for some details of the underlying hardware which you may be able to use to flash it with Tasmota / WLED / esphome, however it's likely this would not directly support the separate IC which it uses to actually control the strip. |
All this is very sad for the owners of such controllers, including for me. Is there any chance of adding support for spi controllers in flux_led? Can open this request again? |
I believe it's a combination of flux_led library version and a refactor involving HA light component that happenend at some point in the past. This devices were working on previous HA versions (0.8X), at least I had three of the with full control over color and brightness. @autinerd: |
@epikurus ah right I see, yes I guess before the 'status' check on them was broken you would have been able to control the on / off and set the overall colour as the protocol for these is the same. I only got mine after the point it was already broken so have never seen it even partly working and thus assumed it never was as it also didn't look like the library had any direct support for them. However the |
Dying to have these controllers work with strips in Home Assistant, even without the built in effects. |
Playing around with the UI I discovered I can change brightness with the slider (light is on, but HA reports its as off) |
I'm going to see if I can get one of the SPI devices to work with ESPHome. |
Have a look at Aircoookie/WLED#398 for someone that's similarly trying to flash it. I suspect whilst you may be able to flash the esp chip, the LEDs go via a separate IC which you'll either need to bypass or interface with. I'd recommend wled. I've now switched to that with a nodemcu board in favour of this controller |
I haven't messed with flashing it yet. I have managed to dump the serial communication between the ESP and the ARM chip, and confirmed that it is just passing raw flux_led message payloads back and forth at 9600 baud, which confirms the theory that it's basically just acting as a modem. I haven't dumped out all the various special patterns yet, but if they appear to be the same as those already documented by the Python module, it'll probably be easy enough to convert it all over to C++ for ESPHome. I've already got two of these, 15 meters of LED strip, and a project in mind, so I'm willing to make it work. |
I got it turning on and off from ESPHome with a simple uart component and template switch. Unfortunately I neglected to grab the commands that configure the LED type or count, so I'll have to run another capture from the device that I haven't reflashed yet. I also realized that there does not appear to be a way to control individual LEDs in the strip via the protocol, so I might just end up bodging around the ARM MCU to run the strip off a GPIO anyway. |
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. |
I just encountered the same issue with my "Home Magic SPI Controller v3" with a "WS2812B"-strip. The issue is that i had "automatic_add: true" in my configuration, but also explicitly defined the device. The name is then used from the device-definition, but apparently not the mode and/or protocol settings. The default mode is RGBW which causes the exception. This worked for me:
To patch the exception in code, i did this in components/flux_led/light.py:
I still see the following issues:
|
Implemented in 2021.12 |
Home Assistant release with the issue:
0.90.0b3
Last working Home Assistant release (if known):
unkown
Operating environment (Hass.io/Docker/Windows/etc.):
hassio on Raspbian
Component/platform:
https://www.home-assistant.io/components/light.flux_led/
Description of problem:
My new MagicHome RGB controller for WS2812B is discovered from Flux LED but doesn't work. If I add the entity to HA it shows status "off" but controller is on and working.
Additional information:
With MagicHome App I can control the RGB stripe without any problem.
The text was updated successfully, but these errors were encountered: