I bought a Yeelight RGB Bulb a couple month ago and decided to handle it myself with a NodeJS server hosted on my raspberry PI.
The ssdp discover function works great and I succeeded in establishing a tcp connection. All the commands are sent but, after a while (usually couple hours), the bulb disconnects itself from the server.
I first tried to use the tcp keepalive function but it didn’t worked. The second idea was to retrieve the bulb state every minute to keep the tcp connection alive and, at the same time update my database. Unfortunately, it still doesn’t work and keep disconnecting after a while.
Any ideas would be apreciated and could really help me.
PS : Sorry, english is not my mother tongue