Volvo2Mqtt: Connect your AAOS Volvo 🚙

This is what I feared, but it was working previously and @droidgren states he is getting the same messages from Sweden.

Hi
I have Volvo C40 (2022) and I am using this fine addon, thanks for this!
however is there something in configuration with sensor.volvoyxxxxxxxx5_charging_connection_status
it just shows: disconnected when not connected or Unspecified when connected ? just curious does it show something else with other models?
I can make template for that to change that connected or any other text.

Its the same for the XC40

1 Like

@droidgren
Have you found any solution to the issue?
Having the same problem myself here in Sweden. However, I’m new to this addon so I have never had it running.

So I did now for several days some testing.
The API keys are completely coreect and functional - on the Volvo developer page I can use them in the sandbox continuously. No problem, no wrong key, no nothing - works like a charm.

In the addon I get the above mentioned problems.
BUT: If I restart the addon from time to time (usually if it does not work for 30min, then restart), then suddenly I get readings. And it continues to work - until I have to restart the raspberry pi or the addon itself.
Then same story with the restarts.

So all in all I think it is a stability problem in the addon, not a configuration issue.

For some reason, connection to the API has started now work now, have been sucessfully been updating all weekend. Don’t know if was just a matter of API being more stable again, or if it was because I actually did something. But this is what I did

  • Only using one application on my developer Volvo account ( deleted all the others ).
  • Using only API key in the settings ( the primary )
  • Using VIN number in the settings.
  • Volvo Developer account created 2024-01-24 , started worked 2024-01-27

I still get a lot of “ERROR: API Call failed. Status Code: 401” in the logs though.

Hi, I’m trying to integrate my Wife’s new car into Home Assistant so we can set up charging schedules based on state of the battery and electricity tariffs. I’ve installed Volvo2Mqtt and have the Mosquito Broker running, but I continue to get these errors in the log. Does anyone have any idea what I’m doing wrong?

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
[21:55:21] ERROR: Got unexpected response from the API: Service not enabled
Feb 06 21:55:22 volvo2mqtt [107] - INFO: Starting volvo2mqtt version v1.8.27
Traceback (most recent call last):
File “/volvoAAOS2mqtt/main.py”, line 14, in
connect()
File “/volvoAAOS2mqtt/mqtt.py”, line 38, 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 827, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/socket.py”, line 962, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -5] Name has no usable address
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

This is the yaml config.

updateInterval: 300
babelLocale: en_GB
TZ: Europe/London
debug: false
disable_logging: false
mqtt:
broker: auto_broker
port: auto_port
username: mqttuseraccount
password: mqttuserpassword
volvoData:
username: volvoappusername
password: volvoapppassword
vin: “”
vccapikey:
- primaryvccapikey
- secondaryvccapikey
odometerMultiplier: 1
averageSpeedDivider: 1
averageFuelConsumptionMultiplier: 1

Mosquito is running as I use it for GivTCP integation, and this works without incident. So i’m very consfused, and would appreciate any ideas how to resolve this so it works!

Thanks

I have been messing around with my mobile dashboard to show the car and have managed to do this pinching ideas from all over and using the bubble-card and minimalist dashboard idea that I use for my dashboard.

On the main dashboard I have basic information such as battery charge, range, distance and time from home and picture ring is green when at home and blue when away. When the picture is clicked a pop up will appear.

The Pop appears and shows the main picture with the colour gradient of the card set for the same as the battery (Cant see clearly in the photo as batter currently at 90%), I then have several buttons which do various things, with the Map and Info Buttons showing so further conditional cards.




2 Likes

Hi, I’m having issues regarding this configurations.

I created my account at Developers Volvo, created the Applications and request the publish ( *Status:*Publication under review).

In the Volvo2Mqtt in my home-assistant I added the user and password (from volvo) and the two keys from the applications. But i receive this error: [15:59:51] ERROR: Got unexpected response from the API: Service not enabled

Can you help me?

Regards,

New API

1 Like

Double check that this is not the MQTT connection that is failing.

MQTT connection is green.

Update: without any change now I’m having success in the log file. Smoth and clean, but when I check the sensors (add it in the dashboard) it tells me that is unknow.

Update 2: Is working… thanks.

Anyone get this working in the states? Maybe with a test account?

No, it doesn’t work in the US. It used to – then sometime last year Volvo took the API entirely offline for North America. It worked great before that. Super frustrating.

I took the opportunity to send a note to the API support group about North America access when I got the email above about moving to API 2. Just crickets back. Email address in the note you see above.

Was trying to set this up myself a few weeks ago and ran into the “allowed market” issue too (I’m in the US). Disappointing that a big market like the US is shut down. Maybe the US (and Australia, etc.) is moving to API 2 before other markets and that’s why we’re shut down?

I just received a notice in my Volvo app that two factor authentication is coming. Hopefully that doesn’t add another hurdle to getting this integration to work again.

Just getting back to a new HA install and finding that my previously-solid Volvo integration is no longer working (in the U.S.)!? This sucks.

Does anyone have suggestions for who at Volvo to contact about this? I’m sure my dealer wouldn’t care, but is there a team (with contact info) at Volvo Cars US and/or Volvo in Sweden who might listen??

A couple posts above is a note from Volvo about the change from API 1 to version 2. In that note is a developer support email address. I sent a couple of notes there but received no reply.

1 Like

Thanks, @billraff ! I just realized after you pointed that out that I’d received that email, as well. I just replied (not that I expect a prompt response).

I see that there’s an issue with Babel locale = sl_SL.

Traceback (most recent call last):
File “/volvoAAOS2mqtt/main.py”, line 16, in
update_loop()
File “/volvoAAOS2mqtt/mqtt.py”, line 227, in update_loop
update_car_data()
File “/volvoAAOS2mqtt/mqtt.py”, line 237, in update_car_data
last_data_update = format_datetime(datetime.now(util.TZ), format=“medium”, locale=settings[“babelLocale”])

File “/usr/lib/python3.11/site-packages/babel/dates.py”, line 719, in format_datetime
locale = Locale.parse(locale)

File “/usr/lib/python3.11/site-packages/babel/core.py”, line 391, in parse
raise UnknownLocaleError(input_id)
babel.core.UnknownLocaleError: unknown locale ‘sl_SL’

Babel locale = en_GB works.