/volvo2mqtt

Home Assistant addon for connecting AAOS Volvos

Primary LanguagePythonMIT LicenseMIT

Volvo2Mqtt

Supports aarch64 Architecture Supports amd64 Architecture Supports armhf Architecture Supports armv7 Architecture Supports i386 Architecture
Project Maintenance GitHub Release GitHub Activity

This component establishes a connection between the newer AAOS Volvo cars and Home Assistant via MQTT.
Maybe this component works also with other Volvo cars. Please try out the native Volvo integration before using this component! If the native component doesn't work for your car, try this mqtt bridge.

Home Assistant thread can be found here.

If you like my work:
ko-fi

Confirmed working with

  • XC40 BEV (2023)
  • XC40 BEV (2022)
  • XC40 PHEV (2021)
  • V60 T8 PHEV (2023)
  • C40 BEV (2023)
  • C40 BEV (2022)
  • XC90 T8 PHEV (2023)
  • XC60 PHEV (2023)
  • XC60 PHEV (2022)
  • XC90 PHEV T8 (2023)
  • XC90 PHEV T8 (2024)
  • V90 PHEV T8 (2019)*

*only partly working

Please let me know if your car works with this addon so I can expand the list!

Supported features

  • Lock/unlock car
  • Start/stop climate
  • Sensor "Battery Charge Level"
  • Sensor "Electric Range"
  • Sensor "Charging System Status"
  • Sensor "Charging Connection Status" (partly broken since 2.10 car update)
  • Sensor "Estimated Charging Finish Time"
  • Sensor "Door Lock Status (All doors, tank lid, and engine hood)"
  • Sensor "Window Lock Status (All windows and sunroof - Thanks to @navet)"
  • Sensor "Engine Status"
  • Sensor "Odometer"
  • Sensor "Tire Status"
  • Sensor "Fuel Status"
  • Sensor "Average Fuel Consumption"
  • Sensor "Average Speed"
  • Car Device Tracker
  • Multiple cars

NOTE: Energy status currently available only for cars in the Europe / Middle East / Africa regions. source

Setup

Docker:

Just install this addon with the following command. Please note to fill in your settings inside the environment variables.

docker run -d --pull=always -e CONF_updateInterval=300 -e CONF_babelLocale='de' -e CONF_mqtt='@json {"broker": "", "username": "", "password": "", "port": 1883}' -e CONF_volvoData='@json {"username": "", "password": "", "vin": "", "vccapikey": "", "odometerMultiplier": 1, "averageSpeedDivider": 1, "averageFuelConsumptionMultiplier": 1}' -e TZ='Europe/Berlin' --name volvo2mqtt ghcr.io/dielee/volvo2mqtt:latest

HA Add-On:

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

Here is what every option means:

Environment Variable Name Type Json Option Default Description
CONF_updateInterval int required Update intervall in seconds.
CONF_babelLocale string required Select your country from this list. "Locale name" is the column you need!
CONF_mqtt json broker required Your MQTT Broker IP. Eg. 192.168.0.5.
CONF_mqtt json port 1883 Your MQTT Broker Port. If no value is given, port 1883 will be used.
CONF_mqtt json username optional MQTT Username for your broker.
CONF_mqtt json password optional MQTT Password for your broker.
CONF_volvoData json username required Normally your email address to login into the Volvo App.
CONF_volvoData json password required Your password to login into the Volvo App.
CONF_volvoData json vin optional A single VIN like "VIN1" or a list of VINs like "["VIN1", "VIN2"]". Leave this empty if you don't know your VIN. The addon will use every car that is tied to your account.
CONF_volvoData json vccapikey required API key linked with your volvo developer account. Get your Vccapi key from here
CONF_volvoData json odometerMultiplier optional The multiplier value for the odometer value, as the volvo api delivers inconsistent data. For some cars this setting is 10, for some 1. Try what's right for your car. If you leave it empty, the multiplier will be 1.
CONF_volvoData json averageSpeedDivider optional The divider value for the average speed value, as the volvo api delivers inconsistent data. For some cars this setting is 10, for some 1. Try what's right for your car. If you leave it empty, the divider will be 1.
CONF_volvoData json averageFuelConsumptionMultiplier optional The multiplier value for the average fuel consumption value, as the volvo api delivers inconsistent data. For some cars this setting is 10, for some 1. Try what's right for your car. If you leave it empty, the multiplier will be 1.
CONF_debug string optional Debug option (true/false). Normally you don't need this.
TZ string required Container timezone eg "Europe/Berlin" from here

Lovelace sample card

Show me more!

alt text

Lovelace card sample
 type: vertical-stack
 title: Autostatus
 cards:
   - type: custom:vertical-stack-in-card
     cards:
       - type: custom:mushroom-lock-card
         entity: lock.volvo_<your vin>_lock_status
         name: Verrigelungsstatus
       - type: horizontal-stack
         cards:
           - type: custom:mushroom-entity-card
             entity: sensor.volvo_<your vin>_electric_range
             name: Reichweite
             layout: vertical
           - type: custom:mushroom-entity-card
             entity: sensor.volvo_<your vin>_battery_charge_level
             name: Batteriestatus
             layout: vertical
           - type: custom:mushroom-entity-card
             entity: sensor.volvo_<your vin>_estimated_charging_time
             layout: vertical
             name: Ladezeit
       - type: horizontal-stack
         cards:
           - type: custom:mushroom-entity-card
             entity: switch.volvo_<your vin>_climate_status
             tap_action:
               action: toggle
             layout: vertical
             name: Klimatisieren/Heizen
           - type: custom:mushroom-template-card
             primary: Daten aktualisieren
             secondary: '{{ states(''sensor.volvo_<your vin>_last_data_update'')}}'
             icon: mdi:update
             layout: vertical
             entity: button.volvo_<your vin>_update_data
       - type: conditional
         conditions:
           - entity: sensor.volvo_<your vin>_estimated_charging_time
             state_not: '0'
         card:
           type: custom:mushroom-entity-card
           entity: sensor.volvo_<your vin>_estimated_charging_finish_time
           name: Ladung vorraussichtlich abgeschlossen
           show_name: true
       - type: map
         entities:
           - entity: device_tracker.volvo_<your vin>_location
         default_zoom: 16
         dark_mode: false
         hours_to_show: 0
         auto_fit: true
         aspect_ratio: '16:9'