Core: Flux_Led Not working with single colour Magic Home led controller since 0.90

Created on 26 Mar 2019  路  21Comments  路  Source: home-assistant/core

Home Assistant release with the issue:
0.90.1

Last working Home Assistant release (if known):
0.89.2

Operating environment (Hass.io/Docker/Windows/etc.):

raspberry pi 3b running Hass.io.

Component/platform:

https://www.home-assistant.io/components/light.flux_led/

Description of problem:
Apologies - first bug report, so I hope I have done it correctly

Since the new Flux_Led component, my Magic Home single colour wifi controller cannot be controlled correctly. Brightness cannot be adjusted and on/off is intermittent. This happens through both the front end cards and automation. This was working fine within the previous Flux_Led component.
This is the Magic Home device https://www.amazon.co.uk/gp/product/B07JVPVDFD
My other Magic Home RGBW device still works however.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

lights.yaml
  - platform: flux_led
    automatic_add: true
    devices:
      192.x.x.x:
        name: Bookshelf Dimmer
        mode: "w"
      192.x.x.x:
        name: Bookshelf Top Dimmer
        mode: "w"
      192.x.x.x:
        name: Kitchen Cabinets
        mode: "rgbw"

automations.yaml
  - alias: Bookshelf Lights - Dimming
    trigger:
      - platform: state
        entity_id: light.office_desk_lamp
    action:
     - service: light.turn_on
       entity_id: light.bookshelf_top_dimmer
       data_template:
         brightness: '{{ states.light.office_desk_lamp.attributes.brightness | int }}'
     - service: light.turn_on
       entity_id: light.bookshelf_dimmer
       data_template:
         brightness: '{{ states.light.office_desk_lamp.attributes.brightness | int }}'

Traceback (if applicable):


Additional information:

flux_led

Most helpful comment

I'm hurrying up, i hope that tomorrow I can put a pull request to the underlying module, because there are fixes needed before it can going smoothly in homeassistant.

All 21 comments

I concur. I'm seeing the same behavior. Previous to 0.90 I did not have this problem. In fact, it's not clear the intent of the fix in PR #20733 by @autinerd which introduced this new break.

Update - reverted back to 0.89.2, but was still having issues. 0.89.2 does not like the 'mode:' option of 'w' for the white dimmer I have. Change this to 'rgbw' and all works as expected. However, updating to 0.90 or 0.90.1 breaks what was working in 0.89.2 and all combinations of changes to the mode option do not work.

Just read another post that was closed and it suggested tagging @autinerd

@autinerd are you aware of these issues?
Thanks

@amelchio Sorry for pulling you in but as the related PR is locked and @autinerd is MIA, could the PR #20733 at least get reverted for the upcoming 0.90.0 release?

I'm hurrying up, i hope that tomorrow I can put a pull request to the underlying module, because there are fixes needed before it can going smoothly in homeassistant.

So, I now have made a hot fix for this issue, it's now treating the white-only controllers like in 0.89.2, with the difference of the 2 seconds break before changing to the new values.
@RIKWEBB In 0.89.2, did it immediately switch to the new value in the frontend after changing? Or did it need a few seconds? Maybe the only-white controllers are faster in returning the new value than the RGBW controllers.

I think this has not been mentioned yet but there are more issues.

E.g. when turning on my RGBW controller, which is set to to brightness: 0 and white_value: 255 it would previously restore it (restore actually means, not changing it).
Now however, when turning on the light, I get white_value: 0, brightness: 255 and rgb_color: <I think 0,0,0 but I didn't check>

Put differently, turning the light on or off should NOT change any of:

  • transition
  • rgb_color
  • color_name
  • hs_color
  • xy_color
  • color_temp
  • kelvin
  • white_value
  • brightness
  • brightness_pct
  • profile
  • flash
  • effect

@tadly You are right, I can implement this. Only brightness will be then checked, because it is possible to turn a light on with the brightness slider.

@tadly I want to restructure the behavior of the component as well, but it needs an update to the flux_led module. In #22161 I will do this, so that warmwhite and color are not excluding each other, as implemented in the module, and after that I can do a simpler implementation here.

@autinerd Sounds good :)

Given how you mentioned that lights can be turned on using the slider, IMO RGBW controllers should show two sliders if the light is turned off allowing to turn it on by using either brightness (the RGB part) or white (the W part).

That's not part of this issue though and probably requires changes further down the line.
Just though I'd mention it...

@tadly A good idea with the two sliders, but that would be a change of the frontend, where you are free to do a feature request.
And the thing is that the function turn_on is used for turning on and changing values, so I will now check if the bulb is turned off when entering the turn_on function.

And the thing is that the function turn_on is used for turning on and changing values

And that's exactly where things get weird if you have a RGBW controller.

I was about to write out all 4 cases and a good solution to cover each until I realized...
Given how there's currently only one slider there are basically only two options upon activating it.

  1. bring up brightness (RGB), set white to 0
  2. bring up brightness (RGB), leave white where it is

To me it sounds obvious to go with option 2 but writing it out wasn't a bad idea I think 馃槄

Hi, I just wanted to quickly chime in as a major contributor to the Arilux firmware with distinct knowledge of flux_led/MagicHome: flux_led is pretty bad IMHO (not our implementation, I mean the firmware that implements the magichome protocol), I _strongly_ suggest that you put ESPHome on the device instead if you can. The ESPHome documentation already has pinouts and stuff for Arilux and other MagicHome/flux_led devices, yours might already be there. The config can be this simple. Anyway, that's my piece, toodles.

@RIKWEBB In 0.89.2, did it immediately switch to the new value in the frontend after changing? Or did it need a few seconds? Maybe the only-white controllers are faster in returning the new value than the RGBW controllers.

Hi @autinerd , I think you have moved past this, but in answer to the question:
Yes, it was fairly immediate - perhaps a second
It looks like @tadly and yourself are making good progress in discussions.
Thank you for your continued efforts.
Rik

Hi, I just wanted to quickly chime in as a major contributor to the Arilux firmware with distinct knowledge of flux_led/MagicHome: flux_led is pretty bad IMHO (not our implementation, I mean the firmware that implements the magichome protocol), I _strongly_ suggest that you put ESPHome on the device instead if you can. The ESPHome documentation already has pinouts and stuff for Arilux and other MagicHome/flux_led devices, yours might already be there. The config can be this simple. Anyway, that's my piece, toodles.

Thanks for the suggestion @robbiet480, I have looked at changing the firmware and would probably choose Tasmota (in-line with other items within my set-up). However, using the Flux_led option is for my current needs far simpler and was working very well.
Thanks for the config example, that may yet come in useful should I eventually go the change of firmware direction.
Rik :)

Thank you for the information @robbiet480, for controllers this might be an option, but there are also bulbs with this firmware, where opening the bulbs without destroying is not possible.
So I want to make the implementation as good as possible.

Ah, I was unaware that the horror that is MagicHome/flux_led now has expanded to bulbs too. Well, I wish all of you good luck and godspeed on this perilous journey.

Yeah, I have two of them at home, but only RGBWW. And they seem to have a lot of names, because their MagicHome App is named com.zengge.wifi, so it is Zengge as well.

Is anybody able to help test #22210?

My white only are just power dimmers. However, if someone can explain how, I am willing to test :)
Rik

Noooo, in 06/2020 here. has this been fixed yet. I can't get it find my 4 single colour leds.

Was this page helpful?
0 / 5 - 0 ratings