Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to setup - 1.0.0 Beta 10 #8

Closed
Xnygra opened this issue Apr 20, 2023 · 8 comments
Closed

Failed to setup - 1.0.0 Beta 10 #8

Xnygra opened this issue Apr 20, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@Xnygra
Copy link

Xnygra commented Apr 20, 2023

Got the initial setup to work, with getting a code and added successfully, but integration fails to setup.

image

Error fetching super_soco_custom data:
07:37:34 – (ERROR) Super Soco Custom (custom integration) - message first occurred at 07:21:58 and shows up 22 times
'NoneType' object is not subscriptable
07:37:34 – (ERROR) Super Soco Custom (custom integration) - message first occurred at 07:21:58 and shows up 22 times
Config entry 'Super Soco Custom' for super_soco_custom integration not ready yet: None; Retrying in background
07:33:31 – (WARNING) config_entries.py - message first occurred at 07:22:57 and shows up 2 times
Config entry 'SOCO' for ev_smart_charging integration not ready yet: Input sensors not ready.; Retrying in background
07:21:58 – (WARNING) config_entries.py - message first occurred at 07:11:19 and shows up 5 times

@drakhart
Copy link
Owner

Can you please try without combining it with the EV Smart Charging integration? Just to make sure it works standalone. Thanks in advance.

Rationale behind: I have the feeling that this other integration is trying to subscribe to events fired by Super Soco sensors even before they are ready. Here's what I'm talking about: https://github.com/jonasbkarlsson/ev_smart_charging/blob/main/custom_components/ev_smart_charging/coordinator.py#L363

@Xnygra
Copy link
Author

Xnygra commented Apr 20, 2023

Unfortunately no changes when removed the EV Smart Charging.

Logger: custom_components.super_soco_custom
Source: custom_components/super_soco_custom/vmoto_soco_api.py:129
Integration: Super Soco Custom (documentation, issues)
First occurred: 19:43:07 (1 occurrences)
Last logged: 19:43:07

Traceback (most recent call last):
File "/config/custom_components/super_soco_custom/vmoto_soco_api.py", line 130, in _api_wrapper
res = await self._session.post(url, headers=headers, json=data)
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 560, in _request
await resp.start(conn)
File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 899, in start
message, payload = await protocol.read() # type: ignore[union-attr]
File "/usr/local/lib/python3.10/site-packages/aiohttp/streams.py", line 616, in read
await self._waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/super_soco_custom/coordinator.py", line 174, in _async_update_data
self._user_data = (await self._client.get_user())[DATA_DATA]
File "/config/custom_components/super_soco_custom/vmoto_soco_api.py", line 64, in get_user
return await self._api_wrapper(url, headers)
File "/config/custom_components/super_soco_custom/vmoto_soco_api.py", line 129, in _api_wrapper
async with async_timeout.timeout(TIMEOUT):
File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 129, in aexit
self._do_exit(exc_type)
File "/usr/local/lib/python3.10/site-packages/async_timeout/init.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

@drakhart
Copy link
Owner

Ok, that's clearly a connection timeout error. I could increase the timeout, but I feel like the current 5 seconds limit is already very generous for an API request.

Do you usually experience connection issues with other stuff? Also, could you please try to ping app.vmotosoco-service.com from your Home Assistant host and report the delay here?

For reference, I'm getting a consistent 49ms delay.

@Xnygra
Copy link
Author

Xnygra commented Apr 22, 2023

image

@drakhart
Copy link
Owner

drakhart commented Apr 23, 2023

Honestly, I don't know why you're getting timeouts while fetching the data, you should be good with those ping figures.

If you happen to have the required knowledge you could try increasing the Vmoto Soco API timeout and restarting HA, until you find a limit that works for you. And if you find a suitable timeout I can then push it to the repo so it's available in general and doesn't mess your integration on every update.

The file to edit is config/custom_components/super_soco_custom/vmoto_soco_api.py and the timeout variable is just TIMEOUT, in line 15 (here's the link for reference). I believe that in HAOS the config folder is located under /mnt/data/supervisor/homeassistant/config, but I can't check that myself as I'm using HA Core on an Ubuntu box.

@drakhart drakhart added the bug Something isn't working label Apr 23, 2023
@drakhart
Copy link
Owner

drakhart commented May 3, 2023

I took the chance of releasing beta 11 with other fixes to also increase the API timeout to 10 seconds (instead of 5). Please let me know if that fixed the issue for you, or if you already managed to fix it by yourself increasing the timeout even more.

@drakhart
Copy link
Owner

Hi, @Xnygra. It's been more than one month since I replied to this thread, but I still haven't had any updates from you. Is the issue still happening? Thanks.

@drakhart drakhart self-assigned this Jun 13, 2023
@drakhart
Copy link
Owner

Closing due to inactivity, assumed to be solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants