Volvo2Mqtt: Connect your AAOS Volvo 🚙

Yes and no. This seems to happen after the 2.10 update… Do you have the installed update ?
This issue also related to here.

Yes… I have indeed upgraded to 2.10 yesterday or the day before (after charging)

Jep, same for me and for others. Hope they will fix this. Just wait…

Sorry if this is too low level but I seem to get stuck on the vccapikey. Left it empty ("") as per the instruction in the GitHub but the add on doesn’t start and the logs tell me it’s needed. Is it available somewhere? I looked it up and requirement is to be a registered developer and build an app, then it will be created. To me it sounds like @Dielee already done that.

Edit: After going back to the readme and scrolling all to the left in the table I found the answer to my question. Considered to delete this post but I decided to only edit it in case someone else of my “capacity” stumbles on the same issue.

Edit2: After doing some RTF and understanding how everything actually works this was actually really easy to get working. The most difficult thing was the vccapikey but if you have a GitHub account it’s really effortless to just login and register (I think that’s more what you do than “creating” one) an app that you want to be able to communicate with your car. I salute @Dielee for putting down the time and work to build this integration. Hat off!

1 Like

Excellent! After a bit of config confusion I have it working with my XC40 recharge. To add a note, the API key you want is one from your created app, not the test API keys you can get from the different APIs. It should only be ~20 characters long, not 100+.

I’m loving this app, particularly the state of charge, but it doesn’t seem to be working as a device tracker? The location is always just “away” with no GPS coordinates. Is there something I have to enable for the API, or is it just because I’m in Australia?

If your device tracker appears, there should be gps coordinates. Please check the device tracker “attributes”.

I’ve added a person under settings. And linked the tracker to this person.

Awsome integration ! It works perfectly on my XC40 Recharge (2021).

Do you think we will be able to modify remotely the desired battery charge % (through the Volvo app or through your integration) ?

No, sorry, as there is no API endpoint to change this setting.

My 2022 C40 (North America) has a device tracker entity but it shows as Unknown state, and the only attribute is Source = GPS.

@chrismelba his may be another thing that EMEA gets but North America and AP don’t.

Please enable debug an show me some logs

Absolutely. Here’s the top of the log, with some material edited out between the initial calls and the location excerpt:

Jul 21 17:29:41 volvo2mqtt [1] - INFO: Starting volvo2mqtt version v1.7.6
Jul 21 17:29:41 volvo2mqtt [1] - DEBUG: Starting new HTTPS connection (1): volvoid.eu.volvocars.com:443
Jul 21 17:29:42 volvo2mqtt [1] - DEBUG: https://volvoid.eu.volvocars.com:443 "POST /as/token.oauth2 HTTP/1.1" 200 None
Jul 21 17:29:42 volvo2mqtt [1] - INFO: Vin: ['VIN_REDACTED'] found!
Jul 21 17:29:42 volvo2mqtt [1] - DEBUG: Starting GET call against https://api.volvocars.com/energy/v1/vehicles/{0}/recharge-status
Jul 21 17:29:42 volvo2mqtt [1] - DEBUG: Starting new HTTPS connection (1): api.volvocars.com:443
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: https://api.volvocars.com:443 "GET /energy/v1/vehicles/VIN_REDACTED/recharge-status HTTP/1.1" 200 94
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: Response status code: 200
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: {
  "status" : 200,
  "operationId" : "7ac07cb5-5c8c-4790-87de-34cf886231b3",
  "data" : { }
}
Jul 21 17:29:43 volvo2mqtt [1] - INFO: Failed, Battery Charge Level is unfortunately not supported by your vehicle.
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: Starting GET call against https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/battery-charge-level
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: https://api.volvocars.com:443 "GET /connected-vehicle/v2/vehicles/VIN_REDACTED/battery-charge-level HTTP/1.1" 200 264
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: Response status code: 200
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: {
  "status" : 200,
  "operationId" : "ce8788f0-00e4-4c5f-9d52-7ff842e7d54d",
  "data" : {
    "batteryChargeLevel" : {
      "name" : "batteryChargeLevel",
      "value" : "90.0",
      "unit" : "percentage",
      "timestamp" : "2023-07-21T20:34:23Z"
    }
  }
}
Jul 21 17:29:43 volvo2mqtt [1] - INFO: Success! Battery Charge Level is supported by your vehicle.
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: Response status code: 200
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: {
  "status" : 200,
  "operationId" : "7ac07cb5-5c8c-4790-87de-34cf886231b3",
  "data" : { }
}
Jul 21 17:29:43 volvo2mqtt [1] - INFO: Failed, Electric Range is unfortunately not supported by your vehicle.
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: Response status code: 200
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: {
  "status" : 200,
  "operationId" : "7ac07cb5-5c8c-4790-87de-34cf886231b3",
  "data" : { }
}
Jul 21 17:29:43 volvo2mqtt [1] - INFO: Failed, Estimated Charging Time is unfortunately not supported by your vehicle.
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: Response status code: 200
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: {
  "status" : 200,
  "operationId" : "7ac07cb5-5c8c-4790-87de-34cf886231b3",
  "data" : { }
}
Jul 21 17:29:43 volvo2mqtt [1] - INFO: Failed, Charging System Status is unfortunately not supported by your vehicle.
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: Response status code: 200
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: {
  "status" : 200,
  "operationId" : "7ac07cb5-5c8c-4790-87de-34cf886231b3",
  "data" : { }
}
Jul 21 17:29:43 volvo2mqtt [1] - INFO: Failed, Charging Connection Status is unfortunately not supported by your vehicle.
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: Response status code: 200
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: {
  "status" : 200,
  "operationId" : "7ac07cb5-5c8c-4790-87de-34cf886231b3",
  "data" : { }
}
Jul 21 17:29:43 volvo2mqtt [1] - INFO: Failed, Estimated Charging Finish Time is unfortunately not supported by your vehicle.
Jul 21 17:29:43 volvo2mqtt [1] - DEBUG: Starting GET call against https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/odometer
Jul 21 17:29:44 volvo2mqtt [1] - DEBUG: https://api.volvocars.com:443 "GET /connected-vehicle/v2/vehicles/VIN_REDACTED/odometer HTTP/1.1" 200 245
Jul 21 17:29:44 volvo2mqtt [1] - DEBUG: Response status code: 200
Jul 21 17:29:44 volvo2mqtt [1] - DEBUG: {
  "status" : 200,
  "operationId" : "10298bff-2430-4464-b3bf-a31673b9fefe",
  "data" : {
    "odometer" : {
      "name" : "odometer",
      "value" : "14949",
      "unit" : "kilometers",
      "timestamp" : "2023-07-21T13:39:51Z"
    }
  }
}
Jul 21 17:29:44 volvo2mqtt [1] - INFO: Success! Odometer is supported by your vehicle.
Jul 21 17:29:44 volvo2mqtt [1] - INFO: Success! Last Data Update is supported by your vehicle.


. . . [OMITTED] . . .


Jul 21 17:29:44 volvo2mqtt [1] - DEBUG: Starting GET call against https://api.volvocars.com/location/v1/vehicles/{0}/location
Jul 21 17:29:44 volvo2mqtt [1] - DEBUG: https://api.volvocars.com:443 "GET /location/v1/vehicles/VIN_REDACTED/location HTTP/1.1" 404 162
Jul 21 17:29:44 volvo2mqtt [1] - DEBUG: Response status code: 404
Jul 21 17:29:44 volvo2mqtt [1] - DEBUG: {
  "status" : 404,
  "operationId" : "acf6946d-6f8d-40ca-97f9-1661615494a7",
  "error" : {
    "message" : "NOT_FOUND",
    "description" : "VIN not found"
  }
}
Jul 21 17:29:44 volvo2mqtt [1] - ERROR: API Call failed. Status Code: 404. Error: {
  "status" : 404,
  "operationId" : "acf6946d-6f8d-40ca-97f9-1661615494a7",
  "error" : {
    "message" : "NOT_FOUND",
    "description" : "VIN not found"
  }
}
Jul 21 17:29:44 volvo2mqtt [1] - INFO: Failed, Location is unfortunately not supported by your vehicle.

Thanks @Dielee, that’s what I thought (it’s a pity that Volvo doesn’t provide this basic feature) :sleepy:
Thanks again for your awsome work !

Location isn’t supported by your car or country, sorry. But you have an device tracker entity which state is unknown ?

OK so I stopped volvo2mqtt, deleted the car’s device in HA, and restarted volvo2mqtt. The device tracker didn’t come back - so it must have been a holdover from a prior version of the software. Thanks for looking into it!

After using this for about two weeks I have to say this add on is amazing!

However I have one entity that I don’t really understand the function of. “Charging Connection Status”. It always indicates “Disconnected” even if the car is connected for charging. I haven’t connected it to a DC fast charger yet, only a home charger, so it could be that this will only activate if connected to a fast charger. The icon indicates that could be the case.

It would be great to have it also working for home chargers.

The “Charging System Status” gives the charging status for home charger.

image

“Charging Connection Status” is broken since 2.10 car update. Hopefully volvo will fix this in 2.11.

1 Like

That explains it!

Again, a great add-on!