theneweinstein / somneo

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

Connection refused #61

Closed skuijper closed 3 months ago

skuijper commented 3 months ago

A couple of months ago there was an issue where after an upgrade the integration kept on crashing because of missing color schemes (https://github.com/theneweinstein/somneo/issues/53).

I had a similar issue, although in my case the sleepmapper app wouldn't even list any sunset themes at all. Resetting the device and updating to the latest version of the integration seemed to have fixed the issue in the end (like others post in that GH issue).

But ever since I have another problem that the device just stops responding to the integration (and to the sleepmapper app) after a random amount of time, but at least a couple of times during the day. The only useful logging information is:

Error requesting somneo data: HTTPSConnectionPool(host='SOMNEO_IP', port=443): Max retries exceeded with url: /di/v1/products/1/wusts (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f682ac230>: Failed to establish a new connection: [Errno 111] Connection refused'))

It is very similar this issue: https://github.com/theneweinstein/somneo/issues/30, but turning on or off the "reuse TLS connections" option does not seem to do anything. Turning the wifi on and off on the device always fixes the issue though.

What also works is installing a smart plug and a HA automation which detects the device becoming unresponsive and power cycling it. But it happens so often, that it interferes with alarms and other automations.

Screenshot 2024-05-20 at 08 09 11

This is my device info:

name    "Wake-up Light"
type    "HF367x"
modelid "884367201011"
serial  "XXX"
ctn "HF3672/01"
allowuploads    true
allowpairing    false
wificountry "NL/1"
swverwifi   "2.2.5"
cnversion   "2.2.5"
productid   "4222018689710S"
pkgver  30408
swveruictrl "R1.59.000.PRD"
swverlight  "29"
swvermp3    "MP 0.0.1"
swvericons  "IC 0.0.11"
productname "Wake-up Light"

Any ideas what I could try to fix this?

theneweinstein commented 3 months ago

I don't know what happens here, and whether it is a problem in the integration or something else. When did the problem start, already with version v2024.2.1? Or in a version later (then I added the TLS session option again). If you're not sure, you could try to install v2024.2.1 to test. When the integration is disabled, does the connection with the app also break (that would imply more a wifi/network issue)?

skuijper commented 3 months ago

Thanks for your response.

It definitely broke before before readding the TLS connection reuse option. Because I remember thinking that the reuse issue could be my problem and I missed the checkbox in the config (gladly trying to use it when it reappeared, but like I said, with no luck).

Connection refused does not seem to be a network issue to me, but I will turn off the integration for a couple of days to check if the issue happens to the app as well without the integration present.

My idea was that it had to do with using TLS, which at some point (after a lot of requests) breaks the webserver. But it seems you have already tried to tackle that by limiting the amount of new connections.

Although I'm also not sure what happens here, it might help to know if I'm the only one. Like I said the device and app acted very strange around the january update. So it could be a local (hardware) issue on my side.

Do you happen to know a way of getting more logging from the integration?

Thanks again anyway. Really appreciate the effort.

skuijper commented 3 months ago

Hello again, I think I can already confirm. After turning off the integration the same thing happens to the sleepmapper app. After a reboot it works fine, but in a random amount of time afterwards, the network connection drops. So it seems there must be a problem with my light.