Mobile SDK

iOS or Android

    SDK Features - Remote Commands

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

    Security: Remote Commands 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.

    With Stellantis Connected Vehicles SDK for ex Groupe PSA brands (Citroën, DS, Peugeot, Opel and Vauxhall) you can remote control a vehicle using internet connection, no need to be next to the vehicle.

    They are 3 commands available only for Low Emission Vehicles (LEV) and Electric Vehicles (EV):

    • 🔌 Start/stop charge.
    • 🔌⏰ Scheduled charge.
    • ❄️ Program preconditioning.

    And 3 commands available for all eligible vehicles:

    • 🔓 Lock/unlock doors.
    • 🔉 Honk the horn.
    • 💡 Set a light blinking.

    Subscribe to Signal Events #

    First, you should subscribe to pims.vehicle.signal. This API is helpful in order to track the progress of remote command send to the vehicle. Each time the vehicle status is updated, this API will return an event.

    Info: Subscribing to signal events will not send any remote command to the vehicle. But subscribing to these events allows being informed of the remote command status!

    1
    2
    3
    4
    5
    6
    
    /* Subscribe, see unsubscribe below */
    pims.subscribe("pims.vehicle.signal"
    ) { message -> /* handle message */ }
    
    /* Unsubscribe */
    pims.unsubscribe( "pims.vehicle.signal" /* no params */ )
    
    1
    2
    3
    4
    5
    6
    
    /* Subscribe, see unsubscribe below */
    pims.subscribe(api: "pims.vehicle.signal"
    ) { (message) in /* handle message */ }
    
    /* Unsubscribe */
    pims.unsubscribe( api: "pims.vehicle.signal" /* 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
    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    
    // representation of the `result` dictionary object message as JSON
    {
      "transactionId": "953cfefb-bc72",
      "status": "RESULT",
      "result": {
        "code": 200,
        "resources": {
          "status": {
            "autonomy":145.0, "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": {
              "isRearRightDoorOpened":false, "isTrunkDoorOpened":false, "isLocked":true,
              "isRearWindowDoorOpened":false, "isPassengerDoorOpened":false,
              "isRearLeftDoorOpened":false, "state": ["trunkLocked", "locked"],
              "isDriverDoorOpened":false
            },
            "precondInformation": {
              "lastUpdate":"2022-02-14T13':'41':57Z",
              "precondScheduling": [
                { "hour":1, "isEnabled":false,
                  "occurrence": ["mon"], "slot":1, "minute":48 }
                { /*another Precond*/ } 
              ],
              "status":"disabled"
            },
            "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",
              "consumption":0.0, "type":"electric"
            },
            "vehicleType":"hybrid"
          }
        },
        "attributes": {
          "engine":"phev", "vin":"VR3ATTENTKY102274", "brand":"peugeot"
        }
      }
    }
    

    false

    Then you need to set a vehicle before sending a remote command.

    Set a Vehicle #

    In order to send a remote command, you must set the VIN of the targeted vehicle.

    1
    2
    3
    4
    5
    6
    
    pims.set("pims.vehicle.vin ",
      mapOf( /* parameters */
      "vin": "VR1AB12C3D45678909"
      )
    ) { message -> /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    
    pims.set(api: "pims.vehicle.vin ", 
      parameters: [
      Pair("vin", "VR1AB12C3D45678909")
      ]
    ) { (message) in /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    
    // representation of the `succeeded` dictionary object message as JSON
    {
      "transactionId": "953cfefb-bc72",
      "status": "SUCCEEDED",
      "result": null
    }
    

    false

    Send a Remote Command #

    Sending a remote command is done using pims.vehicle.command. Make sure you have set a vehicle before sending the command.

    You can follow the remote command status by subscribing to pims.vehicle.signal.

    ❄️ Program preconditioning #

    This remote command is only available for Low Emission Vehicles (LEV) and Electric Vehicles (EV).

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    
    pims.set("pims.vehicle.command",
      mapOf( /* parameters */
      "action": "preconditioning",
      "startNow": false,
      "programs": [
        [
          "hour": 9,
          "minute": 32,
          "isEnabled": true,
          "occurence": ["mon", "tue"],
          "slot": 1
        ],
        [
          "hour": 10,
          "minute": 52,
          "isEnabled": false,
          "occurence": ["wen", "thu"],
          "slot": 2
        ]
      ]
      )
    ) { message -> /* 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
    
    pims.set(api: "pims.vehicle.command", 
      parameters: [
      Pair("action", "preconditioning"),
      Pair("startNow", false),
      Pair("programs", mapOf(
        mapOf(
          Pair("hour", 9),
          Pair("minute", 32),
          Pair("isEnabled", true),
          Pair("occurence", mapOf("mon", "tue")),
          Pair("slot", 1),
        )
        mapOf(
          Pair("hour", 10),
          Pair("minute", 52),
          Pair("isEnabled", false),
          Pair("occurence", mapOf("wen", "thu")),
          Pair("slot", 2),
        )
      )),
      ]
    ) { (message) in /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    
    // representation of the `succeeded` dictionary object message as JSON
    {
      "transactionId": "953cfefb-bc72",
      "status": "SUCCEEDED",
      "result": null
    }
    

    false

    🔌 Start charge #

    This remote command is only available for Low Emission Vehicles (LEV) and Electric Vehicles (EV).

    1
    2
    3
    4
    5
    6
    7
    
    pims.set("pims.vehicle.command",
      mapOf( /* parameters */
      "action": "charge"
      "startNow": "true"
      )
    ) { message -> /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    7
    
    pims.set(api: "pims.vehicle.command", 
      parameters: [
      Pair("action", "charge"),
      Pair("startNow", "true")
      ]
    ) { (message) in /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    
    // representation of the `succeeded` dictionary object message as JSON
    {
      "transactionId": "953cfefb-bc72",
      "status": "SUCCEEDED",
      "result": null
    }
    

    false

    In order to retieve information about of a end of charge, you can use pims.vehicle.event - remote.

    ⏱🔌 Scheduled charge #

    This remote command is only available for Low Emission Vehicles (LEV) and Electric Vehicles (EV).

    Scheduled Charge & Immediate Charge: immediate charging can interfere on scheduled charges.

    • 2335 is returned when “Immediate charging request discarded, deferred hour has been change”.
    • 2336 is returned when “Deferred hour request discarded, immediate charging has been launch”.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    pims.set("pims.vehicle.command",
      mapOf( /* parameters */
      "action": "chargeDeferredTime",
      "startNow": "false",
      "deferredTime": "PTxxHxxM",
      "checkStartCharge": true
      )
    ) { message -> /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    pims.set(api: "pims.vehicle.command", 
      parameters: [
      Pair("action", "chargeDeferredTime"),
      Pair("startNow", "false"),
      Pair("deferredTime", "PTxxHxxM"),
      Pair("checkStartCharge", true)
      ]
    ) { (message) in /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    
    // representation of the `succeeded` dictionary object message as JSON
    {
      "transactionId": "953cfefb-bc72",
      "status": "SUCCEEDED",
      "result": null
    }
    

    false

    In order to retieve information about of a charge (start & end), you can use pims.vehicle.event - remote.

    🔓 Lock/unlock doors #

    1
    2
    3
    4
    5
    6
    7
    
    pims.set("pims.vehicle.command",
      mapOf( /* parameters */
      "action": "doors",
      "doorState": "lock"
      )
    ) { message -> /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    7
    
    pims.set(api: "pims.vehicle.command", 
      parameters: [
      Pair("action", "doors"),
      Pair("doorState", "lock")
      ]
    ) { (message) in /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    
    // representation of the `succeeded` dictionary object message as JSON
    {
      "transactionId": "953cfefb-bc72",
      "status": "SUCCEEDED",
      "result": null
    }
    

    false

    🔉 Honk the horn #

    1
    2
    3
    4
    5
    6
    
    pims.set("pims.vehicle.command",
      mapOf( /* parameters */
      "action": "horn"
      )
    ) { message -> /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    
    pims.set(api: "pims.vehicle.command", 
      parameters: [
      Pair("action", "horn")
      ]
    ) { (message) in /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    
    // representation of the `succeeded` dictionary object message as JSON
    {
      "transactionId": "953cfefb-bc72",
      "status": "SUCCEEDED",
      "result": null
    }
    

    false

    💡 Set a light blinking #

    1
    2
    3
    4
    5
    6
    
    pims.set("pims.vehicle.command",
      mapOf( /* parameters */
      "action": "warning"
      )
    ) { message -> /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    
    pims.set(api: "pims.vehicle.command", 
      parameters: [
      Pair("action", "warning")
      ]
    ) { (message) in /* handle message */ }
    
    1
    2
    3
    4
    5
    6
    
    // representation of the `succeeded` dictionary object message as JSON
    {
      "transactionId": "953cfefb-bc72",
      "status": "SUCCEEDED",
      "result": null
    }
    

    false