Volvo2Mqtt: Connect your AAOS Volvo 🚙

I think I have the docker installed and setup
 but I can’t get the home assistant addon working.

I’m using core, so the addon won’t install. Is there a way to get it working with HACS? I’m pretty new at all of this. Sorry.

I can’t reach the API. Any ideeas?

Log file:
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
[10:38:47] ERROR: Got unexpected response from the API: Service not enabled
Oct 15 10:38:50 volvo2mqtt [108] - 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

YAML:

updateInterval: 300
babelLocale: Sv_SE
TZ: Europé/Stockholm
debug: false
disable_logging: false
mqtt:
  broker: auto_broker
  port: auto_port
  username: auto_user
  password: auto_password
volvoData:
  username: "+46_my_phonenmbr"
  password: mypasswd
  vin: YV1ZWBMVDM_myVINx
  vccapikey:
    - 1ca84f9523_my_primary_APIkeyxxxxxxx
    - 8c541f08ce_my_secondary_APIkeyyyyyy
  odometerMultiplier: 1
  averageSpeedDivider: 1
  averageFuelConsumptionMultiplier: 1
1 Like

I got exact same error. First I change login to broker from auto to my personal, then I dont get the error that says “check MQTT” but still the API-error. Maybe something at Volvo?

1 Like

The API-error suddenly disappeared. Must have been something within Volvo.
However, I still have an issue:

Oct 15 18:29:50 volvo2mqtt [106] - INFO: Starting volvo2mqtt version v1.8.8
Traceback (most recent call last):
File “/volvoAAOS2mqtt/main.py”, line 15, in
authorize()
File “/volvoAAOS2mqtt/volvo.py”, line 59, in authorize
raise Exception(message[“error_description”])
Exception: We didn’t recognize the username or password you entered. Please try again.

I have exactly the same user-ID and password at Volvo Developer account as in the Volvodata in the Volvo2Mqtt.
For the mqtt/broker I have a unique user-id and password created in HA.
Am I doing something wrong?

The username and password should be the ones used in the Volvo Cars app on the phone. Does it work if you try with those?

1 Like

Yes. It works!!
Thank you so much and V60 PHEV MY2021 can be confirmed :grinning:

Is there a API limit that I hit?

Oct 17 15:19:39 volvo2mqtt [107] - INFO: Mqtt update done. Next run in 60 seconds.
Oct 17 15:20:39 volvo2mqtt [107] - INFO: Sending mqtt update

Oct 17 15:20:40 volvo2mqtt [107] - INFO: Mqtt update done. Next run in 60 seconds.
Oct 17 15:21:40 volvo2mqtt [107] - INFO: Sending mqtt update

Oct 17 15:21:40 volvo2mqtt [107] - WARNING: Quota extended. Try to change VCCAPIKEY!
Oct 17 15:21:41 volvo2mqtt [107] - WARNING: No working VCCAPIKEY found, waiting 10 minutes. Then trying again!
Oct 17 15:31:41 volvo2mqtt [107] - WARNING: VCCAPIKEY 3xxxxxxxxxxx06d0f1ea is extended and will be reusable at: 2023 golg 18 02:00:10

Same problem with new application and both keys in the config. Worked until 15:05 today.
Rotated the two keys and restarted:

s6-rc: info: service legacy-services successfully started
Oct 18 17:36:37 volvo2mqtt [106] - INFO: Starting volvo2mqtt version v1.8.8
Oct 18 17:36:38 volvo2mqtt [106] - WARNING: VCCAPIKEY c38de586af464cxxxxxxx00e453cd73bb is extended and will be reusable at: 2023 golg 19 02:00:10

Is this working 24/7 for any one else?

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