skagmo / ha_vwid

Volkswagen ID component for Home Assistant
72 stars 25 forks source link

Error during setup: adding Integration #1

Closed qckz closed 3 years ago

qckz commented 3 years ago

Hey,

So happy to see this custom integration! Thanks for your work.

However, I've added this component in the custom_components folder and HASS sees it just fine. When I try to configure it in the integrations page by selecting 'Volkswagen ID', the integration list just reloads and nothing else happens. I don't see any screen in which i can fill out the details. Obviously, the sensor is also not available.

Details Home Assistant: 0.114.4, python 3.8, pip3 fully updated (yesterday) OS: Raspbian GNU/Linux 10 (buster) Kernel: Linux 5.10.17-v7+ armv7l

Edit: log file only mentions this about vwid WARNING (MainThread) [homeassistant.loader] You are using a custom integration for vwid 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.

skagmo commented 3 years ago

Hi.

Glad to hear you appreciate the integration!

So you're not running Home Assistant using the official docker image. I'm thinking this could be related to missing Python libraries.

Could you open the Home Assistant log page, load the full/complete log, and search for "vwid" in your browser?

Edit: Sorry, didn't refresh before posting, so I couldn't see that you had updated your post. Just to be sure, this was everything you could find after loading the complete log/searching the log file, not just opening the log page?

qckz commented 3 years ago

Hey,

This was the only mention of vwid indeed. It is mentioned twice though; once in the log and once after loading full/complete log.

skagmo commented 3 years ago

Can you try to load the configuration flow/page again, and check the top of the log for any new exceptions/error messages, not necessarily containing "vwid"?

Edit: Or even better, just send me the whole log file.

qckz commented 3 years ago

Not much to see here...

The only error in here which is correct is the Synology one, because the device is off at the moment. The rest i don't understand, because they all work as intended.

`2021-04-13 16:05:32 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry SpeedTest for speedtestdotnet Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config_entries.py", line 223, in async_setup hass, self File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/speedtestdotnet/init.py", line 76, in async_setup_entry await coordinator.async_setup() File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/speedtestdotnet/init.py", line 185, in async_setup self.api = await self.hass.async_add_executor_job(speedtest.Speedtest) File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/srv/homeassistant/lib/python3.7/site-packages/speedtest.py", line 1091, in init self.get_config() File "/srv/homeassistant/lib/python3.7/site-packages/speedtest.py", line 1174, in get_config map(int, server_config['ignoreids'].split(',')) ValueError: invalid literal for int() with base 10: '' 2021-04-13 16:05:38 ERROR (MainThread) [hole] Can not load data from hole: 192.168.XXX.YYY:80 2021-04-13 16:05:38 WARNING (MainThread) [homeassistant.components.pi_hole] Failed to connect: Can not load data from hole: 192.168.XXX.YYY:80 2021-04-13 16:05:38 WARNING (MainThread) [homeassistant.config_entries] Config entry for pi_hole not ready yet. Retrying in 5 seconds 2021-04-13 16:05:43 ERROR (MainThread) [homeassistant.components.yr.sensor] Retrying in 19 minutes: https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/?lat=52.07901&lon=4.35809&msl=6 returned 404 2021-04-13 16:05:43 WARNING (MainThread) [homeassistant.components.weather] Setup of weather platform met is taking over 10 seconds. 2021-04-13 16:05:43 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.XXX.YYY for synology_dsm Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 170, in _new_conn (self._dns_host, self.port), self.timeout, extra_kw File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/connection.py", line 96, in create_connection raise err File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/connection.py", line 86, in create_connection sock.connect(sa) OSError: [Errno 113] No route to host

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 706, in urlopen chunked=chunked, File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 394, in _make_request conn.request(method, url, **httplib_request_kw) File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 234, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/lib/python3.7/http/client.py", line 1260, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1306, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1255, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1030, in _send_output self.send(msg) File "/usr/lib/python3.7/http/client.py", line 970, in send self.connect() File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 200, in connect conn = self._new_conn() File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 182, in _new_conn self, "Failed to establish a new connection: %s" % e urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x50022450>: Failed to establish a new connection: [Errno 113] No route to host

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 756, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.XXX.YYY', port=5000): Max retries exceeded with url: /webapi/query.cgi?api=SYNO.API.Info&version=1&method=query (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x50022450>: Failed to establish a new connection: [Errno 113] No route to host'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/synology_dsm/synology_dsm.py", line 256, in _execute_request url, params=encoded_params, timeout=self._timeout, kwargs File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 543, in get return self.request('GET', url, kwargs) File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 530, in request resp = self.send(prep, send_kwargs) File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 643, in send r = adapter.send(request, kwargs) File "/srv/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.XXX.YYY', port=5000): Max retries exceeded with url: /webapi/query.cgi?api=SYNO.API.Info&version=1&method=query (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x50022450>: Failed to establish a new connection: [Errno 113] No route to host'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/config_entries.py", line 223, in async_setup hass, self File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/synology_dsm/init.py", line 161, in async_setup_entry await api.async_setup() File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/synology_dsm/init.py", line 253, in async_setup await self._hass.async_add_executor_job(self._fetch_device_configuration) File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/synology_dsm/init.py", line 311, in _fetch_device_configuration self.information = self.dsm.information File "/srv/homeassistant/lib/python3.7/site-packages/synology_dsm/synology_dsm.py", line 327, in information data = self.get(SynoDSMInformation.API_KEY, "getinfo") File "/srv/homeassistant/lib/python3.7/site-packages/synology_dsm/synology_dsm.py", line 179, in get return self._request("GET", api, method, params, kwargs) File "/srv/homeassistant/lib/python3.7/site-packages/synology_dsm/synology_dsm.py", line 193, in _request self.discover_apis() File "/srv/homeassistant/lib/python3.7/site-packages/synology_dsm/synology_dsm.py", line 114, in discover_apis self._apis = self.get(API_INFO, "query")["data"] File "/srv/homeassistant/lib/python3.7/site-packages/synology_dsm/synology_dsm.py", line 179, in get return self._request("GET", api, method, params, kwargs) File "/srv/homeassistant/lib/python3.7/site-packages/synology_dsm/synology_dsm.py", line 223, in _request response = self._execute_request(request_method, url, params=params, kwargs) File "/srv/homeassistant/lib/python3.7/site-packages/synology_dsm/synology_dsm.py", line 275, in _execute_request raise SynologyDSMRequestException(exp) synology_dsm.exceptions.SynologyDSMRequestException: {'api': None, 'code': -1, 'reason': 'Unknown', 'details': 'ConnectionError = <urllib3.connection.HTTPConnection object at 0x50022450>: Failed to establish a new connection: [Errno 113] No route to host'} 2021-04-13 16:05:43 ERROR (MainThread) [homeassistant.components.unifi] Error connecting to the UniFi controller at 192.168.XXX.YYY 2021-04-13 16:05:43 WARNING (MainThread) [homeassistant.config_entries] Config entry for unifi not ready yet. Retrying in 5 seconds 2021-04-13 16:06:04 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for vwid 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.`

skagmo commented 3 years ago

Can you try setting the Home Assistant log level to "debug" and repeat the test?

qckz commented 3 years ago

I think this is the part you're looking for:

2021-04-15 09:00:34 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1341779600] Received {'type': 'frontend/get_translations', 'language': 'en', 'category': 'config', 'integration': 'vwid', 'id': 46} 2021-04-15 09:00:34 DEBUG (MainThread) [homeassistant.helpers.translation] Cache miss for en, config: vwid 2021-04-15 09:00:34 DEBUG (MainThread) [homeassistant.components.http.auth] Authenticated 192.168.178.203 for /api/config/config_entries/flow using bearer token 2021-04-15 09:00:34 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/config/config_entries/flow to 192.168.178.203 (auth: True) 2021-04-15 09:00:34 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start resp = await task File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle resp = await handler(request) File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl return await handler(request) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware return await handler(request) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/ban.py", line 73, in ban_middleware return await handler(request) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/auth.py", line 127, in auth_middleware return await handler(request) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/view.py", line 129, in handle result = await result File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/config/config_entries.py", line 112, in post return await super().post(request) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/data_validator.py", line 60, in wrapper result = await method(view, request, *args, **kwargs) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/data_entry_flow.py", line 81, in post result = self._prepare_result_json(result) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/config/config_entries.py", line 117, in _prepare_result_json return super()._prepare_result_json(result) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/data_entry_flow.py", line 43, in _prepare_result_json schema, custom_serializer=cv.custom_serializer File "/srv/homeassistant/lib/python3.7/site-packages/voluptuous_serialize/init.py", line 39, in convert pval = convert(value, custom_serializer=custom_serializer) File "/srv/homeassistant/lib/python3.7/site-packages/voluptuous_serialize/init.py", line 112, in convert raise ValueError('Unable to convert schema: {}'.format(schema)) ValueError: Unable to convert schema: <function string at 0x7559e588>

skagmo commented 3 years ago

Hi. Sorry for replying late. It's rather hard to troubleshoot from the log, as there is nothing pointing in the direction of a particular code line in the vwid integration. The only thing I can recommend at this time is using a more recent HA version than 0.114.4. There are many changes in HA related to config flow over the last year, and unfortunately I don't have the time to prioritize improving backwards compatibility. If you for some reason don't get it up and running with a recent version of HA, we can revisit the issue.