Porsche: api broken
Describe the bug
Seit kurzem kann ich bei einem Bekannten nicht mehr die Infos aus dem Porsche Portal anzeigen. Hat es vll mit dem Screenshot zu tun?
Steps to reproduce
- Status Fahrzeug zeigt keine Information mehr
an
...
Configuration details
vehicles:
- name: my_car
type: template
template: porsche
title: # Wird in der Benutzeroberfläche angezeigt (optional)
user: # Benutzerkonto (bspw. E-Mail Adresse, User Id, etc.)
password: # Passwort des Benutzerkontos (bei führenden Nullen bitte in einfache Hochkommata setzen)
vin: W... # Erforderlich, wenn mehrere Fahrzeuge des Herstellers vorhanden sind (optional)
capacity: 50 # Akkukapazität in kWh (optional)
Log details
pi@raspi:~ $ evcc vehicle
[main ] INFO 2024/06/14 21:58:29 evcc 0.126.4
[main ] INFO 2024/06/14 21:58:29 using config file: /etc/evcc.yaml
[main ] ERROR 2024/06/14 21:58:31 creating vehicle my_car failed: cannot create vehicle type 'template': cannot create vehicle type 'porsche': unexpected status: 403 (Forbidden)
.Soc: vehicle not available: cannot create vehicle type 'template': cannot create vehicle type 'porsche': unexpected status: 403 (Forbidden)
Capacity: 93.0kWh
Features: [Offline Retryable]
What type of operating system are you running?
Linux
Version
0.126.4
Bei mir klappt es seit ein paar Tagen auch nicht mehr. Heute ein paar Mal das Captcha im Browser machen müssen bevor ich mich wieder ohne einloggen konnte. EVCC neu gestartet, aber (noch) klappt es nicht.
Bei mir ist auch keine Verbindung mehr möglich: [main ] ERROR 2024/06/15 14:27:42 creating vehicle taycan2 failed: cannot create vehicle type 'template': cannot create vehicle type 'porsche': unexpected status: 403 (Forbidden).
Version 0.127.1
Porsche gehört ja auch irgendwie zu VW - und die haben ihr System umgestellt. War beim Skoda Enyaq auch so - und hier wurde es beim Update Donnerstag/Freitag behoben. Denke, dass es bei Porsche dann auch ein solches Problem wird und mit einem der nächsten Updates behoben werden kann.
Habe dasselbe Problem: https://github.com/evcc-io/evcc/discussions/14404
Es scheint die API hat sich geändert... https://github.com/CJNE/ha-porscheconnect/issues/242
Der Entwickler hat angefangen den code umzuschreiben das es wieder geht:
https://github.com/CJNE/pyporscheconnectapi/commits/new_api/
Vielleicht sind da ja schon die Änderungen dabei die hier benötigt werden
Auch bei mir klappt es plötzlich seit ein paar Tagen nicht mehr, keine Verbindung mehr möglich. EVCC Updates und Neustarts haben das Problem nicht gelöst.
Configuration details
- type: template
template: porsche
title: Porsche Taycan
icon: car
user: **********
password: *********
vin: **********
capacity: 71
phases: 3
cache: 15m
mode: now
name: ev3
Log Details
[main ] ERROR 2024/06/19 11:12:12 creating vehicle ev3 failed: cannot create vehicle type 'template': cannot create vehicle type 'porsche': unexpected status: 403 (Forbidden)
ev3
---
.Soc: vehicle not available: cannot create vehicle type 'template': cannot create vehicle type 'porsche': unexpected status: 403 (Forbidden)
Capacity: 71.0kWh
Features: [Offline Retryable]
What type of operating system are you running? Linux
Version 0.127.2
Hatte es auch schon hier gemeldet:
https://github.com/evcc-io/evcc/discussions/12445
Depends on https://github.com/CJNE/ha-porscheconnect/issues/242
Is there a solution yet?
FYI with the changes that were done in https://github.com/CJNE/pyporscheconnectapi/tree/new_api it's at least possible to "read" states again. So maybe this is a good starting point at least and will allow evcc to do everything needed except changing charging levels etc
This is with the code installed and used in homeassistant:
Looks like a full rewrite. We'll need a MITM trace of the vehicle communication or someone must re-engineer what the HA plugin does.
@andig if you can give me some details how I could produce so a trace I would be happy to help
Sorry, not using HA…
Maybe @fredriklj can share such a trace as I suspect he had to obtain one as well for his work... OSS for the win :)
Any news ok that topic?
Closed in https://github.com/evcc-io/evcc/commit/cd27ee2ce1a37fa86c6603f5ff59c2820a0a7a84. Nobody has found a way to update- hence we're deprecating the Porsche API. May come back at a later time.
Sounds like it is solved for OpenWB!? https://forum.openwb.de/viewtopic.php?t=1943&start=30
Hier bekommt ihr ggf. Zugriff auf die API's
Am Telefon hatte man sich mir gegenüber sehr offen bezgl. EVCC gezeigt. Vielleicht geben Sie euch einen Zugriff. Viel Erfolg.
https://developer.porsche.com/request-access
@snapscanii they will not give you login access to this page. I think most of us already tried this.
Hi, myPorsche funktioniert über IoBroker. Kann jemand sagen, ob dann ein porsche template erzeugt werden kann oder wie ich mit dem generische Vehicle und der Iobroker Verbindung die Daten rüberziehen kann?
Wichtig ist, dass das Fahrzeug nur während des Ladevorgangs gepollt wird, ansonsten geht es nicht in den Tiefschlaf und die 12V Batterie und dann die HV Batter entleert sich (das hatte ich leider schon einmal).
Grüße und danke für die HIlfe
Wir sind mit Porsche im Kontakt. Schauen wir mal, ob da was bei raus kommt...
Wir sind mit Porsche im Kontakt. Schauen wir mal, ob da was bei raus kommt...
Kam da etwas zufriedenstellendes heraus in der Kommunikation?
@andig: Looks like pyporscheconnectapi has a working implementation (beware the rate limit): https://github.com/CJNE/pyporscheconnectapi/issues/46
I am currently using a combination of https://github.com/CJNE/pyporscheconnectapi/issues/46, shell scripting and mqtt to integrate my taycan. Works "well enough" until we have a native support again.
I am currently using a combination of CJNE/pyporscheconnectapi#46, shell scripting and mqtt to integrate my taycan. Works "well enough" until we have a native support again.
@normanmaurer: Could you share that?
Hi @MarkusGH
maybe I can help out describing my solution divided in the following three steps
- Install the files from the repository https://github.com/CJNE/ha-porscheconnect according to the instructions "manual installation". Important: use the branch "new_api" since the changes are not currently not committed to the "main" branch. Please check if information of you car appear in Home Assistant
- Push the information of your car from Home Assistant via MQTT (e.g. via Statestream (https://www.home-assistant.io/integrations/mqtt_statestream)
- Adapt the vehicle configuration in evcc.yaml as follows
vehicles:
- name: PAG
type: custom
title: Cayenne
capacity: 21.8
soc:
source: mqtt
topic: homeassistant/sensor/state_of_charge/state
range:
source: mqtt
topic: homeassistant/sensor/remaining_range_electric/state
The Home Assistant plugin updates the information approximately every 30 minutes so target SOC charging is "challenging". But hey - much better than before ... :-)
Fingers crossed! :-)
@MarkusGH I basically do the same as @WolfImBusch with the difference that I use a shell script for 2.
#!/usr/bin/bash
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
. "$DIR/config.sh"
CAPABILITIES=`/home/norman/pyporsche/bin/porschecli capabilities -a`
for VIN in ${VINS[@]}; do
MEASUREMENTS=`echo $CAPABILITIES | jq ". | select(.vin==\"$VIN\")" | jq '.measurements'`
CURRENT_CHARGE=`echo $MEASUREMENTS | jq '.[] | select(.key=="BATTERY_LEVEL")' | jq ."value.percent"`
CURRENT_RANGE=`echo $MEASUREMENTS | jq '.[] | select(.key=="E_RANGE")' | jq ."value.kilometers"`
CURRENT_MILEAGE=`echo $MEASUREMENTS | jq '.[] | select(.key=="MILEAGE")' | jq ."value.kilometers"`
CURRENT_MIN_SOC=`echo $MEASUREMENTS | jq '.[] | select(.key=="CHARGING_PROFILES")' | jq ".value.list[] | select(.name==\"Home\")" | jq '.minSoc'`
CURRENT_CHARGING_STATE=`echo $MEASUREMENTS | jq '.[] | select(.key=="BATTERY_CHARGING_STATE")' | jq ."value.status"`
/usr/bin/mosquitto_pub -r -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASSWORD -t $MQTT_TOPIC/$VIN/battery_level -m $CURRENT_CHARGE
/usr/bin/mosquitto_pub -r -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASSWORD -t $MQTT_TOPIC/$VIN/range -m $CURRENT_RANGE
/usr/bin/mosquitto_pub -r -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASSWORD -t $MQTT_TOPIC/$VIN/mileage -m $CURRENT_MILEAGE
/usr/bin/mosquitto_pub -r -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASSWORD -t $MQTT_TOPIC/$VIN/min_soc -m $CURRENT_MIN_SOC
/usr/bin/mosquitto_pub -r -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASSWORD -t $MQTT_TOPIC/$VIN/charging_state -m $CURRENT_CHARGING_STATE
done
@normanmaurer: Amazing! That saves so much time. Can you please post your vehicle configuration in evcc.yaml also ?
vehicles:
- type: custom
title: Taycan
icon: car
capacity: 93
name: taycan
soc:
source: mqtt
topic: porsche/$VIN/battery_level
timeout: 60m
range:
source: mqtt
topic: porsche/$VIN/range
timeout: 60m
odometer:
source: mqtt
topic: porsche/$VIN/mileage
timeout: 60m
limitsoc:
source: mqtt
topic: porsche/$VIN/min_soc
timeout: 60m
@MarkusGH replace $VIN with your VIN.