Xiaomi Yeelight E27 bulb component

Awesome! Thank you.

I’m sorry. I recently started my studies and was really busy for the last two weeks.
I did now merge it.

@Mister-Espria Is this working? I ran into some issues setting my own lights up. For whatever reason when I was testing the fade on / fade off , it was working, but it shouldn’t have.

If it’s not working, try setting your dependency to my tag (line 20):
REQUIREMENTS = [‘https://github.com/jjensn/pyyeelight/archive/v1.7.zip#pyyeelight==1.7’]

@jared No for me it isn’t working either. I have the same issue as in post 87

So only fade to on is working and fade to off is just instantly off.
Sorry for not reporting back but i have some segfault issues with my ha at the moment. But i’m gonna try your dependency now.
I will report back soon.

@jared I tried the code, but i don’t get it to turnoff the bulbs not with fading and not instantly.
I saw home assistant installing your v1.7, but to be sure which yeelight.py are you using your forked one or the one from mxtra from 17 days ago?

when turning off i get this in the log:

16-10-29 22:01:25 homeassistant.core: BusHandler:Exception doing job
Traceback (most recent call last):
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1221, in job_handler
    func(*args)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1075, in execute_service
    service_handler.func(service_call)
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/light/__init__.py", line 223, in handle_light_service
    getattr(light, service_fun)(**params)
  File "/home/hass/.homeassistant/custom_components/light/yeelight.py", line 135, in turn_off
    self.bulb.turnOff()
TypeError: turnOff() missing 1 required positional argument: 'transtime'

@Mister-Espria right right right, you also need to update your device code:

@jared Thank you! now we are getting there. Fading on and off is now working. Turning off and on is also working but it uses (i think) the default transition time. I don’t know if this is intended or not?

When i use scenes with a transition time of 5000 it still uses the default transition time (i think because it’s a lot quicker than 5 seconds). When i use transition: 0 in a scene it will do it instantly.

This is not new in your code i had the same with the previous versions.

you should submit a pull request with the fix

? I didn’t do anything. i’m just using your files. And if i have a solution for the current problem i’m happy to share it. But i don’t know if i can manage to get transition working.

Thanks for your work,

This has not been working for me for few weeks already.

I am using…

This is what I have in my configuration…

platform: yeelight
transition: 500
devices:
  192.168.1.6:
    name: entrance
  192.168.1.7:
    name: carporch_1
  192.168.1.8:
    name: carporch_2
  192.168.1.9:
    name: carporch_3

Is anyone else facing the same problem?

1 Like

Yeelight is now available in the latest release:

1 Like

That’s great news!
Just FYI it works fine on bulb model: YLDP02YL

I’ve just found it’s other component that was here.
Generally works ok, can’t say which is better. The new one doesn’t support transitions but the old one had some issues with that also.

It would be great if you can help update the documentation.
In the upper right corner of any documentation page, you will find “Edit this page on GitHub”.
Follow the link and submit your suggested change.
Demonstrated here: https://youtu.be/dRfk9JAlPJk?t=1h16m17s

I have YLDP01YL (white only) and the automation seems to work but the switch to turn on/off the light in frontend doesn’t seem to work properly.

If I click on the light toggle in the frontend, the light will turn on. but after few seconds, it will toggle back to off position even though the light remain on.

I found this error in the home-assistant.log file…

16-11-07 XX:XX:XX homeassistant.core: Exception inside async loop: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/yeelight.py", line 132, in update
    self._bulb.get_property(self._bulb.PROPERTY_NAME_RGB_COLOR))
ValueError: invalid literal for int() with base 10: ''

Hello everyone,

I’ve received an e-mail from Daniel Who point at me this topic. I’ve developed the support of Yeelight for Home Assistant.

I only develop this with RGB model and ask for a rgb property on a only white bulb make the library crash.

I’m not available until 10 days, but I will try to fix this issue when I will be at home even if I don’t have the bulb.

Excellent! Thank you so so much

Thank you for adding support. May i ask ,when you have some more spare time ofc, if you want to take a look at adding support for transition time? So that a user can define a transition time in each automation. i’m trying to get this to work with the other implementation, but unfortunately i have no luck.

It’s on the roadmap, but I can’t say when. I’ve already implemented this feature on the Yeelight python library Home Assistant rely on.

The last part is to make aware home assitant how to use it. But it can take some time. :wink:

2 Likes