rstrouse / ESPSomfy-RTS-HA

Control your somfy shades in Home Assistant
The Unlicense
102 stars 9 forks source link

Random disconnection from device #35

Closed SimonCtl closed 4 months ago

SimonCtl commented 5 months ago

Hi, Everything was working fine until this morning, now it only shows "Unavailable" but I can still access ESPSomfy portal through its local IP address. Can't find what is wrong 🧐 Thanks for your help !

image

image

SimonCtl commented 5 months ago

Had to delete device and re-add it to make it work again but doesn't know why...

rstrouse commented 5 months ago

Next time click on the reload integration. This will tell me if HA simply stopped communicating on the socket which is what I suspect. Is there anything related to this in the HA log.

open1999 commented 5 months ago

Same problem with the last v2.3.2.

I reloaded integration.

For me v2.3.1 it was ok.

rstrouse commented 5 months ago

@SimonCtl have you set up an IP reservation in your router for ESPSomfy RTS? It is very odd that the web interface was available yet the plugin was not receiving any data. In v2.3.1 there was an issue where the ESP was not timing out when checking the internet for an available update but this was resolved in 2.3.2. During this check it would wait for github to return even when it wasn't available and during this waiting period (up to 30 minutes) the HA socket would go disabled. I have found a workaround to the limitations in the ESP32 library so that it no longer does that.

@open1999 is the web interface still available under this condition? If it is restart HA since it looks like a socket hang.

SimonCtl commented 5 months ago

@SimonCtl have you set up an IP reservation in your router for ESPSomfy RTS? It is very odd that the web interface was available yet the plugin was not receiving any data. In v2.3.1 there was an issue where the ESP was not timing out when checking the internet for an available update but this was resolved in 2.3.2. During this check it would wait for github to return even when it wasn't available and during this waiting period (up to 30 minutes) the HA socket would go disabled. I have found a workaround to the limitations in the ESP32 library so that it no longer does that.

@open1999 is the web interface still available under this condition? If it is restart HA since it looks like a socket hang.

yes I have set up an IP reservation for my ESPSomfy RTS. For now, I haven't had any linking problem between ESPSomy RTS and HomeAssistant since. I am now dealing with HA "Unable to connect to Home Assistant" loading screen 😫 Not easy to debug/read logs

open1999 commented 5 months ago

With ESP 2.3.1 / HA 2.3.1 all ok

With ESP 2.3.2 / HA 2.3.2 or HA 2.3.3 not ok for

image

image

It's only information for Wifi Channel/ Wifi SSID...

No problem with the shutters on HA or ESP, it's ok.

open1999 commented 4 months ago

Ok with With ESP 2.3.3 / HA 2.3.3 image

rstrouse commented 4 months ago

I am going to close this for now. One thing that was changed in v2.4.0 is the order in which the plugin initializes the entities. In the past HA started the plugin and it then attempted to initialize the entities. Unfortunately, if the ESPSomfy RTS device was not available yet the plugin would start and HA would not have registered the entities.

When the ESPSomfy RTS device finally came online it would then establish a connection to HA but HA had already determined that the entities were not available and would not load them. Starting in v2.4.0 the plugin now waits to initialize the entities until contact can be made with the device. Unfortunately, I have not been able to figure out how to coerce HA to reinitialize the entities on a successful connection to the socket. It simply throws an error in the log that it has already been initialized and cannot be done again regardless of any attempts to unload the entities, devices, or integration.

This waiting period gets around this issue.