Einbinden der neuen Volvo on Call API mit HTTPMOD

Begonnen von lynckmeister, 14 Februar 2023, 17:05:47

Vorheriges Thema - Nächstes Thema

lynckmeister

Moin zusammen,
dank der Vorarbeit von nikagersonlohman auf Github (https://github.com/openhab/openhab-addons/issues/13607) ist es mir gelungen die neue API für Modelle ab 21 erfolgreich einzubinden. Sie läuft nun für meinen XC90 und ich würde das gern hier mit allen Interessierten teilen :

Als erstes sollte man mal checken , ob der Login mit der Volvo-ID problemlos funktioniert: https://volvoid.eu.volvocars.com/VolvoLogin/login
Ich habe die Volvo-ID auf Email (und nicht auf Telefonnummer stehen)

Dann muss man sich einen Account machen auf : https://developer.volvocars.com/
Nachdem man da eingeloggt ist muss man sich für die API eine "App" anlegen. Zu der App gehört dann ein APP-Key (VCC API key - Primary) den man bei jeder Abfrage braucht ... Das geht unter Create Application : https://developer.volvocars.com/apis/docs/getting-started/


Das wars schon, jetzt gehts los mit der Konfig vom HTTPMOD. Dazu ein paar Erklärungen:

Es müssen zunächst die drei setreadings
* myAPP-KEY (VCC API key - Primary)
* myVolvoID und
* myVolvoPW
gefüllt werden...

Das Device ist so gebaut, dass es einmal in der Stunde sich ein neues Token holt. Es gibt auch ein Updatetoken, dass mehrere Tage gültig ist, aber damit hab ich noch nicht rumgespielt. Das Token läuft ab und das HTTPMOD holt eben ein Neues....
Das zurückkommende JSON wird automatisch geparsed und das Token wird unter Access_token als Reading angelegt.
In den URLs wird die Fahrzeug Ident Nummer (VIN) verwendet, die holt sich das Device aktuell nicht automatisch , nachdem also das Token geholt wurde muss manuell
get vehicles aufgerufen werden... dann wird die VIN in ein reading vehicles_01_id ausgelesen und ab dann für alle weiteren calls verwendet.

Dann läuft es von selbst... Aktuell habe ich nur
Klima an/aus (Standheizung!)
Batterieladestatus ( leier geht das bei meinem XC90 Hybrid nicht es kommt ein leeres {data}... ich habe bei Volvo developers angefragt, aber bislang keine Antwort... geht das bei euch??
Engine Status (an aus)

Ich habe noch weitere Endpunkte wie fuel etc ausprobiert, aber hier noch nicht drin... sollte aber hier leicht erweiterbar für jeden sein...





define VolvoOnCall HTTPMOD https://volvoid.eu.volvocars.com/as/token.oauth2 1750
setreading VolvoOnCall myAPP-KEY <APP-KEY>
setreading VolvoOnCall myVolvoID <VOLVO-ID>
setreading VolvoOnCall myVolvoPW <VOLVO-ID-PW>
attr VolvoOnCall extractAllJSON 1
attr VolvoOnCall get01Name EngineStatus
attr VolvoOnCall get01URL https://api.volvocars.com/connected-vehicle/v1/vehicles/%VIN%/engine-status
attr VolvoOnCall get02Name SOC
attr VolvoOnCall get02URL https://api.volvocars.com/connected-vehicle/v1/vehicles/%VIN%/battery-charge-level
attr VolvoOnCall get03Header1 accept: application/json
attr VolvoOnCall get03Header2 vcc-api-key: %APPKEY%
attr VolvoOnCall get03Header3 authorization: Bearer %AC%
attr VolvoOnCall get03Name Vehicles
attr VolvoOnCall get03URL https://api.volvocars.com/extended-vehicle/v1/vehicles
attr VolvoOnCall getHeader1 accept: application/vnd.volvocars.api.connected-vehicle.vehicledata.v1+json
attr VolvoOnCall getHeader2 vcc-api-key: %APPKEY%
attr VolvoOnCall getHeader3 authorization: Bearer %AC%
attr VolvoOnCall httpVersion 1.1
attr VolvoOnCall replacement01Mode reading
attr VolvoOnCall replacement01Regex %AC%
attr VolvoOnCall replacement01Value access_token
attr VolvoOnCall replacement02Mode reading
attr VolvoOnCall replacement02Regex %APPKEY%
attr VolvoOnCall replacement02Value myAPP-KEY
attr VolvoOnCall replacement03Mode reading
attr VolvoOnCall replacement03Regex %VolvoID%
attr VolvoOnCall replacement03Value myVolvoID
attr VolvoOnCall replacement04Mode reading
attr VolvoOnCall replacement04Regex %VolvoPW%
attr VolvoOnCall replacement04Value myVolvoPW
attr VolvoOnCall replacement05Mode reading
attr VolvoOnCall replacement05Regex %VIN%
attr VolvoOnCall replacement05Value vehicles_01_id
attr VolvoOnCall requestData username=%VolvoID%&password=%VolvoPW%&grant_type=password&scope=openid email profile care_by_volvo:financial_information:invoice:read care_by_volvo:financial_information:payment_method care_by_volvo:subscription:read customer:attributes customer:attributes:write order:attributes vehicle:attributes tsp_customer_api:all conve:brake_status conve:climatization_start_stop conve:command_accessibility conve:commands conve:diagnostics_engine_status conve:diagnostics_workshop conve:doors_status conve:engine_status conve:environment conve:fuel_status conve:honk_flash conve:lock conve:lock_status conve:navigation conve:odometer_status conve:trip_statistics conve:tyre_status conve:unlock conve:vehicle_relation conve:warnings conve:windows_status energy:battery_charge_level energy:charging_connection_status energy:charging_system_status energy:electric_range energy:estimated_charging_time energy:recharge_status vehicle:attributes
attr VolvoOnCall requestHeader01 content-type: application/x-www-form-urlencoded
attr VolvoOnCall requestHeader02 authorization: Basic aDRZZjBiOlU4WWtTYlZsNnh3c2c1WVFxWmZyZ1ZtSWFEcGhPc3kxUENhVXNpY1F0bzNUUjVrd2FKc2U0QVpkZ2ZJZmNMeXc=
attr VolvoOnCall requestHeader03 user-agent: okhttp/4.10.0
attr VolvoOnCall room aussen
attr VolvoOnCall set01Header1 content-type: application/vnd.volvocars.api.connected-vehicle.climatizationstop.v1+json
attr VolvoOnCall set01Header2 vcc-api-key: %APPKEY%
attr VolvoOnCall set01Header3 authorization: Bearer %AC%
attr VolvoOnCall set01Method POST
attr VolvoOnCall set01Name AC-OFF
attr VolvoOnCall set01NoArg 1
attr VolvoOnCall set01URL https://api.volvocars.com/connected-vehicle/v1/vehicles/%VIN%/commands/climatization-stop
attr VolvoOnCall set02Header1 content-type: application/vnd.volvocars.api.connected-vehicle.climatizationstart.v1+json
attr VolvoOnCall set02Header2 vcc-api-key: %APPKEY%
attr VolvoOnCall set02Header3 authorization: Bearer %AC%
attr VolvoOnCall set02Method POST
attr VolvoOnCall set02Name AC-ON
attr VolvoOnCall set02NoArg 1
attr VolvoOnCall set02URL https://api.volvocars.com/connected-vehicle/v1/vehicles/%VIN%/commands/climatization-start
attr VolvoOnCall setHeader1 content-type: application/vnd.volvocars.api.connected-vehicle.climatizationstart.v1+json
attr VolvoOnCall setHeader2 vcc-api-key: %APPKEY%
attr VolvoOnCall setHeader3 authorization: Bearer %AC%
attr VolvoOnCall verbose 5



in der Request Data, ist der Scope definiert, hier müssen alle Calls von den Endpunkten rein, die man nutzen will..



B.Stromberg

Vielen Dank für deine Arbeit.

Dann versuche ich hier auch noch einmal mein Glück, du scheinst ja von der Materie Ahnung zu haben.

Hast du eine Steuerung der Standheizung über Alexa am laufen?

Habe es damals aufgegeben....

lynckmeister

Alexa noch nicht, aber das ist jetzt zumindest mit einem Dummy vermutlich eine Kleinigkeit .. ich schau mir das mal in den nächsten Tagen an...

und Ahnung naja... also mit httpmod hab ich mein Bestes gegeben , gibt da sicher noch einiges zu verbessern ;))

lynckmeister

so also eine einfachste Alexanbindung geht so :




attr VolvoOnCall alexaName Volvo
attr VolvoOnCall homebridgeMapping On=AC-ON,off=AC-OFF,cmdOn=AC-ON,cmdOff=AC-OFF
attr VolvoOnCall genericDeviceType switch


Jetzt kannst du Alexa, volvo an und Volvo aus sagen ;) Dann geht die Standheizung an und aus , funktioniert - für mich reicht das ...

B.Stromberg

Zitat von: lynckmeister am 14 Februar 2023, 21:43:00
so also eine einfachste Alexanbindung geht so :




attr VolvoOnCall alexaName Volvo
attr VolvoOnCall homebridgeMapping On=AC-ON,off=AC-OFF,cmdOn=AC-ON,cmdOff=AC-OFF
attr VolvoOnCall genericDeviceType switch


Jetzt kannst du Alexa, volvo an und Volvo aus sagen ;) Dann geht die Standheizung an und aus , funktioniert - für mich reicht das ...

Das wäre tatsächlich cool, wenn das so einfach wäre...

Mein Volvo ist MY2018.

Hier mal die RAW:

defmod VolvoOnCall HTTPMOD https://user:pass@vocapi.wirelesscar.net/customerapi/rest/v3.0/vehicles/FIN/status 300
attr VolvoOnCall alexaName Volvo
attr VolvoOnCall event-on-change-reading .*
attr VolvoOnCall extractAllJSON 1
attr VolvoOnCall genericDeviceType switch
attr VolvoOnCall homebridgeMapping On=AC-ON,off=AC-OFF,cmdOn=AC-ON,cmdOff=AC-OFF
attr VolvoOnCall requestHeader01 Content-Type: application/json
attr VolvoOnCall requestHeader02 x-device-id: Device
attr VolvoOnCall requestHeader03 x-originator-type: App
attr VolvoOnCall requestHeader04 x-os-type: Android
attr VolvoOnCall requestHeader05 x-os-version: 22
attr VolvoOnCall room Volvo
attr VolvoOnCall set01Name Lock
attr VolvoOnCall set01NoArg 1
attr VolvoOnCall set01URL https://user:pass@vocapi.wirelesscar.net/customerapi/rest/v3.0/vehicles/FIN/lock

setstate VolvoOnCall 2023-02-15 01:50:34 averageFuelConsumption 115
setstate VolvoOnCall 2023-02-15 01:50:34 averageFuelConsumptionTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 averageSpeed 55
setstate VolvoOnCall 2023-02-15 01:50:34 averageSpeedTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 brakeFluid Normal
setstate VolvoOnCall 2023-02-15 01:50:34 brakeFluidTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 bulbFailuresTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 carLocked 1
setstate VolvoOnCall 2023-02-15 01:50:34 carLockedTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 distanceToEmpty 80
setstate VolvoOnCall 2023-02-15 01:50:34 distanceToEmptyTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 doors_frontLeftDoorOpen 0
setstate VolvoOnCall 2023-02-15 01:50:34 doors_frontRightDoorOpen 0
setstate VolvoOnCall 2023-02-15 01:50:34 doors_hoodOpen 0
setstate VolvoOnCall 2023-02-15 01:50:34 doors_rearLeftDoorOpen 0
setstate VolvoOnCall 2023-02-15 01:50:34 doors_rearRightDoorOpen 0
setstate VolvoOnCall 2023-02-15 01:50:34 doors_tailgateOpen 0
setstate VolvoOnCall 2023-02-15 01:50:34 doors_timestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 engineRunning 0
setstate VolvoOnCall 2023-02-15 01:50:34 engineRunningTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2022-09-10 14:32:39 errorDescription An unknown error occured
setstate VolvoOnCall 2022-09-10 14:32:39 errorLabel UnknownError
setstate VolvoOnCall 2023-02-15 01:50:34 fuelAmount 11
setstate VolvoOnCall 2023-02-15 01:50:34 fuelAmountLevel 15
setstate VolvoOnCall 2023-02-15 01:50:34 fuelAmountLevelTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 fuelAmountTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 heater_seatSelection_frontDriverSide 0
setstate VolvoOnCall 2023-02-15 01:50:34 heater_seatSelection_frontPassengerSide 0
setstate VolvoOnCall 2023-02-15 01:50:34 heater_seatSelection_rearDriverSide 0
setstate VolvoOnCall 2023-02-15 01:50:34 heater_seatSelection_rearMid 0
setstate VolvoOnCall 2023-02-15 01:50:34 heater_seatSelection_rearPassengerSide 0
setstate VolvoOnCall 2023-02-15 01:50:34 heater_status off
setstate VolvoOnCall 2023-02-15 01:50:34 heater_timestamp 2023-02-14T13:07:18+0000
setstate VolvoOnCall 2023-02-15 01:50:34 odometer 67042221
setstate VolvoOnCall 2023-02-15 01:50:34 odometerTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 privacyPolicyEnabled 0
setstate VolvoOnCall 2023-02-15 01:50:34 privacyPolicyEnabledTimestamp 2022-03-12T13:41:18+0000
setstate VolvoOnCall 2023-02-15 01:50:34 serviceWarningStatus Normal
setstate VolvoOnCall 2023-02-15 01:50:34 serviceWarningStatusTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 timeFullyAccessibleUntil 2023-02-19T14:44:31+0000
setstate VolvoOnCall 2023-02-15 01:50:34 timePartiallyAccessibleUntil 2023-03-08T14:44:31+0000
setstate VolvoOnCall 2023-02-15 01:50:34 tripMeter1 513800
setstate VolvoOnCall 2023-02-15 01:50:34 tripMeter1Timestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 tripMeter2 12400
setstate VolvoOnCall 2023-02-15 01:50:34 tripMeter2Timestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 tyrePressure_frontLeftTyrePressure Normal
setstate VolvoOnCall 2023-02-15 01:50:34 tyrePressure_frontRightTyrePressure Normal
setstate VolvoOnCall 2023-02-15 01:50:34 tyrePressure_rearLeftTyrePressure Normal
setstate VolvoOnCall 2023-02-15 01:50:34 tyrePressure_rearRightTyrePressure Normal
setstate VolvoOnCall 2023-02-15 01:50:34 tyrePressure_timestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 washerFluidLevel Normal
setstate VolvoOnCall 2023-02-15 01:50:34 washerFluidLevelTimestamp 2023-02-14T14:45:39+0000
setstate VolvoOnCall 2023-02-15 01:50:34 windows_frontLeftWindowOpen 0
setstate VolvoOnCall 2023-02-15 01:50:34 windows_frontRightWindowOpen 0
setstate VolvoOnCall 2023-02-15 01:50:34 windows_rearLeftWindowOpen 0
setstate VolvoOnCall 2023-02-15 01:50:34 windows_rearRightWindowOpen 0
setstate VolvoOnCall 2023-02-15 01:50:34 windows_timestamp 2023-02-14T14:45:39+0000



Leider funktioniert das Ganze so nicht.
Alexa findet auch kein Device mit dem Namen Volvo.

Hast du eine Idee, wo da der Fehler sein könnte?

B.Stromberg

Habe das Ganze jetzt mal umgemodelt, so wie oben von lynckmeister beschrieben.

Hängt nun bei mir bei der Registrierung.

Einen App Key gibt es nicht.

Es gibt einen VCC API key - Primary sowie einen VCC API key - Secondary.

Beide funktionieren nicht, bekomme nur einen Verbindungsfehler.

Dann gibt es noch den Access Token...

Also doch etwas verwirrender, kannst du Licht ins Dunkel bringen?

lynckmeister

#6
Oh ja das war etwas unpräzise beschrieben, ich änder das : Du musst als App-Key den primary aus der angelegten APP nehmen. Der Access_Token wird beim reread automatisch erzeugt und im Device abgelegt!
paste mal das Log vom Hauptlog ( fhem-2023-2 oder so ) darin steht bei verbose 5 die Response vom Server und du kannst sehen was er zurückmeldet. Wenn du ein Problem mit der Authroisierung hast kommt der Fehler 404 glaub ich UNAUTHORIZED , oder es kommt auch ( wenn du einen ungültigen CALL hast  UNKNOWN RESSOURCE) Check das mal und poste mal hier ...
Alexa musst du natürlich, nachdem du das eingetragen hast set <alexa-device> restart machen, anschliessend in der alexaapp oder auf alexa.amazon.com neue Geräte suchen... dann solltest du auch "volvo" oder wie der alexaname eben ist in deiner Liste auftauchen...

Dein Auto sollte jedenfalls von der API unterstützt werden..

alternativ kannst du auch mal folgendes script in eine datei deiner BASH ( zb vom Rasp) legen und 7

*Username
* PW
* App Key
eintragen
dann
ausführen:


#!/bin/bash
result=$(curl -s -X POST 'https://volvoid.eu.volvocars.com/as/token.oauth2' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'authorization: Basic aDRZZjBiOlU4WWtTYlZsNnh3c2c1WVFxWmZyZ1ZtSWFEcGhPc3kxUENhVXNpY1F0bzNUUjVrd2FKc2U0QVpkZ2ZJZmNMeXc=' \
-H 'user-agent: okhttp/4.10.0' \
-d 'username=<VOLVOID-USERNAME>&password=<VOLVO-ID-PASSWORD>&grant_type=password&scope=openid email profile care_by_volvo:financial_information:invoice:read care_by_volvo:financial_information:payment_method care_by_volvo:subscription:read customer:attributes customer:attributes:write order:attributes vehicle:attributes tsp_customer_api:all conve:brake_status conve:climatization_start_stop conve:command_accessibility conve:commands conve:diagnostics_engine_status conve:diagnostics_workshop conve:doors_status conve:engine_status conve:environment conve:fuel_status conve:honk_flash conve:lock conve:lock_status conve:navigation conve:odometer_status conve:trip_statistics conve:tyre_status conve:unlock conve:vehicle_relation conve:warnings conve:windows_status energy:battery_charge_level energy:charging_connection_status energy:charging_system_status energy:electric_range energy:estimated_charging_time energy:recharge_status vehicle:attributes')
result=$(sed -n 's/^.*token":"\(.*\)","refresh.*/\1/p' <<< "$result")
curl -s -X GET 'https://api.volvocars.com/extended-vehicle/v1/vehicles' \
-H 'accept: application/json' \
-H "authorization: Bearer $result" \
-H 'vcc-api-key: <VCC API key - Primary>'
echo $result >out.token


Damit habe ich das aufgebaut...
Wenn es funktioniert wird das neue Token in out.token abgelegt und du erhälst dein VIN gelistet:

{
  "vehicles" : [ {
    "timestamp" : 1635465600000,
    "id" : "YV1LFxxxxxx7xxxxxxx9"
  } ]
}


B.Stromberg

Zitat von: lynckmeister am 15 Februar 2023, 07:21:09
Oh ja das war etwas unpräzise beschrieben.....

Danke für deine Rückantwort :)

Volvo schien wohl gestern Abend Probleme zu haben?

Nun bekomme ich readings, u. a. aber auch dieses:

error_description
Full authentication is required to access this resource
2023-02-15 12:35:51
error_message
Unauthorized
2023-02-15 12:35:51


Muss ich bei den Dev Sachen meine App publishen?
Ist das der Fehler?


lynckmeister

ja das ist ein Fehler ... du scheinst kein gültiges Token zu haben... wiegesagt... poste mal die Logs hier , was passiert wenn du ein reread machst ..,.(verbose 5 nicht vergessen)
Alternativ kannst du das Script in der Bash abfeuern und da die Rückmeldung mal reingeben...

B.Stromberg

#9
Zitat von: lynckmeister am 15 Februar 2023, 12:45:02
ja das ist ein Fehler ... du scheinst kein gültiges Token zu haben... wiegesagt... poste mal die Logs hier , was passiert wenn du ein reread machst ..,.(verbose 5 nicht vergessen)
Alternativ kannst du das Script in der Bash abfeuern und da die Rückmeldung mal reingeben...

2023-02-15 12:52:53 HTTPMOD VolvoOnCall reread
2023-02-15 12:52:54 HTTPMOD VolvoOnCall error_description: Unexpected problem: Server error
2023-02-15 12:52:54 HTTPMOD VolvoOnCall error: server_error


Mehr Einträge sind nicht...

Verbose 5 habe ich so im Device:

attr VolvoOnCall verbose 5

Habe jetzt mal die Veröffentlichung beantragt

ZitatStatus:
Publication under review


lynckmeister

Das veröffentlichen der App wird dir nichts nützen. Der Prozess soll auch bis zu 21 Tage dauern. Ich habe auch keine App veröffentlicht

Ich habe mir jetzt nochmal ein zweites Device angelegt und es damit auch probiert und es geht auf anhieb.
Was mir direkt auffällt bei dir ist deine URL : defmod VolvoOnCall HTTPMOD https://user:pass@vocapi.wirelesscar.net/customerapi/rest/v3.0/vehicles/FIN/status 300
Das hat nix mit der zu tun die ich oben beschrieben habe... auch stehen in deinem RAW noch jede Menge anderer Sachen drin, die mir unbekannt sind und womöglich aus der alten API kommen ? Wenn du die Dinge mischt, wird das wohl eher nix ...
Lege dir ein NEUES Device an und trage dort exakt das ein was ich beschrieben habe, dann läufts...


B.Stromberg

Zitat von: lynckmeister am 15 Februar 2023, 17:03:20
Das veröffentlichen der App wird dir nichts nützen.....
Lege dir ein NEUES Device an und trage dort exakt das ein was ich beschrieben habe, dann läufts...

Neues Device habe ich angelegt. Ja, habe vorher das alte VolvoOnCall hier genutzt und es waren noch Readings da.
Habe ich alles entfernt.

Fehler bleibt weiterhin

Sag mal

Kann es sein, dass es daran liegt, dass in meinem Passwort ein Sonderzeichen enthalten ist?
Ist das Zeichen %

Übermittelt das FHEM falsch?

lynckmeister

Probiere es doch aus , kannst das PW ja leicht ändern ..
Ansonsten waren da nicht einfach zuviele Attribute sondern deine Basis URL war eine andere , die zeigte wo anders hin und du hattest Username und PW drin .. Liste nochmal dein device wie es jetzt aussieht

B.Stromberg

#13
Zitat von: lynckmeister am 15 Februar 2023, 18:41:45
Liste nochmal dein device wie es jetzt aussieht


Internals:
   BUSY       0
   DEF        https://volvoid.eu.volvocars.com/as/token.oauth2 0
   FUUID      63ed109c-f33f-4afb-4718-b5a8b62e4931b45e
   Interval   0
   MainURL    https://volvoid.eu.volvocars.com/as/token.oauth2
   ModuleVersion 4.1.15 - 17.12.2022
   NAME       VolvoXC60
   NOTIFYDEV  global
   NR         338
   NTFY_ORDER 50-VolvoXC60
   STATE      ???
   TYPE       HTTPMOD
   eventCount 3
   value     
   CompiledRegexes:
   HTTPCookieHash:
     PF;:
       Name       PF
       Options    Path=/; Expires=Wed, 15-Feb-2023 17:14:13 GMT; Max-Age=300; Secure; HttpOnly; SameSite=None
       Path       
       Value      Tq2gSlmtbWCNo9fokzBbi0
   HttpUtils:
     NAME       
     addr       https://api.volvocars.com:443
     auth       0
     buf       
     code       401
     compress   1
     conn       
     data       
     displayurl https://api.volvocars.com/connected-vehicle/v1/vehicles//engine-status
     header     accept: application/vnd.volvocars.api.connected-vehicle.vehicledata.v1+json
vcc-api-key: 450ec7446dc84c6eb4ce53xxxxxxxxxxx
authorization: Bearer
Cookie: PF=Tq2gSlmtbWCNo9fokzBbi0
     host       api.volvocars.com
     httpheader HTTP/1.1 401 Unauthorized
content-length: 207
content-type: application/json;charset=UTF-8
date: Wed, 15 Feb 2023 17:10:54 GMT
server: vcc
cache-control: no-cache, no-store, max-age=0, must-revalidate
expires: 0
pragma: no-cache
vcc-api-operationid: cba41a39-e1ef-475d-bb33-af95031ebf26
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
strict-transport-security: max-age=31536000 ; includeSubDomains
x-frame-options: DENY
request-context: appId=cid-v1:d08a6ac1-4942-4ce7-a466-f3dd07fd71d1
connection: close
     httpversion 1.1
     hu_blocking 0
     hu_filecount 1
     hu_port    443
     hu_portSfx
     ignoreredirects 1
     loglevel   4
     path       /connected-vehicle/v1/vehicles//engine-status
     protocol   https
     redirects  0
     timeout    2
     url        https://api.volvocars.com/connected-vehicle/v1/vehicles//engine-status
     sslargs:
   QUEUE:
   READINGS:
     2023-02-15 18:09:13   error           server_error
     2023-02-15 18:10:54   error_description Full authentication is required to access this resource
     2023-02-15 18:10:54   error_message   Unauthorized
     2023-02-15 18:04:28   myAPP-KEY       450ec7446dc84c6eb4ce53xxxxxxxxxxx
     2023-02-15 18:04:28   myVolvoID       VolvoXC60@mailadresse.de
     2023-02-15 18:04:28   myVolvoPW       Password0815%
     2023-02-15 18:10:54   operationId     cba41a39-e1ef-475d-bb33-af95031ebf26
     2023-02-15 18:10:54   status          401
   REQUEST:
     context    get
     data       
     header     accept: application/vnd.volvocars.api.connected-vehicle.vehicledata.v1+json
vcc-api-key: %APPKEY%
authorization: Bearer %AC%
     ignoreredirects 0
     num        01
     retryCount 0
     type       get01
     url        https://api.volvocars.com/connected-vehicle/v1/vehicles/%VIN%/engine-status
     value     
   defptr:
     readingBase:
       error      reading
       error_description get
       error_message get
       operationId get
       status     get
     readingNum:
       error      unknown
       error_description 01
       error_message 01
       operationId 01
       status     01
     readingOutdated:
     requestReadings:
       get01:
         error_description get 01
         error_message get 01
         operationId get 01
         status     get 01
       update:
         error      reading unknown
         error_description reading unknown
Attributes:
   extractAllJSON 1
   get01Name  EngineStatus
   get01URL   https://api.volvocars.com/connected-vehicle/v1/vehicles/%VIN%/engine-status
   get02Name  SOC
   get02URL   https://api.volvocars.com/connected-vehicle/v1/vehicles/%VIN%/battery-charge-level
   get03Header1 accept: application/json
   get03Header2 vcc-api-key: %APPKEY%
   get03Header3 authorization: Bearer %AC%
   get03Name  Vehicles
   get03URL   https://api.volvocars.com/extended-vehicle/v1/vehicles
   getHeader1 accept: application/vnd.volvocars.api.connected-vehicle.vehicledata.v1+json
   getHeader2 vcc-api-key: %APPKEY%
   getHeader3 authorization: Bearer %AC%
   httpVersion 1.1
   replacement01Mode reading
   replacement01Regex %AC%
   replacement01Value access_token
   replacement02Mode reading
   replacement02Regex %APPKEY%
   replacement02Value myAPP-KEY
   replacement03Mode reading
   replacement03Regex %VolvoID%
   replacement03Value myVolvoID
   replacement04Mode reading
   replacement04Regex %VolvoPW%
   replacement04Value myVolvoPW
   replacement05Mode reading
   replacement05Regex %VIN%
   replacement05Value vehicles_01_id
   requestData username=%VolvoID%&password=%VolvoPW%&grant_type=password&scope=openid email profile care_by_volvo:financial_information:invoice:read care_by_volvo:financial_information:payment_method care_by_volvo:subscription:read customer:attributes customer:attributes:write order:attributes vehicle:attributes tsp_customer_api:all conve:brake_status conve:climatization_start_stop conve:command_accessibility conve:commands conve:diagnostics_engine_status conve:diagnostics_workshop conve:doors_status conve:engine_status conve:environment conve:fuel_status conve:honk_flash conve:lock conve:lock_status conve:navigation conve:odometer_status conve:trip_statistics conve:tyre_status conve:unlock conve:vehicle_relation conve:warnings conve:windows_status energy:battery_charge_level energy:charging_connection_status energy:charging_system_status energy:electric_range energy:estimated_charging_time energy:recharge_status vehicle:attributes
   requestHeader01 content-type: application/x-www-form-urlencoded
   requestHeader02 authorization: Basic aDRZZjBiOlU4WWtTYlZsNnh3c2c1WVFxWmZyZ1ZtSWFEcGhPc3kxUENhVXNpY1F0bzNUUjVrd2FKc2U0QVpkZ2ZJZmNMeXc=
   requestHeader03 user-agent: okhttp/4.10.0
   room       Volvo
   set01Header1 content-type: application/vnd.volvocars.api.connected-vehicle.climatizationstop.v1+json
   set01Header2 vcc-api-key: %APPKEY%
   set01Header3 authorization: Bearer %AC%
   set01Method POST
   set01Name  AC-OFF
   set01NoArg 1
   set01URL   https://api.volvocars.com/connected-vehicle/v1/vehicles/%VIN%/commands/climatization-stop
   set02Header1 content-type: application/vnd.volvocars.api.connected-vehicle.climatizationstart.v1+json
   set02Header2 vcc-api-key: %APPKEY%
   set02Header3 authorization: Bearer %AC%
   set02Method POST
   set02Name  AC-ON
   set02NoArg 1
   set02URL   https://api.volvocars.com/connected-vehicle/v1/vehicles/%VIN%/commands/climatization-start
   setHeader1 content-type: application/vnd.volvocars.api.connected-vehicle.climatizationstart.v1+json
   setHeader2 vcc-api-key: %APPKEY%
   setHeader3 authorization: Bearer %AC%
   verbose    5


EDIT 19:10h

Nochmal eine Frage zum App Key.

Ich habe einen Github Account, dieser ist aber nicht identisch mit meiner Mail von Volvo.

Ist es überhaupt richtig, sich bei Volvo Dev mit Github anzumelden?
Oder muss das über CDSID erfolgen?

Oder egal?

Passwort habe ich geändert auf ohne "%"
Fehler bleibt

lynckmeister

Wie kommst du denn auf Github? Das hat nix mit Github zu sondern mit VOlvo zu tun .. du musst deine VolvoID und das dazugehöriige PW nutzen, daher habe ich auch geschrieben , als ERSTES prüfen, ob du mit diesen Daten dich hier anmelden kannst: https://volvoid.eu.volvocars.com/VolvoLogin/login
wenn das geht nimm genau diese credentials und nutze sie für unser HTTPMOD-Device..