Volvo2Mqtt: Connect your AAOS Volvo 🚙

Hi everyone,

I am having this permissions error when running the add on. Does anyone know what does it mean and how to fix it ?

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Traceback (most recent call last):
  File "/usr/lib/python3.11/pathlib.py", line 1116, in mkdir
    os.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/addons/volvo2mqtt/log'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/volvoAAOS2mqtt/main.py", line 9, in <module>
    setup_logging()
  File "/volvoAAOS2mqtt/util.py", line 43, in setup_logging
    check_existing_folder()
  File "/volvoAAOS2mqtt/util.py", line 77, in check_existing_folder
    Path("/addons/volvo2mqtt/log/").mkdir(parents=True, exist_ok=True)
  File "/usr/lib/python3.11/pathlib.py", line 1125, in mkdir
    if not exist_ok or not self.is_dir():
                           ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pathlib.py", line 1250, in is_dir
    return S_ISDIR(self.stat().st_mode)
                   ^^^^^^^^^^^
  File "/usr/lib/python3.11/pathlib.py", line 1013, in stat
    return os.stat(self, follow_symlinks=follow_symlinks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/addons/volvo2mqtt/log'
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

My Config

updateInterval: 300
babelLocale: en_AU
TZ: Australia/Sydney
debug: true
disable_logging: true
mqtt:
  broker: auto_broker
  port: auto_port
  username: auto_user
  password: auto_password
volvoData:
  username: [email protected]
  password: password
  vin: myvin
  vccapikey:
    - myvccapikey1
    - myvccapikey2
  odometerMultiplier: 1
  averageSpeedDivider: 1
  averageFuelConsumptionMultiplier: 1

Do you use the “primary” and “secondary” key from the volvo app page ? If yes, this is wrong.
You only have to use the “primary” keys. So create two volvo apps and post the “primary” keys into the vccapikey section.

There is something wrong with your rights on the host filesystem. Try to create the folder /addons/volvo2mqtt/log via ssh

Ok, thank you!
The primary problem was to short update interval. Increase it from 60 to 120 solved the problem.

Just upgraded my HA and now the energy status is not correct.
image
image


Anyone else having this issue?

Yes I’m as well it seems that it stoped for some sensors but the triggers seems to be working.

Can it be the api that doesnt work? Tested it on Volvos site and se that its not updated since this morning.

I had the same response

Same problem here since yesterday. Typically, battery usage doesn’t update :sob:

Something like this happened a few weeks ago and it got solved without doing anything (restarting AAOS, the add-on, etc.)
So I guess it’s an issue on their side…

It’s working a bit more again, at least Battery, Odo and Range are back online, so to say. Charging sensors are still not working.

It seems to be working again, but the data are delayed. Still watching…

It does seem to be an issue on the Volvo API side. I use this great (thank you for this integration!) integration besides a Node-RED API call automation. They both receive the same data. Besides that I still do see different values for battery state in the Volvo app, but different from the actual SoC of our car (XC40 Recharge 2023 model). So none of the sources was showing correct yesterday.
Today it seems to be working again.

Is there anyway of installing this on a containerised Home Assistant that doesn’t support Add-Ons?

Hi, I’m looking to build some logic in to NodeRed so that I can run commands to lock/unlock the car and turn pre-conditioning on without having HA running.

At the moment I can connect to the car and run everything through HA but wanted to know what MQTT topics and payloads I should be sending so that I can trigger Volvo2Mqtt to lock/unlock the car directly from NodeRed without having to go via HA.

Apologies for posting about how not to use HA in this scenario but does anyone know if this is possible and if so, what the MQTT topics and payloads are please?

Thanks.

Hi everyone,

I have HA Supervisor with Debian 12 and encountering below error:

“s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
curl: (7) Failed to connect to supervisor port 80 after 1 ms: Couldn’t connect to server
[22:04:04] ERROR: Something went wrong contacting the API
Nov 02 22:04:06 volvo2mqtt [103] - INFO: Starting volvo2mqtt version v1.8.8
Traceback (most recent call last):
File “/volvoAAOS2mqtt/main.py”, line 14, in
connect()
File “/volvoAAOS2mqtt/mqtt.py”, line 39, in connect
client.connect(settings[“mqtt”][“broker”], port)
File “/usr/lib/python3.11/site-packages/paho/mqtt/client.py”, line 914, in connect
return self.reconnect()
^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/site-packages/paho/mqtt/client.py”, line 1044, in reconnect
sock = self._create_socket_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/site-packages/paho/mqtt/client.py”, line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/socket.py”, line 851, in create_connection
raise exceptions[0]
File “/usr/lib/python3.11/socket.py”, line 831, in create_connection
sock = socket(af, socktype, proto)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/socket.py”, line 232, in init
_socket.socket.init(self, family, type, proto, fileno)
PermissionError: [Errno 13] Permission denied
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped”

If I am using
mqtt:
broker: auto_broker
port: auto_port
username: auto_user
password: auto_password

“s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
curl: (7) Failed to connect to supervisor port 80 after 0 ms: Couldn’t connect to server
[22:10:08] ERROR: Something went wrong contacting the API
Nov 02 22:10:10 volvo2mqtt [102] - INFO: Starting volvo2mqtt version v1.8.8
Traceback (most recent call last):
File “/volvoAAOS2mqtt/main.py”, line 13, in
set_mqtt_settings()
File “/volvoAAOS2mqtt/util.py”, line 134, in set_mqtt_settings
raise Exception(“MQTT connection could not be established. Please check if your MQTT Add-On is running!”)
Exception: MQTT connection could not be established. Please check if your MQTT Add-On is running!
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped”

Solved by editing apparmor.txt

Hi all,

I’m having problems starting the integration. I have started the docker container with the right conf for Mosquitto and the VCC-API-KEYS I just created but the logs show the following: ‘message": “Access denied due to invalid VCC-API-KEY. Make sure to provide a valid key for an active application.”’
I’ve regenerated the two keys and passed them to docker as in the example, but I keep on getting the same message. Do you need to publish the application for the API keys to work? So far I just create an App and generated the two API keys, but I did not publish the application. I assume I must be doing something wrong with my devel API conf.
Any hints?
Thanks!

UPDATE: Even though I keep on seeing that message in the docker logs it turns out that Home Assistant does receive all the sensors data via Mosquitto, so everything seems to be working.
/Nacho

Just wanted to check if others are seeing their Battery Level no longer returning data. Started just today.

Nov 07 15:48:37 volvo2mqtt [106] - INFO: Failed, Battery Charge Level is unfortunately not supported by your vehicle.

Worked for months. XC90 2024 Recharge Ultimate.

After a restart of volvo2mqtt I also lost battery level, but also some other sensors like windows, doors. Some are still working.