Page 1 of 11
Python Plugin: Volvo EV
Posted: Saturday 11 February 2023 16:32
by akamming
Hi,
started working on the Volvo API's
it's still very experimental and doesn't have a lot of sensor yet, but give it a try if you own a Volvo (X)C40 Pure Electric (Twin).
to install
- go to <domoticz dir>/plugins
- git clone
https://github.com/akamming/Domoticz_Vo ... rge_Plugin
- restart domoticz
- add hardware (Volvo Recharge (Full EV))
- configure VCC Key (can be acquired by registring an application on
https://developer.volvocars.com/apis/do ... g-started/, Volvo on Call username and password
- and enjoy (for now just range en battery percentage, but more will be added)
Re: Python Plugin: Volvo EV
Posted: Saturday 11 February 2023 19:44
by heggink
Nice. I have an xc40 recharge and would love to be able to set charge timers from domoticz since the hourly electricity rates are already in my domoticz system.
Re: Python Plugin: Volvo EV
Posted: Saturday 11 February 2023 20:37
by kiddigital
Hi @akamming , not sure if interesting/useful.. a while back I started some development on the Volvo-on-call API for another Volvo driver... it is native C++ hardware for Domoticz...
look at :
https://github.com/kiddigital/domoticz/ ... olvooncall
Feel free to use it if interesting...
Re: Python Plugin: Volvo EV
Posted: Saturday 11 February 2023 21:01
by akamming
kiddigital wrote: ↑Saturday 11 February 2023 20:37
Hi @akamming , not sure if interesting/useful.. a while back I started some development on the Volvo-on-call API for another Volvo driver... it is native C++ hardware for Domoticz...
look at :
https://github.com/kiddigital/domoticz/ ... olvooncall
Feel free to use it if interesting...
This is definitely very interesting!
Question: This one is also referring to clientid and client secret from development console. Volvo did not approve my app , since i am not a company and therefor they stated they cannot approve an app because i'm not a legal entity... (has to do with liablity etc..)
What would have been the procedure in this case to get the client secret (apparently there has to be a legal entity with terms and conditions)
Python Plugin: Volvo EV
Posted: Sunday 12 February 2023 9:23
by kiddigital
Good question, no idea.
Looks like Volvo has a little different view on how to accept ‘clients/apps’ in comparison to others like Daimler, Tesla, Kia, etc.
For those, as an individual (without a legal entity) you can register yourself as a developer and access the data of your own car via the API’s.
That is why every user of these modules have to register themselves and get there own ClientId and ClientSecret.
Seems that Volvo does not provide this to Volvo car owners? Only to registered companies?
Maybe send them a mail and ask for an explanation why they have a different approach?
Re: Python Plugin: Volvo EV
Posted: Sunday 12 February 2023 20:24
by akamming
kiddigital wrote: ↑Sunday 12 February 2023 9:23
Seems that Volvo does not provide this to Volvo car owners? Only to registered companies?
Maybe send them a mail and ask for an explanation why they have a different approach?
already asked them some time ago. Their reply was:
Thank you for the email.
As I mentioned in the previous one, our progressions with the clients are done on case-by-case basis, currently. And it highly involves adherences to GDPR and legal compliances – which our data protection officers and legal advocates have directed us to follow while creating applications.
While we encourage Open source solutions, being developer friendly - our aim is to support wide range of community. But due to our practical and administrative reasons attributing to the aforementioned compliance regulations, we are unfortunately feeling sorry in not processing with this approval further, at this point in time.
Hope you can understand the situation, looking forward to fix this for open source and will immediately come back to you with more support.
Python Plugin: Volvo EV
Posted: Monday 13 February 2023 6:41
by kiddigital
Bummer.. seems like Volvo’s legal and compliance people look at things differently than others.
So, dead-end?
Re: Python Plugin: Volvo EV
Posted: Monday 13 February 2023 8:15
by akamming
kiddigital wrote: ↑Monday 13 February 2023 6:41
Bummer.. seems like Volvo’s legal and compliance people look at things differently than others.
So, dead-end?
Only way i can think of is that of Volvo Gers more requests they might start thinking differently…
Would it be an option for readers who read this to start registrering apps at
https://developer.volvocars.com/apis/do ... g-started/ and asking for approvals? Hooefully we’ll convince them if they get more than one request
EDIT:
I just tried again, hopefully their policy changed already

Re: Python Plugin: Volvo EV
Posted: Monday 20 February 2023 9:38
by akamming
No reply from Volvo yet,
but some news: i think i finished the plugin using the current workaround (don't know how long Volvo will keep that loophole open. According to their docs the API should not work now

), at least it seams quite stable now are there (X)C40 Pure electric owners here on the forum who would like to try if the plugin works for them as well?
Install instructions are in the 1st message of this thread
Re: Python Plugin: Volvo EV
Posted: Monday 20 February 2023 12:21
by heggink
Installed and works like a charm. Would be brilliant if the charge planning could be set as well.
Re: Python Plugin: Volvo EV
Posted: Tuesday 21 February 2023 13:26
by akamming
heggink wrote: ↑Monday 20 February 2023 12:21
Installed and works like a charm. Would be brilliant if the charge planning could be set as well.
agreed, unfortunately that API is not released to dev community...
it should be there, since you can this using the app. But in official docs(
https://developer.volvocars.com/apis/) i have not yet found this functionality...
Re: Python Plugin: Volvo EV
Posted: Tuesday 28 March 2023 14:48
by heggink
Has this api been changed? Since a while, the plugin won;t work reporting a keyrror 'hood'..
Re: Python Plugin: Volvo EV
Posted: Tuesday 28 March 2023 14:59
by akamming
heggink wrote: ↑Tuesday 28 March 2023 14:48
Has this api been changed? Since a while, the plugin won;t work reporting a keyrror 'hood'..
hmmm... tx for noticing, just checked. Mine gives error too, and indeed just noticed output of API changed resulting in the plugin giving an error
bit busy now, will fix somewhere this week.
Re: Python Plugin: Volvo EV
Posted: Tuesday 28 March 2023 20:51
by akamming
Fixed with latest commit
Re: Python Plugin: Volvo EV
Posted: Wednesday 29 March 2023 20:38
by Naqua
i get errors (below) login goes well. Anything i'm doing wrong?
2023-03-29 20:37:17.079 Volvo: INFO: Updating Devices
2023-03-29 20:37:17.458 Error: Volvo: Call to function 'onHeartbeat' failed, exception details:
2023-03-29 20:37:17.460 Error: Volvo: Traceback (most recent call last):
2023-03-29 20:37:17.460 Error: Volvo: File "/home/pi/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 681, in onHeartbeat
2023-03-29 20:37:17.460 Error: Volvo: _plugin.onHeartbeat()
2023-03-29 20:37:17.460 Error: Volvo: File "/home/pi/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 646, in onHeartbeat
2023-03-29 20:37:17.460 Error: Volvo: Heartbeat()
2023-03-29 20:37:17.461 Error: Volvo: File "/home/pi/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 477, in Heartbeat
2023-03-29 20:37:17.461 Error: Volvo: GetRechargeStatus()
2023-03-29 20:37:17.461 Error: Volvo: File "/home/pi/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 371, in GetRechargeStatus
2023-03-29 20:37:17.461 Error: Volvo: int(RechargeStatus["data"]["electricRange"]["value"]),
2023-03-29 20:37:17.461 Error: Volvo: KeyError: 'electricRange'
2023-03-29 20:37:21.246 Smartmeter: P1 Smart Meter (Electriciteit)
2023-03-29 20:37:21.282 Smartmeter: Usage (Usage L1)
Re: Python Plugin: Volvo EV
Posted: Wednesday 29 March 2023 20:51
by akamming
i have no idea. At my side it's working fine...
Can you set debug to all (a setting in the plugin config). You might get more logging which will indicate the issue...
Re: Python Plugin: Volvo EV
Posted: Thursday 04 May 2023 10:37
by akamming
New Version available
(just do "git pull" and restart domoticz to upgrade, otherwise follow instruction in the above post)
Now contains ODOmeter and sends SOC to ABRP (if configured. Check github page for how to make setup).
Curious if this plugin is used and what your findings are..
Re: Python Plugin: Volvo EV
Posted: Thursday 04 May 2023 10:53
by waltervl
akamming wrote: ↑Thursday 04 May 2023 10:37
Curious if this plugin is used and what your findings are..
https://docs.github.com/en/repositories ... repository
Re: Python Plugin: Volvo EV
Posted: Thursday 04 May 2023 11:50
by akamming
tx..that's a good tip! (not a pro user, just a hobby dev

)
Re: Python Plugin: Volvo EV
Posted: Thursday 23 November 2023 21:46
by FireWizard
Hello @kamming,
Did you come any further with the plugin for Volvo?
The reason I ask this, is that I succeeded the get the Connected AP v2 up and running, but not the Extended API, the Energy API and the Location API.
I did not try the Connected API v1, as this will be deprecated in a couple of month.
The Energy API does not give any data, but connects. The reason is probably that my car is a
XC40 PHEV and not a BEV. The other 2 give a "scope" error.
The Demo car and my own car, with the created authorization from the Volvo developer portal works fine.
Regards
.