Volvo Cars integration

This looks very nice, could you please share the code to get this on the lock screen.

Here you are, it’s a bit of a PITA to get into the code and there was a lot of trial and error

Best of luck!

Very nice card setup! Do you mind sharing the code here?

I got my ex40 last Friday and I’m super happy with the car and this integration.
Question to all users here, what automations and blueprints etc are you using?

Thank you for the integration. Works perfect.
Do you know if there is a way to see or look mat the car camera’s? Like a sentry mode or something.

1 Like

Thank you!

It’s not possible to get a live view from the cameras.

1 Like

I just moved over from volvo2mqtt, I have a 2023 xc40 recharge. This new integration shows me 74 entities, but it looks like I lost entities for the tyre pressure. Is that correct?

It’s an API issue. More info can be found on Tire info not available · Issue #22 · thomasddn/ha-volvo-cars · GitHub.

@thomas_be
I own a 2021 XC60 hybrid but do not see the charging connecting and charging status sensors. Any particular reason why these sensors do not show for me?

With the old integration I used the charging status sensor as a trigger for an automation.

Can you see if it helps when you reload the integration?

If that still doesn’t work can you (1) enable debug logging, (2) reload the integration, (3) disable debug logging and (4) send me the file?

If you are still worried about privacy, you can send the file privately to my dropbox at https://www.dropbox.com/request/SdxkVf0OIWJCDjgcKtRj. The integration does not log privacy related data, unless in very specific exceptions the VIN might be included. I cannot speak for other integrations.

Thanks @thomas_be - will try that later today.

The file has been uploaded @thomas_be.

The recharge endpoint is not supported for your model:

[recharge-status] response: {'status': 404, 'operationId': '...', 'error': {'message': 'NOT_FOUND', 'description': 'Resource not supported for this vehicle model'}}

There is also a limitation for the used API user. We’re not allowed access to some resources unfortunately, so some values cannot be retrieved. More on that in issue 101.

that’s unfortunate :frowning:
Thanks for looking into this @thomas_be

Can anyone provide more information on how this should be implemented? thanks

Thanks for the nice integration.
After using volvo2mqtt for a while I’d like to switch completely to your addon. But I have still a problem with the integration with evcc. I use this to control the energy flow between solar, battery, car and so on. And with volvo2mqtt it was possible to integrate this into evcc. This feature is unfortunately not available with your new addon or do I miss something?
The main problem with volvo2mqtt and evcc was, that evcc does not recognize my car automatically, when connecting it to the wall box as it does with other cars like ID.3. So I hoped, that your addon can solve this lack.
Do you think that it’s possible to extend your addon, that it gets an interface to evcc, too?
Thanks a lot and best regards!

What exactly is missing from the integration in order to connect it to evcc?

That’s the point - I don’t know. :wink:

In the evcc configuration there’s a possibility to add a new car. It looks like this (sorry, my interface is in german language):


In the combobox there’s a list of integrations, which can be used and there I can find the volvo2mqtt integration:

After choosing this integration, there are some fields to fill out and the car will be added:


And here you can see the problem. The volvo2mqtt integration does not support all needed fields for evcc to decide, if the car is connected - and so evcc does not recognize the car automatically.

I’m sorry, but I don’t have an idea how to build an integration for evcc and I’m also not familiar with implementing an addon for HA.

Have you tried using the Volvo configuration in evcc https://docs.evcc.io/en/docs/devices/vehicles#volvo?

Yes, I used this with my previous Volvo. But after Volvo added 2FA to their API solution, the original integration works no longer, because it does not support 2FA. And unfortunately, they won’t update the integration.

@dirsve I did not use EVCC to control charging as I’m using control directly on HA, but I have made some tests and apparently this worked fine here to get the car status , configuring vehicle on the yaml and using mqtt_statestream MQTT Statestream - Home Assistant

vehicles:
  - name: XC40
    title: XC40
    type: custom
    # Apesar de aceitar 3, aqui em casa considera somente 1
    phases: 1
    capacity: 69.452
# Capacity must be fixed value    
#       source: mqtt
#       topic: homeassistant_out/states/sensor/volvo_XC40_battery_capacity/state
    soc:
      source: mqtt
      topic: homeassistant_out/states/sensor/volvo_XC40_battery_charge_level/state        
    range:
      source: mqtt
      topic: homeassistant_out/states/sensor/volvo_XC40_distance_to_empty_battery/state
# https://github.com/evcc-io/evcc/blob/e93e42003745743af9ce58accd9de539609bba90/cmd/demo.yaml#L119
    status:
      source: go
# State A: Standby, when the EV is not connected
# State B: The EV is connected
# State C: The EV requests charging
# not all status considered here, only the ones that make sense for local control
      script: |
        if (system_status == "charging_system_charging") {
          "C" 
        } else if (connection_status == "connection_status_connected_ac") {
          "B"
        } else {
          "A"
        }
      in:
        - name: connection_status
          type: string
          config:
             source: mqtt
             topic: homeassistant_out/states/sensor/volvo_XC40_charging_connection_status/state
        - name: system_status
          type: string
          config:
             source: mqtt
             topic: homeassistant_out/states/sensor/volvo_XC40_charging_system_status/state