theneweinstein / somneo

Home Assistant custom component for Philips Someo
33 stars 18 forks source link

Max retries exceeded #66

Open Pascal31500 opened 1 month ago

Pascal31500 commented 1 month ago

After a certain time (variable) the Somneo control no longer works, see error message:

Failed to perform the action light/turn_on. HTTPSConnectionPool(host='xxx.xxx.xxx.xxx', port=443): Max retries exceeded with url: /di/v1/products/1/wulgt (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f66e32900>: Failed to establish a new connection: [Errno 111] Connection refused'))

Pascal31500 commented 1 month ago

r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 700, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='xxx.xxx.xxx.xxx', port=443): Max retries exceeded with url: /di/v1/products/1/wulgt (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused'))

Eikei7 commented 1 month ago

I get pretty much the same thing.

Eikei7 commented 1 month ago

Or rather, I get this when I try to set it up:

HTTPSConnectionPool(host='192.168.1.223', port=443): Max retries exceeded with url: /upnp/description.xml (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1f122517f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

drewbern commented 4 weeks ago

I noticed that unplugging the device for a few seconds usually solves this issue, for a short time at least. I also noticed that when this error pops up, I am unable to establish a connection with the SleepMapper app as well. Not sure if the state is cause by something in this repo which then prevents normal communication via SleepMapper, or if this is an issue with the device software itself.

This seems to be the same issue as in #61. Did you ever find a solution @skuijper?

skuijper commented 4 weeks ago

Yes, this looks very much like the issue I was having. I suspect it has to do with poor wifi reception combined with the inability to handle less than optimal wifi reception. Restarting it always makes it connect, but if after a while the reception has dropped (for a moment or maybe after a certain amount of times) the device becomes inaccessible. Even though it indicates that it is connected on the device display.

Since it had worked before without changing anything I suspect the firmware is the culprit. Maybe it just stalls in these type of (edge) cases.

My solution was to improve wifi signal by rearranging my wifi mesh devices (I seemed to have some kind of black hole around my nightstand).

Still this is not 100% failsafe (although the device usually keeps on working a.t.m.) because it may still stop responding after any kind of wifi hick-up. That's why I also installed a smart power socket together with an automation which detects unavailability. It just power cycles the device when it becomes unavailable.

jonatino commented 4 weeks ago

I have this as well. Does the somneo do rate limiting on its API's? I wonder if different poll times avoid this issue. Because even when the HA device fails to connect, you can still ping the ip normally and view it in a web browser.

2024-08-16 01:15:52.702 ERROR (SyncWorker_45) [pysomneo] Error connecting to somneo after 3 attempts.