[Solved] Yeelight Thing not working

I’m using OpenHAB 2.3 stable and copied yeelight binding from unstable 2.4 (the jar file). When I open PaperUI, the lightbulbs are detected, I can create items and link them to the things and I can control all the light. Works wonderfully. But I decided that I want all my configuration in one place and started migrating everything to files. I was able to do it for HUE and Xiaomi Mi Home but I struggle with Yeelight. I’m using the following declaration, the file is parsed (per openhab’s log) but no new thing appears. What am I doing wrong?
Thing yeelight:wonder:0x0000000005ed2c62 "_Toilet Light" @ "Toilet" [itemId="0x0000000005ed2c62"]

From the name of the light you can judge it’s quite urgent :smiley:

.:rofl:

If you create the Yeelight associated items in a items file you can link the channel there.

Example from the doc’s:

Thing yeelight:stripe:1 [ deviceId="0x000000000321a1bc" ]

Color YeelightLEDColor { channel="yeelight:stripe:1:color" }

Notice the channel is linked by using the things name, e.g. channel=“yeelight:stripe:1:color”

After making the changes if your still having issues maybe look at upgrading from OH 2.3 to 2.4 M8. I also read that in the next week or so that OH 2.4 will become the new stable version.:grinning:

Thank you for your reply. I read the docs as well but the example given there does not work (if you look at xiaomi mi home binding docs, they are extremely well written and everything was setup in one go). But the problem is not the binding - I have three more yeelights and all of them work 100%. The problem is that I want to be 100% file-based setup and I have no clue how to include Yeelights in file-based config.
I just checked another of my lights (I sadly already deleted my toilet light from paperUI) and it lists brightness item as
yeelight:Wonder:0x0000000005ed0846:Brightness
That, on my end, implies that my former example should be ok but it is not. Any ideas?

If this item shows in PaperUI, like above, then defining the items file like below should work.

Brightness YeelightName  { channel="yeelight:Wonder:0x0000000005ed0846:Brightness" }

I appreciate your time but we do not understand each other. I have a lightbulb from yeelight that is identified by the number in the first post (was discovered by PaperUI, thing created, items added and controlled, then deleted from PaperUI to put it into things file). I added the line from the first post to a file, saved it (and log tells me it was successfully parsed and found zero things). I have a mistake in that Thing definition:
Thing yeelight:wonder:0x0000000005ed2c62 "_Toilet Light" @ "Toilet" [itemId="0x0000000005ed2c62"]
and have no idea what. I do not yet care about items, I just want the Thing visible in PaperUI but defined in .things file. What mistake do I make?

Per the documentation, use deviceId= not itemId= in your things file.

Example:

Thing yeelight:wonder:0x0000000005ed2c62 "_Toilet Light" @ "Toilet" [ deviceId="0x0000000005ed2c62" ]

That’s the bit I was missing. Now I see my thing in the list but sadly it’s offline (I restarted OpenHAB in between the trial and error). All the rest of yeelights that were added in PaperUI are offline as well so I suspect some IP address switch may have occured. Anyway, thank you for finally solving my puzzle, you are my hero, H102!

Glad to hear you have the thing file created and able to see it in PaperUI.:grinning: Now let’s find out why it’s not working.

If the address has not changed and it’s still not working. You may want to clean the cache using the following steps.

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo systemctl start openhab2

If this doesn’t work, I wonder if the binding has an issue with some things created in PaperUI and some in files.:thinking: You may want to try creating all your things in files and remove everything created via PaperUI.

Try the above and let me know what happens.

I did a quick cleanup (removed all the items in PaperUI and the rest of them manually from jsondb). Now all the things are in files (and they are online). So far so good. I’ll be adding items now and I’m curious what will happen. I will keep posting here soon :slight_smile:
Also, if it’s inportant, I use OpenHAB on WIndows.