Yeelight led ceiling light compatible with HA

Hi, tried to sift through this topic to find the answer, but I where unable to find a (working) solution.

I have 3 yeelight ceiling lights (these: https://www.yeelight.com/en_US/product/luna) which I have setup in Hass.io as a yeallight like:

- platform: yeelight
  devices:
    192.168.2.72:
      name: Kantoor links 1
      transition: 1500
      save_on_change: True
    192.168.2.73:
      name: Kantoor links 2
      transition: 1500
      save_on_change: True
    192.168.2.71:
      name: Kantoor rechts
      transition: 1500
      save_on_change: True

The problems I am encountering are:

  1. The light will not dimm properly. It’s bright trough very bright, but dimming it all the way won’t work.
  2. I can not use the moonlight feature
  3. Setting the color temperature is extremely cumbersome. I can not find the right values to emulate the way it works with the included remote.

Can somebody point me towards a working configuration that solves these issues?

KInd regards,

MIchel

1 Like

Hello! Any updates ons this? I have the Yeelight 650 and it works but:

  • Ambilight RGB is not working.
  • It comes unavailable several times a day.

Thank you!

1 Like

We have 1 Luna and 3 other Ceiling lights, availability is not an issue since I assigned fixed IP to them in the DHCP. Is your wifi stable enough? 2.4 GHz can get quite congested. You should make sure the lamp is on the latests firmware (upgrade with the yeelight app).

The ambient RGB support would need more work, and I don’t have the time right now to implement it.

Regarding your second point: I’m planning to implement moonlight functionality by remapping the brightness slider: 1-10% in home assistant maps to moonlight mode 1-100%, and 11-100% would map to normal mode 1-100%. It’s not too hard to do, I’m just busy with other projects these days.

3 Likes

Color temperature issue and color picker issue fixed in dev version today. Thanks @syssi

1 Like

@mouth4war when it should be available in beta/stable branch?

Umm…soon? Sorry, I’m not sure about the exact dates.

Sounds great but wont moonlight mode restrict color temperature changing? So in your implementation 1-10% brightness = moonlight mode = fixed color temperature (warm).

Hi, @syssi can you help me please with my yeelight.

I have this problem, these errors are in the homeassistant.log

Oct 23 14:44:01 hassbian hass[29615]: File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
Oct 23 14:44:01 hassbian hass[29615]: File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/yeelight.py”, line 125, in setup_platform

Log Details (ERROR)

Error while setting up platform yeelight
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/lib/python3.5/asyncio/tasks.py”, line 400, in wait_for
return fut.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/yeelight.py”, line 125, in setup_platform
from yeelight.enums import PowerMode
ImportError: cannot import name ‘PowerMode’

and homeassistant discovery services seems this

Oct 23 14:44:28 hassbian hass[29615]: 2018-10-23 14:44:28 INFO (MainThread)
[homeassistant.components.discovery] Found new service: yeelight {‘host’: ‘192.168.0.48’, ‘device_type’: ‘ceiling1’, ‘properties’: {‘epoch’: ‘1’, ‘mac’: ‘7811dc6d17b7’}, ‘port’: 54321, ‘hostname’: ‘yeelink-light-ceiling1_mibt73094532.local.’, ‘mac_address’: ‘7811dc6d17b7’}

Thank you for every advice.

Which HA version do you use? It looks like your python-yeelight version is outdated:

# shutdown homeassistant first
su - homeassistant
source /srv/homeassistant/bin/activate
pip3 install -U yeelight
# and may be
pip3 install -U homeassistant
# start homeassistant again

@syssi you’re the best, thank you, everything works.

Is there a way to check what mode the light is in (mainly interested in moonlight) from state attibutes or do I have to implement an input boolean?

You cannot even query it as far as I know. The yeelight module (as of today, with 0.80.1) don’t expose the necessary internal variables.

Anyone knows how to make a switch to toggle moon/normal mode?

Not really i´m interested if some figured this out. But i use a Workaround which works pretty well for me.
I created a Script to switch the Lamp to Moonlight Mode. If you want to switch back you just have to change the Light Temperature. The brightness Silder Works from 0-100 in each Mode for itself.

wohnzimmermoon:
  alias: Wohnzimmer Moon Mode
  sequence:
  - service: light.yeelight_set_mode
    data:
      entity_id: light.insert-your-light-here
      mode: moonlight

Hope this helps you.

I made a separate template switch for moonlight mode only that looks at an input boolean. Will do a writeup in the wiki in the next few days

1 Like

Thanks, it’s working for single light, but not for group:

entity_id: light.yeelight_lights_1

Group I have defined like:

light:
      - platform: group
        name: Yeelight Lights 1
        entities:
          - light.yeelight_ceiling_7c49ebb
          - light.yeelight_ceiling_7c49ebb
          - light.yeelight_ceiling_7c49ebb

Yeah, pleast post an example.

Are your lights all named the same ? I just have one yeelight so i can´t test how the behavior of my Script is with more than one. Maybe you create a normal Group. Group Tutorial