skagmo / ha_vwid

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

Setup fails due to invalid redirect URL #9

Closed DarkFox closed 2 years ago

DarkFox commented 3 years ago

When I try to set it up, it fails to connect, most likely due to the "weconnect://..." redirect URL used in libvwid:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 646, in async_device_update
    await task
  File "/config/custom_components/vwid/sensor.py", line 92, in async_update
    data = await self.api.get_status()
  File "/config/custom_components/vwid/libvwid.py", line 156, in get_status
    if await self.reconnect():
  File "/config/custom_components/vwid/libvwid.py", line 48, in reconnect
    response = await self.session.get(LOGIN_BASE + '/authorize', params=payload)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 606, in _request
    raise ValueError("Can redirect only to http or https")
ValueError: Can redirect only to http or https
diplix commented 3 years ago

had the same error and changed https://github.com/skagmo/ha_vwid/blob/1956af2529e70ee912eedcb94f4c587ec7142f2b/custom_components/vwid/sensor.py#L42 to

    session = async_get_clientsession(hass, verify_ssl=False)

this works for me.

skagmo commented 2 years ago

Redirects using the "weconnect"-adapter is handled properly, so it shouldn't be related. Seeing the solution from diplix I assume this is related to HTTPS certificates on your computer. Do you use other components depending on HTTPS?

skagmo commented 2 years ago

Closed due to inactivity.