Xiaomi Yeelight E27 bulb component

If this component gets written, does that mean it should work with this wifi desk lamp? One would expect Xiaomi to use the same system on all of its kit, right?

Hard to say, it’s not a Yeelight lamp. You’d need to test it with the python code above.

You can try to do enable the developer mode from the app on you lamp and then do a telnet on the ip of the lamp on port 55443 ex:
telnet 192.168.1.50 55443

If the telnet command doesn’t fail then your lamp is compatible.

1 Like

Now the RGB lamp is 19$ on gearbest:
http://www.gearbest.com/smart-lighting/pp_361555.html?wid=21

I haven’t actually bought it yet. I wanted to know if it could be integrated before I forked out for a useless piece of silo-ed plastic!

Are there any news on the Yeelight E27 WIfi (the one the op asked about)? I just ordered one because they can be picked up for just over $10 from China. There is no hub needed for this one - but sadly, there also seems to be no API available.

EDIT: My fault. Everything seems to be already there. Sorry!

I’m looking forward to this. Is anyone working on this component?

I just bought one, too. It would be really great if somebody could implement the hass component :slight_smile:

I was able to get it working, but so far my platform only supports white bulbs. Also, my code is not pretty. More like “pretty dirty” :slight_smile:

2 Likes

Can you share with the community? Maybe someone here can clean your code :slight_smile:

I am just doing some cleanup before I’ll do that.

I uploaded the code to github. https://github.com/mxtra/yeelight-ha/blob/master/yeelight.py
Just copy yeelight.py to ~/.homeassistant/custom_components/light/.

Then add your lights to your configuration.yaml:

light:
   platform: yeelight
   automatic_add: False
   devices:
     IP_ADR:
        name: NAME

Currently, automatic discovery is not supported. Also, the platform does not support RGBW at the moment.

You can find a small library here: https://github.com/mxtra/pyyeelight

3 Likes

Thanks! Just ordered few of this light bulbs. Can’t wait to try it out

I already ordered the RGBW-version. However, if anyone has one at home and is willing to help, I could try to add RGB-functionality. All I would need is someone to test the code.

I think the code is good enough to merge in to HA. Missing functionality can be added later.
You should add config validation. You can find an example here: https://github.com/home-assistant/home-assistant/blob/c028e1fc6f4b0f6205a11364805466999e9c7a74/homeassistant/components/light/flux_led.py#L32

I applied your code but did not work. Ha version 0.28.2

The following errors have been logged this session:

16-09-16 13:12:00 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 865, in job_handler
func(*args)
File “/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/event.py”, line 190, in pattern_time_change_listener
action(now)
File “/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 229, in _update_entity_states
entity.update_ha_state(True)
File “/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py”, line 154, in update_ha_state
self.update()
File “/home/hass/.homeassistant/custom_components/light/yeelight.py”, line 96, in update
self.bulb.refreshState()
File “/home/hass/.homeassistant/deps/pyyeelight/init.py”, line 48, in refreshState
‘“power”,“bright”’))
File “/usr/lib/python3.4/json/init.py”, line 312, in loads
s.class.name))
TypeError: the JSON object must be str, not ‘NoneType’

Do you use the RGB-bulb? I only tested it with the white bulb. However, my RGB bulb will arrive next week.

Ooo, I have theese RGB bulbs, Im excitded now :smiley:

I have both and I installed HA at raspberry pi 1.

The bulbs i ordered have arrived but i have no idea how to add the bulbs into the network. I have installed the Mi Home Android App from the Play Store but couldn’t find the bulbs in the app.

How do you guys add the bulb into the network?