Volvo Oncall binding

Hi Ben,

Somehow I missed your reply, sorry about that. I’ve contacted you by PM, let’s try to schedule a Zoom or Teams session to resolve this as I am not sure either what is happening… might depend on the version of my rules, or something like that…

Regards,

Nika.

Well, that’s weird. The token_type is supposed to return “Bearer” instead of the entire authResponse.

The code is:

		var token_type = transform("JSONPATH", "token_type", authResponse)

Which is supposed to use the JSONPATH transform and look for token_type from the JSON:

{"access_token":"eyJhbGciOiJSUzI1NiIs<knip>NR5jd","token_type":"Bearer","expires_in":1799}

What version of OpenHAB are you using?

That was it! JSONPATH missing.
Now, everything is nicely rolling in! And we can start building nice things around it…

ps, I don’t agree with the average speed: 291 km/h. I know EV’s are fast, but that fast? Maybe I just need some extra readings to get my average lowered? Will now go for a relaxing drive… :wink:

Thanks for you effort and patience!!!

Nice Ben! Yes, the Volvo API is still somewhat buggy with some of the statistics. Good to know, they released a beta v2 version of the API which seems to be a bit more stable (and from my first tests using Postman it looks like the average speed is correct with v2):

I still need to incorporate it into the code.

Also good to know, maybe I should start a new thread, I have created some code to push the power percentage to ABRP (A Better Route Planner) using their API as well. Will publish it soon.

Still hoping some Java developer can actually create Bindings for this as well…

Regards,

Nika.

1 Like

Still hoping for someone to pick up development of the actual plugin from here. Home Assistant and Domoticz already have the plugins available…

Also good to know, Volvo now also published the location API:

Regards,

Nika.

I had a look at GitHub - Dielee/volvo2mqtt: Home Assistant addon for connecting AAOS Volvos. After getting the vcc-api-key from https://developer.volvocars.com/account/ and changing some configurations in the src/settings.json, I was able to connect to my XC40 BEV MY23. This addon communicates via MQTT (duh!) and I have succeeded to intercept with mosquitto_sub the message volvoAAOS2mqtt/availability online, but that’s about it. I haven’t figured out how to communicate via MQTT with the addon.

I know it isn’t a very beautiful solution, but a quick hack could be to have this addon running as a service on the OS and then set up a {Generic MQTT Thing | HomeAssistant MQTT Component} in OpenHAB. Has anybody else tried this and figured out the MQTT topics and commands?

In fact, OpenHAB autodiscovered my car thing as a HomeAssistant MQTT Component. It created applicable channels as well.

One alternative (again, not so beautiful), would be to create a service running the process, but this would(?) be platform dependent.