Another connection issue thread with lots of research and will to help and test!

Hi, can you add me to whitelist? I would also try the new FW, because my newest bulb mono4 blinks once when disconnected.

MI ID: 1655679156

I have the same issues :confused: Made a few posts about that…
If i turn the Internet off the lights go even faster offline! The only solution is to cut the power!

Hello,

For each second you make the WPA Key Update Interval longer, it becomes more insecure. So surely this wouldn’t be a solution for any problem in this world. Also, most Home Routers can’t be configured that way. Even lot of Business Routers don’t have possibility to do that (have some lying around and checked it).

And also I can confirm that it is not an issue on the Yeelight Bulbs. They have support for this.

The issue with Yeelight Bulbs is still on the get_prop command which does not return values as expected as soon as connection limit is hit.

And the other one is the reconnection timeout (in case of Router restart) which could be to low based on the information from liufei.

best regards,
Thomas

Hi, sorry for the long waiting. The new version of following products are in beta now. Please check it out/
bslamp2 2.0.6_0040
ceiling15 2.0.6_0026
ceiling20 2.0.6_0026
ceiling10 2.0.6_0050

Still need a couple of days for color4.

Thanks for the feedback. This looks like a bug a bug on bulbs’ side but currently need routers to adapt. We will try to confirm the issue in our lab and see what we can do.

Hi, which product are you using? Do you favor a beta test?

@liufei Thanks to you and the team so, so much for this!! I could successfully update these lamps to the version you soecified:

  • Both bslamp2
  • My ceiling10
  • Both ceiling15
  • My ceiling20

I will monitor the lamps in Home Assistant and see if it fixes the issues :slight_smile:

One ask again: This is about the lamps going unavailable and coming back every x minutes, right? So the “get_prop” example / issue tomb92 listed?
This is not yet about lamps going completely offline after a certain time and only physical power off and on helps?

Thanks!

Hi Fei Liu,

I bought 16 Yeelight LED Bulbs 1S (Color) a few days. I installed 8 in my first ceiling light and another 8 in my second ceiling light. I upgraded the firmware of the bulbs in the first ceiling light to the latest version 2.0.6_0030 (indicated on the Yeelight app). The 8 bulbs with the upgraded firmware are now offline and unreachable. I reset the 8 bulbs and I was able to connect to them again using the Yeelight iPhone app. But after several minutes, they again became offline and unreachable. And I have to repeat the reset process to connect to them again. Here are the devices I used to connect to the bulbs:

Router: Askey5100 router
Yeelight App on iPhone
Server: Asia and Oceania (Singapore)
MI ID: 1859693023

I read the discussions in the thread. It seems that there will be new firmware that should be able to resolve the connectivity incidents. How do I update to this newer version of firmware? My Yeelight app is still showing 2.0.6_0030 as the latest version.

Regards
CS Tan

@liufei can you please check that I’m part of testers?
my Mi id: 1595692303

is it possible to do ceiling19 too ? This is the big 960mm 49YL light

Hi…The yeelight colour bulbs are not automatically reconnecting to the wifi after the router gets reset… the bulbs have to be switched off and on again for them to be online.

My mi account ID - 5354206260 and the model of my lights are - yeelink.light.color3
I am using the Singapore server. Please suggest.

Hi could you add me to the whitelist?

Mi id: 6191275032

First feedback after 24h using the new firmware. The issues definitely have dramatically decreased, from like every 5 minutes to pretty much every 3-3.5h! So still not totally random, which makes it very suspicious… Looking just at my two bedside lamps, these are the logs HA sees over 24hours of using the new beta build (I installed it around 9am yesterday, so exactly now 24h ago):

2020-12-03 12:00:40 ERROR (SyncWorker_16) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: A socket error occurred when sending the command.
2020-12-03 12:01:10 ERROR (SyncWorker_38) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: A socket error occurred when sending the command.

2020-12-03 15:21:10 ERROR (SyncWorker_17) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: A socket error occurred when sending the command.
2020-12-03 15:21:40 ERROR (SyncWorker_35) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: A socket error occurred when sending the command.

2020-12-03 18:41:41 ERROR (SyncWorker_47) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: A socket error occurred when sending the command.

2020-12-03 18:46:11 ERROR (SyncWorker_5) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: A socket error occurred when sending the command.

2020-12-03 22:02:43 ERROR (SyncWorker_28) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: A socket error occurred when sending the command.

2020-12-03 22:06:43 ERROR (SyncWorker_18) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: A socket error occurred when sending the command.

2020-12-04 01:05:49 ERROR (SyncWorker_7) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: Bulb closed the connection.
2020-12-04 01:05:49 ERROR (SyncWorker_33) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: Bulb closed the connection.

2020-12-04 01:52:44 ERROR (SyncWorker_25) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: A socket error occurred when sending the command.
2020-12-04 01:52:44 ERROR (SyncWorker_21) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: A socket error occurred when sending the command.

2020-12-04 04:26:14 ERROR (SyncWorker_45) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: A socket error occurred when sending the command.
2020-12-04 04:26:44 ERROR (SyncWorker_13) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: A socket error occurred when sending the command.

2020-12-04 07:47:15 ERROR (SyncWorker_47) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: A socket error occurred when sending the command.
2020-12-04 07:47:15 ERROR (SyncWorker_17) [homeassistant.components.yeelight] Unable to update device 192.168.178.34, [Bedroom] Bedside Lamp Andy: A socket error occurred when sending the command.

The lamps have not been touched / used most of the day. Only usage times were at ~1:30am and again ~8am. Nor has power been cut at any time. Also Wi-Fi was available the whole time and they’re still very close to an access point (it’s literally behind the wall).
Again: The only command that HA sends at that time is “get_properties”!
And again: They still have internet blocked!

It would be very interesting to see, if you @tomb92 can still reproduce the “get_prop” issue using Telnet. I haven’t applied your suggested changes to the Yeelight HA component / Yeelight python lib yet, because I wanted to see if the fix itself solves all occurrences of this issue :slight_smile:

I will now also monitor the Pendant lamp (ceiling10) and my three ceiling lamps (2x ceiling15, 1x ceiling20). That’s a bit harder to actually track, as people tend to hit the wall switch which then gives false reports. I will note down every time a wall switch has been hit, so I can post clean results. I hope to have them by tomorrow!

Thanks again so far @liufei and Yeelight team!!

Hello,

Hello

There is one issue I’ve read about here on the forum. I applied the solution from this post to the Python library.

Basically this one is not an error. It’s just letting you know that the connection has been closed which is absolutely fine. I debugged this one. But Homeassisant doesn’t like Errors.

2020-12-04 01:05:49 ERROR (SyncWorker_7) [homeassistant.components.yeelight] Unable to update device 192.168.178.35, [Bedroom] Bedside Lamp Kristina: Bulb closed the connection.

So what I implemeneted was this:

def send_command(self, method, params=None):
    """
    Send a command to the bulb.

    :param str method:  The name of the method to send.
    :param list params: The list of parameters for the method.

    :raises BulbException: When the bulb indicates an error condition.
    :returns: The response from the bulb.
    """
    command = {"id": self._cmd_id, "method": method, "params": params}

    _LOGGER.debug("%s > %s", self, command)

    try:
        self._socket.send((json.dumps(command) + "\r\n").encode("utf8"))
        **time.sleep(0.05)**
        **self._socket.close();**
    except socket.error as ex:
        # Some error occurred, remove this socket in hopes that we can later
        # create a new one.
        self.__socket.close()
        self.__socket = None
        raise_from(BulbException("A socket error occurred when sending the command."), ex)

As you can see I implemented a little wait after a command is sent and then close it, which also increases reaction times dramatically. (it can be any command, get_prop, set_ etc.)

        **time.sleep(0.05)**
        **self._socket.close();**

Same here without timeout.

    while response is None:
        try:
            data = self._socket.recv(16 * 1024)
            **self._socket.close()**
        except socket.error:
            # An error occured, let's close and abort...
            self.__socket.close()
            self.__socket = None
            response = {"error": "Bulb closed the connection."}
            break

So for those error you are getting I can confirm that it is a problem on the library. But it is really a non-problem. The library is just not specifically made to work with Homeassistant.
So if I implement my own Python solution there are no issues with it.

best regards,
Thomas Barbut

True that the library could use some work in regards to error handling etc for home assistant :stuck_out_tongue:
But it’s also a problem with Yeelights stops responding to get_prop after a while (randomly) Though home assistant depends on availability with get_prop

Any progress for fixing the bug with get_prop for lamp model color4 ?

Thanks

Thanks again for pointing this out. However, only one out of eight “connection issues” are the “bulb closed the connection” error you’re mentioning and fixing with that patch. I was still lazy and didn’t check and apply your fix. I’m still thinking of somehow applying that fix to the HA plugin, but didn’t have time yet to think about it…

1 个赞

@ezcGman

That fix breaks more stuff than it fixes. Trust me.

    try:
        self._socket.send((json.dumps(command) + "\r\n").encode("utf8"))
        **time.sleep(0.05)**
        **self._socket.close();**

/\ Closing the socket and then the below happens later in the same method

data = self._socket.recv(16 * 1024)
            **self._socket.close()**

Trying to read from the socket which was just closed previously.

@liufei
Can I please be whitelisted for the beta firmware for color2?

UID: 6360133601
Server: Asia and Oceana (Singapore)

Thanks!

hi, @Dwaipayan, we will look into this issue. no fix yet.
@Skirmish, color2 irrelevant with the issues discussed in this thread. Please describe the issues with yout bulbs. Thanks.

@tancheesoo I have whitelisted your MI ID and you should be able to see 2.0.6_0031 very soon. There’s will be another version with fix of issue discussed in this thread. But I believe 0031 will perform much better than 0030.

====

About beta version of color4.
There’s a new 2.0.6_0031 queued to be released, which include some enhancement in network connectivity. Should be online within a week. Please wait and see if this helps with the issues you are seeing.
The beta version (likely 0032) including the new patch has to wait until 0031 is released.