Yeelight Plugin Development ?

Would anyone be up for creating a plugin for Yeelight bulbs ? they are cheap compared to Hue, ~?15

I have asked Vera Support and they have no interest in supporting them. ::slight_smile:

There is an open API available using tcp connection, json commands / responses and a notification when status of bulb changes to update any connected devices.

There is also a python library on Github that I am successfully using in Eventghost to control the bulbs but Vera integration would be great so my RTI remote processor can control and have status updates from Vera.

It’s beyond my capabilities unfortunately. :-[

Thanks

Simon

Sadly I suspect it’s beyond my abilities as well but, as you noted, the API is out there and it doesn’t look overly complicated so I’ll have a look when I have a chance. I will note that I am impressed with the value (price & quality) of the Xiaomi products. I have a couple of RGB Yeelight strips and they work fine with my Google Home now, and am thinking about getting one of the desk lamps. I also recently got their robot vacuum and am very impressed with it - definitely equal or better than my Neato.

If it turns out I have neither the time nor ability to do it, if there’s enough interest for it in the community, maybe we can convince/pay someone via fiverr.com with LUA skills to work on something for us? . :slight_smile:

I have added experimental support for the Yeelight bulbs to the WiFi/UDP Switch Controller plugin… HERE

Note: Availability of these bulbs in the great white north is sporadic, so I do NOT have any of these bulbs, so if you try the plugin and it does not work, you WILL need to provide excerpts of the LuaUPnP log in order to get it working.

Also, as support is experimental, you will need to force installation of the specific version using the instructions in post 3 of the WiFi/UDP thread.

@cybrmage,

Thanks for the heads up to Yeelight support on your plugin.

I tried to install v1.45 but the “Lua Engine Failed to Load” (v1.40 installs fine)

The device number is 471 on my Vera.

Hope you can iron this out !

Cheers

These lines show up in my log:

01 09/17/17 20:12:27.114 IOPort::Connect connect -1 127.0.0.1:3481 <0x2d82b680>
01 09/17/17 20:12:31.118 IOPort::Connect connect -1 127.0.0.1:3481 <0x2d82b680>
01 09/17/17 20:12:34.171 Device_Interface::CreateLuaInterface 471 failed to start engine <0x2aded310>
01 09/17/17 20:12:34.436 LuaInterface::LoadCode: [string “local VERSION = “v1.45”…”]:2159: unexpected symbol near ‘)’ <0x2aded310>
01 09/17/17 20:12:35.123 IOPort::Connect connect -1 127.0.0.1:3481 <0x2d82b680>
01 09/17/17 20:12:39.129 IOPort::Connect connect -1 127.0.0.1:3481 <0x2d82b680>
01 09/17/17 20:12:43.133 IOPort::Connect connect -1 127.0.0.1:3481 <0x2d82b680>

I’ve made some changes, based on assumptions - your log excerpt is a little spare… The error indicated could only be generated if the ssdp search did not find any YEELIGHT devices… So I have tweaked the ssdp search algorithm to hopefully find some devices.

Attached is the update…

Upload the file to you vera from Apps/Develop apps/Luup files… Make sure “Restart Luup after upload” is checked.

*** SUPERSEDED ATTACHMENT REMOVED ***

Thanks I’ll try it tonight but it wouldn’t even install, and stopped at “Lua Engine Failed to Load”

It didn’t start the search.

I tried v1.40 and it installed fine and did the search, but not Yeelight obviously.

If it still doesn’t work I’ll post my whole log, sorry

Cheers

Hi, now it does install OK and does the discovering for YEELIGHT devices.

However, when I press on Configure I get this is red:

Error executing function configuration(): Unexpected token in JSON at position 21

I attach my full log this time, EcoSwitch device is 474.

From the log, Yeelight is being discovered OK, IP 192.168.1.212

For info, There is a typo in your searches for the SengLED device “Discovy” intead or “Discovery”

Thanks again

Try this…

Download BOTH files. rename J_ECO_Switch1.js.txt" to J_ECO_Switch1.js" and upload both files to your vera, allow the LuaUPnP engine to reload, then refresh your browser…

*** SUPERSEDED ATTACHMENT REMOVED ***

It now says discovered 1 Yeelight but still has the same error when I click on configure:

Error executing function configuration(): Unexpected token in JSON at position 21

and doesn’t display anything else

Cheers

Ok…

Something in the device data is corrupted… and without better logging, I can’t tell where it’s being corrupted…

I’ve added additional debugging… please upload this version, and post logs again… thanks.

*** SUPERSEDED ATTACHMENT REMOVED ***

Here you go

Thanks

Ok…

This one should do it… (well… at least for device discovery and configuration)

*** SUPERSEDED ATTACHMENT REMOVED ***

No, still the same I’m afraid, it does discover one device but the configure button still fails.

Not sure what the IP address of 192.168.1.255 is line 28381 of the log ? my Yeelight is 192.168.1.219.

Cheers

The log you posted is incomplete… It does not show the complete startup of the plugin…

Sorry, been chopping it so I can post it here, hopefully this is complete ?

Cheers

Better…

This should do it… (really this time…)

*** SUPERSEDED ATTACHMENT REMOVED ***

Getting closer!

Device now is configurable and a dimmable light devices appears but it doesn’t control the Yeelight. The switch won’t switch to the ON position but the slider does slide, but no reaction from the Yeelight.

Attached it latest log.

Cheers

Try this… post log…

8-}

*** SUPERSEDED ATTACHMENT REMOVED ***

Just the same I’m afraid

You can see when I turn on the device (475) at the end of the log.

Cheers

Ok…

yet another version…

*** SUPERSEDED ATTACHMENT REMOVED ***