"LED Light bulb" with Magic Home app" integration?

for anyone interested, I created a pull request which adds LB1 support to the broadlink integration. Locally fully tested and working. Broadlink Integration add support for LB1 by L-I-Am · Pull Request #50953 · home-assistant/core · GitHub

1 Like

Thanks a lot @L_I_Am, I saw that your PR is under review. Do you know how long does it usuly take to merge changes back? Is there any way to deploy your changes from dev as a custom component?

Actually Magic Home-Smart Home works too, but you have to use AP mode:

  • click on + to add lighting
  • choose AP mode
  • follow the instructions to reset the bulb in AP mode
  • cancel adding new bulb in the app
  • use broadlink-python to connect the bulb to your wifi
  • you can now add it to Magic Home-Smart home
1 Like

I have no idea how long it usually take to merge back. There was a review but all comments are already resolved, not sure what will happen now, going to bump it anyway now. You can deploy the changes from dev as a custom component indeed. Just download this entire folder and place it in your custom_components folder. As it’s exactly the same as the already embedded broadlink library, it will override the existing one as long as it’s in that folder.

2 Likes

due to the newest release of home assistant, just copying the folder to the custom-components folder will still use the official version. You’ll need to add a version key to the manifest.json.

for example: "version":"1.0.0",

@L_I_Am, thanks I deployed and tested. Works fine. I shall comment on github as well. Now I need to figure out how to add scenes :). Thanks for all great work

1 Like

First congratulations for your work, I followed your tip to copy the folder and put it in the custom_component folder along with the “version”: “1.0.0” in manifest.json and the result I got was this, it found the lamps automatically.

but when I click configure, this popup opens

My lamps are linked to the Magic Home-Smart Home app, I followed the guidelines, but I didn’t find this unlock option, how do I?

I unlocked all my smartbulbs using the broadlink app, I just set them up normally and in the last step, it fails (but this is enough to unlock them).

@new-kirte stated above that you can also unlock them using the Magic Home-Smart Home app using AP mode (https://community.home-assistant.io/t/led-light-bulb-with-magic-home-app-integration/169049/50

image

I managed to unlock, set it up, but how do you control the lamp? did not create any entities in my HA …

it should auto-create the entities, and you can normally control them from there. Maybe restart home-assistant now that the bulbs are fully unlocked and set up correctly.

I restarted, but with no result. I’ll wait a little longer to see if it appears.

image

without result, I’ve been trying for days, but the integration doesn’t create the entities, even after restarting. I connected the lamp with python-broadlink and managed to control it calmly. But with broadlink integration it doesn’t work.

Hi @L_I_Am - thank you for the workaround.

But unfortunately, I am in the same situation as hudsonbrendon above. I copied the folder in the custom_components folder, added version to the manifest file - restarted, then in Configuration - Integrations it auto-discovered 2 bulbs - ip: .84 and .85 - but it did not discover the other 2 (I have 4 of them at this moment). I set them up but they did not create any entities. I restarted HA but the same. Now I only have 1 bulb setup, and when I try to add the other 3, it fails constantly. I tried changing the timeout - nothing changed - it failed again to setup the devices.
Any thoughts?
The bulbs I have are LB1 - no RGB - just white. After restarting HA, it throws the following error:

Logger: homeassistant.components.light
Source: custom_components/broadlink/light.py:46
Integration: Light (documentation, issues)
First occurred: 2:44:19 PM (1 occurrences)
Last logged: 2:44:19 PM
Error while setting up broadlink platform for light

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/broadlink/light.py", line 32, in async_setup_entry
    lights = [BroadlinkLB1Light(device)]
  File "/config/custom_components/broadlink/light.py", line 46, in __init__
    self._hs_color = [data["hue"], data["saturation"]]
KeyError: 'hue'

Hi @lostprophet, as stated in the merge request itself, this only supports the LB1 RGB bulbs. Someone did propose some changes to include non-RGB LB1 lights. Maybe you could use their changes locally to ensure support for non-RGB LB1.

ok, my bad then - I did not read the part with only RGB - can you please point me in the direction for non-RGB bulb?

Thank you very much.


Ok, so, by editing the light.py and commenting all of the attributes regarding hs_color/color_temp I managed to get the entity to be created and to turn it on/off from HA.

1

The issue now is how to add the rest of 3 bulbs? As if I try to normal Integrations - Broadlink … - it keeps stating that Connection Failed. I do not think that this relates to the bulb being RGB or not.

Any ideas?

they are suggestions by marcotullomatos on the pull request here: https://github.com/home-assistant/core/pull/50953
as they are suggestions, it’s not easy to pull, but you can apply his suggestions. As for why the bulbs don’t seem to be added automatically, I have no idea. If the bulbs are unlocked using the broadlink app (and you can control them using the python script), it should all be working. My implementation is only an added interface on top of the already existing broadlink integration (which is on top of the broadlink library). I didn’t change anything to the auto-adding process so I can’t really help you there. Sorry

I checked again and in the Broadlink App I have all 4 of them - I can control them from here - unblocked all of them from the app.
Then when i try to add them using the Broadlink integration - it states that"

 Logger: custom_components.broadlink.config_flow
Source: custom_components/broadlink/config_flow.py:130
Integration: Broadlink
First occurred: 3:12:01 PM (4 occurrences)
Last logged: 3:43:49 PM

    Failed to connect to the device at xxx.xx.xxx.87: Device not found
    Failed to connect to the device at xxx.xxx.xxx.86: Device not found
    Failed to connect to the device at xxx.xxx.xxx.84: Device not found

I am trying to replicate those instructions to see if something changes.

congratulation for your success adding the light.
can you plz provide us with the light.py after commenting the attributes.
I have tried to do so with no progress.
thanks for your help

Hi @Mohammed_Abubakr , I cannot attach it here. If you have a share where I can upload it, I can send it to you.
The issue that I have now is that I have 4 bulbs, I added sequentially all of them, but only 1 works at a time, not all of them at once.

I have 4 pieces also and I think I will face the same situation trying to add the other 3 bulbs once I have the first bulb working .
Did you try to remove the integration and add it again so Hass can detected them all at once?
or add them with the Mac address>
regarding the light.py file if you can send it to mail or share it through google drive that would be appreciated.
mine is [email protected]
many thanks