gndean / home-assistant-hypervolt-charger

Home Assistant integration for Hypervolt EV charger
46 stars 3 forks source link

Setup issue following the recent update (V2.3.0) #62

Closed rosarch closed 2 months ago

rosarch commented 2 months ago

Hypervolt 2.0 Charger

I have been running this HA addon without issue for a number of months, I have just applied the latest update and am now getting a 'Failed setup, will retry' error.

To rule out anything odd, I deleted the app and installed it again, I still have the same issue; I have confirmed I am adding the right username and password. The mobile app is working without issue.

Logs:

2024-07-04 16:08:34.925 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hypervolt_charger which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-07-04 16:08:34.926 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration octopus_energy which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-07-04 16:08:34.927 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-07-04 16:08:34.927 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration kia_uvo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-07-04 16:08:34.928 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nodered which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-07-04 16:08:36.800 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles/frontend", "/config/custom_components/hacs/hacs_frontend_experimental", False)]); This function will be removed in 2025.7 at custom_components/hacs/frontend.py, line 49: hass.http.register_static_path(, please create a bug report at https://github.com/hacs/integration/issues
2024-07-04 16:08:36.802 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles/iconset.js", "/config/custom_components/hacs/iconset.js", True)]); This function will be removed in 2025.7 at custom_components/hacs/frontend.py, line 57: hass.http.register_static_path(, please create a bug report at https://github.com/hacs/integration/issues
2024-07-04 16:08:36.803 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues
2024-07-04 16:08:36.805 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call await hass.http.async_register_static_paths([StaticPathConfig("/hacsfiles", "/config/www/community", True)]); This function will be removed in 2025.7 at custom_components/hacs/base.py, line 1162: self.hass.http.register_static_path(, please create a bug report at https://github.com/hacs/integration/issues
2024-07-04 16:08:47.710 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 642: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues
2024-07-04 16:09:25.436 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/config/custom_components/hypervolt_charger/manifest.json',) inside the event loop by custom integration 'hypervolt_charger' at custom_components/hypervolt_charger/utils.py, line 17: with open(manifest_filename, encoding="utf-8") as manifest_file: (offender: /config/custom_components/hypervolt_charger/utils.py, line 17: with open(manifest_filename, encoding="utf-8") as manifest_file:), please create a bug report at https://github.com/gndean/home-assistant-hypervolt-charger/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/main.py", line 223, in <module>
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
return loop.run_until_complete(setup_and_run_hass(runtime_config))
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
self._run_once()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
handle._run()
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
return await func(self, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
return await method(view, request, data, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure
result = await self._async_configure(flow_id, user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 415, in _async_configure
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
File "/config/custom_components/hypervolt_charger/config_flow.py", line 69, in async_step_login
self.charger_ids = await login_and_get_charger_ids(self.hass, user_input)
File "/config/custom_components/hypervolt_charger/config_flow.py", line 34, in login_and_get_charger_ids
get_version_from_manifest(), data[CONF_USERNAME], data[CONF_PASSWORD]
File "/config/custom_components/hypervolt_charger/utils.py", line 17, in get_version_from_manifest
with open(manifest_filename, encoding="utf-8") as manifest_file:
gndean commented 2 months ago

Thanks for the report. The log shows the warning that's been reported in #60 also, and should now be fixed. However, this was only a warning and shouldn't have caused a 'Failed setup, will retry' error, I think. Was there anything else in the logs? Could you try V2.3.1 now please?

rosarch commented 2 months ago

Thanks. I have tried the latest version and am still having the same issue.

It seems to be an Async_setup_entry exception - 'Failed setup, will retry'

(I have cleaned up the logs)

2024-07-05 19:41:43.006 DEBUG (MainThread) [custom_components.hypervolt_charger] Async_setup_entry enter, entry_id: 01J2232N0NGJKWFX99BZFDV4BN
2024-07-05 19:41:43.007 DEBUG (MainThread) [custom_components.hypervolt_charger.utils] get_version_from_manifest loading manifest: /config/custom_components/hypervolt_charger/manifest.json
2024-07-05 19:41:43.009 DEBUG (MainThread) [custom_components.hypervolt_charger.utils] get_version_from_manifest returning version: 2.3.1
2024-07-05 19:41:43.009 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_update_coordinator] Create_hypervolt_coordinator enter
2024-07-05 19:41:43.010 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_update_coordinator] Create_hypervolt_coordinator HypervoltApiClient created, charger_id: 202481599413613
2024-07-05 19:41:43.010 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_update_coordinator] HypervoltUpdateCoordinator init
2024-07-05 19:41:43.010 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_update_coordinator] Create_hypervolt_coordinator HypervoltUpdateCoordinator created
2024-07-05 19:41:43.010 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_update_coordinator] Hypervolt _update enter
2024-07-05 19:41:43.010 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_update_coordinator] HypervoltCoordinator _update, exception: InvalidAuth: No active session
2024-07-05 19:41:43.010 INFO (MainThread) [custom_components.hypervolt_charger.hypervolt_api_client] Attempting log in
2024-07-05 19:41:43.288 INFO (MainThread) [custom_components.hypervolt_charger.hypervolt_api_client] HypervoltApiClient logged in!
2024-07-05 19:41:43.289 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_api_client] notify_on_websocket sync, Task-2029, enter
2024-07-05 19:41:43.289 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_api_client] notify_on_websocket session/in-progress, Task-2030, enter
2024-07-05 19:41:43.402 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_api_client] Hypervolt charger schedule: {"type":"open","enabled":false}
2024-07-05 19:41:43.402 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_update_coordinator] Finished fetching hypervolt_charger data in 0.392 seconds (success: False)
2024-07-05 19:41:43.402 ERROR (MainThread) [custom_components.hypervolt_charger] Async_setup_entry exception.
2024-07-05 19:41:43.402 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_update_coordinator] HypervoltCoordinator async_unload
2024-07-05 19:41:43.403 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_api_client] Unload enter
2024-07-05 19:41:43.404 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_update_coordinator] notify_on_hypervolt_sync_push_task Task-2029 was cancelled :True
2024-07-05 19:41:43.404 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_update_coordinator] notify_on_hypervolt_session_in_progress_push_task Task-2030 was cancelled :True
2024-07-05 19:41:43.405 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_api_client] notify_on_websocket sync, Task-2029, cancelled (main try/catch)
2024-07-05 19:41:43.405 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_api_client] notify_on_websocket sync, Task-2029, exit
2024-07-05 19:41:43.425 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_api_client] notify_on_websocket session/in-progress, Task-2030, cancelled (main try/catch)
2024-07-05 19:41:43.425 DEBUG (MainThread) [custom_components.hypervolt_charger.hypervolt_api_client] notify_on_websocket session/in-progress, Task-2030, exit

As a quick test I briefly went back to v2.26 and this works without issues,

gndean commented 2 months ago

Thanks for the logs. I think I can see what's happening now. Please can you try V2.3.2

rosarch commented 2 months ago

That has done the trick - thanks for the quick turnaround