Yeelight led ceiling light compatible with HA

All the bulbs are on the same wireless network, and I didn’t change anything on my router lately.
The only thing that changed is the firmware of the bulbs/strip. Upgraded from 1.x to 2.0.6.
14 and 15 are older bulbs, and didn’t receive (yet?) the fw upgrade.

I wonder if it could be an issue with the python-yeelight, like @syssi mentioned in the post #373

It might be possible, but changning get_prop query from yeelight API seems a bit unexpected. Maybe try to check if LAN mode is still on, after FW update ?

I’ve reset the bulbs multiple times, and toggled ON/OFF/ON the LAN mode.
python-yeelight can’t control nor see the status of the bulbs.

hassio@hassiodev:~/.local/bin$ ./yee --ip 192.168.2.12 status

Bulb parameters:
Traceback (most recent call last):
  File "./yee", line 11, in <module>
    sys.exit(cli())
  File "/home/hassio/.local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/hassio/.local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/hassio/.local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/hassio/.local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/hassio/.local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/hassio/.local/lib/python2.7/site-packages/yeecli/cli.py", line 301, in status
    for key, value in bulb.get_properties().items():
  File "/home/hassio/.local/lib/python2.7/site-packages/yeelight/main.py", line 359, in get_properties
    response = self.send_command("get_prop", requested_properties)
  File "/home/hassio/.local/lib/python2.7/site-packages/yeelight/main.py", line 399, in send_command
    raise_from(BulbException("A socket error occurred when sending the command."), ex)
  File "/home/hassio/.local/lib/python2.7/site-packages/future/utils/__init__.py", line 456, in raise_from
    raise e
yeelight.main.BulbException: A socket error occurred when sending the command.

It seems like it doesn’t recognize LAN mode anymore.

Are you sure the LAN mode is still enabled? Please disable and re-enable the LAN mode just to be sure.

100%, at least that’s what my app is saying. This is 192.168.2.12


Can you ping that ip ? Maybe they have different ips now ?

All of the bulbs respond to pings.

And they respond to control via yeelight app ?

Yes, all of them respond via the yeelight app.

Issue solved.
I’ve reset the lights (again) and added them to the app using my wife’s phone. After enabling LAN mode, the lights showed up as entities.

The only possible cause could be the rooted phone (pixel 2XL).

1 Like

I’ve updated support for 2 light entities for nighlight supported lights, you can test it here https://github.com/home-assistant/home-assistant/pull/26224 . Lets hope it will be merged soon.

4 Likes

It’s a good news! Thank you very much!

Could you help me, please.? I upgraded the Hassio to 0.99 and deleted custom yeelight from the custom components. Now I get this error:
image

The config is not changed and it is worked pefectly with the custom yeelght component.

My config:

discovery:
  ignore:
    - yeelight
yeelight:
  devices:
    192.168.31.165:
      name: kitchen
      model: ceiling3      
    192.168.31.128:
      name: kitchen2
      model: ceiling3
    192.168.31.218:
      name: living room
      model: ceiling4
    192.168.31.42:
      name: bathroom
      model: color2
    192.168.31.129:
      name: entrance
      model: color2
    192.168.31.166:
      name: room
      model: color2
    192.168.31.147:
      name: girls
      model: ceiling3
    192.168.31.178:
      name: bedroom
      model: ceiling3
  nightlight_switch_type: light 

I don’t see what’s wrong…

More detailed logs should be available somewhere, probably in dev tools, but I think problem is with: nightlight_switch_type: light, its configured now per light, not globally.

How does syntax look like in this case?

yeelight:
  devices:
    192.168.31.166:
      name: room
      model: color2
      nightlight_switch_type: light
    192.168.31.147:
      name: girls
      model: ceiling3

Add this per each device, that you want to have 2 lights for nightlight / normal mode

1 Like

Thank you very much! It is working now! :smiley: :beers:

hey guys need your help, I got an automation for a nightlight, after getting up in the morning light turned on via motion, so far so good, but if we change the brightness to be brighter and showering the light goes into the nightlight mode due to there is no motion triggered in the shower. My girlfriend is going crazy :wink:

  alias: 'Badezimmer: Nachtlicht'
  trigger:
  - entity_id: binary_sensor.motion_sensor_xxxxx
    platform: state
    to: 'on'
  condition:
  - after: '23:01'
    before: 07:59
    condition: time
  action:
  - data:
      entity_id: light.yeelight_ceiling1_xxxxx
      mode: moonlight
    service: yeelight.set_mode
  - data:
      brightness_pct: 5
      entity_id: light.yeelight_ceiling1_xxxxx
    service: light.turn_on
  alias: 'Badezimmer: Nachtlicht Aus'
  trigger:
  - entity_id: binary_sensor.motion_sensor_xxxxx
    for:
      minutes: 5
    platform: state
    to: 'off'
  condition:
  - after: '23:01'
    before: 07:59
    condition: time
  action:
  - data:
      entity_id: light.yeelight_ceiling1_xxxxx
    service: light.turn_off

Hello Michael. First of all thank you for your work. It worked like a charm for my ceiling lights.
I tried to do the same to my bedside2 lamp, but unfortunately it didn’t work. You have any suggestion?
Thank you.

I assume you are talking about switch for nightlight mode ? What do you mean by doesn’t work ? Try to declare device as bslamp2, in config.