Yeelight ceiling lamp binding

Hi all
I am running openhabiab on resp pi 4.
I have a Yeelight ceiling lamp. The lamp is configured and works well with the yeelight mobile app.
I want to bind it into the OH.
I followed this guide: https://www.openhab.org/addons/bindings/yeelight/
But the light has not discovered in the inbox.
I tried to manually bind it, but it asks for device ID which I don’t know from where to bring it (searched in the mobile app).

What can be done to troubleshoot it?

Thanks

If I remember correctly you need to enable developer mode in the app to get the device ID.

Per the doc’s:

To control Yeelight devices with this binding, you need to connect the device to your local network at first with the Yeelight app. This app is available in the iOS AppStore and on Google Play.

Then you need to activate LAN control mode by enable Developer Mode in device settings, after which it will become discoverable by openHAB.

#

Hi
Of course that I activated Lan control (I didn’t needed to enable developer mode)
As I wrote the device is working well with the app.
The binding just finds nothing.

When you enable developer mode you can get the device ID that’s needed.

Do you know how to enable developer mode on the mobile app?
I didnt find any useful data anywhere.

Seems developer mode is named LAN Control in new app version. With that enabled you don’t find the device ID?

From other post:
Prerequisites:

  • Yeelight app
  • Python and Pip installed
  1. Open Yeelight app and run “Lan Control” as described here: https://www.yeelight.com/faqs/lan_control
  2. in Linux Terminal run “sudo pip install yeelight” to import yeelight library for python
  3. In linux Terminal run “python” to access to the python console (terminal now prompts “>>>”)
  4. type “from yeelight import discover_bulbs” and press enter
  5. type discover_bulbs() and press enter (lan control in yeelight up must be activated).
    Instrunctions here: https://yeelight.readthedocs.io/en/latest/

After few seconds the console prompts something like this (at the bottom of the image you can see the deviceid):

If your a Windows user you can try:
Not sure how well it works as I mainly use Linux but here’s a link for how to. https://docs.microsoft.com/en-us/windows/wsl/install-win10

If I have windows I must install Linux for windows? just to connect to the device?
can’t I do it inside the openhabian terminal? the resp Pi and the device on the same network.

It’s a rasbian lite OS so it should work.

Thank you very much for your help - it still doesn’t work :frowning:
I found the id exactly as you said.
Should I copy it like it is - on hex ?

What should I put in the field “device id”? decimal or hex? with “0x” or not?
Whatever I put in the “device id” the device stays offline.

The device ID will look something like 0x000000000321a1bc in your case it’s the 0x00000000xxxxxx with the x’s being whats marked out in the screen shot.

Any suggestions how to solve it?
The device is offline after settings the device id as descrived :frowning:
In python I can see the light.

image

Yes, I found the workaround how to use and control my ceiling20 which is offline in yeelight binding.
It is quite simple approach to use python script via execommand. executeCommandLine(“python /home/openhabian/pyscript/ceilingON.py”, 1500)

Make your own script: YeeLight library — python-yeelight 0.6.1 documentation

from yeelight import Bulb
bulb = Bulb(“192.168.0.101”)
bulb.toggle()

save it as ceilingON.py

use it in some rule:

rule “Mijia & Aqara Wireless Switch”
when
Channel “mihome:sensor_switch:158d000xxxxx:button” triggered
then
var actionName = receivedEvent.getEvent()
switch(actionName) {
case “SHORT_PRESSED”: {

    executeCommandLine("python /home/openhabian/pyscript/ceilingON.py", 1500)
     

    }
    case "DOUBLE_PRESSED": {
      
    
    }
    case "LONG_PRESSED": {
        if (ZIDOO.state == OFF) {
            ZIDOO.sendCommand(ON)
        }
        else {
            ZIDOO.sendCommand(OFF)
        }
    }
    case "LONG_RELEASED": {
        //<ACTION>
    }
}

end