Can't login to mqtt with token

Hello.

PortalId: c0619ab2e756

User is using token.
Can login to VRM using this token but can’t login to mqtt: mqtt47.victronenergy.com using “Token token” as password.
Error: Connecting with MQTT server failed (NotAuthorized).
Why?

PS. It works fine for other users.

1 Like

Hello!

Should the access token be used as a password for MQTT login?
If so, I face the same issue. When logging in I receive the status code 5 which means - Connection refused: not authorized.
Did someone come up with the solution?

Do you use a user name and password to login?

Using token to login to mqtt is working.
Only for this one user it is not working.

Am I doing it the right way?

    username="myemail@email.com"
    token="tokenFromVRM"

    client = mqtt.Client("SomeRandomClientName")
    client.tls_set(cert_reqs=ssl.CERT_NONE)
    client.tls_insecure_set(True)
    client.username_pw_set(username=username, password=token)

I use the token generated at the vrm portal → preferences → integrations → Access tokens

@lxonline I use the username and instead of the password I use the token. I need it for my website for the Victron management so that users won’t share the credentials

No.
Before token from VRM you must put word “Token” and one space.
So:

token = “Token tokenFromVRM”

More info: GitHub - victronenergy/dbus-flashmq: Plugin for FlashMQ that interfaces between DBUS and MQTT.
Section: Connecting to the VRM MQTT servers

1 Like

Thanks a lot, Piotr!
It’s working now.