h4de5 / home-assistant-vimar

VIMAR by-me integration into home-assistant.io
GNU General Public License v3.0
42 stars 6 forks source link

Error loading device payload #30

Closed davideciarmiello closed 3 years ago

davideciarmiello commented 3 years ago

Hi. After a few hours of use, all devices are offline and still offline until i reboot home Assistant. The message that i receive is this:

Logger: custom_components.vimar_platform Source: helpers/update_coordinator.py:205 Integration: Vimar Platform (documentation) First occurred: 15:59:25 (2 occurrences) Last logged: 16:07:58

Error fetching vimar data: Error communicating with API: VimarConnectionError: Error parsing SQL: Missing :-character in response line: Unknown-Payload in line: 481 - payload: Unknown-Payload

There is a method for restart the component on error? after, i not receive other message (and i have a logger at debug level)

please help me :) Thanks

h4de5 commented 3 years ago

which firmware version do you have insta)ed on the vimar web server? i currently still use v2.8 - i did not yet testet v2.9

davideciarmiello commented 3 years ago

I have a 2.9 firmware version.
The integration work well, but under some unknown conditions (i think a network problems), i receive this message, and after not retry to connect (not managed exception and exit from program?). At this point, all entites are in state "unavailable". if i reload home assistant, all works great again.

the actual messages: 2021-05-04 22:31:09 DEBUG (MainThread) [custom_components.vimar_platform] Updating coordinator.. 2021-05-04 22:31:09 ERROR (MainThread) [custom_components.vimar_platform] Error fetching vimar data: Error communicating with API: VimarConnectionError: Error parsing SQL: Missing :-character in response line: Unknown-Payload in line: 481 - payload: Unknown-Payload 2021-05-04 22:31:09 DEBUG (MainThread) [custom_components.vimar_platform] Finished fetching vimar data in 0.134 seconds 2021-05-04 22:31:17 DEBUG (MainThread) [custom_components.vimar_platform] Updating coordinator..

"Updating coordinator.." but entities are "unavailable". There is a method for debug if i can help you? Thanks

h4de5 commented 3 years ago

i see. this is true. if the integration gets an invalid sql it assumes the web server is gone and falls back to the unavailable state to avoid spamming the log file with connection errors.

it would require some rework of that exception handling to test it a view times with increasing time spans before disconnecting. a reconnect is also not possible with the current code state, as its only connecting during the initial startup - it does not use config flow yet.

all i can do is to add it to the improvement list for now :(

davideciarmiello commented 3 years ago

Finded a problem. I'm using the same credential, and when i login in vimarybyweb, disconnect the plugin, and the plugin not retry to connect. Now i have created a dedicated user, but what if some other similar error occurs? Maybe it should be managed with a retry from login step. Thanks! 👍

h4de5 commented 3 years ago

@davideciarmiello the current release should no longer disconnect on invalid web server responses.

davideciarmiello commented 3 years ago

@davideciarmiello the current release should no longer disconnect on invalid web server responses.

Thank you very much! :)