G-Two / homeassistant-subaru

Subaru STARLINK custom component for Home Assistant.
Apache License 2.0
54 stars 6 forks source link

v0.7.0 #67

Closed G-Two closed 1 year ago

G-Two commented 1 year ago

Breaking Changes

New Features

Bug Fixes

christophermichaelshaw commented 1 year ago

@G-Two Thanks so much for your quick response and update!

As a point of clarification, which will hopefully prevent a deluge of questions for you:

1) Given the sensors that are now being removed, which I'm assuming are API calls no longer being functional -- is there a chance that I'm wrong and they need to be reimplemented?

2) If the API calls are being closed off, do we have a technical contact at Subaru we can ping about setting up an API gateway/cache server to reduce traffic (I'm assuming this is the motivation for the reduction of available API calls).

3) How can we help support the project further? And also help support you?

neebski commented 1 year ago

@G-Two Thanks so much for your quick response and update!

As a point of clarification, which will hopefully prevent a deluge of questions for you:

  1. Given the sensors that are now being removed, which I'm assuming are API calls no longer being functional -- is there a chance that I'm wrong and they need to be reimplemented?
  2. If the API calls are being closed off, do we have a technical contact at Subaru we can ping about setting up an API gateway/cache server to reduce traffic (I'm assuming this is the motivation for the reduction of available API calls).
  3. How can we help support the project further? And also help support you?

Genuinely curious as to what their reasoning is to remove sensors. I'm paying for this service so I'd expect additional sensors not fewer.

stboch commented 1 year ago

@G-Two Thanks so much for your quick response and update!

As a point of clarification, which will hopefully prevent a deluge of questions for you:

1) Given the sensors that are now being removed, which I'm assuming are API calls no longer being functional -- is there a chance that I'm wrong and they need to be reimplemented? These are sensors that were never exposed to the mysubaru app. And given the current issues with batteries and Subaru I think they are likely removing them to reduce the updates.

2) If the API calls are being closed off, do we have a technical contact at Subaru we can ping about setting up an API gateway/cache server to reduce traffic (I'm assuming this is the motivation for the reduction of available API calls). This is in unofficial connection using reverse engineering. I doubt Subaru would be responsive to our requests.

3) How can we help support the project further? And also help support you? I'll leave this to @G-Two but testing and providing debugs when problems occur is the best value.

G-Two commented 1 year ago

@G-Two Thanks so much for your quick response and update! As a point of clarification, which will hopefully prevent a deluge of questions for you:

  1. Given the sensors that are now being removed, which I'm assuming are API calls no longer being functional -- is there a chance that I'm wrong and they need to be reimplemented? These are sensors that were never exposed to the mysubaru app. And given the current issues with batteries and Subaru I think they are likely removing them to reduce the updates.
  2. If the API calls are being closed off, do we have a technical contact at Subaru we can ping about setting up an API gateway/cache server to reduce traffic (I'm assuming this is the motivation for the reduction of available API calls). This is in unofficial connection using reverse engineering. I doubt Subaru would be responsive to our requests.
  3. How can we help support the project further? And also help support you? I'll leave this to @G-Two but testing and providing debugs when problems occur is the best value.

@christophermichaelshaw unfortunately Subaru isn't providing the data for the battery voltage or temperature anymore, so there isn't much we can do client side.

@neebski I don't know what the Subaru developers' motivation was to removing the data from being reported (the vehicles are still certainly reporting it). But since the official mobile app never used this data, they may just have decided that the consumer didn't need it. As @stboch mentioned, this is all an unofficial project and Subaru isn't likely to do anything to help consumers access their vehicle data.

The best way to help is to test pre-releases and report issues. With v0.7.0rc1, I've added detailed device diagnostics which will help troubleshoot issues and better understand what data Subaru is providing. It takes the raw API responses from Subaru, redacts personal/identifying info, and dumps the content so we can see what data is available.

Here's an example snippet that shows my values from the GET vehicleStatus.json request:

      "vehicleStatus": {
        "success": true,
        "errorCode": null,
        "dataName": null,
        "data": {
          "vhsId": "**REDACTED**",
          "odometerValue": "**REDACTED**",
          "odometerValueKilometers": "**REDACTED**",
          "eventDate": 1669658919000,
          "eventDateStr": "2022-11-28T18:08+0000",
          "latitude": "**REDACTED**",
          "longitude": "**REDACTED**",
          "positionHeadingDegree": "261",
          "tirePressureFrontLeft": "2600",
          "tirePressureFrontRight": "2700",
          "tirePressureRearLeft": "2650",
          "tirePressureRearRight": "2650",
          "tirePressureFrontLeftPsi": "37.71",
          "tirePressureFrontRightPsi": "39.16",
          "tirePressureRearLeftPsi": "38.44",
          "tirePressureRearRightPsi": "38.44",
          "distanceToEmptyFuelMiles": 529.41,
          "distanceToEmptyFuelKilometers": 852,
          "avgFuelConsumptionMpg": 52.3,
          "avgFuelConsumptionLitersPer100Kilometers": 4.5,
          "evStateOfChargePercent": 14,
          "evDistanceToEmptyMiles": 529.41,
          "evDistanceToEmptyKilometers": 852,
          "evDistanceToEmptyByStateMiles": null,
          "evDistanceToEmptyByStateKilometers": null,
          "vehicleStateType": "IGNITION_OFF",
          "windowFrontLeftStatus": "VENTED",
          "windowFrontRightStatus": "VENTED",
          "windowRearLeftStatus": "UNKNOWN",
          "windowRearRightStatus": "UNKNOWN",
          "windowSunroofStatus": "UNKNOWN",
          "tyreStatusFrontLeft": "UNKNOWN",
          "tyreStatusFrontRight": "UNKNOWN",
          "tyreStatusRearLeft": "UNKNOWN",
          "tyreStatusRearRight": "UNKNOWN",
          "remainingFuelPercent": null,
          "distanceToEmptyFuelMiles10s": 530,
          "distanceToEmptyFuelKilometers10s": 850
        }
      },

As you can see, remainingFuelPercent would be a great thing to have supported if the value was ever populated (it never is for my 2019 Crosstrek). If an owner of a newer vehicle were to see that field populated with a reasonable value, it would be pretty easy to add as another sensor. 2023 models seem like they have more advanced telematics features, so owners of those vehicles may find more data is available. This new detailed diagnostics output should help with their discovery.

tango2590 commented 1 year ago

FWIW, I have a 2020 Crosstrek and I'm getting similar data as you (minus the EV stuff). remainingFuelPercent remains null for me as well. Window statuses also do not change, regardless of the window positions (only tested the front 2 and the sunroof). I do have additional data for my doors, however, that are not listed with yours (as well as remote start climate preset data, which is pretty useless). Here is what I have that includes the doors (I included the MILs as well, in case it may help with issue #55)

    "data": [
      {
        "modelYear": "2020",
        "modelName": "Crosstrek",
        "nickname": "**REDACTED**",
        "features": [
          "ABS_MIL",
          "ACCS",
          "ATF_MIL",
          "AWD_MIL",
          "BSD",
          "BSDRCT_MIL",
          "CEL_MIL",
          "EBD_MIL",
          "EOL_MIL",
          "EPAS_MIL",
          "ESS_MIL",
          "EYESIGHT",
          "ISS_MIL",
          "OPL_MIL",
          "RCC",
          "RES",
          "RESCC",
          "SRS_MIL",
          "TEL_MIL",
          "TIF_33",
          "TIR_32",
          "TPMS_MIL",
          "VDC_MIL",
          "WASH_MIL",
          "g2"
        ],
        "subscriptionFeatures": [
          "REMOTE",
          "SAFETY",
          "Retail"
        ],
        "subscriptionStatus": "ACTIVE",
        "status": {
          "ODOMETER": "**REDACTED**",
          "TIMESTAMP": "2022-12-10T06:35:33+00:00",
          "AVG_FUEL_CONSUMPTION": 8.9,
          "DISTANCE_TO_EMPTY_FUEL": 353,
          "VEHICLE_STATE_TYPE": "IGNITION_OFF",
          "TYRE_PRESSURE_FRONT_LEFT": 0,
          "TYRE_PRESSURE_FRONT_RIGHT": 0,
          "TYRE_PRESSURE_REAR_LEFT": 0,
          "TYRE_PRESSURE_REAR_RIGHT": 0,
          "location_valid": true,
          "LONGITUDE": "**REDACTED**",
          "LATITUDE": "**REDACTED**",
          "HEADING": null,
          "DOOR_BOOT_POSITION": "CLOSED",
          "DOOR_ENGINE_HOOD_POSITION": "CLOSED",
          "DOOR_FRONT_LEFT_POSITION": "CLOSED",
          "DOOR_FRONT_RIGHT_POSITION": "CLOSED",
          "DOOR_REAR_LEFT_POSITION": "CLOSED",
          "DOOR_REAR_RIGHT_POSITION": "CLOSED",
          "REMAINING_FUEL_PERCENT": null,
          "LAST_UPDATED_DATE": "2022-12-10T06:35:33+0000",
          "WINDOW_FRONT_LEFT_STATUS": "VENTED",
          "WINDOW_FRONT_RIGHT_STATUS": "VENTED",
          "WINDOW_REAR_LEFT_STATUS": "UNKNOWN",
          "WINDOW_REAR_RIGHT_STATUS": "UNKNOWN",
          "WINDOW_SUNROOF_STATUS": "UNKNOWN"
        },
G-Two commented 1 year ago

I think in order for a particular Subaru to report window state, it needs to have the feature PWAAADWWAP. For sunroof state, it needs to have either PANPM-TUIRWAOC or PANPM-DG2G. This is from looking at the official Android app:

// APK file: assets/www/app/pages/vehicleDiagnostics.js
function VehicleDiagnosticsPage() {
  var windowCount,
      tireCount;
    this.onCreate = function (pd) {
    if(jQuery.inArray( "g1", app.$sessionData.getCurrentVehicle().features ) > -1) {
      jqmHelper.loadPage('vehicleHealth');
    }
    var lastUpdatedDate;
    var timeZone = app.$sessionData.getCurrentVehicle().timeZone; 
    var collapse_headings;
    var llError = false;
    var hasMoonroofPanaromic = jQuery.inArray("PANPM-DG2G", app.$sessionData.getCurrentVehicle().features) >= 0;
    var hasMoonroofPower = jQuery.inArray("PANPM-TUIRWAOC", app.$sessionData.getCurrentVehicle().features) >= 0;
    var hasPowerWindows = jQuery.inArray("PWAAADWWAP", app.$sessionData.getCurrentVehicle().features) >= 0;