Code Monkey home page Code Monkey logo

weconnect-python's People

Contributors

bendavidson avatar dependabot[bot] avatar devidtr avatar gilder0 avatar madd0 avatar tillsteinbach avatar towe96 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  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

weconnect-python's Issues

Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups

Describe the bug
After updating HA to Home Assistant 2023.2.2, I get the error "Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups" in the logs:

To Reproduce
Steps to reproduce the behaviour:
Update to HA v2023.2.2
Check the logs

Expected behaviour
N/A

Screenshots
image

Logs
`Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 20:19:58 (1 occurrences)
Last logged: 20:19:58

Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for volkswagen_we_connect_id using this method at custom_components/volkswagen_we_connect_id/init.py, line 92: hass.config_entries.async_setup_platforms(entry, PLATFORMS)`

HA Version Info:
Home Assistant 2023.2.2
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230202.0 - latest

Additional context
This is based on the latest update to We Connect ID (v0.1.3) integration in HACS, which has then had the files provided from this repo, to allow it to work with the Cupra Born.

I tried to alter line 92 in the custom_components/volkswagen_we_connect_id/init.py file from:

hass.config_entries.async_setup_platforms(entry, PLATFORMS)

to...

hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

...but clearly Python isn't my strong point and just made all the entities unavailable. It might be in the right format, but it could be there's something else in the file that also needs altering.

Just ask if there's any more info you need!

Charging power has no decimals

Describe the bug
The chargePower_kW field in charging/chargingStatus/chargePower_kW is an integer and has no decimals. The api returns decimals when AC charging. (I dont know about DC).

Unable to login - KeyError: 'location'

Describe the bug
When running the sample allVehicles.py using verified and working username and password,
I get an KeyError and login fails.

To Reproduce
Run allVehicles.py

Expected behavior
Login should succeed and a list of registered vehicles be displayed.

Logs

#  Initialize WeConnect
#  Login
Traceback (most recent call last):
  File "/Users/vaaben/git/flaf/test.py", line 30, in <module>
    main()
  File "/Users/vaaben/git/flaf/test.py", line 19, in main
    weConnect.login()
  File "/Users/vaaben/git/flaf/venv/lib/python3.10/site-packages/weconnect/weconnect.py", line 184, in login
    self.__session.login()
  File "/Users/vaaben/git/flaf/venv/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 75, in login
    authorizationUrl = self.authorizationUrl(url='https://identity.vwgroup.io/oidc/v1/authorize')
  File "/Users/vaaben/git/flaf/venv/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 96, in authorizationUrl
    redirect = tryLoginResponse.headers['Location']
  File "/Users/vaaben/git/flaf/venv/lib/python3.10/site-packages/requests/structures.py", line 52, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'location'
  • OS: MacOS
  • Version used python 3.10, WeConnect 0.54.0 (also tested with same failure in 0.50.0 with failing login)

Additional context
AuthorizationUrl seems to have changed and a 404 is returned.

API Change causes exception

Due to a new element in the API the retrieval of information is not possible anymore

To Reproduce
Can be reproduced with ID.3 vehicles

Expected behavior
No exception to be thrown

Logs
log taken from WeConnect-mqtt:
WARNING:weconnect:/vehicles/AAABBBCCCCDDD11122234: Unknown attribute chargeMode with value {'preferredChargeMode': 'manual'}
ERROR:paho.mqtt.client:Caught exception in on_connect: 'chargeMode'
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3452, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1779, in loop_forever
rc = self.loop(timeout, max_packets)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1181, in loop
rc = self.loop_read(max_packets)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1572, in loop_read
rc = self._packet_read()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2310, in _packet_read
rc = self._packet_handle()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2942, in _packet_handle
return self._handle_connack()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3029, in _handle_connack
self.on_connect(
File "/usr/local/lib/python3.9/site-packages/weconnect_mqtt/weconnect_mqtt.py", line 350, in on_connect_callback
self.updateWeConnect()
File "/usr/local/lib/python3.9/site-packages/weconnect_mqtt/weconnect_mqtt.py", line 282, in updateWeConnect
self.weConnect.update(updateCapabilities=self.updateCapabilities, updatePictures=self.updatePictures)
File "/usr/local/lib/python3.9/site-packages/weconnect/weconnect.py", line 403, in update
self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force)
File "/usr/local/lib/python3.9/site-packages/weconnect/weconnect.py", line 440, in updateVehicles
vehicle = Vehicle(weConnect=self, vin=vin, parent=self.__vehicles, fromDict=vehicleDict,
File "/usr/local/lib/python3.9/site-packages/weconnect/elements.py", line 57, in init
self.update(fromDict, updateCapabilities=updateCapabilities, updatePictures=updatePictures)
File "/usr/local/lib/python3.9/site-packages/weconnect/elements.py", line 155, in update
self.updateStatus(updateCapabilities=updateCapabilities, force=force)
File "/usr/local/lib/python3.9/site-packages/weconnect/elements.py", line 247, in updateStatus
self.statuses[status] = keyClassMap[status](vehicle=self, parent=self.statuses, statusId=status,
KeyError: 'chargeMode'

Option to read TripStatistics (aggregated longTerm & tripStatistics)

Would be great to read out the trip statistics which are displayed in the VW web frontend in various diagrams, see picture.
It allows to display nice statistics/graphs using HighCharts - about electric consumption, comparing winter & summer for auxConsumption during trips & charging habits.

Due to the huge tables which are behind trip statistics, a json dump of this element would be easier to handle than many many single fields which must be queried one-by-one. But does not matter, any way of delivering the table data is fine.

Alternative simple solution not found, an ioBroker plugin allows such readings (longTerm or shortTerm) but unfortunately not both types at the same time and installing ioBroker for just this usage is like breaking a fly on the wheel (de: mit Kanonen auf Spatzen schießen).

Note: In the old api, the trips were located in rtsViewModel.longTermData & rtsViewModel.tripStatistics. For the new API (is it completely new?) I cannot tell.
image

Thank you for your time and consideration.

P.S. If you need test-data from api created for an e-Up, also independent from this ticket, feel free to contact me.

Clarification: does the library provide any alarm information for id.3?

Hello.

Can anyone clarify if the library provides/is able to provide any alarm information for an id.3?

I was surprised to know that even though the alarm of my connected car may be triggered, no notification is sent from the We Connect ID app (not sure if it is only lacking the notification).

Thanks for clarifying.

3 new Unknown attribute messages

I have noticed 3 new Unknown attribute messages being printed in the console every time weConnect.update() is run. Not sure exactly what they mean but would be great if they could be added.

/vehicles/***: Unknown attribute brandCode with value V
/vehicles/***/domains/charging/chargingSettings: Unknown attribute autoUnlockPlugWhenChargedAC with value off
/vehicles/***/domains/charging/plugStatus: Unknown attribute ledColor with value none

Get cars images and provide overlay built of cars status

Get the nice pictures displaying the car in its real configuration and also calculate the schematic image from the cars status (door state, windows, lights, etc.) currently only useful for cars that are not an ID as the IDs don't provide status for doors, etc.

Needs to be thought through what a good user interface e.g. for the CLI is. Probably it only makes sense to allow to save the images

consentURL not printed

The print format seems to be wrong. I get this message:
CRITICAL:weconnect-cli:There was a problem when authenticating with WeConnect: It seems like you need to accept the terms and conditions for the WeConnect ID service. Try to visit the URL "{consentURL}" or log into the WeConnect ID smartphone app

userRoleStatus

2021-10-26T21:21:48+0000:WARNING:vehicle:/vehicles/XXXYYYZZZ111: Unknown attribute userRoleStatus with value ENABLED

2021-10-26T21:26:50+0000:WARNING:vehicle:/vehicles/XXXYYYZZZ222: Unknown attribute userRoleStatus with value UNKNOWN

Position support.

Is your feature request related to a problem? Please describe.
Not possible to see where the car is.

Describe the solution you'd like
As in v3 of the firmware it is possible to enable location data. When i did that i can now see where the car is on the we connect ios app so i guess the data would be possible to get from your module.

Additional context
I can share my login to we connect if you want to be able to test it, i have an VW ID5 GTX model.

Get all home charging sessions

I would like to export all home charging sessions to evaluate how much energy was taken from which wallbox and authenticated by which charging card.

So far I am working with the iobroker.vw-connect and iobroker.simple-api adapter. I am requesting the data from a python script using the simple-api REST API. This is not very efficient but was working in a first POC. I would like to get rid of the iobroker dependency providing an exporting possibility that is kind of standalone. It would be great to use the weconnect-python module to handle the VW API. However, I think there is no API yet to return the former home charging sessions . Would it be possible to add it?

VW Passat GTE: Not allowed to start climatisation without plugged in power

The system refuses to start climatisation without plugged in power unless that setting is sent in the request:

...body {'callback': 'https://mobileapi.apps.emea.vwapps.io/vehicles/callbacks/.../climatisation/start', 'targetTemperature_K': 297.15}
...
...info The process could not be started. Please make sure that the charging cable is plugged and try again.

But with the setting added,

...body {'targetTemperature_K': 297.15, 'callback': 'https://mobileapi.apps.emea.vwapps.io/vehicles/callbacks/.../climatisation/start', 'climatisationWithoutExternalPower': True}
...status successful
...body {'callback': 'https://mobileapi.apps.emea.vwapps.io/vehicles/callbacks/.../climatisation/start', 'climatisationWithoutExternalPower': True, 'targetTemperature_K': 297.15}

it works.

I added this value to settingsDict in controls.py. This should probably reflect the value from the settings instead:

                elif 'targetTemperature_F' in settingsDict:
                    settingsDict['targetTemperature_K'] = farenheitToKelvin(settingsDict['targetTemperature_F'])
                else:
                    settingsDict['targetTemperature_K'] = celsiusToKelvin(20.5)
+            settingsDict['climatisationWithoutExternalPower'] = True

        data = json.dumps(settingsDict)
        controlResponse = self.vehicle.weConnect.session.post(url, data=data, allow_redirects=True)
        if controlResponse.status_code != requests.codes['ok']:
            errorDict = controlResponse.json()

Authorization fail on email addres

I'm using another module that uses weconnect as a base, and weconnect is throwing an 'account XXX does not exist' error.

Here's the error with my email address removed:

2023-01-19 19:56:55 File "/usr/local/lib/python3.10/site-packages/weconnect/weconnect.py", line 182, in login
2023-01-19 19:56:55 self.__session.login()
2023-01-19 19:56:55 File "/usr/local/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 76, in login
2023-01-19 19:56:55 response = self.doWebAuth(authorizationUrl)
2023-01-19 19:56:55 File "/usr/local/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 198, in doWebAuth
2023-01-19 19:56:55 raise AuthentificationError(f'Error during login, account {self.sessionuser.username} does not exist')
2023-01-19 19:56:55 weconnect.errors.AuthentificationError: Error during login, account [email protected] does not exist

I assure you my account does exist, as I am logged into it here:

image

I even reset my password to make sure it was correct and re-logged in.

So what could be causing an 'account does not exist' error when my account clearly exists?

I am in the USA and attempting to use my VW US account. Is this not supported by weconnect?

Too many requests when modifying vehicle state

Describe the bug
This might be related to my account but I can't validate that so apologies in advance.

If I try to modify state, e.g. setting the charge status (or AC etc etc). I get the following from the api respond (I added some logging):

{"error":{"message":"Too Many Requests","info":"Upstream service responded with an unexpected status. If the problem persists, please contact our support.","code":4296,"group":2,"retry":true}}

The more sanitised version from the library simply says:

weconnect.errors.ControlError: Could not control charging (Too Many Requests - Upstream service responded with an unexpected status. If the problem persists, please contact our support. - Please retry in a moment)

Car status is logged out correctly prior to this so reading data is fine.

To Reproduce

print('#  Initialize WeConnect')

passwordSecret = os.environ['vw-password']

weConnect = weconnect.WeConnect(username="xxxx", password=passwordSecret, updateAfterLogin=False, loginOnInit=False)
weConnect.login()
weConnect.update()

car = weConnect.vehicles["xxxx"]
print(f"Car {car}")

#car.controls.climatizationControl.value = ControlOperation.STOP
car.controls.chargingControl.value = ControlOperation.STOP

Expected behavior
The command successfully updates the status

Screenshots

Logs
See above

Login is changed _again_

2022-02-11 10:40:19 ERROR (MainThread) [homeassistant.components.volkswagen_we_connect_id.config_flow] Unexpected exception Traceback (most recent call last): File "/workspaces/core/homeassistant/components/volkswagen_we_connect_id/config_flow.py", line 64, in async_step_user info = await validate_input(self.hass, user_input) File "/workspaces/core/homeassistant/components/volkswagen_we_connect_id/config_flow.py", line 39, in validate_input await hass.async_add_executor_job(we_connect.login) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.9/site-packages/weconnect/weconnect.py", line 166, in login self.__session.login() File "/usr/local/lib/python3.9/site-packages/weconnect/auth/we_connect_session.py", line 49, in login response = self.doWebAuth(authorizationUrl) File "/usr/local/lib/python3.9/site-packages/weconnect/auth/we_connect_session.py", line 140, in doWebAuth raise APICompatibilityError('No credentials form found') weconnect.errors.APICompatibilityError: No credentials form found

I'm using the newest version #0.36.2

Unknown attribute doorLockStatus

Describe the bug
Getting the following attribute error.

Logs

/vehicles/XXXX/domains/access/accessStatus: Unknown attribute doorLockStatus with value locked

Additional context
Using 45.1

Login suddenly not possible anymore

Hi,
I have built a smart charging SW using Info from your library, which is awesome! Since ~2 days, I get the fault OAUTH sc2:fal not present, cannot refresh, leading to a crash in the SW.
Do you know, what could be the reason? Access via app is still possible.
Regards,
Tobias

Remaining Charging Time

Hi,

in other Methods to access the Info you also get access to ["charging"]["chargingStatus"]["remainingChargingTimeToComplete_min"]. Is it somehow possible to access that here too?

Thanks for your help

"Unknown attribute targetSOC_pct" after T&C update

Describe the bug
Since having had to confirm new T&Cs, error / warning lines keep coming up in my script after the "Update" step of it, even when the attributes are not used in the code.

To Reproduce

  • Run the example file "climatization.py" with correct credentials
  • The warning messages are shown after the "Update" step

Expected behavior
No error / warning message after the "Update" step

Screenshots
screenshot

Logs

  • OS: Windows 10
  • Version used: 0.51.1, Python 3.11

Unknown attribute singleTimer

As reported in weconnect-mqtt project:
weconnect-mqtt_composed | WARNING:weconnect:/vehicles/WVWZZZE1ZMPXXXXXX/status/climatisationTimer/timers/1: Unknown attribute singleTimer with value {'startDateTime': '1999-12-31T22:00:00Z'}

PreHeater integration

Hi there! :)

i want to control, start and stop my preHeater(German: Standheizung).
I can control the preHeater with "We Connect" so i think it should be possible to integrate in your code?

If you need me or my car for debugging or testing send me a pm.

Thanks!!

unknown Charge mode

Describe the bug
after I Login, and do an update I get this error
An unsupported chargeMode: off was provided, please report this as a bug

To Reproduce
w=weconnect.WeConnect(username='[email protected]',password='xxxxxx',updateAfterLogin=False, loginOnInit=False)
w.login()
w.update()
An unsupported chargeMode: off was provided, please report this as a bug

  • OS: MacosX
    car : id4

Unknown attribute log messages

Describe the bug
Got a lot of warning messages

Logs

2022-02-16 13:57:01 WARNING (SyncWorker_5) [weconnect] /vehicles/WVGZZZE2ZMP053387/domains/charging/chargingStatus: Unknown attribute chargeType with value invalid
2022-02-16 13:57:01 WARNING (SyncWorker_5) [weconnect] /vehicles/WVGZZZE2ZMP053387/domains/charging/chargingStatus: Unknown attribute chargingSettings with value default

Climatizationcontrols not working with id.3 2021

I am tryng to start vw id.3 climate control by calling "vehicle.controls.climatizationControl.value = ControlOperation.START", but it seems like it is not doing anything. The code runs with no exceptions but nothing happens at the car. Starting the climate control via the weconnect-id app works, but I have to presss the "start"-button multiple times before something happens, but it still works with the app.

HomeAssistant support

Hi Till,

First of all: thanks a lot for your work on this great repository. It looks very promising.

I started working on an integration with HomeAssistant based on WeConnect-mqtt. It works great but I'm facing some issues:
the message contains the VIN. So the sensors look like:
` sensor:
- platform: mqtt
name: PREFIX_display_name
state_topic: "weconnect/0/vehicles/MYVIN/nickname"
icon: mdi:car

- platform: mqtt
  name: PREFIX_display_model
  state_topic: "weconnect/0/vehicles/MYVIN/model"
  icon: mdi:car-connected

`
It is not possible to work with a variable in the name of the sensor or in the state_topic. So you'll have to replace MYVIN with your real VIN.
The PREFIX should only be used it you have more than 1 car in WeConnect, because each sensor should have a unique name. In case of a second car, you have to copy/paste all sensors and replace MYVIN and PREFIX with the other values.
This works for now but I'm looking for something more dynamically and automatically.

The second approach I'm thinking about is to write a custom integration based on WeConnect-python:
I did some quick testing but I could not find a method that dumps all domains and their values in one big list. (Unless I looked over it.)
A big dictionary that looks something like this:
[ "weconnect/0/vehicles/MYVIN/nickname": "Daddy's car", "weconnect/0/vehicles/MYVIN/model": "ID4", .... ]
Is this available?

climatisationTimersStatus & chargingRequestStatus Target

Error

WARNING:weconnect:/vehicles/WVWZZZE1ZMP0XXXXXX: got target climatisationTimersStatus with value [{'status': 'successful', 'operation': 'timers', 'body': {'callback': 'https://mobileapi.apps.emea.vwapps.io/vehicles/callbacks/WVWZZZE1ZMPXXXXXX/climatisation/timers', 'timers': [{'enabled': False, 'id': 1, 'recurringTimer': {'recurringOn': {'fridays': True, 'mondays': True, 'saturdays': False, 'sundays': False, 'thursdays': True, 'tuesdays': True, 'wednesdays': True}, 'startTime': '05:15'}}, {'enabled': False, 'id': 2, 'singleTimer': {'startDateTime': '2021-06-26T22:00:00Z'}}]}}] for not existing status
/vehicles/XXXXXX: Unknown attribute chargingRequestStatus with value {'status': 'in_progress'}

start charging

Describe the bug
when I alter the control value /vehicles/XXXXXX/controls/charging to "start"
I have to do it twice
the first attempt throws an error

Traceback (most recent call last):
File "", line 1, in
File "/Users/gert/Downloads/WeConnect-python-main/weconnect/addressable.py", line 236, in value
self.setValueWithCarTime(newValue=newValue, lastUpdateFromCar=None)
File "/Users/gert/Downloads/WeConnect-python-main/weconnect/addressable.py", line 176, in setValueWithCarTime
self.notify(flags)
File "/Users/gert/Downloads/WeConnect-python-main/weconnect/addressable.py", line 53, in notify
observer(element=self, flags=flags)
File "/Users/gert/Downloads/WeConnect-python-main/weconnect/elements.py", line 2121, in __onChargingControlChange
self.vehicle.updateStatus(force=True)
File "/Users/gert/Downloads/WeConnect-python-main/weconnect/elements.py", line 157, in updateStatus
and cacheDate < (datetime.utcnow() - timedelta(seconds=self.weConnect.maxAge))):
TypeError: unsupported type for timedelta seconds component: NoneType

the 2nd time it works

To Reproduce
w=weconnect.WeConnect(username='xxxx',password='xxxx',updateAfterLogin=False, loginOnInit=False)
w.login()
w.update()
cc = w.getByAddressString('/vehicles/xxxx/controls/charging')
cc.value = 'start'
Traceback (most recent call last):
File "", line 1, in
File "/Users/gert/Downloads/WeConnect-python-main/weconnect/addressable.py", line 236, in value
self.setValueWithCarTime(newValue=newValue, lastUpdateFromCar=None)
File "/Users/gert/Downloads/WeConnect-python-main/weconnect/addressable.py", line 176, in setValueWithCarTime
self.notify(flags)
File "/Users/gert/Downloads/WeConnect-python-main/weconnect/addressable.py", line 53, in notify
observer(element=self, flags=flags)
File "/Users/gert/Downloads/WeConnect-python-main/weconnect/elements.py", line 2121, in __onChargingControlChange
self.vehicle.updateStatus(force=True)
File "/Users/gert/Downloads/WeConnect-python-main/weconnect/elements.py", line 157, in updateStatus
and cacheDate < (datetime.utcnow() - timedelta(seconds=self.weConnect.maxAge))):
TypeError: unsupported type for timedelta seconds component: NoneType
cc.value = 'start'

  • OS: MacOS
  • car : id4

(sorry if this is not a bug, but some code error)

3.x - Sensors are not updated when other user is logged in

My ID.4 got updated to 3.0 (First OTA wave). One of the functions we were really happy to have are profiles.
Our mirrors, seats, colors and radio stations are now in sync with the person that's driving.

Awesome.

One big issue i now have with implementing the new 3.0 sensors into Home Asssistant is that the sensors are not updating when the other user is driving the car. Also when she parks the car, the car still holds her account so no sensors are updated.

Is know this a privacy thing, do you think there is a way around this? State of charge is not that much of a secret.
I do understand that parking position is private.

The app is also greyed out when she uses it :)

Error when setting maxChargeCurrentAC

I get an error when i want to switch maxChargeCurrentAC from maximum to reduced or other way around.
The app does work.

Failed to send request to car - issubclass() arg 1 must be a class

Attribute is no image and cannot be converted to one

Hi,

I'am using your Package on a Raspberry Pi4 and everything works fine except the Images. Whenever I try to get these i get the following Exception.

File "/home/pi/.local/lib/python3.9/site-packages/weconnect/addressable.py", line 282, in saveToFile
    raise ValueError('Attribute is no image and cannot be converted to one')
ValueError: Attribute is no image and cannot be converted to one

On my Windows PC everythin works fine.

I'm pretty new to Programming so I don't know what I can do.

Thank you for your help

Clarification: does locking/unlocking with the library work for id.3?

Hello.

Can anyone clarify if locking/unlocking added in 0.47.0 works for an id.3?

My question comes because this is not currently supported by the We Connect ID app and it would be awesome if possible (I have reported this to VW, as this works for other PHEV VW models (not EV), using a different app)...

Thanks for clarifying.

Unknown attribute batterySupport with value enabled

Describe the bug
When running the example allVehicles.py I get an error message.

To Reproduce
Run allVehicles.py

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
The example should run without error.

Logs

/vehicles/XXXXX/domains/batterySupport/batterySupportStatus: Unknown attribute batterySupport with value enabled

Additional context
The error message causes issues with downstream use of the library, such as https://github.com/mitch-dc/volkswagen_we_connect_id

Error during login, account X does not exist

Describe the bug

Using weconnect.WeConnect(username=<username>, password=<password>), with an appropriate and verified username and password, I get the errors:

To Reproduce
Steps to reproduce the behavior:

  1. Open Python 3.10.6 in terminal.
  2. Run from weconnect import weconnect
  3. Run weconnect.WeConnect(username=<username>, password=<password>), with an appropriate and verified username and password
  4. See error

Logs

Traceback (most recent call last):
File "", line 1, in 
File "/usr/local/lib/python3.10/site-packages/weconnect/weconnect.py", line 115, in init
self.update(updateCapabilities=updateCapabilities, updatePictures=updatePictures, selective=selective)
File "/usr/local/lib/python3.10/site-packages/weconnect/weconnect.py", line 191, in update
self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
File "/usr/local/lib/python3.10/site-packages/weconnect/weconnect.py", line 199, in updateVehicles
data = self.fetchData(url, force)
File "/usr/local/lib/python3.10/site-packages/weconnect/weconnect.py", line 364, in fetchData
statusResponse: requests.Response = self.session.get(url, allow_redirects=False)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 600, in get
return self.request("GET", url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 69, in request
return super(WeConnectSession, self).request(
File "/usr/local/lib/python3.10/site-packages/weconnect/auth/openid_session.py", line 192, in request
url, headers, data = self.addToken(url, body=data, headers=headers, access_type=access_type, token=token)
File "/usr/local/lib/python3.10/site-packages/weconnect/auth/openid_session.py", line 229, in addToken
self.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 198, in doWebAuth
raise AuthentificationError(f'Error during login, account {self.sessionuser.username} does not exist')
weconnect.errors.AuthentificationError: Error during login, account <redacted> does not exist
  • OS: Mac OS 13.1
  • v 0.51.0

Additional context
Original error was observed using a Home Assistant integration that uses the WeConnect-python library: https://github.com/mitch-dc/volkswagen_we_connect_id

Could this all simply be because I am in the US and using Car-Net? I assumed the rebranding of WeConnect to Car-Net wouldn't matter, but this may be a stupid assumption.

Cannot login

Describe the bug
When calling "weConnect.login()", it gives the error "No user id provided"

Additional context
Everything was running well until one week ago. Initially, the login problems seemed to be resolved thanks to the update to 0.54.1.
However, since a couple of days, the error "No user id provided" started to appear.

What could be the issue?
Thanks in advance!

APICompatibilityError('No credentials form found') in 0.35 and 0.34

Since this morning i get the following error when loggin in/update.

`Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/weconnect/weconnect.py", line 771, in fetchData
self.login()
File "/usr/local/lib/python3.9/site-packages/weconnect/weconnect.py", line 391, in login
raise APICompatibilityError('No credentials form found')
weconnect.errors.APICompatibilityError: No credentials form found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/volkswagen_we_connect_id/init.py", line 35, in async_setup_entry
await hass.async_add_executor_job(api.update)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/weconnect/weconnect.py", line 594, in update
self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
File "/usr/local/lib/python3.9/site-packages/weconnect/weconnect.py", line 601, in updateVehicles
data = self.fetchData(url, force)
File "/usr/local/lib/python3.9/site-packages/weconnect/weconnect.py", line 797, in fetchData
except requests.exceptions.JSONDecodeError as jsonError:
AttributeError: module 'requests.exceptions' has no attribute 'JSONDecodeError'`

Incorrect range - from source

Describe the bug
In some ciscumstances the API is reporting an incorrect milage for the EV.

I recognise this is an issue with the upstream source data supplied, and not an issue with the API.

My reason for reporting is to try see of only I am seeing the issue, or if it is general. If general, pointers on how to report to the VW team would be good.

To Reproduce
When the EV is driving or charging the range is both kM and Miles is correctly reported.

Sometimes, then the car is parked up, the range is incorrectly reported in both kM and Miles
It turns out the errors is a factor of 0.62, it seems coincidental this is the conversion factor for miles to km.
(This has the effect that the kM attribute actually shows the number of miles range).

So, it seems to me something upsteams has an error in its range conversion.

Expected behavior
Miles to show miles, and kM to show kM!!!

Screenshots
N/A

Logs
N/A

Additional context
The discrepancy shows up in the weCOnnectID app as well, so confirming an upstream issue.

Sorry if it is considered inapproproiate to seek assistance here - please just close the issue. But pointers on where to report it would be appreciated

Send destinations to car

The API allows to send destinations to the car. The necessary communication is already analyzed. This just needs a good user interface to put in the address.

Will add after thinking about it for some days.

"isActive" returing an incorrect value.

Describe the bug
The value of the Readiness parameter isActive is sometimes incorrect.
The WeConnect API returns the isActive paramter in its data set when the vehicle is active, but does not return anything when the vehicle becomes inactive.
Thus, the update function, which updates the local data dictionary does not update the isActive parameter, as the parameter is absent.
Thus the data dictionary incorrectly reports the vehicle as active, when it is not.

The issue probably affects outher parameters as well - isActive is my test case!

To Reproduce
Run the API, with the EV off.
Run the update funtion
Turn EV on.
Run the update function
Turn EV off
Run the update function - the API will show the EV incorrectly as being active.

Expected behavior
When the EV is switched off, the update function should recognise the absence of the parameter indicate the EV is off, and update the data dictionary accordingly

Screenshots
N/A

Logs
N/A

Additional context
Issue reported in downstream Home Asssiant integration here: mitch-dc/volkswagen_we_connect_id#96

isOnline no longer provided by API?

Describe the bug
Attribute 'isOnline' (usually under [readiness] / [readinessStatus] / Connection State) doesn't seem to be provided anymore (since 1 or 2 weeks)

To Reproduce
In the past, running weconnect-cli used to return something like:

[readiness] Elements: 1 items
        [readinessStatus]
                Connection State:
                        Is online: True
                        Battery power level: comfort
                        Daily Power Budget Available: True
                Connection Warning:
                        Insufficient Battery Level Warning: False
                        Daily Power Budget Warning: False

If I run it now, it only shows:

[readiness] Elements: 1 items
	[readinessStatus]
		Connection State: 
			Battery power level: comfort
			Daily Power Budget Available: True 
		Connection Warning: 
			Insufficient Battery Level Warning: False
			Daily Power Budget Warning: False 

Using library volkswagen_we_connect_id, noticed that the provided sensor is always off (default when either false or absent information?), but this seems to be an issue with this library instead.

Expected behavior
Attribute "isOnline" is available and provided by the library (as the app does).

Screenshots
NA

Logs
NA

Additional context
NA

Was there any change in the API that could be causing this issue, as the app is still reporting it properly?

control with -> climatization.py

i test youtr climatization.py script to use, but the follow error i get.
` python3 climatization.py --username xxxxxxx --password xxxxxx --vin WVWZZZAUZLW91 6270

Initialize WeConnect

Login

update

/vehicles/WVWZZZAUZLW916270: Unknown attribute tags with value []

climatization status

ClimatizationState.OFF

start climatization

Traceback (most recent call last):
File "climatization.py", line 42, in
main()
File "climatization.py", line 37, in main
vehicle.controls.climatizationControl.value = ControlOperation.START
File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect/addressable.py", line 334, in value
self.setValueWithCarTime(newValue=newValue, lastUpdateFromCar=None)
File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect/addressable.py", line 230, in setValueWithCarTime
self.notify(flags)
File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect/addressable.py", line 76, in notify
observer(element=self, flags=flags)
File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect/elements/controls.py", line 86, in __onClimatizationContro lChange
raise SetterError(f'Could not control climatisation ({message})')
weconnect.errors.SetterError: Could not control climatisation (Resource could not be found - Internal error, please try again l ater. If the problem persists, please contact our support. - Please retry in a moment)
`

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.