tillsteinbach / WeConnect-mqtt

MQTT Client that publishes data from Volkswagen WeConnect
MIT License
69 stars 15 forks source link

Support other Models of the VW Group? #32

Open buliwyf42 opened 3 years ago

buliwyf42 commented 3 years ago

Hello,

do you plan to add the support for other models of the VW Group as well, e.g., Seat or Škoda?

tillsteinbach commented 3 years ago

I would be interested to do so, but I have no car to test. One challenge: I use the new API that came with the ID models. I don't know if that is already available for Skoda/Seat For skoda it could be possible as the Enyaq is on the market. For seat we probably have to wait for the Born. And then the question is if the API vor Skoda/Seat is also working for the previous generation of cars. If someone has more information I would be keen to know what is possible today.

buliwyf42 commented 3 years ago

I own a late 2020 Seat Leon FR Hybrid. How can I try if it is reachable via the new API? It is accessible via the my.seat site. If it is not reachable via the new WEconnect API, should I look for a CarNet access?

tillsteinbach commented 3 years ago

My guess is that it will be available when the new My Cupra App is available mid of November. They call it CUPRA CONNECT GEN4. But Seat might be also a special case as Cupra is a subbrand. Very difficult to predict. How is the app called you are using now with the car?

buliwyf42 commented 3 years ago

It's called SEAT Connect (Version 1.4.6)

tillsteinbach commented 3 years ago

Ok, that is the equivalent of the WeConnect App from VW. That is using the old API.

tasisale commented 2 years ago

Hi, how i can start the "weconnect-mqtt" as service or so? When my e-Golf is not at home, the script stops with error and i must start ist via putty/terminal again. The show error-code are: Traceback (most recent call last): File "/home/fhemadmin/.local/bin/weconnect-mqtt", line 8, in <module> sys.exit(main()) File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect_mqtt/weconn ect_mqtt_base.py", line 231, in main mqttCLient.run() File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect_mqtt/weconn ect_mqtt_base.py", line 462, in run self.updateWeConnect() File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect_mqtt/weconn ect_mqtt_base.py", line 287, in updateWeConnect self.weConnect.update(updateCapabilities=self.updateCapabilities, updatePict ures=self.updatePictures) File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect/weconnect.p y", line 530, in update self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=up datePictures, force=force) File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect/weconnect.p y", line 600, in updateVehicles self.__vehicles[vin].update(fromDict=vehicleDict, updateCapabilities=updateC apabilities, updatePictures=updatePictures) File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect/elements/ve hicle.py", line 203, in update self.updateStatus(updateCapabilities=updateCapabilities, force=force) File "/home/fhemadmin/.local/lib/python3.8/site-packages/weconnect/elements/ve hicle.py", line 428, in updateStatus data = statusResponse.json() File "/home/fhemadmin/.local/lib/python3.8/site-packages/requests/models.py", line 910, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 518, in loa ds return _default_decoder.decode(s) File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in deco de obj, end = self.raw_decode(s) File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_ decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

regards simon

tillsteinbach commented 2 years ago

Looks like the car is sending something unexpected when there is no parking position. I will try to fix that based on your log. Hope that I can do that. Always difficult to debug for a car I don’t have access to.

which version of WeConnect-MQTT are you running?

tasisale commented 2 years ago

Looks like the car is sending something unexpected when there is no parking position. I will try to fix that based on your log. Hope that I can do that. Always difficult to debug for a car I don’t have access to.

which version of WeConnect-MQTT are you running?

How can I help you, to get access, any log or a invitation to my weconnect? The lastest version, how can I check ;-).

regards

tillsteinbach commented 2 years ago

I think I already found the problem. It looks like an exception is not properly handled when simpeljson is installed on the system, which is the case for you. I will fix that in an upcoming release. If you want a quick workaround you can uninstall simplejson package.

tasisale commented 2 years ago

Ok, thx. please help me to make a autostart Task for your tool. I don’t now how to do this.

regards

tillsteinbach commented 2 years ago

What operating system are you running?

tasisale commented 2 years ago

Ubuntu 20.04 LTS

tillsteinbach commented 2 years ago

Can you try this out?: https://github.com/tillsteinbach/WeConnect-mqtt/tree/main/autostart/systemd

tasisale commented 2 years ago

Can you try this out?: https://github.com/tillsteinbach/WeConnect-mqtt/tree/main/autostart/systemd

sudo systemctl start weconnect-mqtt Failed to start weconnect-mqtt.service: Unit weconnect-mqtt.service has a bad unit file setting. See system logs and 'systemctl status weconnect-mqtt.service' for details.

tillsteinbach commented 2 years ago

what does systemctl status weconnect-mqtt.service say?

tasisale commented 2 years ago

` Loaded: loaded (/etc/systemd/system/weconnect-mqtt.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2022-01-04 10:22:43 CET; 4min 16s ago Main PID: 196944 (code=exited, status=127)

Jan 04 10:22:43 srvfhem systemd[1]: Started WeConnect-mqtt. Jan 04 10:22:43 srvfhem sh[196944]: /bin/sh: 1: weconnect-mqtt: not found Jan 04 10:22:43 srvfhem systemd[1]: weconnect-mqtt.service: Main process exited, code=exited, status=127/n/a Jan 04 10:22:43 srvfhem systemd[1]: weconnect-mqtt.service: Failed with result 'exit-code'. Jan 04 10:22:58 srvfhem systemd[1]: /etc/systemd/system/weconnect-mqtt.service:8: Failed to resolve unit specifiers in weconnect-mqtt --username simon@xxxxx.de --password xxxxxxx --mqttbroker 192.168.151.18 --no-capabilities --> Jan 04 10:22:58 srvfhem systemd[1]: weconnect-mqtt.service: Unit configuration has fatal error, unit will not be started. `

tillsteinbach commented 2 years ago

I tried to change the service file a bit. Maybe it works better that way

tasisale commented 2 years ago

I tried to change the service file a bit. Maybe it works better that way /etc/systemd/system/weconnect-mqtt.service:9: Failed to resolve unit specifiers in %XxxxxXxxxxx!: Invalid slot i think the problem is my password, it beginns with an %. have you any idear to fix that?

tasisale commented 2 years ago

yes, the % in my password are the problem.

tillsteinbach commented 2 years ago

Yes, I think the % is interpreted. Can you replace the % with %%. If that does not help you can also rely on storing your password in netrc like described here: https://github.com/tillsteinbach/WeConnect-mqtt#credentials

tasisale commented 2 years ago

perfect with %% ist works now fine. thx for the grait work. one question more, is it possible to user your script to set the climatisationState on, or start charging

regards simon

tillsteinbach commented 2 years ago

yes, in general it should be possible if your car supports it. There should be a topic like: weconnect/0/vehicles/WVWZZZXXXYYYZZZ012345/controls/climatization (the actual topic name of course depends on your prefix and the VIN of the car) when you send a start to that topic climatization should start, when you send stop it should stop (there will be some delay due to the communication through the servers. You can also e.g. change the temperature on the topic: weconnect/0/vehicles/WVWZZZXXXYYYZZZ012345/status/climatisationSettings/targetTemperature_C and some more settings.

tasisale commented 2 years ago

I think I already found the problem. It looks like an exception is not properly handled when simpeljson is installed on the system, which is the case for you. I will fix that in an upcoming release. If you want a quick workaround you can uninstall simplejson package.

Sorry, but no simplejson is install, the error i get every time i drive the car.

pi@fhem-aussen:~ $ sudo pip3 uninstall simplejson Found existing installation: simplejson 3.17.2 Not uninstalling simplejson at /usr/lib/python3/dist-packages, outside environment /usr Can't uninstall 'simplejson'. No files were found to uninstall. pi@fhem-aussen:~ $ sudo apt-get remove simplejson Paketlisten werden gelesen… Fertig Abhängigkeitsbaum wird aufgebaut… Fertig Statusinformationen werden eingelesen… Fertig E: Paket simplejson kann nicht gefunden werden. pi@fhem-aussen:~ $ sudo apt-get remove simplejson Paketlisten werden gelesen… Fertig Abhängigkeitsbaum wird aufgebaut… Fertig Statusinformationen werden eingelesen… Fertig E: Paket simplejson kann nicht gefunden werden. pi@fhem-aussen:~ $ sudo apt-get remove python-simplejson Paketlisten werden gelesen… Fertig Abhängigkeitsbaum wird aufgebaut… Fertig Statusinformationen werden eingelesen… Fertig E: Paket python-simplejson kann nicht gefunden werden. pi@fhem-aussen:~ $ sudo apt-get remove --auto-remove python-simplejson Paketlisten werden gelesen… Fertig Abhängigkeitsbaum wird aufgebaut… Fertig Statusinformationen werden eingelesen… Fertig E: Paket python-simplejson kann nicht gefunden werden. pi@fhem-aussen:~ $ sudo apt-get purge python-simplejson Paketlisten werden gelesen… Fertig Abhängigkeitsbaum wird aufgebaut… Fertig Statusinformationen werden eingelesen… Fertig E: Paket python-simplejson kann nicht gefunden werden. pi@fhem-aussen:~ $ sudo apt-get purge --auto-remove python-simplejson Paketlisten werden gelesen… Fertig Abhängigkeitsbaum wird aufgebaut… Fertig Statusinformationen werden eingelesen… Fertig E: Paket python-simplejson kann nicht gefunden werden.

tillsteinbach commented 2 years ago

I just pushed version 0.22.0 that should fix your problem without uninstalling simplejson (probably it came through some other pip package). Please be aware that the naming of the topics slightly changed in 0.22.0!

tasisale commented 2 years ago

ok, thx will test and report here.

regards simon

Intenos commented 1 year ago

Hi, May I kindly ask if it is planned to continue working on the Cupra Born? If so it would be fantastic :-) and I would be happy to support as good as I can.

Regards, Tobias

TotallyInformation commented 1 year ago

I would also like to ask about the Cupra Born now that I have one :-)

I note that the base weconnect does now seem to support the Born. But I just tried with my login and it is saying the login isn't valid.

https://github.com/tillsteinbach/WeConnect-python/issues/26

daernsinstantfortress commented 1 year ago

I've just released a new custom component for Home Assistant, based on this library specifically for the Cupra Born. More details in this post: https://github.com/tillsteinbach/WeConnect-python/issues/26#issuecomment-1582902306

You can install it from https://github.com/daernsinstantfortress/cupra_we_connect using HACS.

As a note, this is clearly not an MQTT integration at this point (not sure if I'll ever get around to porting this bit unless there's demand), but if you're wanting to work directly with HA, you'll be ok with the one I've released.

TotallyInformation commented 1 year ago

Thanks for your work. I don't use HA myself as I'm a native Node-RED user and contributor. But I will certainly take a good look at it and see if I can adapt it. If I can work out how to do the initial secure connection using node.js, the rest I can hopefully work out as I've done with other API's.

tillsteinbach commented 1 year ago

If you need something in node.js have a look here https://github.com/TA2k/ioBroker.vw-connect

KingKoerle commented 1 year ago

Is there a possibility to integrate a cupra born to weconect-mqtt now?

I don't use ha or node.js (but openHAB instead) :-s

tillsteinbach commented 1 year ago

No, unfortunately for now the differences between the APIs is just too big. I have an idea for a rewrite of a library what could support different types of cars and brands, but right now I have no time for that.

chrisandsally commented 1 year ago

Hi, I have a VW Tiguan Hybrid 2022, which you are more than welcome to test

tillsteinbach commented 1 year ago

A 2022 (European) Tiguan should already work

chrisandsally commented 1 year ago

Hi, yes most do. Some have an error. like charge mode

weconnect/0/vehicles/WVGZZZ5xxxxxxx/domains/charging/chargeMode also, I believe vehicle_moving is a state that is reported but not listed.

tillsteinbach commented 1 year ago

Ah ok, can you send me a log with -vv enabled? The output is probably enough to add the missing attributes

chrisandsally commented 1 year ago

Sorry, how do I do that? I'm a quick learner but only started Mqtt & Docker the other day. What log file. MQTT Explorer / docker?

tillsteinbach commented 1 year ago

The docker should show a log with warnings when you add -vv to the ADDITIONAL_PARAMETERS

chrisandsally commented 1 year ago

Hi, This is the output of the log.

2023-11-20T18:40:33+0000:INFO:weconnect_mqtt_base:WeConnect-mqtt 0.48.3 (using WeConnect-python 0.59.5) 2023-11-20T18:40:33+0000:INFO:weconnect_mqtt_base:Connect to WeConnect 2023-11-20T18:40:33+0000:INFO:weconnect_mqtt_base:Connected to MQTT broker 2023-11-20T18:40:33+0000:INFO:weconnect_mqtt_base:waiting for first update from server 2023-11-20T18:45:33+0000:INFO:weconnect_mqtt_base:Update data from WeConnect 2023-11-20T18:50:38+0000:INFO:weconnect_mqtt_base:Update data from WeConnect 2023-11-20T18:55:42+0000:INFO:weconnect_mqtt_base:Update data from WeConnect