Volvo2Mqtt: Connect your AAOS Volvo 🚙

Will this work with an S60 Recharge? I live in the United States.

I’m getting the following error in the log…

File “/volvoAAOS2mqtt/volvo.py”, line 271, in set_key_state
extended, extended_until = check_vcc_api_key(key)
^^^^^^^^^^^^^^^^^^^^^^
File “/volvoAAOS2mqtt/volvo.py”, line 313, in check_vcc_api_key
logging.warning("VCCAPIKEY " + test_key + " isn’t working! " + data[“error”][“message”])
~~~~^^^^^^^^^

hey, now I need an OTP code ! was this added to some update of volvo2mqtt ? I didn’t need it at first state, and suddenly, it appeared !

so to fix this, and a little help from GPT4, here is a quick python script that allowed me to register the OTP code :

import paho.mqtt.client as mqtt

# Configuration
broker_address = "192.168.3.19"
port = 1883
topic = "volvoAAOS2mqtt/otp_code"
otp_code = "000000"
username = "youruser"
password = "yourpassword"

# Callback for connection
def on_connect(client, userdata, flags, rc, properties=None):
    print(f"Connected with result code {rc}")

# Create a new MQTT client instance
client = mqtt.Client(protocol=mqtt.MQTTv5)

# Set username and password
client.username_pw_set(username, password)

# Assign the on_connect callback function
client.on_connect = on_connect

# Connect to the broker
client.connect(broker_address, port, 60)

# Publish the OTP code
client.publish(topic, otp_code)

# Start the network loop
client.loop_start()

# Disconnect after publishing
client.loop_stop()
client.disconnect()

Please tell me I won’t have to run this several times ?!

Now two things :

  1. activating the climate control doesn’t do anything on my XC60, I was expecting this to be the same “feature” as the one that enables the climate before I start the car in the morning, to heat the car (during the winter), or cool it (during the summer).

  2. the location of the car never changes. The car was detected home once, but its location ain’t be updated when I drive it.

Didn’t the entity text.volvo_otp work?

Well yes, I only hope this is real OTP, like in ONE TIME password. I don’t want to see this thing asking me for an otp again and again. I guess the container / integration is smart enough to register as a proper browser, that will be remained by volvo servers.

I have a strange problem with this update (1.9.2). As soon as I register the “passcode” from the Volvo email some process keeps resetting the code to 000000 the same second as it starts…
Any ideas?

well, after one day or something, and volvo2mqtt has been autoupdated by watchtower :

time="2024-05-29T13:07:39Z" level=info msg="Stopping /dozzle (5a08c75f8b38) with SIGTERM"
time="2024-05-29T13:07:40Z" level=info msg="Stopping /volvo2mqtt (36eeb60d1495) with SIGTERM"
time="2024-05-29T13:07:50Z" level=info msg="Creating /volvo2mqtt"
time="2024-05-29T13:07:50Z" level=info msg="Creating /dozzle"
time="2024-05-29T13:07:50Z" level=info msg="Session done" Failed=0 Scanned=24 Updated=2 notify=no

the OTP is required again. If this happens each time their is an update, and if updates are frequent, then it will be a serious pain in the back.

1 Like

Starting version 1.9.1 this isn’t the case.
The token now survives addon updates :wink:

2 Likes

I’m getting the same error. I’ve used en_GB and the short api key from my Volvo developer account app. The addon also appears to connect to mqtt but then closes its connect moments later.

Have you had any luck trying to get it to work?

Ah nice ! Thanks !!! :smiley:

No, sadly. Not sure what else to tinker with.

Is there anyone who uses volvo2mqtt for a Volvo EX30?

Are you able to view and post the logs here (without identifying information such as your VIN)?

PLEASE NOTE: Anyone who is experiencing the problem with unsupported region, Volvo dev team has a survey you can fill in about the API and website – maybe we can get them to explain why their Overview page says “The API can be used with test credentials around the world”, but test apps stopped working outside of the published app supported regions.

I tried e-mailing twice with no response - the Survey info says they’ll be reading every response they receive!

Please don’t SPAM the survey with more than one response each, but I encourage those who are experiencing issues relating to the above to submit a response so we can perhaps get some traction on a fix from Volvo.

Thanks!

Dear all,

i tried to find it all in this topic but could not.

After upgrading the volvo2mqtt the requirement is to add the OTP to the system for it to work again.

I tried several attempts which i could find. There is one option i didn’t try yet and this is to add the OTP script to the system.
However in the meantime i don’t receive any OTP emails anymore. Which i did everytime i restarted my system.

Anybody an idea how to get OTP emails again?

Many thanks,
Marcel

Works with V60 T6 PHEV (2025)!

We got XC40 BEV today and looking to automate when car will be charged.
Am I missing something or is this not supported?

That’s awesome (and congratulations on your new vehicle)!

Do you mind if I ask what region of the world you are in?

Finland.
I already have this addon installed and configured.
Got plenty of sensors but no obvious way to control charging.

Edit:
Noticed this wasn’t reply to my messages. But anyways additional info.

1 Like

I think the best way to control WHEN the car will be charged in your home is using a connected charger, because the car will respect the limits imposed by the car.

I’m controlling my juicebox and determining when the cars can charge.

But as the volvo API is not available on my country I can only estimate the battery during charging. To get the battery data during usage of car I’m using Car Stats Viewer and Traccar