Mobile SDK

iOS or Android

SDK Features - Vehicle Status

Info: Stellantis Mobile SDK for ex Groupe PSA brands (Citroรซn, DS, Peugeot, Opel and Vauxhall) is not publicly available yet.

Security: Vehicle Status require the following security schemes to be valid

Connectivity: this feature is available usingย ๐Ÿ“ก Cellular network over-the-air

  • ๐Ÿš— The vehicle should be able to access internet.
  • ๐Ÿ“ฑ The device should be able to access internet.

References: check-out ๐Ÿš— Vehicle Status component list of APIs.

Vehicle Information is a set of data including VIN, vehicle brand, precond info, fuel info, electric info and door state. These data are available in Mobile SDK using internet connection ๐Ÿ“ก, no need to be next to the vehicle!

Depending on the vehicle capabilities, some fields of the vehicle informations can be null.

When the vehicle is awake, it will refresh these data on a regular basis on Stellantis servers. This tutorial explains how to access theses informations with pims.vehicle.informations.

They are different way to query vehicle information data:

  • โฌ‡๏ธ Get: a command requesting data from Stellantis server, if there is a connection issue with the server, it will return cache data.
  • ๐Ÿ”„ Refresh: this command will request the latest information available in Stellantis server. It will send a wake-up command only if the charging state is in progress or if the vehicle is plugged and charging state is disconnected.

โฌ‡๏ธ Get #

Using the get parameter you will retrieve the latest information from the server, but if the server is not available then you will receive information from the mobile phone cache:

1
2
3
4
5
6
7
pims.get("pims.vehicle.informations",
  mapOf( /* parameters */
  Pair("actionType", "remote"),
  Pair("action", "get")
  )
) { message -> /* handle message */ }
1
2
3
4
5
6
7
pims.get(api: "pims.vehicle.informations", 
  parameters: [
  "actionType": "remote",
  "action": "get"
  ]
) { (message) in /* handle message */ }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// representation of the `succeeded` dictionary object message as JSON
{
  "transactionId": "953cfefb-bc72",
  "status": "SUCCEEDED",
  "result": {
      "resources": {
        "status": {
          "lastUpdate": "2022-02-14T13':'41':58Z",
          "fuelInformation": {
            "autonomy":145.0,
            "chargingInformation": {
              "chargingMode": null, "chargingRate":0.0, "isPlugged":false,
              "chargingState": null, "remainingTime": "PT0S" },
            "chargingLevel":42.0, "lastUpdate": "2022-02-14T13':'41':57Z",
            "consumption":0.0, "type": "fuel" },
          "doorStateInformation": {
            "isDriverDoorOpened": false, "isPassengerDoorOpened": false,
            "isRearLeftDoorOpened": false, "isRearRightDoorOpened": false,
            "isRearWindowOpened": false, "isRoofWindowOpened": false, "isTrunkOpened": false,
            "state": [ "Locked" ] },
          "precondInformation": {
            "lastUpdate": "2022-02-14T13':'41':57Z", "status": "disabled",
            "precondScheduling": [
              { "hour":1, "isEnabled":false, "occurence": ["Mon"],
                "slot":1, "recurrence": "Daily", "minute":48 },
              { "hour": 12, "isEnabled": false, "minute": 12,
                "occurence": ["Wed"], "recurrence": "Daily", "slot": 2 } ] },
          "electricInformation": { "autonomy":0.0,
            "chargingInformation": {
              "chargingMode": "no", "chargingRate":0.0, "isPlugged":false,
              "nextDeferredChargingDate": "2022-02-14T18':'00':10.715Z",
              "chargingState": "disconnected", "remainingTime": "PT0S" },
            "chargingLevel":1.0, "lastUpdate": "2022-02-14T13':'41':57Z", "type": "electric" },
          "vehicleType": "hybrid", "vin": "VR3ATTENTKY102274" } },
      "attributes": {
        "engine": "PHEV", "vin": "VR3ATTENTKY102274", "brand": "peugeot"
      }
    }
}

false

๐Ÿ”„ Refresh #

Refresh parameter will also retrieve the latest information from the server but, if:

  • ressources.status.electricInformation.ChargingInfo.chargingState == 'DISCONNECTED or INPROGRESS'
  • And ressources.status.electricInformation.ChargingInfo.isPlugged == true, then the vehicle will also receive a wake-up command that will refresh the vehicle information.

Error: If the connection with the server is not possible the response will be error 2201: network problem. You can use Get to retrieve cached data.

1
2
3
4
5
6
7
pims.get("pims.vehicle.informations",
  mapOf( /* parameters */
  Pair("actionType", "remote"),
  Pair("action", "refresh")
  )
) { message -> /* handle message */ }
1
2
3
4
5
6
7
pims.get(api: "pims.vehicle.informations", 
  parameters: [
  "actionType": "remote",
  "action": "refresh"
  ]
) { (message) in /* handle message */ }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// representation of the `succeeded` dictionary object message as JSON
{
  "transactionId": "953cfefb-bc72",
  "status": "SUCCEEDED",
  "result": {
      "resources": {
        "status": {
          "lastUpdate": "2022-02-14T13':'41':58Z",
          "fuelInformation": {
            "autonomy":145.0,
            "chargingInformation": {
              "chargingMode": null, "chargingRate":0.0, "isPlugged":false,
              "chargingState": null, "remainingTime": "PT0S" },
            "chargingLevel":42.0, "lastUpdate": "2022-02-14T13':'41':57Z",
            "consumption":0.0, "type": "fuel" },
          "doorStateInformation": {
            "isDriverDoorOpened": false, "isPassengerDoorOpened": false,
            "isRearLeftDoorOpened": false, "isRearRightDoorOpened": false,
            "isRearWindowOpened": false, "isRoofWindowOpened": false, "isTrunkOpened": false,
            "state": [ "Locked" ] },
          "precondInformation": {
            "lastUpdate": "2022-02-14T13':'41':57Z", "status": "disabled",
            "precondScheduling": [
              { "hour":1, "isEnabled":false, "occurence": ["Mon"],
                "slot":1, "recurrence": "Daily", "minute":48 },
              { "hour": 12, "isEnabled": false, "minute": 12,
                "occurence": ["Wed"], "recurrence": "Daily", "slot": 2 } ] },
          "electricInformation": { "autonomy":0.0,
            "chargingInformation": {
              "chargingMode": "no", "chargingRate":0.0, "isPlugged":false,
              "nextDeferredChargingDate": "2022-02-14T18':'00':10.715Z",
              "chargingState": "disconnected", "remainingTime": "PT0S" },
            "chargingLevel":1.0, "lastUpdate": "2022-02-14T13':'41':57Z", "type": "electric" },
          "vehicleType": "hybrid", "vin": "VR3ATTENTKY102274" } },
      "attributes": {
        "engine": "PHEV", "vin": "VR3ATTENTKY102274", "brand": "peugeot"
      }
    }
}

false

๐Ÿ”Œ Charge Events #

When a vehicle is charging, itโ€™s possible to subscribe to events triggered when the charge is finished or interrupted.

This event is triggered when the charge is finished or when the charge is interrupted.

1
2
3
4
5
6
7
8
9
10
/* Subscribe, see unsubscribe below */
pims.subscribe("pims.vehicle.event",
  mapOf( /* parameters */
  Pair("actionType", "remote"),
  Pair("type", mapOf("remoteChargeFinished", "remoteChargeInterrupted"))
  )
) { message -> /* handle message */ }

/* Unsubscribe */
pims.unsubscribe( "pims.vehicle.event" /* no params */ )
1
2
3
4
5
6
7
8
9
10
/* Subscribe, see unsubscribe below */
pims.subscribe(api: "pims.vehicle.event", 
  parameters: [
  "actionType": "remote",
  "type": ["remoteChargeFinished", "remoteChargeInterrupted"]
  ]
) { (message) in /* handle message */ }

/* Unsubscribe */
pims.unsubscribe( api: "pims.vehicle.event" /* no params */ )
1
2
3
4
5
6
// representation of the `succeeded` dictionary object message as JSON
{
  "transactionId": "953cfefb-bc72",
  "status": "SUCCEEDED",
  "result": null
}
1
2
3
4
5
6
7
8
// representation of the `result` dictionary object message as JSON
{
  "transactionId": "953cfefb-bc72",
  "status": "RESULT",
  "result": {
    "notification": "remoteChargeFinished"
  }
}

false