Broadlink SP3 stops working after a few days

Well, nice to know I am not alone. Not sure whether this is a problem with the Broadlink python library, or a problem with HA itself.

I haven’t tried controlling the switches through the Broadlink python library directly, as my Linux skills are not terrific and I haven’t set it up. I suspect if a reboot of HA fixes the issue, then it is more likely HA than the python library itself?

@Danielhiversen, any ideas?

Bump. Anyway, have scheduled in a nightly restart of HA … see how far that gets me. Not ideal, as it is not really solving the problem, but I need these damn switches to just work. at 4am when the restart is scheduled, not much is going on in my HA set up anyway.

Nightly restart of hass.io seems to be working around the issue. Not ideal, but at least my devices are not going off to NeverNeverLand :slight_smile:

FYI I’m no longer having difficulty, an update in recent days may have fixed it.

Interesting … I am still getting the odd issue every now and then, even with the nightly reboots. Running the latest version of hass.io, but I haven’t upgraded my ResinOS from 1.1 to 1.3 yet … I read somewhere that there were some issues, so have been holding out. @claud9999, what versions of hass.io, ResinOS and supervisor are you running?

Still happening.
Now after an hour at most.
Pi 3
Hass.io supervisor 141
HassOS 1.13
Hassio 0.84.6

Same. Still happening. Latest version of hassio, supervisor, etc. I rebuilt completely from scratch using hassos on a new rpi3 model b+. Also able to recreate the problem running on a docket container on Ubuntu. Frustrating!

@aheath Andrew - any update - My 2 Broadlinks went offline at the weekend and I could not get them working again until a restart.

As far as I know, the problem still exists, although I must admit I haven’t tried recently - I have put in a 3am HA restart and that seems to work around the problem the vast majority of the time.

0.93.1 and I can see that, on SC1 devices (that must behave the same).
EDIT : but MP1 does not the same. Neither a Broadlink-based thermostat.

If the device gets disconnected from WiFi, then HA won’t see its status anymore. Turning on or off may work though ! Restarting HA is needed to make it work again.
I guess that when HA looses once the connection to the device, it won’t be able to access it anymore.

Can reproduce anytime when I reboot my WiFi access points.

Now that is interesting!

My wireless network is fairly stable with strong connection, so not sure why the switch would disconnect, and it does not explain the fact that with a restart of HA every night, this problem has occurred maybe 3 times over the course of 1+ year. I suppose it is plausible that this could be the cause, and if, as you say, you can recreate it at will then it may be time to create a bug report. Have you already done this, or should I do it - I don’t want to create a duplicate.

No I didn’t, I’m not sure it’s actually a bug, is there something that can be done ? There are several components that won’t connect a device if they don’t see it, for instance at startup.

3 time a year, it’s fine ! I don’t restart my HA often (well, sometimes several times in a row when I mess things adding new automations ! :sweat_smile:) and I see that every other week. Most of the time on the same devices. My Wifi is a bit complex, with two access points (one in the basement, one upstairs) so some devices roam and then it can loose the connection for a few seconds. It’s the only way I can explain SC1 disconnecting, I never reboot them, for years

Others are having similar issues. Broadlink A1 stops updating

According to that thread, HA tries to connect 3 times and if it cannot connect, then it just stops all subsequent communications - which could explain it.

https://github.com/home-assistant/home-assistant/issues/15275 describes the exact same issue, and states that it was resolved in HA 0.72.1.

I might do some further testing over the next few days I think, and if it is still not working, then I will create another bug report.

1 Like

I’ve also found that every so often HA loses connection with my Broadlink RM mini3. I can’t see anything that stands out in the HA logs. Restarting HA fixes the issue each time, although that’s not a solution.

My HA is configured to automatically restart each and every morning. Usually it reconnects to the Broadlink just fine, but once every few weeks, it fails to do so. BTW, I use the SmartIR component to send IR commands from the Broadlink to my HVAC.

@pkozul - I have a 3 x RM Mini3’s and 1 x RM Pro and have never noticed any of them being unresponsive. I also using the SmartIR component. It may be related, but it may not be.

You should be able to test by unplugging one of them, leaving it unplugged for an hour or so, and then plug back in and see if responds.

That is what I am going to do with some of my Broadlink devices, probably over the weekend. The more people that can test and respond, the better, I think.

@aheath - I actually tried powering cycling the Broadlink, but it made no difference. The only solution was to restart HA. In my case, it’s definitely something not working right on the HA side. BTW, everything else works just great in my setup. I run Hass.io on a Dell laptop.

@pkozul Yes, once the switch becomes unresponsive in HA, the only way to get it back is to restart HA.

I think it would be far batter if HA were to retry connection at regualr intervals rather than just assuming that switch will never come back onto the network.

I was more thinking if you could test to see if you could re-create the unresponsiveness in the first place by powering the switch off, and allowing HA to try connecting 3 times, and then plug it back in and see if it is unresponsive. Or perhaps by moving to an area of your house that barely gets network signal.

Logged an issue - see how we go

Same issue here, so thanks for raising it. Would be ideal if it could be a service call (say, broadlink.connect) so it’s not trying thousands of times to connect to a device that’s off.

Hello. I’ve had same issue with 2 SP3s. I’m using HA on RPI 3 B+ and after restart they work from 5 to 20 minutes then randomly unavailable or just do not respond. Digging into python code I’ve found that they create socket descriptor per device instead of per request. So I’ve implemented my version of “mjg59/python-broadlink” module which creates socket as soon as communication with plug needed and it fixed issue. I’ve tested it for few days and it works smooth so created PR https://github.com/mjg59/python-broadlink/pull/283 and hope it will help. Thank you

1 Like