Volkswagen ID component for Home Assistant

Related tags

Hardware ha_vwid
Overview

Volkswagen ID component for Home Assistant

This folder contains both a generic Python 3 library for the Volkswagen ID API and a component for Home Assistant using the library.

Home Assistant component installation

  • (Activate We Connect using the official app)
  • Add content of "custom_components/vwid" in this repository to the custom_components subfolder in your Home Assistant configuration folder
  • Go to integrations and search for "Volkswagen ID"
  • Fill in username/email, password and VIN as used in your app
  • There should now be a sensor entity called "sensor.state_of_charge" with a lot of attributes with the remaining values

Library

"custom_components/vwid/libvwid.py" contains the Python class to communicate with the We Connect ID API used by the ID series electric cars. See libvwid_example.py in the same folder for usage.

Comments
  • Set up failed

    Set up failed

    Im getting the same issue as #11 on a new set up. I have tried in uppercase as per user on #11

    The car has been registered today and connected to the we connect ID app.

    vwid: Error on device update! 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 684, in async_device_update await task File "/config/custom_components/vwid/sensor.py", line 95, in async_update self._state = int(data['data']['batteryStatus']['currentSOC_pct']) KeyError: 'batteryStatus'

    opened by SwannyBFC 12
  • Error on device update

    Error on device update

    Since this morning the integration no longer updates properly and the log states:

    vwid: Error on device update!
    
    Traceback (most recent call last):
      File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 493, in _async_add_entity
        await entity.async_device_update(warning=False)
      File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 715, 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 196, in get_status
        if await self.reconnect():
      File "/config/custom_components/vwid/libvwid.py", line 102, in reconnect
        (form, action) = self.password_form(await response.read())
      File "/config/custom_components/vwid/libvwid.py", line 43, in password_form
        (name, val) = line.strip().split(':', 1)
    ValueError: not enough values to unpack (expected 2, got 1)
    

    I have verified that the account works in the app, and I have tried restarting home assistant as well as removing and re-adding the integration. Still the same result.

    opened by erikosvaldsson 10
  • No attributes available after Upgrade to Home Assistant 2022.4.0

    No attributes available after Upgrade to Home Assistant 2022.4.0

    After upgrading my setup to 2022.4.0, all attributes are not available any more.

    Therefore i'm only able to use the SOC value which sits directly on the sensor value. All attributes are gone.

    I can't find anything specific in the logs, has anyone encountered this also?

    opened by tmakowka 9
  • Component stopped working

    Component stopped working

    HA Version:

    Version | core-2021.5.5 -- | -- Installation Type | Home Assistant Supervised Development | false Supervisor | true Docker | true Virtual Environment | false Python Version | 3.8.9 Operating System Family | Linux Operating System Version | 4.19.0-16-amd64 CPU Architecture | x86_64 Timezone | Europe/Stockholm

    LOGS:

    Logger: custom_components.vwid.sensor Source: /config/custom_components/vwid/sensor.py:111 Integration: Volkswagen ID (documentation) First occurred: 3 juni 2021 18:22:24 (308 occurrences) Last logged: 21:32:26

    Error retrieving data

    Logger: custom_components.vwid.libvwid Source: custom_components/vwid/libvwid.py:141 Integration: Volkswagen ID (documentation) First occurred: 3 juni 2021 18:22:24 (308 occurrences) Last logged: 21:32:26

    Get status failed

    Logger: custom_components.vwid.libvwid Source: custom_components/vwid/libvwid.py:79 Integration: Volkswagen ID (documentation) First occurred: 3 juni 2021 18:22:24 (308 occurrences) Last logged: 21:32:26

    Not redirected

    opened by lorddaku 9
  • Service to start preheating manually

    Service to start preheating manually

    It could be awesome of it was possible to call a service and start preheating. I would like to contribute with this, if you can help me out with some basic info on the the API.

    opened by esbenr 8
  • Entity unavailable error

    Entity unavailable error

    Hi,

    This error started today:

    2022-12-05 14:39:02 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.wvgzzze2zmp034600_soc fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in async_device_update raise exc 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 198, in get_status if await self.reconnect(): File "/config/custom_components/vwid/libvwid.py", line 90, 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

    opened by JaniAst 7
  • State: ”unavailable”

    State: ”unavailable”

    Thank you for a excellent work. I have one ID3 and one ID4 and it worked fine for two weeks to read data into node red but suddenly I do not get any information from my ID3. The car is online and I haven’t changed anything. Do you have any idea of what is failing? See enclosed picture. Object 0 is ID4 and object 1 is ID3. 169B3824-42E1-414C-9C3F-BAE707D3F227

    opened by PerWallentin 7
  • Error during setup: adding Integration

    Error during setup: adding Integration

    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.

    opened by qckz 7
  • Error on loading

    Error on loading

    Jan 28 15:29:15 homeassistant hass[11877]: 2022-01-28 15:29:15 INFO (MainThread) [homeassistant.setup] Setting up vwid Jan 28 15:29:15 homeassistant hass[11877]: 2022-01-28 15:29:15 INFO (MainThread) [homeassistant.setup] Setup of domain vwid took 0.0 seconds Jan 28 15:29:15 homeassistant hass[11877]: 2022-01-28 15:29:15 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.vwid Jan 28 15:29:15 homeassistant hass[11877]: 2022-01-28 15:29:15 INFO (MainThread) [custom_components.vwid.libvwid] Reconnecting Jan 28 15:29:16 homeassistant hass[11877]: 2022-01-28 15:29:16 ERROR (MainThread) [homeassistant.components.sensor] vwid: Error on device update! Jan 28 15:29:16 homeassistant hass[11877]: File "/home/homeassistant/.homeassistant/custom_components/vwid/sensor.py", line 92, in async_update Jan 28 15:29:16 homeassistant hass[11877]: File "/home/homeassistant/.homeassistant/custom_components/vwid/libvwid.py", line 156, in get_status Jan 28 15:29:16 homeassistant hass[11877]: File "/home/homeassistant/.homeassistant/custom_components/vwid/libvwid.py", line 62, in reconnect Jan 28 15:29:16 homeassistant hass[11877]: File "/home/homeassistant/.homeassistant/custom_components/vwid/libvwid.py", line 28, in form_from_response Unable to connect from today.. tried to install and reinstall app, but seems like there is a connection issue with libvwid.py. Ios app is working as normal

    opened by strutings 6
  • Setup fails due to invalid redirect URL

    Setup fails due to invalid redirect URL

    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
    
    opened by DarkFox 3
  • Get status failed

    Get status failed

    Hello

    since yesterday (update of Home Assistant -> 2022.11.5) I get the following error at startup:

    home-assistant   | 2022-12-06 07:36:24.113 ERROR (MainThread) [custom_components.vwid.libvwid] Get status failed
    home-assistant   | 2022-12-06 07:36:24.120 ERROR (MainThread) [custom_components.vwid.sensor] Error retrieving data
    home-assistant   | NoneType: None
    

    Any idea what could be the cause?

    opened by moikorg 2
  • Question, is this library using the browser or app data?

    Question, is this library using the browser or app data?

    Hi @skagmo great work with the library, but i am wondering how did you get the information on how to build this library? is it by analyzing the request to the web application or have you investigated all the request from the app on mobile?

    Brg Robin

    opened by robinostlund 0
  • Separate sensors for attributes

    Separate sensors for attributes

    Hi,

    Currently I'm using this integration together with some template sensors in my configuration.yaml file to split the attributes into separate sensor. That makes it possible to track the history of all the separate sensors. Is it possible to easily integrate this functionality into the integration already? I know how to 'code' in YAML (after googling for some examples) but coding in Phyton is a bit above my league. If someone can help me out so I can contribute to this, that would be very helpful.

    opened by Emacee 5
  • All Entities not available

    All Entities not available

    Hi, at first thanks for all your good work. I have a problem with this integration. It happend now the 3rd time. So maybe it is worth to have a look at it. After reboot of my HA Hardware the VWID integration won't work any more. I get the following errors:

    2021-11-26 10:44:31 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up vwid platform for sensor
    Traceback (most recent call last):
      File "/config/custom_components/vwid/sensor.py", line 65, in async_update_data
        data = await api.get_status()
      File "/config/custom_components/vwid/libvwid.py", line 145, in get_status
        response = await self.session.get(API_BASE + "/vehicles/" + self.vin + "/status", headers=self.headers)
      File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
        conn = await self._connector.connect(
      File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
        proto = await self._create_connection(req, traces, timeout)
      File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
        _, proto = await self._create_direct_connection(req, traces, timeout)
      File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
        transp, proto = await self._wrap_create_connection(
      File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
        return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
      File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1081, in create_connection
        transport, protocol = await self._create_connection_transport(
      File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1111, in _create_connection_transport
        await waiter
    asyncio.exceptions.CancelledError
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/config/custom_components/vwid/sensor.py", line 70, in async_update_data
        _LOGGER.exception("Error retrieving data")
      File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 55, in __aexit__
        self._do_exit(exc_type)
      File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 92, in _do_exit
        raise asyncio.TimeoutError
    asyncio.exceptions.TimeoutError
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
        self.data = await self._async_update_data()
      File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
        return await self.update_method()
      File "/config/custom_components/vwid/sensor.py", line 71, in async_update_data
        except ApiAuthError as err:
    NameError: name 'ApiAuthError' is not defined
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
        await asyncio.shield(task)
      File "/config/custom_components/vwid/sensor.py", line 87, in async_setup_entry
        await coordinator.async_config_entry_first_refresh()
      File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 161, in async_config_entry_first_refresh
        raise ex
    homeassistant.exceptions.ConfigEntryNotReady: name 'ApiAuthError' is not defined
    

    After that I have to delete the integratio and add it again. Then everything works until next restart my Pi.

    Do you have any idea, what I do wrong?

    Kind Regards Micha

    opened by michas79 3
Owner
null
SALUS THERMOSTAT Custom component for Home-Assistant

Home-Assistant Custom Components Custom Components for Home-Assistant (http://www.home-assistant.io) Salus Thermostat Climate Component My device is R

null 21 Dec 18, 2022
Windhager myComfort custom component for Home Assistant

Windhager myComfort custom component for Home Assistant

null 5 Apr 27, 2022
Custom component for MPC-HC for home-assistant

mpc_hc The current mpchc integration in homeassistant violates ADR0004, so it will be deleted from core. This is just the existing integration copied

null 3 Dec 15, 2022
Component for deep integration LedFx from Home Assistant.

LedFX for Home Assistant Component for deep integration LedFx from Home Assistant. Table of Contents FAQ Install Config Performance FAQ Q. What versio

Dmitry Mamontov 28 Dec 13, 2022
This Home Assistant custom component adds support for controlling Midea dehumidiferes on local network.

This is a custom component for Home assistant that adds support for Midea dehumidifier appliances via the local area network. midea-dehumidifier-lan H

Nenad Bogojevic 97 Jan 8, 2023
Home Assistant component to handle key atom

KeyAtome Home Assistant component to handle key atom, a Linky-compatible device made by Total/Direct-Energie. Installation Either use HACS (default),

null 18 Dec 21, 2022
Resmed_myair_sensors - This is a Home Assistant custom component to pull daily CPAP data from ResMed's myAir service using an undocumented API

resmed_myair This component will set up the following platforms. Platform Description sensor Show info from the myAir API. Installation Using the tool

Preston Tamkin 17 Dec 29, 2022
Historic weather - Home Assistant custom component for accessing historic weather data

Historic Weather for Home Assistant (CC) 2022 by Andreas Frisch github@fraxinas.

Andreas Frisch 1 Jan 10, 2022
Home Assistant custom component to help ev-chargers stay below peak hourly energy levels.

Peaqev ev-charging Peaqev ev-charging is an attempt of charging an ev without breaching a preset monthly max-peak energy level. In order for this inte

Magnus Eldén 35 Dec 24, 2022
Home assiatant Custom component: Camera Archiver

Camera archiver Archive your ftp camera meadia files on other ftp with files renaming and event creation. Event can be used for send information to el

null 1 Jan 6, 2022
Universal Xiaomi MIoT integration for Home Assistant

Xiaomi MIoT Raw 简体中文 | English MIoT 协议是小米智能家居从 2018 年起推行的智能设备通信协议规范,此后凡是可接入米家的设备均通过此协议进行通信。此插件按照 MIoT 协议规范与设备通信,实现对设备的状态读取及控制。

null 1.9k Jan 2, 2023
Sensor of Temperature Feels Like for Home Assistant.

Please ⭐ this repo if you find it useful Sensor of Temperature Feels Like for Home Assistant Installation Install from HACS (recommended) Have HACS in

Andrey 60 Dec 25, 2022
Home Assistant custom integration for e-distribución

e-Distribución is an energy distribution company that covers most of South Spain area. If you live in this area, you probably are able to register into their website to get some information about your power demand, energy consumption, or even cycle billing (in terms of consumptions).

VMG 17 Sep 7, 2022
Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner and yi-hack-Allwinner-v2

yi-hack Home Assistant integration Overview yi-hack Home Assistant is a custom integration for Yi cameras (or Sonoff camera) with one of the following

roleo 131 Jan 3, 2023
Интеграция Home Assistant с ЛК "Интер РАО"

ЕЛК ЖКХ «Интер РАО» для Home Assistant Предоставление информации о текущем состоянии ваших аккаунтов в ЕЛК ЖКХ. Введение @ TODO @ Установка Посредство

Alexander Ryazanov 27 Nov 5, 2022
Provide Unifi device info via api to Home Assistant that will give ap sensors

Unifi AP Device info Provide Unifi device info via api to Home Assistant that will give ap sensors

null 12 Jan 7, 2023
Switch predictor for Home Assistant with AppDeamon

Home Assistant AppDeamon - Event predictor WORK IN PROGRESS - CURRENTLY NOT COMPLETE AND NOT WORK This is an idea under development (when I have free

null 37 Dec 17, 2022
Uses the Duke Energy Gateway to import near real time energy usage into Home Assistant

Duke Energy Gateway This is a custom integration for Home Assistant. It pulls near-real-time energy usage from Duke Energy via the Duke Energy Gateway

Michael Meli 28 Dec 23, 2022
Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API.

Hildebrand Glow (DCC) Integration Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API. T

Aniket 153 Dec 30, 2022