Dielee / volvo2mqtt

Home Assistant addon for connecting AAOS Volvos
MIT License
143 stars 30 forks source link

1.8.15 - API call failed #130

Closed macjuju closed 10 months ago

macjuju commented 10 months ago

Happy to see v1.8.15 - My car (MY24 XC40 BEV, located in Hong Kong, Asia)

This upgrade did not break anything (which is good) but I have some concern about the warning/error reported in the log. After enabled debug log I found more about the error. It is as result of these "v1 API call"?

Nov 21 12:22:58 volvo2mqtt [106] - DEBUG: Starting GET call against https://api.volvocars.com/energy/v1/vehicles/{0}/recharge-status
Nov 21 12:22:59 volvo2mqtt [106] - DEBUG: Response status code: 404

Nov 21 12:23:00 volvo2mqtt [106] - DEBUG: Starting GET call against https://api.volvocars.com/location/v1/vehicles/{0}/location
Nov 21 12:23:00 volvo2mqtt [106] - DEBUG: Response status code: 404

And I found these return 200 code, but still failed. Not sure if it is NOT looking for averageEnergyConsumption and distanceToEmptyBattery on BEV?

Nov 21 12:23:01 volvo2mqtt [106] - INFO: Failed, Average Fuel Consumption is unfortunately not supported by your vehicle.
Nov 21 12:23:01 volvo2mqtt [106] - DEBUG: Response status code: 200
Nov 21 12:23:01 volvo2mqtt [106] - DEBUG: {
  "data" : {
    "averageFuelConsumption" : {
      "value" : 0.0,
      "unit" : "l/100km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "averageEnergyConsumption" : {
      "value" : 19.0,
      "unit" : "kwh/100km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "averageSpeed" : {
      "value" : 34,
      "unit" : "km/h",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "tripMeterManual" : {
      "value" : 3728.1,
      "unit" : "km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "tripMeterAutomatic" : {
      "value" : 35.9,
      "unit" : "km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "distanceToEmptyTank" : {
      "value" : 0,
      "unit" : "km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "distanceToEmptyBattery" : {
      "value" : 320,
      "unit" : "km",
      "timestamp" : "2023-11-21T04:14:02.667Z"
    }
  }
}

Nov 21 12:23:01 volvo2mqtt [106] - INFO: Failed, Distance to Empty is unfortunately not supported by your vehicle.
Nov 21 12:23:01 volvo2mqtt [106] - DEBUG: Response status code: 200
Nov 21 12:23:01 volvo2mqtt [106] - DEBUG: {
  "data" : {
    "averageFuelConsumption" : {
      "value" : 0.0,
      "unit" : "l/100km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "averageEnergyConsumption" : {
      "value" : 19.0,
      "unit" : "kwh/100km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "averageSpeed" : {
      "value" : 34,
      "unit" : "km/h",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "tripMeterManual" : {
      "value" : 3728.1,
      "unit" : "km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "tripMeterAutomatic" : {
      "value" : 35.9,
      "unit" : "km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "distanceToEmptyTank" : {
      "value" : 0,
      "unit" : "km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "distanceToEmptyBattery" : {
      "value" : 320,
      "unit" : "km",
      "timestamp" : "2023-11-21T04:14:02.667Z"
    }
  }
}

Also from https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/diagnostics, i saw washerFluidLevelWarning available. It might be cosmetic, but nice to include on next update. :-)

Nov 21 12:23:01 volvo2mqtt [106] - INFO: Success! Average Speed is supported by your vehicle.
Nov 21 12:23:01 volvo2mqtt [106] - DEBUG: Starting GET call against https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/diagnostics
Nov 21 12:23:01 volvo2mqtt [106] - DEBUG: Response status code: 200
Nov 21 12:23:01 volvo2mqtt [106] - DEBUG: {
  "data" : {
    "serviceWarning" : {
      "value" : "NO_WARNING",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "engineHoursToService" : {
      "value" : 1176,
      "unit" : "h",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "distanceToService" : {
      "value" : 26290,
      "unit" : "km",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "washerFluidLevelWarning" : {
      "value" : "NO_WARNING",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    },
    "timeToService" : {
      "value" : 9,
      "unit" : "months",
      "timestamp" : "2023-11-21T00:52:49.610Z"
    }
  }
}
Dielee commented 10 months ago

The 404 are currently issues with the energy API. Please check the "API Backend Status" Sensor. Location isn't available at China.

I will check the average values, there is maybe some optimization potential. Also I will add the washer fluid sensor.

Dielee commented 10 months ago

Please try v1.8.16!

macjuju commented 10 months ago

You are awesome. Just upgrade to 1.8.18 and all are working fine. :-)

Anyway seems Energy API still did not response for my car, so Charging System Status are not available.. But I knew it is nothing from you. 👍

''' Nov 22 10:17:40 volvo2mqtt [107] - DEBUG: Starting GET call against https://api.volvocars.com/energy/v1/vehicles/{0}/recharge-status Nov 22 10:17:40 volvo2mqtt [107] - DEBUG: Response status code: 200 Nov 22 10:17:40 volvo2mqtt [107] - DEBUG: { "status" : 200, "operationId" : "df3dc38c-47a9-4e3f-98be-ae6f454566ca", "data" : { } } Nov 22 10:17:40 volvo2mqtt [107] - INFO: Failed, Battery Charge Level is unfortunately not supported by your vehicle. Nov 22 10:17:40 volvo2mqtt [107] - DEBUG: Starting GET call against https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/fuel Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: Response status code: 200 Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: { "data" : { "batteryChargeLevel" : { "value" : 53.0, "unit" : "%", "timestamp" : "2023-11-22T00:53:32.683Z" } } } Nov 22 10:17:41 volvo2mqtt [107] - INFO: Success! Battery Charge Level is supported by your vehicle. Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: Response status code: 200 Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: { "status" : 200, "operationId" : "df3dc38c-47a9-4e3f-98be-ae6f454566ca", "data" : { } } Nov 22 10:17:41 volvo2mqtt [107] - INFO: Failed, Electric Range is unfortunately not supported by your vehicle. Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: Response status code: 200 Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: { "status" : 200, "operationId" : "df3dc38c-47a9-4e3f-98be-ae6f454566ca", "data" : { } } Nov 22 10:17:41 volvo2mqtt [107] - INFO: Failed, Estimated Charging Time is unfortunately not supported by your vehicle. Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: Response status code: 200 Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: { "status" : 200, "operationId" : "df3dc38c-47a9-4e3f-98be-ae6f454566ca", "data" : { } } Nov 22 10:17:41 volvo2mqtt [107] - INFO: Failed, Charging System Status is unfortunately not supported by your vehicle. Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: Response status code: 200 Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: { "status" : 200, "operationId" : "df3dc38c-47a9-4e3f-98be-ae6f454566ca", "data" : { } } Nov 22 10:17:41 volvo2mqtt [107] - INFO: Failed, Charging Connection Status is unfortunately not supported by your vehicle. Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: Response status code: 200 Nov 22 10:17:41 volvo2mqtt [107] - DEBUG: { "status" : 200, "operationId" : "df3dc38c-47a9-4e3f-98be-ae6f454566ca", "data" : { } } Nov 22 10:17:41 volvo2mqtt [107] - INFO: Failed, Estimated Charging Finish Time is unfortunately not supported by your vehicle. '''