Volvo2Mqtt: Connect your AAOS Volvo 🚙

Yes, they introduced a one-time password (OTP) with version 1.9.0. The author describes how to use it here: GitHub - Dielee/volvo2mqtt: Home Assistant addon for connecting AAOS Volvos

I can’t get it to work though, will post an additional comment for my problem.

Did anyone get the OTP thing to work? When I get the code via email and change the status of the text.volvo_otp entity, nothing happens. The add-on did its 15 retries and that’s it. When I restart it, it creates a new OTP, so I am always “running behind”. What am I doing wrong?

I updated the plugin, filled in the verification code in the “Volvo OTP” entity and it worked immediately.

When I was beta-testing this last month at first I didn’t get the verification code on time because my mail client marked the Volvo email as spam. It’s just a matter of filling in the “Volvo OTP” code in time. I immediately received an email with the verification code when starting the add-on.

@Dielee is there a possibility to extend the time between the 15 retries to make sure people can copy the verification code from the email?

How do i trigger new code?
I reloaded Addon and MQTT but both didn trigger new code. I did found Volvo OTP and try to enter old code via “developer tool”.

I do get a new code whenever I restart the Volvo2Mqtt add-on.

However, I update the “Volvo OTP” by navigating to all entities (Settings > Devices & services > Entities) and selecting the “Volvo OTP” entity.
Setting state via Developer tools didn’t work for me either.

2 Likes

after stop and start the volvo add-on, i received new code and updated it quickly as you described and it seems to be working. Thx for the quick help, appriciated.

1 Like

Ah, that did it! Thanks!

1 Like

Just installed this for my 2019 V60 T8. Only tank lid entity is not working. Great add-on!

Hi All,

I defined the value of the OTP from the Developer Tools
otp-value

But I have this error

May 27 13:27:44 volvo2mqtt [106] - INFO: Waiting for otp code… Please check your mailbox and post your otp code to the following mqtt topic “volvoAAOS2mqtt/otp_code”. Retry 14/15
Traceback (most recent call last):
File “/volvoAAOS2mqtt/main.py”, line 15, in
authorize()
File “/volvoAAOS2mqtt/volvo.py”, line 71, in authorize
response = send_otp(auth_session, response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/volvoAAOS2mqtt/volvo.py”, line 155, in send_otp
raise Exception (“No OTP found, exting…”)
Exception: No OTP found, exting…
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
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
/volvoAAOS2mqtt/mqtt.py:56: SyntaxWarning: invalid escape sequence ‘\d’
“pattern”: “\d{6}”,

Have you a fix ?

Try just going to Settings, Entities, and searching for OTP and editing it there. Editing it in States might be causing issues.

1 Like

I am also unable to configure the OTP code (through entities) :sleepy:

Why you are unable ? Whats your problem ?

Hi Dielee,
I was unable to make it work with version 1.9.0 : after configuring the OTP on the volvo_otp entity and restarting the add-on, I was getting a new OTP passwork through e-mail.
I just saw that a version 1.9.1 of the add-on was available and it seems to be fine now.
Neverthless I am getting an syntax warning in the logs, but this doesn’t prevent the add-on to work correctly.

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
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
/volvoAAOS2mqtt/mqtt.py:56: SyntaxWarning: invalid escape sequence ‘\d’
“pattern”: “\d{6}”,

Ok, nice. Thanks for your input.
Which HA Version are you on ?

Latest

image

OTP bug fixed with the v1.9.1 and Entity value (Thanks a lot)

But this warning is still here
volvoAAOS2mqtt/mqtt.py:56: SyntaxWarning: invalid escape sequence ‘\d’
“pattern”: “\d{6}”,

That’s just a syntax warning, think this can be fixed by prefixing the regular epression with a raw string (r) @Dielee

"pattern": r"\d{6}",

Yes, thanks. Fixed this already. Pushing later this day a new version.

Heya all. I got myself a MY2023 XC40 in the UK, set up the Volvo account, and bumped into configuration set up problems with answers spread out in this thread. To even get config to save:

I needed a password without a special character.
I needed a short API of a dozen numbers unlike the massive token.

I have MQTT running doing other services, so I think that’s fine.

Q1. The config saves with “GB” or with “en_GB” as the locale - which one is correct?

Q2. The log spits out some errors when it runs, and then successfully stops>

May 27 15:41:45 volvo2mqtt [106] - INFO: Starting volvo2mqtt version v1.9.0
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.12/site-packages/paho/mqtt/client.py”, line 914, in connect
return self.reconnect()
^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/site-packages/paho/mqtt/client.py”, line 1044, in reconnect
sock = self._create_socket_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/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.12/socket.py”, line 828, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.12/socket.py”, line 963, 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

I’m not receiving an e-mail after upgrading to 1.9.1. I’ve checked my spambox as well. No e-mail from Volvo.