Yeelight, first use with ceiling light, but thing is offline

Hi there,

I just bought myself a Yeelight “C2001 Ceiling Light”. Was tempted to do so as their protocol is open, does not require a cloud and seemed to be supported by Openhab.

After spending two hours, I got the lamp partially working, that is:

  • It does not seem to be discoverable by the binding itself
  • However I was able to discover and control it (e.g. toggle on/off) using the python library “yeelight”, see below for result of the discovery:

[{'ip': '10.30.255.114', 'port': 55443, 'capabilities': {'id': '0x000000001a61993f', 'model': 'ceila', 'fw_ver': '11', 'support': 'get_prop set_default set_power toggle set_bright set_scene cron_add cron_get cron_del start_cf stop_cf set_adjust adjust_bright set_name set_ct_abx adjust_ct', 'power': 'on', 'bright': '10', 'color_mode': '2', 'ct': '3000', 'rgb': '0', 'hue': '0', 'sat': '0', 'name': ''}}].

  • If I create a Thing via file it is reported as offline

Thing yeelight:ceiling:1 [ deviceId="0x000000001a61993f" ]

I tried also all other types line “ceiling1” and so on, but no change, they always appear offline.
I’m wondering about the IP, just guessing: As discovery does not work, the light is not found at all from the perspective of the addin? Or is it about the model named “ceila” which simply is not recognized by the addin?

The addin is a little short on the documentation so right now I’m somehow clueless how to get it working.

Wanted to add something: I use network devices from unifi, the openhabian box and all IoT devices are running in a single, own VLAN, the network is “10.30.0.1/16”, as visible from the python output.

Just got one more idea, I think that does not solve it, but points out the problem. Setting the addin to “trace” showed the following log output. So basically it’s discovered but model “ceila” not recognized.
What is the recommendation now? Thanks

2024-11-09 00:09:00.989 [DEBUG] [.internal.lib.services.DeviceManager] - DeviceManager: got message: M-SEARCH * HTTP/1.1
HOST:239.255.255.250:1982
MAN:"ssdp:discover"
ST:wifi_bulb

2024-11-09 00:09:01.020 [DEBUG] [.internal.lib.services.DeviceManager] - DeviceManager: got message: HTTP/1.1 200 OK
Cache-Control: max-age=3600
Date:
Ext:
Location: yeelight://10.30.255.114:55443
Server: POSIX UPnP/1.0 YGLC/1
id: 0x000000001a61993f
model: ceila
fw_ver: 11
support: get_prop set_default set_power toggle set_bright set_scene cron_add cron_get cron_del start_cf stop_cf set_adjust adjust_bright set_name set_ct_abx adjust_ct
power: on
bright: 1
color_mode: 2
ct: 4000
rgb: 0
hue: 0
sat: 0
name:

2024-11-09 00:09:01.020 [DEBUG] [.internal.lib.services.DeviceManager] - DeviceManager: got bulbInfo: {Ext=, Server=POSIX UPnP/1.0 YGLC/1, color_mode=2, sat=0, bright=1, rgb=0, Date=, ct=4000, Cache-Control=max-age=3600, name=, hue=0, model=ceila, id=0x000000001a61993f, power=on, fw_ver=11, support=get_prop set_default set_power toggle set_bright set_scene cron_add cron_get cron_del start_cf stop_cf set_adjust adjust_bright set_name set_ct_abx adjust_ct, Location=yeelight://10.30.255.114:55443}
2024-11-09 00:09:01.021 [DEBUG] [.internal.lib.services.DeviceManager] - Error getting ip addresses: No enum constant org.openhab.binding.yeelight.internal.lib.enums.DeviceType.ceila
java.lang.IllegalArgumentException: No enum constant org.openhab.binding.yeelight.internal.lib.enums.DeviceType.ceila
        at java.lang.Enum.valueOf(Enum.java:273) ~[?:?]
        at org.openhab.binding.yeelight.internal.lib.enums.DeviceType.valueOf(DeviceType.java:1) ~[?:?]
        at org.openhab.binding.yeelight.internal.lib.device.DeviceFactory.build(DeviceFactory.java:34) ~[?:?]
        at org.openhab.binding.yeelight.internal.lib.device.DeviceFactory.build(DeviceFactory.java:63) ~[?:?]
        at org.openhab.binding.yeelight.internal.lib.services.DeviceManager.lambda$1(DeviceManager.java:175) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
        at java.lang.Thread.run(Thread.java:840) [?:?]

The yeelight lamps don’t want to be controlled from a different vlan. You can work around that by adding a SNAT rule for masquerading requests on you unifi controller. Trouble is that there is no native ui to do so. While setting this manually on the console will work it won’t survive reboots. I use the on boot scripts from GitHub - unifi-utilities/unifios-utilities: A collection of enhancements for UnifiOS based devices to make it persistent across restarts.

Sorry, I wasn’t quite clear with my posting: Openhab and yeelight are in the same VLAN. But as posted, discovery works, but the device is unknown. I think I’ll open a request in github for this.

Ok sorry I got it wrong then. I guess that’s the best you can do then :man_shrugging:

You might be able to control them with the miio (Xiaomi wifi) binding.

If your model is not recognised you can override the modelid in the config

Thanks for the hint Marcel, tried that, but the whole issue around using and retreiving that token just is too cumbersome. Also the lamp does not support the basic discovery, log states “No token discovered for device xxx”.
So for the moment I’m okay using the lamp with a python script and execution of the script from a rule and hope the “ceila” model gets added in one of the next releases :grinning: I made an enhancement request in github, so let’s wait :wink:

1 Like