Speak EV - Electric Car Forums banner
1 - 12 of 12 Posts

·
Registered
Joined
·
63 Posts
Discussion Starter · #1 ·
I took delivery on my new Corsa-e this weekend and have spent more time intergrating the PSA api into my Home Assistant setup and Alexa than driving the car !

I can now ask Alexa about the Car status, display all the cars stats including milege , charging speed, autonomy, charging and climate schedules on my phone and PC

Working on charging and setting the climate controls via various triggers such as time, calendars, local temperature, etc

I can take no credit for any real code as i'm intergrating this from already existing addon's availiable to Home Assistant.

PSA car controller
Alexa Media Player

Home assistant is an open source project than "glues" various devices and services together. It provides the data in a common format , which you can then display, manipulate and pass to other devices as input data , in my case Alexa.

This is not for the faint hearted and is a hobby which has comsumed vast amounts of time ( far more time than I have ever saved in automating the house !).

If there is any interest in the setup I will make my configuration public via github ,once I have cleanup the code and removed all the passwords, VIN's etc.

Interestingly in the PSA car controller software there are API calls to change a threshold value which limits the battery charge level to a certain percentage and also an option to stop the charge at a certain time. This just shows how crap the exsiting phone app is ( and I thought the Renault software was bad)
 

·
Registered
Vauxhall Corsa-e SE Nav
Joined
·
8 Posts
That’s really interesting. Didn’t know there was an API that could be used. How reliable is home assistant? You should do a YouTube demo.
 

·
Registered
Joined
·
63 Posts
Discussion Starter · #3 ·
Still not finished all the code updates , but the basic code is up on git hub

Github

here is short old video of the interface ( still showing my Renault Zoe) but you get the idea. Will update soon to show the Corsa-e

Video

The link via Home assistant to the PSA API is basically a very cut down phone app, running in its own virtual container. Home Assistant can then "scrape" the values from that. I can then use that data in other apps say Alexa . I can also create automation from lots of different sources, so I can get Alexa to remind me to charge the car , or I can Alexa to run the climate control. I can access the same Home assistant interface from my phone as well , so i don't have to use the Vauxhall one.

To be fair only had the car a week , so still lots of testing.
 

·
Registered
Joined
·
63 Posts
Discussion Starter · #5 ·
OK after a week and a bit I have little more info

The following web page burried in the PSA API documation contains a data catalogue of all the possible information that may be obtained from the car, depending if the car has this information, if its been implemented on the car. Basiclly it is an outline of how the information can be obtained from the API, if the car can deliver the info.

Data Catalog | Overview | Connected-vehicles

The major thing I have discovered (googling,searching forums, etc) is the telemetry API calls are now broken. This is where the API can return the GPS coordinates of the car . They used to work , but now don't. This explains why the trip data on the app is all over the place . I think the app uses the phone GPS as a secondary data source as a backup to the car API.

The only useful info I have managed to extract so far is the following :-

  • SOC
  • Range km
  • Current millage km
  • Car Plug Status (disconnected, charging, etc)
  • Charging speed in km/h

I can obviously convert km to miles . If anybody knows a way of converting charging speed from km/h to kW per hour, let me know,

I can also start a charge remotely and start climate control the same as the app. I have also found a couple of extra features not implemented in the app

  • Stop charge at a partiular time
  • Charge to a certain percentage ( say 80%)
I have not had chance to test all the above , will let you know how i get on :)
 

·
Registered
Corsa-e 2020
Joined
·
1,006 Posts
Difficult to convert km/h to kW/h but when I charge at home on my PodPoint, I get 6.2kW/h charge and the dash shows 21 miles/hour. My conversion of those numbers indicates 33.8km/hour = 6.2kW/hour.

Based on those numbers (no guarantee of how accurate that is would be):

100kW = 545 km/h = 339 miles/h
75kW = 409 km/h = 254 miles/h
50kW = 273 km/h = 170 miles/h
25kW = 136 km/h = 85 miles/h
10kW = 55 km/h = 34 miles/h
7kw = 38 km/h = 24 miles/h
6.2kW = 34km/h = 21 miles/h
3.5kW = 19km/h = 12 miles/h
2.2kW = 9.7 km/h = 6 miles/h (based on granny charger usage @10A with ~223v supply voltage)

I don't know how those numbers compare to others when charging but the do appear to be roughly what I get depending on what power of charger I am using.

Have you tried looking at the log files for the app on your iPhone. You can see from those exactly what info is passing between the car and the servers.

The "stop charge" and "charge to a particular %" would be invaluable options for users.
 

·
Registered
Joined
·
63 Posts
Discussion Starter · #7 ·
Just so you can see the sort of data you can obtain. This is an example of data from a get_vehicleinfo request. You can lookup the data types from Data Catalog | Overview | Connected-vehicles

so charging mode can return No,Quick or slow.


Notice all the positioning and kinetic is null !!!

{
"embedded": null,
"links": {
"_self": {
"deprecation": null,
"href": "https://api.groupe-psa.com/connecte...3259774e5459334e44466d597a45344e7a453d/status",
"hreflang": null,
"name": null,
"profile": null,
"templated": null,
"title": null,
"type": null
},
"vehicle": null
},
"battery": {
"current": 0,
"voltage": 88
},
"doors_state": null,
"energy": [
{
"updated_at": "2021-07-25 13:04:51+00:00",
"autonomy": 278,
"battery": null,
"charging": {
"charging_mode": "No",
"charging_rate": 0,
"next_delayed_time": "PT30M",
"plugged": false,
"remaining_time": "PT0S",
"status": "Disconnected"
},
"consumption": null,
"level": 81,
"residual": null,
"type": "Electric"
},
{
"updated_at": "2021-07-25 13:04:50+00:00",
"autonomy": null,
"battery": null,
"charging": null,
"consumption": null,
"level": 0,
"residual": null,
"type": "Fuel"
}
],
"environment": null,
"ignition": null,
"kinetic": {
"acceleration": null,
"moving": null,
"pace": null,
"speed": null
},
"last_position": {
"type": "Feature",
"geometry": {
"coordinates": [
null,
null,
null
],
"type": "Point"
},
"properties": {
"heading": null,
"signal_quality": null,
"type": null,
"updated_at": null
}
},
"preconditionning": {
"air_conditioning": {
"failure_cause": null,
"programs": null,
"status": "Disabled",
"updated_at": "2021-07-25 13:04:51+00:00"
}
},
"privacy": {
"state": "None"
},
"safety": null,
"service": {
"type": "Electric",
"updated_at": "2021-07-25 13:04:51+00:00"
},
"timed_odometer": {
"updated_at": null,
"mileage": 103
}
}
 

·
Registered
Corsa-e 2020
Joined
·
1,006 Posts
This is how it looks in the app logs:

Code:
2021-07-25 12:01:49:479 <INFO>    LRRManager.m:172 : LongRangeRemote - getLEVInformationWithOldInfos:success:failure = success
2021-07-25 12:01:49:479 <ERROR>   BDCHttpManager.m:170 : BigDataConnector : New data saved in USerDefaults
2021-07-25 12:01:49:496 <INFO>    MMLogUtilities.m:43 : <LEV> UVS : Calling getStepsStatusWithCarAssociationID: **** resetSteps:0
2021-07-25 12:01:49:496 <INFO>    PIMSFacade.m:1230 : PIMSFacade - getStepsStatusWithCarAssociationID:resetSteps:success:failure:
2021-07-25 12:01:49:496 <INFO>    PIMSCoreManager.m:1403 : PIMSCoreManager - getStepsStatusWithCarAssociationID:resetSteps:success:failure:
2021-07-25 12:01:49:496 <INFO>    UVSManager.m:93 : UVS : getStepsStatusWithCarAssociationID:resetSteps:success:failure
2021-07-25 12:01:49:496 <INFO>    AuthentManager.m:160 : AuthentManager: getCurrentUserLogin
2021-07-25 12:01:49:503 <INFO>    UVSTools.m:199 : UVS: Getting saved steps for Key == [email protected]#ba68f774-ad59-4b0e-8556-de2bb39553c6#5
2021-07-25 12:01:49:503 <INFO>    UVSManager.m:120 : UVS : GET Saved Steps by car association Id: <UVSSteps: 0x28374c480>
2021-07-25 12:01:49:503 <INFO>    MMLogUtilities.m:43 : <LEV> UVS : Success getStepsStatusWithCarAssociationID: **** resetSteps:0
2021-07-25 12:01:50:343 <INFO>    BDCHttpManager.m:150 : BigDataConnector : Vehicle status JSON result : {
    "_links" =     {
        self =         {
            href = "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/1566c684c5655686153316861544451784e6a59784e6a636a493251334d474e6a4d574533597a59314d4441784e7a466b4e6a5a6d4d575a6c4d54426d4d7a63334d7a4977596a466d5a575a6c5a6a67334f446b314d4455315a5449784e6a686b5a574a694e6a59795a444e6b596a673d/status";
        };
        vehicles =         {
            href = "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/1566c684c5655686153316861544451784e6a59784e6a636a493251334d474e6a4d574533597a59314d4441784e7a466b4e6a5a6d4d575a6c4d54426d4d7a63334d7a4977596a466d5a575a6c5a6a67334f446b314d4455315a5449784e6a686b5a574a694e6a59795a444e6b596a673d";
        };
    };
    battery =     {
        createdAt = "2021-07-24T17:53:09Z";
        current = 0;
        voltage = "82.5";
    };
    createdAt = "2021-07-25T11:01:07Z";
    energy =     (
                {
            level = 0;
            type = Fuel;
            updatedAt = "2021-07-24T17:53:09Z";
        },
                {
            autonomy = 294;
            charging =             {
                chargingMode = No;
                chargingRate = 0;
                nextDelayedTime = PT20H31M;
                plugged = 0;
                remainingTime = PT0S;
                status = Disconnected;
            };
            level = 92;
            type = Electric;
            updatedAt = "2021-07-25T11:01:07Z";
        }
    );
    preconditionning =     {
        airConditioning =         {
            programs =             (
                                {
                    enabled = 0;
                    occurence =                     {
                        day =                         (
                            Mon,
                            Tue,
                            Wed,
                            Thu,
                            Fri
                        );
                    };
                    recurrence = Daily;
                    slot = 1;
                    start = PT8H;
                }
            );
            status = Disabled;
            updatedAt = "2021-07-24T17:53:09Z";
        };
    };
    privacy =     {
        createdAt = "2021-07-25T11:01:07Z";
        state = None;
    };
    service =     {
        type = Electric;
        updatedAt = "2021-07-25T11:01:07Z";
    };
    "timed.odometer" =     {
        createdAt = "<null>";
        mileage = 13045;
    };
    updatedAt = "2021-07-25T11:01:07Z";
}
 

·
Registered
Joined
·
63 Posts
Discussion Starter · #9 ·
2021-07-25 12:01:50:343 <INFO> BDCHttpManager.m:150 : BigDataConnector : Vehicle status JSON result
Interesting the phone app is making the same call ( hardly surprising )

It's is also using version 4 of the web API. all the documentation is for V3


I noticed the privacy settings are set to none same as mine , can you check the following settings on your car and let me know ?

Privacy Settings

Thanks for the info :)
 

·
Registered
Corsa-e 2020
Joined
·
1,006 Posts
Interesting the phone app is making the same call ( hardly surprising )

It's is also using version 4 of the web API. all the documentation is for V3


I noticed the privacy settings are set to none same as mine , can you check the following settings on your car and let me know ?

Privacy Settings

Thanks for the info :)
I have it set for "Public" (Sharing data and vehicle position), so all data should be sent to their servers.

I have noticed that location data is not included anymore. Several months ago, location data was sent but it was always out by just over 3 miles to the southwest of the actual location.
 

·
Registered
Joined
·
63 Posts
Discussion Starter · #11 ·
I have it set for "Public" (Sharing data and vehicle position), so all data should be sent to their servers.

I have noticed that location data is not included anymore. Several months ago, location data was sent but it was always out by just over 3 miles to the southwest of the actual location.
Thanks for checking. All the other forums ive checked confirm location data is missing. That feature would be so useful . I could setup a geo-fence round the house and triggers events as I got close.
 

·
Registered
Corsa-e 2020
Joined
·
1,006 Posts
This a part of a log I copied back in March/April and you can see the location data was in use at that time:

PHP:
vehicles =         {
            href = "https://api.groupe-psa.com/connectedcar/v4/user/
vehicles/
1566c684c5655686153316861544451784e6a59784e6a636a493251334d474e6a4d5
74533597a59314d4441784e7a466b4e6a5a6d4d575a6c4d54426d4d7a63334d7a497
7596a466d5a575a6c5a6a67334f446b314d4455315a5449784e6a686b5a574a694e6
a59795a444e6b596a673d";
}; };
    battery =     {
        createdAt = "2021-03-30T06:44:32Z";
        current = 0;
        voltage = "63.5";

};
createdAt = "2021-04-01T09:46:08Z";
 energy =
(
    {
autonomy = 220;
charging =             {
    chargingMode = No;
    nextDelayedTime = PT13H30M;
    plugged = 0;
    status = Disconnected;
};
level = 100;
type = Electric;
updatedAt = "2021-04-01T09:46:09Z";
} );
kinetic =     {
    createdAt = "2021-03-23T16:11:43Z";
    moving = 0;
};
lastPosition =     {
    geometry =
        coordinates =
{
(
        "1.09211",
        "52.03812",
        11
);
    type = Point;
};
properties =
    signalQuality = 7;
    type = Aquire;
    updatedAt = "2021-03-23T16:11:43Z";
};
    type = Feature;
};
preconditionning =
    airConditioning =
programs =
{
{
{
(
{ enabled = 0;
occurence =
    day =
{
(
        Mon,
        Tue,
        Wed,
        Thu,
        Fri
); };
    recurrence = Daily;
    slot = 2;
    start = PT8H;
}

            );
            status = Disabled;
            updatedAt = "2021-04-01T09:46:05Z";
}; };
    privacy =     {
        createdAt = "2021-04-01T09:46:09Z";
        state = None;
};
service = {
        type = Electric;
        updatedAt = "2020-09-16T07:10:12Z";
    };
    "timed.odometer" =     {
        createdAt = "<null>";
        mileage = "7592.3";
};
    updatedAt = "2021-04-01T09:46:08Z";
}
2021-04-12 11:02:11:802 <INFO>    LRRManager.m:168 : LongRangeRemote
- getLEVInformationWithOldInfos:success:failure = success
2021-04-12 11:02:11:802 <ERROR>   BDCHttpManager.m:169 :
 
1 - 12 of 12 Posts
Top