OK. thanks for your reply in advance.
To set static ip for bulbs, I do set reserve ip in DHCP
I do power recycle the bulbs if it is unavailable.
But, the problem is, like other users in this thread. Yeelight bulb become unavailable in HA time to time. Unavailable after several hours, until I manually switch off and on the bulb. And after another several hours, unavailable again. Same problem on FW 0051, 0053, 0055 and the newest 0056.
I know that the bulb has rate limited, I did try to send command through HA to control the bulb repidly so to try to simulate unavailable in HA. If I control the bulbs through HA for about 10 to 12 times repidly, the bulb will be unavailable for a while, and reconnect within 1 or 2 minutes and work fine afterwards. Errors in HA like:
Unable to update device 192.168.0.63, YeelightColorBulb-5221: {‘code’: -1, ‘message’: ‘client quota exceeded’}
Connection lost. Reconnecting…
But, If I let the bulb idle, for several hours, error like:
2019-10-02 16:07:46 ERROR (SyncWorker_2) [homeassistant.components.yeelight] Unable to update device 192.168.0.63, YeelightColorBulb-5221: Bulb closed the connection.
2019-10-02 18:13:44 ERROR (SyncWorker_2) [homeassistant.components.yeelight] Unable to update device 192.168.0.63, YeelightColorBulb-5221: Bulb closed the connection.
2019-10-03 04:01:41 ERROR (SyncWorker_2) [homeassistant.components.yeelight] Unable to update device 192.168.0.63, YeelightColorBulb-5221: Bulb closed the connection.
And it will be unavailable in HA until a bulbs power cycle. Like I mention in previous reply, If it is unavailable, HA failed to control it, even telnet failed to control it. Only a power recycle can make the bulb live again.