Giter VIP home page Giter VIP logo

ha_vwid's People

Contributors

skagmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha_vwid's Issues

Is this integration still working?

A few month ago it stopped working.
I removed the folder VWID and the integration and reinstalled by copying the files to new created custom_components/vwid and then added the integration VWID custom and filled in the login information.
I can't find any entities connected to this integration.
What am I doing wrong?
VW

Sensor unavailable

It seems VW made an update a couple of weeks ago since then I can't get the sensor working, it always states unavailable:
image

(I have a VW Id.4)

checks I did:

  • Enterd the VIN in uppercase
  • Username & pass works in the app/the info in the app is up-to-date
  • Removed the entire integration/reinstalled it
  • logged in on the VW site and accepted the new terms & conditions

Anybody any idea's what I could try to fix this?

Thanks in advance!

non-numeric value problem

Hi

I started to get this error today:
2023-04-13 13:31:12.308 WARNING (MainThread) [homeassistant.components.sensor] Sensor sensor.yxn_sensor_range has device class None, state class None and unit km thus indicating it has a numeric value; however, it has the non-numeric value: (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22

Is there something changed in the VW side again?

Exceptions during execution in Home Assistant

I run the VW integration in my self-hosted Home Assistant instance since approx. one week.
So far everything looked very good but today the integration threw some exceptions at two points in time.
The unfortunate thing about these exceptions is that afterwards the connection between the integration and the VW backend seems to be lost "forever": I need to restart Home Assistant (and also my own backend) in order to get all connections up and running again.

Below please find what can be seen from the logs. I am happy to help with more information if required.

Cheers,
Peter

P.S.: I removed my original vin from the logs.

`2021-05-18 15:10:57 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.wvwzzze1_soc fails
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 999, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 865, in _resolve_host
addrs = await self._resolver.resolve(host, port, family=self._family)
File "/usr/local/lib/python3.8/site-packages/aiohttp/resolver.py", line 31, in resolve
infos = await self._loop.getaddrinfo(
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 825, in getaddrinfo
return await self.run_in_executor(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 316, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 524, 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 126, in get_status
response = await self.session.get(API_BASE + "/vehicles/" + self.vin + "/status", headers=self.headers)
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 520, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 535, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 892, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 1011, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host mobileapi.apps.emea.vwapps.io:443 ssl:default [Try again]
2021-05-18 15:11:57 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.wvwzzze1_soc fails
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 999, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 865, in _resolve_host
addrs = await self._resolver.resolve(host, port, family=self._family)
File "/usr/local/lib/python3.8/site-packages/aiohttp/resolver.py", line 31, in resolve
infos = await self._loop.getaddrinfo(
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 825, in getaddrinfo
return await self.run_in_executor(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 316, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 524, 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 126, in get_status
response = await self.session.get(API_BASE + "/vehicles/" + self.vin + "/status", headers=self.headers)
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 520, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 535, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 892, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 1011, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host mobileapi.apps.emea.vwapps.io:443 ssl:default [Try again]
2021-05-18 15:14:51 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.8/http/client.py", line 1344, in getresponse
response.begin()
File "/usr/local/lib/python3.8/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.8/http/client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/local/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 532, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.8/site-packages/urllib3/packages/six.py", line 734, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.8/http/client.py", line 1344, in getresponse
response.begin()
File "/usr/local/lib/python3.8/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.8/http/client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/local/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))`

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

Config flow could not be loaded

Hi, really keen to get your integration setup but when I try and select the integration it says config flow could not be loaded. Any help would be appreciated.

Update Rate

Hi,
thank you for this great integration. It works like a charm and enables automations like charging notifications etc.
I'm using an automation to increase the update rate while charging to 1 minute and I've seen that the component uses a scan interval of 10 minutes. I've changed that default 10 minutes to 5 minutes (in the sensor.py), but HA doesn't seem to respect it. Do you have an idea on how to change to update rate? Could you maybe add a config option for the update rate?

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

Question: Volkswagen API polling frequency - potential issue?

Hello @skagmo - awesome work! I was looking quite a while for something like this!

This is actually more of a question: in the context of some other project (evcc - to control a charger based on information on solar power and grid power consumption) I read a warning, that polling car vendor APIs with high frequency may lead to a lock out of the calling account (probably to protect the server side resources of the vendor). I don't know what high frequency means in particular for Volkswagen but I wonder: did you ever hear about anything like this? Are you using this integration already for a while and have some experience with this?

Thanks!

Entity implements device_state_attributes

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:580
First occurred: 15:31:42 (1 occurrences)
Last logged: 15:31:42

Entity sensor.mycar_soc (<class 'custom_components.vwid.sensor.VwidSensor'>) implements device_state_attributes. Please report it to the custom component author.


I have no idea what this means but it's in my logs. And now I have reported it.

configuration ok but entities wan't update

Hi, i have just configured all the entities, i can see the values of them (maybe the values fetched during the initialization of the add-on); but now for example if i turn on the heater with the vw connet id app, the entity in my HA doesn't update. I tried to wait some minutes but no updates are coming...; how much time is necessary fo the entities to update? how often does the add-on fetch the data?

thanks a lot...

Mauro

Works in US?

I see mention of 'we connect', which makes me wonder if this is supposed to work in the US or not (we have car-net app here, not we connect)?

This is the error I'm getting when enabling the component:

2021-06-24 10:14:29 ERROR (MainThread) [homeassistant.components.sensor] vwid: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 432, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 550, 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 87, in reconnect
    url = response.headers['Location']
KeyError: 'Location'

Toggle charging with this integration?

Firstly: many thanks to the dev for working on this project.

I have this integration setup and I can see my state of charge entity along with the following atrributes:

Vin
CurrentSOCPct 
CruisingRangeElectricKm
RemainingChargingTimeToCompleteMin
ChargingState
ChargeMode
ChargePowerKW
ChargeRateKmph
MaxChargeCurrentAC
AutoUnlockPlugWhenCharged
TargetSOCPct
PreferredChargeMode
PlugConnectionState
PlugLockState
RemainingClimatisationTimeMin
ClimatisationState
TargetTemperatureC
TargetTemperatureF
UnitInCar
ClimatisationWithoutExternalPower
ClimatizationAtUnlock
WindowHeatingEnabled
ZoneFrontLeftEnabled
ZoneFrontRightEnabled
TargetTemperatureK
TimeInCar
CarType
TotalRangeKm

Is it possible to change any of these attributes via the integration?

A switch to enable/disable changing would be brilliant.

Non-2xx response error

Today started to come errors:

2023-02-27 19:36:40 ERROR (MainThread) [custom_components.vwid.libvwid] Non-2xx response
2023-02-27 19:36:40 ERROR (MainThread) [custom_components.vwid.libvwid] Reconnect failed
2023-02-27 19:36:40 ERROR (MainThread) [custom_components.vwid.sensor] Error retrieving data

How? Add content of "custom_components/vwid" .....

Sorry. New Home Assistant user here.

How do I do this. "Add content of "custom_components/vwid" in your Home Assistant configuration folder.
I've got SSH access, and HACS installed, and have access to: root/config/custom_components (where other scripts live)

Thank you for any help with this.

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

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.

"Can redirect only to http or https"

Hi
Is it only me who get "Can redirect only to http or https" when Home Assistant loads? Vwid connect hasn't worked for a couple of weeks. I have updated to the latest source, all URLs should be ok.

2023-04-17 21:26:36.972 ERROR (MainThread) [homeassistant.components.sensor] vwid: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 521, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 748, in async_device_update
await task
File "/config/custom_components/vwid/sensor.py", line 93, in async_update
data = await self.api.get_status()
File "/config/custom_components/vwid/libvwid.py", line 208, in get_status
if await self.reconnect():
File "/config/custom_components/vwid/libvwid.py", line 94, in reconnect
response = await self.session.get(LOGIN_BASE + '/authorize', params=payload)
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 624, in _request
raise ValueError("Can redirect only to http or https")

My payload is comprised of:
{'nonce': 'n1kFY2seLfFzBoXS', 'redirect_uri': 'weconnect://authenticated'}

What is supposed to happen when the redirect to 'weconnect://' is done? Anyway, client.py does not seem to agree it is a good idea...

Anyone knows how to fix this without editing client.py?

HA 2023.3.2 issues

Bit of a weird set of errors. Not sure it is anything to do with this integration (probably not) but more due to the crappy VW software:

  1. If I change the charging mode, immediately, the integration gets unavailable data
  2. to resolve this, I have to log into the ID site again (on a PC - not the ID app), change some contact details in the profile, delete the integration and re-load it. all is working then

Secondly, the switch to charge the car (when the car is set to timer) doesn't work. Again, I'm not sure that this is a VW thing as their logic is that if the car is set to timer, then you shouldn't be able to start charging manually.

There is no option with the API to switch from timer to manual as far as I can see.

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?

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

APICompatibilityError: No user id provided

Hey, thanks for your efforts on this HA integration! I find it really useful.

Since a few days (maybe 5 days) the integration no longer starts up. In the log message it says that "no user id is provided" for the login.

Full log:

Logger: homeassistant.config_entries
Source: custom_components/volkswagen_we_connect_id/__init__.py:47
Integration: Volkswagen We Connect ID
First occurred: 19 april 2023 kl. 13:41:03 (7 occurrences)
Last logged: 21 april 2023 kl. 13:51:11

Error setting up entry Volkswagen We Connect ID for volkswagen_we_connect_id
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/volkswagen_we_connect_id/__init__.py", line 47, in async_setup_entry
    await hass.async_add_executor_job(_we_connect.login)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/weconnect/weconnect.py", line 184, in login
    self.__session.login()
  File "/usr/local/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 76, in login
    response = self.doWebAuth(authorizationUrl)
  File "/usr/local/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 243, in doWebAuth
    raise APICompatibilityError('No user id provided')
weconnect.errors.APICompatibilityError: No user id provided

terms-and-conditions acceptance broken?

I get this exception when T&Cs need acceptance:
...
File "libvwid.py", line 204, in get_status
if await self.reconnect():
File "libvwid.py", line 121, in reconnect
(form, action) = self.form_from_response(await response.read())
File "libvwid.py", line 30, in form_from_response
return (form, page.forms[0].action)
IndexError: list index out of range

I understand the code that acceptance should happen automatically.
I suspect it might be related to the recent move of URLs from volkswagen to cariad, i.e. everythiing cariad, acceptance on vw?

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?

the plugin causes stop charging

Hi to all; i'm using the plugin from a month more or less, without issue; anyway, the last week i started to have problem during charging; the problem is that the charge stops after few minutes, without any error in the car or in the vw connect Id app; once it is stopped, i can resume it with vwconnet ID app but after some minutes (random, 5/10 minutes) it stops again. I disabled the integration in home assistant and the problem disappeared; what can be the problem?

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.

Fails to set up

This is the error message that i get.
Tried remove component restart HA, add component restart HA same error allways.

2021-09-26 11:01:14 ERROR (MainThread) [homeassistant.components.sensor] 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 633, 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'

Integration not available to install

I tried adding this and HA (2021.6.4) finds the integration ok:

2021-06-25 11:29:52 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration 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

But from the Integrations page I can't add it...
What am I missing?

image

image

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

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'

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.

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.

Is it possible to get the location of the car from the API?

It would really be neat if the sensor was a device_tracker with the cars current longitude and latitude. Then you can automate on home and not_home.
And then all the attributes should be on that.
So basically change the device_class of the sensor to a device_tracker and add the location if it's available in the API.

Offline?

I have problem with this intregation a cupple days I can't receive info from my id3

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

No device or entities appear after adding a car with 3.0 software

The car in question is a brand new iD.4 GTX registered in Norway. I suspect the user function to mess up the data path, but im not sure. All the data is visible in WeConnect iD as usual.

Error from log:

vwid: Error on device update!
Traceback (most recent call last):
File "/snap/home-assistant-snap/509/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity await entity.async_device_update(warning=False) 
File "/snap/home-assistant-snap/509/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 736, in async_device_update await task
File "/var/snap/home-assistant-snap/509/custom_components/vwid/sensor.py", line 95, in async_update self._state = int(data['data']['batteryStatus']['currentSOC_pct']) KeyError: 'batteryStatus'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.