Signing-in to new Volvo API and collecting data from Node RED


I am an ameature of this, but eager to collect data from my EV og the Volvo API inn to Home assistant (the oldVolvo integration do not support the EV cars)

I see ( Authorisation – APIs | Volvo Cars Developer Portal ) that Volvo is using OAuth2 for logging on and i found node-red-contrib-oauth2 ( node-red-contrib-oauth2 (node) - Node-RED ) that seems to do the trick, but i am not sure of how to configure or use it. So if anyone has done something like this before i'm interested in some inputs on an flow for logging on and collecting status of my EV ( Specification – Energy API | Volvo Cars Developer Portal )

You mention Home Assistant (HA) in your post - not many people on this Node-RED forum use HA so you might not get that many responses, therefore might be better to ask your question on the HA forum.

I want to use NR for collecting data, getting the data i have collected it in to HA is no problem :slight_smile:

Ha, ha - that makes more sense.

node-red-contrib-oauth2 (node) - Node-RED

The documentation of that node includes a sample flow.
I have yet to see OAuth2 working within a node-red flow, good luck.

Hi! Did you get it sorted out? I'd like to use this to control the charging of the EV based on the power coming in from the solar generator.


About 2 years ago Volvo made their first new API ( Extended Vehicle API) available. Shortly after that another API came available ( Connected Vehicle API). In order to develop applications for one or both of these API's they offer a Demo "car", you can use. If you own a Volvo, you can with your Volvo Cars app (previously called Volvo on Call) also login and use the data of your own call

About 2 years ago, I created for both API's a Node-RED flow. If you are interested you can find them at GitHub - FireWizard52/Volvo-Extended-Vehicle-API-to-Domoticz and GitHub - FireWizard52/Volvo-Connected-Vehicle-API-to-Domoticz

They work for both the Demo "car" and your own car. The biggest problem is that the token expires after one hour, both for the Demo car and your private car. This makes the use of that API not very practical, compared to the Python script (GitHub - molobrakos/volvooncall: Retrieve information from the Volvo On Call (VOC) web service) This script is used by almost all Home Automation Systems. I created also a flow based on this one in order to get the data into Domoticz.

Very recent I noticed that again the Volvo developer portal has changed, which required some small changes in my flow. Yesterday, I updated Github with these changes.

The also made a new Energy API available. I followed the same approach as with the Connected Vehicle API, but it did not work. As I do not own a full electric Volvo, I had to use the Demo "Car".
However this API does not supply the VIN number of the DEMO car, which you need. I tried it with the VIN number of the Demo "car" for the Connected Vehicle API, but no luck.
So that does not work (yet)

I have now published the new Connected Vehicle API Node RED project, in order to get a "client-id" and a "client-secret". Let see, if they respond. They did not respond two years ago)

If someone can make the OAuth 2.0 working, we can continue, but for now both applications are on hold on Github.


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.