ksya / ha-nefiteasy

Nefit Easy connection for Home Assistant
74 stars 30 forks source link

Endless Reconnect after Unexpected disconnect #296

Closed arjanvdnoort closed 5 months ago

arjanvdnoort commented 5 months ago

Since I updated to ha-nefitwasy v0.4.1 having the issue the component is endless trying to reconnect after an unxepcted disconnect. Any solution for this behavior?

part of the debug-log:

2024-01-21 18:29:34.218 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 1.603 seconds (success: True) 2024-01-21 18:29:51.169 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 1.555 seconds (success: True) 2024-01-21 18:30:06.619 DEBUG (MainThread) [custom_components.nefiteasy] Unexpected disconnect of 560956267 with Bosch server. Try to reconnect.. 2024-01-21 18:30:15.618 ERROR (MainThread) [custom_components.nefiteasy] Timeout fetching nefiteasy data 2024-01-21 18:30:15.618 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 9.003 seconds (success: False) 2024-01-21 18:30:30.616 DEBUG (MainThread) [custom_components.nefiteasy] Starting reconnect procedure. 2024-01-21 18:30:30.616 DEBUG (MainThread) [custom_components.nefiteasy] Start connecting. 2024-01-21 18:30:30.616 DEBUG (MainThread) [custom_components.nefiteasy] Waiting for connected event. 2024-01-21 18:30:30.633 DEBUG (MainThread) [custom_components.nefiteasy] Connected successfully. 2024-01-21 18:30:30.634 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 0.019 seconds (success: False) 2024-01-21 18:30:45.617 DEBUG (MainThread) [custom_components.nefiteasy] Starting reconnect procedure. 2024-01-21 18:30:45.617 DEBUG (MainThread) [custom_components.nefiteasy] Start connecting. 2024-01-21 18:30:45.617 DEBUG (MainThread) [custom_components.nefiteasy] Connection procedure is already running. 2024-01-21 18:30:45.617 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 0.000 seconds (success: False) 2024-01-21 18:31:00.615 DEBUG (MainThread) [custom_components.nefiteasy] Starting reconnect procedure. 2024-01-21 18:31:00.615 DEBUG (MainThread) [custom_components.nefiteasy] Start connecting. 2024-01-21 18:31:00.615 DEBUG (MainThread) [custom_components.nefiteasy] Connection procedure is already running. 2024-01-21 18:31:00.615 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 0.000 seconds (success: False) 2024-01-21 18:31:15.615 DEBUG (MainThread) [custom_components.nefiteasy] Starting reconnect procedure. 2024-01-21 18:31:15.616 DEBUG (MainThread) [custom_components.nefiteasy] Start connecting. 2024-01-21 18:31:15.616 DEBUG (MainThread) [custom_components.nefiteasy] Connection procedure is already running. 2024-01-21 18:31:15.616 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 0.000 seconds (success: False) 2024-01-21 18:31:30.616 DEBUG (MainThread) [custom_components.nefiteasy] Starting reconnect procedure. 2024-01-21 18:31:30.616 DEBUG (MainThread) [custom_components.nefiteasy] Start connecting. 2024-01-21 18:31:30.616 DEBUG (MainThread) [custom_components.nefiteasy] Connection procedure is already running. 2024-01-21 18:31:30.616 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 0.001 seconds (success: False)

RobBie1221 commented 5 months ago

Thanks for adding the logging!

That's indeed a bug in the new code, I'll create an update for this today.

RobBie1221 commented 5 months ago

Fixed in 0.4.2

arjanvdnoort commented 5 months ago

Thanks @RobBie1221. Until now, the problem was not seen anymore after installing 0.4.2. I noticed one-time a "Timeout fetching nefiteasy data" error, but that was no longer resulting in an endless reconnect. So, looks fine.

part of debug log after update to 0.4.2: 2024-01-26 12:53:08.228 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 1.573 seconds (success: True) 2024-01-26 12:54:17.656 ERROR (MainThread) [custom_components.nefiteasy] Timeout fetching nefiteasy data 2024-01-26 12:54:17.656 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 9.002 seconds (success: False) 2024-01-26 12:55:26.658 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 9.003 seconds (success: False) 2024-01-26 12:56:28.222 INFO (MainThread) [custom_components.nefiteasy] Fetching nefiteasy data recovered 2024-01-26 12:56:28.223 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 1.567 seconds (success: True) 2024-01-26 12:57:30.248 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 1.593 seconds (success: True)

arjanvdnoort commented 5 months ago

Hello @RobBie1221, Unfortunately the issue is not solved. Still having the issue when a Unexpected disconnect is occuring. Only way to ovecome the problem is reloading the component (or restart HA)

part of debug log after update to 0.4.2: 2024-01-29 23:10:45.188 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 1.580 seconds (success: True) 2024-01-29 23:11:45.614 DEBUG (MainThread) [custom_components.nefiteasy] Unexpected disconnect of 560956267 with Bosch server. Try to reconnect.. 2024-01-29 23:11:54.613 ERROR (MainThread) [custom_components.nefiteasy] Timeout fetching nefiteasy data 2024-01-29 23:11:54.613 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 9.003 seconds (success: False) 2024-01-29 23:12:54.607 DEBUG (MainThread) [custom_components.nefiteasy] Starting reconnect procedure. 2024-01-29 23:12:54.608 DEBUG (MainThread) [custom_components.nefiteasy] Start connecting. 2024-01-29 23:12:54.608 DEBUG (MainThread) [custom_components.nefiteasy] Waiting for connected event. 2024-01-29 23:12:54.613 DEBUG (MainThread) [custom_components.nefiteasy] Connected successfully. 2024-01-29 23:12:54.615 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 0.008 seconds (success: False) 2024-01-29 23:13:54.607 DEBUG (MainThread) [custom_components.nefiteasy] Starting reconnect procedure. 2024-01-29 23:13:54.607 DEBUG (MainThread) [custom_components.nefiteasy] Start connecting. 2024-01-29 23:13:54.607 DEBUG (MainThread) [custom_components.nefiteasy] Connection procedure is already running. 2024-01-29 23:13:54.607 DEBUG (MainThread) [custom_components.nefiteasy] Finished fetching nefiteasy data in 0.000 seconds (success: False)