Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Changes in App behaviour / data requests | REL: #724 #725

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
- [Data](vehicle/state/data.md)
- [Charge State](vehicle/state/chargestate.md)
- [Climate State](vehicle/state/climatestate.md)
- [Closures State](vehicle/state/closuresstate.md)
- [Drive State](vehicle/state/drivestate.md)
- [GUI Settings](vehicle/state/guisettings.md)
- [Location State](vehicle/state/locationstate.md)
- [Vehicle State](vehicle/state/vehiclestate.md)
- [Vehicle Config](vehicle/state/vehicleconfig.md)
- [Mobile Enabled](vehicle/state/mobileenabled.md)
- [Vehicle Data Combo](vehicle/state/vehicledatacombo.md)
- [Nearby Charging Sites](vehicle/state/nearbychargingsites.md)
- [Miscellaneous](vehicle/state/misc.md)
- [Commands](vehicle/commands/README.md)
Expand Down
32 changes: 24 additions & 8 deletions docs/vehicle/state/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@
description: These endpoints give the state of the various subsystems of the car.
---

# State
# Vehicle State

{% page-ref page="data.md" %}
## A rollup of the `vehicle_data` data endpoint and its sub-categories.

Following the depraction of all `data_request` endpoints in favor of the `vehicle_data` endpoint, the app has been observed to use the `vehicle_data` endpoint in combination with the `endpoints` parameter to request the same data, which the old `data_request` sub-category endpoints would have returned.

To request the same chunks of data as you would with the old `data_request` endpoints, use the `vehicle_data` endpoint with the `endpoints` parameter like below:

```
GET /api/1/vehicles/{id}/vehicle_data?endpoints={endpoints}
```

{% hint style='warning' %}
All `data_request` endpoints have been deprecated in favor of the `vehicle_data` endpoint. All of the data they return is found in the response of `vehicle_data` within sub-categories and the documentation of these/what the different fields mean, still applies.
{% endhint %}
You can also specify multiple endpoints by separating them with semi-colons.

A rollup of all the `data_request` endpoints plus vehicle configuration.
The responses and documentation for each of these parameters are found in the following pages below:

{% page-ref page="data.md" %}
The base endpoint with all data.

{% page-ref page="chargestate.md" %}

Expand All @@ -20,6 +29,9 @@ Information on the state of charge in the battery and its various settings.

Information on the current internal temperature and climate control system.

{% page-ref page="closuresstate.md" %}
Currently unknown.

{% page-ref page="drivestate.md" %}

Returns the driving and position state of the vehicle.
Expand All @@ -28,6 +40,9 @@ Returns the driving and position state of the vehicle.

Returns various information about the GUI settings of the car, such as unit format and range display.

{% page-ref page="locationstate.md" %}
Currently unknown.

{% page-ref page="vehiclestate.md" %}

Returns the vehicle's physical state, such as which doors are open.
Expand All @@ -36,9 +51,10 @@ Returns the vehicle's physical state, such as which doors are open.

Returns the vehicle's configuration information including model, color, badging and wheels.

{% page-ref page="mobileenabled.md" %}
{% page-ref page="vehicledatacombo.md" %}
Returns a combination of the above endpoints and a `vehicle_data` field which contains what appears to be base64 encoded data.

Lets you know if the Mobile Access setting is enabled in the car.
## Other data/state endpoints

{% page-ref page="nearbychargingsites.md" %}

Expand Down
131 changes: 71 additions & 60 deletions docs/vehicle/state/chargestate.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Charge State

{% hint style='warning' %}
This endpoint was deprecated and returns 404.
{% endhint %}

## GET `/api/1/vehicles/{id}/data_request/charge_state`
## GET `/api/1/vehicles/{id}/vehicle_data?endpoints=charge_state`

Information on the state of charge in the battery and its various settings.

Expand All @@ -13,61 +9,76 @@ Information on the state of charge in the battery and its various settings.
```json
{
"response": {
"battery_heater_on": false,
"battery_level": 90,
"battery_range": 224.47,
"charge_amps": 12,
"charge_current_request": 40,
"charge_current_request_max": 40,
"charge_enable_request": true,
"charge_energy_added": 29.41,
"charge_limit_soc": 90,
"charge_limit_soc_max": 100,
"charge_limit_soc_min": 50,
"charge_limit_soc_std": 90,
"charge_miles_added_ideal": 118.5,
"charge_miles_added_rated": 95.0,
"charge_port_cold_weather_mode": null,
"charge_port_color": "<invalid>",
"charge_port_door_open": true,
"charge_port_latch": "Engaged",
"charge_rate": 0.0,
"charge_to_max_range": false,
"charger_actual_current": 0,
"charger_phases": null,
"charger_pilot_current": 40,
"charger_power": 0,
"charger_voltage": 0,
"charging_state": "Complete",
"conn_charge_cable": "SAE",
"est_battery_range": 171.24,
"fast_charger_brand": "<invalid>",
"fast_charger_present": false,
"fast_charger_type": "<invalid>",
"ideal_battery_range": 280.59,
"managed_charging_active": false,
"managed_charging_start_time": null,
"managed_charging_user_canceled": false,
"max_range_charge_counter": 0,
"minutes_to_full_charge": 0,
"not_enough_power_to_heat": false,
"off_peak_charging_enabled": false,
"off_peak_charging_times": "all_week",
"off_peak_hours_end_time": 360,
"preconditioning_enabled": false,
"preconditioning_times": "all_week",
"scheduled_charging_mode": "Off",
"scheduled_charging_pending": false,
"scheduled_charging_start_time": null,
"scheduled_charging_start_time_app": 665,
"scheduled_departure_time": 1652090400,
"scheduled_departure_time_minutes": 720,
"supercharger_session_trip_planner": false,
"time_to_full_charge": 0.0,
"timestamp": 1604977209418,
"trip_charging": false,
"usable_battery_level": 90,
"user_charge_enable_request": null
"id": 1234567890123,
"user_id": 1234,
"vehicle_id": 1234567890123,
"vin": "7SA...",
"display_name": "Nikola",
"option_codes": null,
"color": null,
"access_type": "OWNER",
"tokens": ["abc123", "abc123"],
"state": "online",
"in_service": false,
"id_s": "1234567890123",
"calendar_enabled": true,
"api_version": 57,
"backseat_token": null,
"backseat_token_updated_at": null,
"ble_autopair_enrolled": false,
"charge_state": {
"battery_heater_on": false,
"battery_level": 44,
"battery_range": 141.56,
"charge_amps": 24,
"charge_current_request": 24,
"charge_current_request_max": 24,
"charge_enable_request": true,
"charge_energy_added": 35.49,
"charge_limit_soc": 100,
"charge_limit_soc_max": 100,
"charge_limit_soc_min": 50,
"charge_limit_soc_std": 90,
"charge_miles_added_ideal": 102.0,
"charge_miles_added_rated": 127.5,
"charge_port_cold_weather_mode": null,
"charge_port_color": "Off",
"charge_port_door_open": false,
"charge_port_latch": "Blocking",
"charge_rate": 0.0,
"charger_actual_current": 0,
"charger_phases": null,
"charger_pilot_current": 24,
"charger_power": 0,
"charger_voltage": 0,
"charging_state": "Disconnected",
"conn_charge_cable": "<invalid>",
"est_battery_range": 69.59,
"fast_charger_brand": "<invalid>",
"fast_charger_present": false,
"fast_charger_type": "<invalid>",
"ideal_battery_range": 113.38,
"max_range_charge_counter": 1,
"minutes_to_full_charge": 0,
"not_enough_power_to_heat": false,
"off_peak_charging_enabled": false,
"off_peak_charging_times": "all_week",
"off_peak_hours_end_time": 360,
"preconditioning_enabled": false,
"preconditioning_times": "weekdays",
"scheduled_charging_mode": "Off",
"scheduled_charging_pending": false,
"scheduled_charging_start_time": null,
"scheduled_charging_start_time_app": 0,
"scheduled_departure_time": 1671166800,
"scheduled_departure_time_minutes": 360,
"supercharger_session_trip_planner": false,
"time_to_full_charge": 0.0,
"timestamp": 1685477952460,
"trip_charging": false,
"usable_battery_level": 44,
"user_charge_enable_request": null
}
}
}
```
92 changes: 55 additions & 37 deletions docs/vehicle/state/climatestate.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Climate State

{% hint style='warning' %}
This endpoint was deprecated and returns 404.
{% endhint %}

## GET `/api/1/vehicles/{id}/data_request/climate_state`
## GET `/api/1/vehicles/{id}/vehicle_data?endpoints=climate_state`

Information on the current internal temperature and climate control system.

Expand All @@ -13,38 +9,60 @@ Information on the current internal temperature and climate control system.
```json
{
"response": {
"allow_cabin_overheat_protection": true,
"auto_seat_climate_left": true,
"auto_seat_climate_right": false,
"battery_heater": false,
"battery_heater_no_power": false,
"cabin_overheat_protection": "FanOnly",
"cabin_overheat_protection_actively_cooling": false,
"climate_keeper_mode": "off",
"cop_activation_temperature": "High",
"defrost_mode": 0,
"driver_temp_setting": 22.8,
"fan_status": 0,
"hvac_auto_request": "On",
"inside_temp": 27.0,
"is_auto_conditioning_on": false,
"is_climate_on": false,
"is_front_defroster_on": false,
"is_preconditioning": false,
"is_rear_defroster_on": false,
"left_temp_direction": -232,
"max_avail_temp": 28.0,
"min_avail_temp": 15.0,
"outside_temp": 23.0,
"passenger_temp_setting": 22.8,
"remote_heater_control_enabled": false,
"right_temp_direction": -232,
"seat_heater_left": 0,
"seat_heater_right": 0,
"side_mirror_heaters": false,
"supports_fan_only_cabin_overheat_protection": true,
"timestamp": 1604977244530,
"wiper_blade_heater": false
"id": 1234567890123,
"user_id": 1234,
"vehicle_id": 1234567890123,
"vin": "7SA...",
"display_name": "Nikola",
"option_codes": null,
"color": null,
"access_type": "OWNER",
"tokens": ["abc123", "abc123"],
"state": "online",
"in_service": false,
"id_s": "1234567890123",
"calendar_enabled": true,
"api_version": 57,
"backseat_token": null,
"backseat_token_updated_at": null,
"ble_autopair_enrolled": false,
"climate_state": {
"allow_cabin_overheat_protection": false,
"battery_heater": false,
"battery_heater_no_power": false,
"bioweapon_mode": false,
"cabin_overheat_protection": "Off",
"climate_keeper_mode": "off",
"cop_activation_temperature": "High",
"defrost_mode": 0,
"driver_temp_setting": 15.0,
"fan_status": 0,
"hvac_auto_request": "Override",
"inside_temp": 22.0,
"is_auto_conditioning_on": false,
"is_climate_on": false,
"is_front_defroster_on": false,
"is_preconditioning": false,
"is_rear_defroster_on": false,
"left_temp_direction": -160,
"max_avail_temp": 28.0,
"min_avail_temp": 15.0,
"outside_temp": 18.5,
"passenger_temp_setting": 15.0,
"remote_heater_control_enabled": false,
"right_temp_direction": -160,
"seat_heater_left": 0,
"seat_heater_rear_left": 0,
"seat_heater_rear_right": 0,
"seat_heater_right": 0,
"seat_heater_third_row_left": 0,
"seat_heater_third_row_right": 0,
"side_mirror_heaters": false,
"steering_wheel_heater": false,
"supports_fan_only_cabin_overheat_protection": false,
"timestamp": 1685478078500,
"wiper_blade_heater": false
}
}
}
```
31 changes: 31 additions & 0 deletions docs/vehicle/state/closuresstate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Closures State

## GET `/api/1/vehicles/{id}/vehicle_data?endpoints=closures_state`

Currently unknown, as it only returns the 'top level' data.

### Response

```json
{
"response": {
"id": 1234567890123,
"user_id": 1234,
"vehicle_id": 1234567890123,
"vin": "7SA...",
"display_name": "Nikola",
"option_codes": null,
"color": null,
"access_type": "OWNER",
"tokens": ["abc123", "abc123"],
"state": "online",
"in_service": false,
"id_s": "1234567890123",
"calendar_enabled": true,
"api_version": 57,
"backseat_token": null,
"backseat_token_updated_at": null,
"ble_autopair_enrolled": false
}
}
```
2 changes: 1 addition & 1 deletion docs/vehicle/state/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## GET `/api/1/vehicles/{id}/vehicle_data`

A rollup of all the `data_request` endpoints plus vehicle configuration.
The base endpoint which returns all vehicle data.

_Note:_ all `*_range` values are in miles, irrespective of GUI configuration.

Expand Down
Loading