Volvo2Mqtt: Connect your AAOS Volvo đźš™

This is a Volvo AAOS Cars to MQTT Home Assistant Addon

This addon will serve the data over MQTT, including Autodiscovery for all supported “sensors”, “binary_sensors”, “locks”, “switches” and “device_trackers”. It allows you to start the climate, lock or unlock, and get a bunch of information from your car.
The add-on has been tested with the Mosquitto MQTT addon but can also be configured to use any other broker if wanted.

Current Release:

GitHub Release

Add this Repo to your HomeAssistant

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

Supported architectures:

Supports aarch64 Architecture Supports amd64 Architecture Supports armhf Architecture Supports armv7 Architecture Supports i386 Architecture

Detailed information can be found inside the GitHub repo:

10 Likes

Works great on XC90 2023 T8

3 Likes

Average speed always indicates 1 on an XC40 BEV (P8). All other sensors work fine. Tried with debug logging on, but it only catches the tail of it and I can’t download the full logs on mobile.

What I can see is:


Starting GET call against https://api.volvocars.com/connected-vehicle/v2/vehicles/{0}/statistics
{
  "status" : 200,
  "operationId" : "09b287e0-9e46-40c8-9b1d-854ab37f1197",
  "data" : {
    "tripMeter1" : {
      "value" : "7",
      "unit" : "kilometers",
      "timestamp" : "2023-06-26T10:40:35Z"
    },
    "tripMeter2" : {
      "value" : "0",
      "unit" : "kilometers",
      "timestamp" : "2023-06-26T10:40:35Z"
    },
    "averageFuelConsumption" : {
      "value" : "0.0",
      "unit" : "liters_per_100_kilometers",
      "timestamp" : "2023-06-26T10:40:35Z"
    },
    "distanceToEmpty" : {
      "value" : "0",
      "unit" : "kilometers",
      "timestamp" : "2023-06-26T10:40:35Z"
    },
    "averageSpeed" : {
      "value" : "1",
      "unit" : "kilometers_per_hour",
      "timestamp" : "2023-06-26T10:40:35Z"
    }
  }
}

Jep, same for me. Will add a filter tomorrow, the API delivers garbage for some cars. There is nothing we can do at this time, sorry…

I have no real use for that particular sensor anyway. Home Assistant can no do things that the Volvo app can’t. Like warm you when you forget to close the sunroof. Or schedule preheating depending on how you set your alarm clock. :+1:

Yes same here. Because of this, I will add a filter and skip the creation of the sensor.

I found the engine state here: https://api.volvocars.com/connected-vehicle/v2/vehicles/:vin/engine.
I’m not sure if this endpoint delivers usable data. Maybe some of you can take a look if the engineRunning key delivers real and usable data ?

This is what you get:

{
  "status" : 200,
  "operationId" : "<redacted>",
  "data" : {
    "engineCoolantLevel" : {
      "name" : "engineCoolantLevel",
      "value" : "NORMAL",
      "timestamp" : "2023-06-27T05:18:23Z"
    },
    "oilLevel" : {
      "name" : "oilLevel",
      "value" : "NORMAL",
      "timestamp" : "2023-06-27T05:18:23Z"
    },
    "engineRunning" : {
      "name" : "engineRunning",
      "value" : "STOPPED",
      "timestamp" : "1970-01-01T00:00:00Z"
    }
  }
}

I don’t think the engineRunning changes if you look at the timestamp.

Thanks, same for me…
I don’t know how the volvo app gets the climate state. There is no API endpoint for this. Maybe someone tries to intercept the app’s communication ?

I have been investigating that exact thing also but not found how the Volvo app gets the climate info.
There is now official API for that, not even in the version 2.0 spec.

I have tried to intercept the iOS apps communication but when I enable my http proxy the app stop to function so I think Volvo has implemented some failsafe mechanism to hinder snopers like us :wink:

Yes, thats cert pinning. I know how to get arround this, but had no time until now…
With Frida and a rooted android phone, this should be possible. Maybe I will give it a try tomorrow.

1 Like

So, good news. Traffic interception is working. I successfully removed SSL pinning.
Let’s see what we can get.

EDIT: They are using the same auth and tokens for their app as we do. That’s nice. If there is an endpoint for the climate state, it will be usable for us.

Volvo C40 EV some parts not working. All other working greate.

Have you upgraded from an older version ?

Yes, it is the latest one. However, saw that the entities have been replaced so it works when I put in the new ones

As said in the release notes. To clean up your device, just delete it and restart the addon :slight_smile:

1 Like

Great Job!! Is there a way to get the charge and climate scheduling settings working?

Maybe if the interception between the app and the Volvo servers works. Until now I can’t sniff the traffic to the car, only the login. But it’s work in progress.

Thanks for your reply. I’m sure you’ll get it working. :slight_smile:

Version 1.6.0 is working great here on my North America (US) 2022 C40 BEV. Happy to see this - thanks for your work on it!

As expected, I’m not getting any Energy sensors (except battery charge level) and Location doesn’t work.

In case you’re inclined to do some more model-related filtering, the C40 BEV currently shows sensors for “Sunroof” and “Tank Lid,” neither of which actually exist!

2 Likes