Broadlink A1 stops updating

Before raising an issue on this I wondered if anyone else is using the above (or any other broadlink device that reports temperature).

The issue I have is that the component stops updating - a reset of homeassistant forces it to start again but there is no info in the log to suggest a problem.

Anyone have any ideas, willing to have suggestions of how I’d start looking to debug this.

Thanks

Yep, my RM pro has the same problem, posted a couple of times but didn’t get anywhere.

Have you enabled debug logging for the Broadlink component?

Yes I have.

I have:

homeassistant.components.sensor.broadlink: debug

Having a quick look at the component code it doesn’t appear to be written to provide much feedback.

This is what I posted last time…

What else do i need to do?

That issue have to be fixed in the Broadlink library we are using: https://github.com/mjg59/python-broadlink

Sorry Daniel, not sure I understand? Are you saying it’s a known problem and we just need to be patient?

I do not know if the developer of the library knows it. But everyone that sees your post knows it.

The library has not been updated for a long time.
So someone have to add a fix to the library.

Have been trying to debug this. I’ve create a very simple command_line sensor calling the python broadlink package directly.

From what I can tell there are periods of time where my A1 goes unavailable for more than 3 retries worth of the homeassistant component. Whilst my command_line sensor doesn’t care about this and keeps retrying (and eventually reconnects), the homeassistant component is designed to fall over and hence stop updating.

Doh, for some reason I got it into my head that it was your baby.

Yep, that’s what my log shows.

I have write access to the repo, but @mjg59 is the owner.
Unfortantly, maintenance of the library is not high on the priority list for none of us.
But your are welcome to add a pull request with a suggested solution.

From what @andrewdolphin says, I guess it is probably as simple as not limiting retries.

@Bobby_Nobble did you find a solution to this problem?
I had a quick look at the library code (currently stuck on my phone so pretty limited). And it seem quite basic there is no error handling or retry logic in there.
It seem that no one is actively trying to solve this, and I would thus like to give it a go. Unless you actually solved it already?
It’s driving me nuts having to restart ha constantly

The fix is to just remove the retry element of the update and to try to auth before every request.

My testing meant I created a really simple python script I run as a command line sensor so haven’t used/needed the component for a while.

Erm…yes but…I have no idea what it was!

Hadn’t given up using it for ages but hadn’t removed the code, checked a few weeks ago and it now seems 100% reliable…well, it was fine over the long Christmas break between updates with no other restarts in between so as reliable as it needs to be.

In that time we’ve had a couple of updates and I’ve changed my router, so it was one of those that cured it! If you’re still having the problem I guess it was the router. I had a perfectly capable Archer C9 but the newer versions don’t like third party firmware which I wanted to use for device tracking so when Amazon had the R7000 for £50 I couldn’t resist and promptly put AsusWRT Merlin on it.

One of the best upgrades I’ve made, despite being virtually identical on paper the wifi is vastly stronger, no issues with moron neighbours with wifi routers on the window ledge anymore drowning the Sonoffs in the garage out, much more capacity for reserved IPs for more wifi switches etc. and of course I can now check the temperature in the lounge when ever I want to :slight_smile:

The main problem is that it just simply gives up once it times out >3 times. My device is located a bit of a distance from the wifi so i still have this problem, i guess the issues is mainly due to a bad connection.

It should be fixable though, as most of the time its working just fine. Its just when theres a bad connection for a few it simply gives up. It would be way more useful it it would just give up for now and try again in a minute or something.
The component it self does not suggest it should simply give up though it just returns nothing after 3 retries - I dont know how that is handeled by what ever component is using it. It guess it would be better just to report the last seen value and then have it try again later.

Ill try if i cant make it work a bit more reliably and then report back what I comeup with. I only get the outages once or twice pr day so it could take a while :slight_smile: