Xiaomi Yeelight RGBW E27

I sort of got it running on my qnap NAS by manually download from github, the problem though qnap don’t have a native arp command and your node script stopped there, need to install 3rd party entware on Qts which I don’t want probably will get a raspberry pi 3 for such, anyone has successfully make it work on Pi as I have zero experience on Pi, actually I can see the program can locate my yeelight already on the LAN

Yes that ARP stuff is a bit crappy…I was really coming up the learning curve and used that because the MAC seemed to be critical. The yeelights dont expose their MAC through any api call, so I used ARP to find them.

I am currently working on V2 which may sort a lot of this out, but it wont be for a few weeks. I want to incorporate the MiPow playbulbs which I like and have loads of -:slight_smile:

Main thing I havent got completely clear is why/when you need a MAC as opposed to a hex ip for a DNI (devicenetworkid) I am going slower this time, so I hope to bottom it out. If I can use Hex IP I may be able to drop the ARP stuff

Oh thanks for that I assume weiwei from yeelight should have some idea about the arp

Dave got it working from my raspberry pi just arrived today thanks though I cannot start it by service but I can start the node.js manually after updating the node.js version manually on Pi, if anyone have any question on Pi just let me know

1 Like

I had issues with this too. I was running the server from a folder on my Pi’s desktop. I moved all the files to /var/opt/node/yeelight-smartthings then:

sudo addgroup --system yeelights
sudo adduser --system yeelights --ingroup yeelights getent group yeelights

Then:

sudo cp /var/opt/node/yeelight-smartthings/yeelight-smartthings.service /etc/systemd/system/

sudo cp /var/opt/node/yeelight-smartthings/config.json /home/yeelights/

sudo chown yeelights:yeelights /home/yeelights/

sudo chown yeelights:yeelights /home/yeelights/config.json

Then:

sudo systemctl daemon-reload

sudo systemctl enable yeelight-smartthings

sudo systemctl start yeelight-smartthings

That did it for me.

My TP-Link node.js server is started by using Cron but I couldn’t get it to work with this for some reason. You could try it.

Sudo crontab -e

Add ‘@reboot sudo /use/local/bin/node /path/to/node/server.js &’ to the last line of Cron, save and exit then reboot. YMMV.

Good luck buddy.

1 Like

I’ve tidied up the readme on GitHub…I made a mess of using markdown!! It makes the users and groups clearer. I’ve also raised an issue regarding cron not working, it isn’t high on my priority list, but I will eventually get to it

Glad to hear it!!!

Ok…I predict a few problems…mainly with ARP and MACs…I am currently creating a new version that will be a lot tidier, (and hopefully less dependent on ARP) so until you try this I am not going to investigate. Just drop me a line when you do and let me know any problems.

Oh I have fixed it by modifying the yeelight-smartthings.service PATH to put /usr/local/bin at the front since my updated node binary is there, may be in the server.js/package.json could enforce the minimum node.js version required

Hi @Davec I just have another question about whether I should change the discovered yeelight 's name or IP seems the devices went offline twice, last time I could only recover it by removing it and start over again
Another question is seems like there is no synchronization of real light bulb state if I change it by yeelight’s app or through schedule as I found the on/off state seems not reflected in the smartapp/smartthings

Ok…I will check that Thanks

So…I will need to investigate the name/ip change. Name should work, but IP might have bugs…

Regarding the synchronisation with the yeelight app…indeed this is a future plan…I got lost in the smartthings groovy couldn’t decide if I wanted to poll or to try and make subscription work…so I left it…will return to it in the near future.

I am getting a offline message again while having the device name and IP intact kind of weired it could be the device health feature of my android app

Update: oops seems my yeelight really go down itself for some unknown reason I will further observe it could be unrelated to the device handler or smartapp

Hi @Davec still see unavailable status from my yeelights in smartthings again after I go to the device to configure and press done seems it is going back to available status
One thing wanted to note is I have daily schedule running from yeelight itself to turn off and turn at certain time of the date may be I could do it from smartthings itself

I use the Smart Lighting smartapp to set schedules for all my smartthings. Seems to work fine with the yeelights.

Regarding the disconnect, I have been a bit busy, haven’t had a chance to investigate. If I can’t replicate it, I will need to see your server logs and ip address details.

Hope to investigate in the next couple of days…

Sorry Dave just found seems someone power off my raspberry pi that’s why my smartthings cannot access it let me observe a few days and report back

Haha. I have had that problem. Took me ages to diagnos

Just a quick note to say thanks again. Server still working perfectly.

Wow…thanks…I must admit I was scared to ask!!!

I just installed it on my raspberry, works perfect and many thanks for it!!
In discovering process sometimes smartthings app hangs and crashes.

Is the lightstrip also supported because its not findable? and is the ceiling light supported?

Many tnx in advance!!!

Hi Dave I still have some intermittent offline in the smartthings app I think it could be due to I have Amazon echo dot to turn it off and on, other than I have to go to the device in the app click the x and then refresh usually it will come back to life, another reason could be the device health for smartthings app which many people have complained