Python Plugin: Volvo EV

Python and python framework

Moderator: leecollings

akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

FireWizard wrote: Monday 07 July 2025 15:06 Hi @akamming,
The refresh token under 2 is (or was, since it’s no langer there) langer valid dan 1800s. I’ve Done tests with a refresh token of more than 2 days old and could still obtain a new token
I think, you are correct, but if you rotate the refresh_token, the old one will become invalid and will be "replaced" by the new one.
I don't think you can re-use an old "refresh_token" later on

I'm reading currently the Volvo Developer API and I see something, I did not see before.
You are also able to retrieve a complete list of any commands that you have sent.
Have you seen that before?
Nope
This API is Rate Limited to prevent malicious activity or accidents that cause service disruptions. The limit is set to 100 request per minute for a combination of the user's Volvo ID and the Client ID sending the request. A given user will have 100 requests per minute per application it uses. Should this limit be exceeded, the API will respond with HTTP code 429.

The invocation methods are more strictly limited to 10 requests per minute. This limit is also set using a combination of Volvo ID and Client ID. This stricter limitation is due to the underlying system's capacity.
Would that "id_token" be related to control the limitation instead of the current 10.000 calls/day?
no clue
The 7 days is not only the vision of Thomasddn, it is also stated on the Volvo developer page:
The access_token has a short lifespan. To create a seamless end-user experience, you will need to refresh the access token before it expires.

By default, refresh token rotation is enabled. Each time you call the Refresh endpoint, a new refresh token is created, and the old token is invalidated. If not rotated, the refresh_token is valid for 7 days. After that, the user has to re-authenticate.
That is what I know and I used that for my flow specification.

Regards
Check, i understand, tx for the clear explanation
rron
Posts: 279
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: Python Plugin: Volvo EV

Post by rron »

akamming wrote: Friday 04 July 2025 17:34
mvveelen wrote: Friday 04 July 2025 16:46 Hi, actually what's in the custom text device so that I have an overview in just 1 place.
Not sure how I can accomplish this.
several ways to go:
You could create a dzVents script to populate a text device or use something like dashticz to create your overview.

To be honest domoticz is a outdated for the UI (in my humble opinion, will not be a popular opinion in this forum), so you need more advanced ways to create simple overviews.

Tha'ts why i am now using a combi of domoticz (which is still far better than HA in flexibility in scripting, so I use it for the more complex scripting cases) and home assistant (for simple automations and dashboarding).

Sorry this is complete off topic but how do you use the HA user interface in combination with domoticz?



Alternatively: If you're an iphone user, you could also use https://github.com/PatchworkBoy/homebridge-edomoticz, to make apple home your dashboard. That was my setup before i moved to HA for that part.
Sorry my question is complete off topic but how do you use the HA user interface in combination with domoticz?
Rpi4, Docker, z-wave, zigbee, espeasy, smartevse
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

rron wrote: Monday 07 July 2025 17:44
akamming wrote: Friday 04 July 2025 17:34
mvveelen wrote: Friday 04 July 2025 16:46 Hi, actually what's in the custom text device so that I have an overview in just 1 place.
Not sure how I can accomplish this.
several ways to go:
You could create a dzVents script to populate a text device or use something like dashticz to create your overview.

To be honest domoticz is a outdated for the UI (in my humble opinion, will not be a popular opinion in this forum), so you need more advanced ways to create simple overviews.

Tha'ts why i am now using a combi of domoticz (which is still far better than HA in flexibility in scripting, so I use it for the more complex scripting cases) and home assistant (for simple automations and dashboarding).

Sorry this is complete off topic but how do you use the HA user interface in combination with domoticz?



Alternatively: If you're an iphone user, you could also use https://github.com/PatchworkBoy/homebridge-edomoticz, to make apple home your dashboard. That was my setup before i moved to HA for that part.
Sorry my question is complete off topic but how do you use the HA user interface in combination with domoticz?
Very offtopic indeed and if you would have searched the forum, you would have found the answer: viewtopic.php?t=42803
rron
Posts: 279
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: Python Plugin: Volvo EV

Post by rron »

You are right. I searched but not good enough :geek:
Rpi4, Docker, z-wave, zigbee, espeasy, smartevse
User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Python Plugin: Volvo EV

Post by FireWizard »

Hi, @akamming

Interesting article, I found, and probably for "something" new to come, as announced in that email.

https://auth0.com/blog/id-token-access- ... ifference/

Just to prepare yourself.

Regards
Last edited by FireWizard on Wednesday 05 November 2025 17:59, edited 1 time in total.
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

FireWizard wrote: Monday 07 July 2025 22:28 Hi, @akammingm

Interesting article, I found, and probably for "something" new to come, as announced in that email.

https://auth0.com/blog/id-token-access- ... ifference/

Just to prepare yourself.

Regards
Yeah I already found more artikels/docs like that.Unfortunately it all depends on how Volvo is gonna implement it and hopefully how they document it

It is a bad sign they already started changing the Production environment without notifying the developers community and/or updating the docs on what they did

Hopefully they don’t do this too often, cause then it becomes frustrating to maintain a plugin like this. It’s just a hobby so I don’t have the time to reverse engineer changes like this…
User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Python Plugin: Volvo EV

Post by FireWizard »

Hello @akamming,

You said:
It is a bad sign they already started changing the Production environment without notifying the developers community and/or updating the docs on what they did

Hopefully they don’t do this too often, cause then it becomes frustrating to maintain a plugin like this. It’s just a hobby so I don’t have the time to reverse engineer changes like this…
I have to disappoint you, as they already started with modifications, that will have impact on the maintenance of our projects.

They silently introduced Energy API Version 2, that will replace Version 1 completely.
Your (and mine) application Version 1 supported 5 of 7 Endpoints with the scopes for h4Yf0b.
In Version 2, this has been reduced to 2 Endpoints,

1 Endpoint gives you the capabilities of your car as a boolean value.
The other gives you the data of 10 "sensors". So the information has been extended, but so far only 2 supports my car (XC 40 PHEV Hybrid 2023).

These 2 endpoints has also new scopes, so I was afrai0d, that I had to register a new project, as you cannot extend an existing project with new scopes. But I noticed that the current user does support these 2 new scopes.

The new document does also mention a new API (Subscription API) But the API itself has not been published yet.

Some changes in the base URL and Header, but that is easy to accomplish.

You have 6 months to migrate.

So some challenges

I also noted that ThomasDDN already has implemented version 2 in his library and also the id_token.

Regards
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

FireWizard wrote: Thursday 10 July 2025 15:01 Hello @akamming,

You said:
It is a bad sign they already started changing the Production environment without notifying the developers community and/or updating the docs on what they did

Hopefully they don’t do this too often, cause then it becomes frustrating to maintain a plugin like this. It’s just a hobby so I don’t have the time to reverse engineer changes like this…
I have to disappoint you, as they already started with modifications, that will have impact on the maintenance of our projects.

They silently introduced Energy API Version 2, that will replace Version 1 completely.
Your (and mine) application Version 1 supported 5 of 7 Endpoints with the scopes for h4Yf0b.
In Version 2, this has been reduced to 2 Endpoints,

1 Endpoint gives you the capabilities of your car as a boolean value.
The other gives you the data of 10 "sensors". So the information has been extended, but so far only 2 supports my car (XC 40 PHEV Hybrid 2023).

These 2 endpoints has also new scopes, so I was afrai0d, that I had to register a new project, as you cannot extend an existing project with new scopes. But I noticed that the current user does support these 2 new scopes.

The new document does also mention a new API (Subscription API) But the API itself has not been published yet.

Some changes in the base URL and Header, but that is easy to accomplish.

You have 6 months to migrate.

So some challenges

I also noted that ThomasDDN already has implemented version 2 in his library and also the id_token.

Regards
i have no issues with improvements for which i have 6 months (was not aware of this one btw..., so tx for the hint) and are documented. My issue is that have breaking changes with no time to migrate and which are also undocumented... like the refresh token which is now changed..

Edit: This was an easy change, updates the plug-in with the v2 energy api. Nice to see more data available now. Tx for the tip!
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

FireWizard wrote: Monday 07 July 2025 22:28 Hi, @akammingm

Interesting article, I found, and probably for "something" new to come, as announced in that email.

https://auth0.com/blog/id-token-access- ... ifference/

Just to prepare yourself.

Regards
Hi @FireWizard: They fixed it. I checked the logs today, cause it would fail, since i implemented the workaround on July 7th. But the refresh token call now also sends back a new token. I did a scan on the logs and on July 10th as of about 2100 it was fixed.
User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Python Plugin: Volvo EV

Post by FireWizard »

Hello @akamming,

You wrote:
They fixed it. I checked the logs today, cause it would fail, since i implemented the workaround on July 7th. But the refresh token call now also sends back a new token. I did a scan on the logs and on July 10th as of about 2100 it was fixed.
I did not see that. For me it is still the same.

This morning I did a manual re-authentication. As in the past I received a refresh token, that you can use after 1799 seconds.
But in my case the response to the refresh token does not contain a new refresh token.

So in my case, it has not been fixed.

I discovered also something else:

Linus Dietz (dielee) made a small modification in his project. See: https://github.com/Dielee/volvo2mqtt/pull/295
I thought, that he stopped that project in favor of the new HA integration of ThomasDDN.

Have you done that as well?
In 3 places he replaced http for https. If that would be essential, then I would expect, that it would be corrected at the server (Volvo) side and that it is not something we should correct.

However, it is not a big job to correct.

Regards
Last edited by FireWizard on Wednesday 05 November 2025 18:06, edited 2 times in total.
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

FireWizard wrote: Sunday 13 July 2025 11:09 Hello @akamming,

You wrote:
They fixed it. I checked the logs today, cause it would fail, since i implemented the workaround on July 7th. But the refresh token call now also sends back a new token. I did a scan on the logs and on July 10th as of about 2100 it was fixed.
I did not see that . Fur me it is still the same.

This morning I did a manual re-authentication. As in the past I received a refresh token, that you can use after 1799 seconds.
But in my case the response to the refresh token does not contain a new refresh token.

So in my case, it has not been fixed.

I discovered also something else:

Linus Dietz (dielee) made a small modification in his project. See: https://github.com/Dielee/volvo2mqtt/pull/295
I thought, that we stopped that project in favor of the new HA integration of ThomasDDN>

Have you done that as well?
In 3 places he replaced http for https. If that would be essential, then I would expect, that it would be corrected at the server (Volvo) side and that it is not something we should correct.

However, it is not a big job to correct.

Regards
Yeah, I did this Some time ago. At that moment in time refreshing tokens also failed, so i force https now in the url’s which are returned by the Volvo api when refreshing tokens or authenticating
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

FireWizard wrote: Sunday 13 July 2025 11:09 Hello @akamming,

You wrote:
They fixed it. I checked the logs today, cause it would fail, since i implemented the workaround on July 7th. But the refresh token call now also sends back a new token. I did a scan on the logs and on July 10th as of about 2100 it was fixed.
I did not see that . Fur me it is still the same.

This morning I did a manual re-authentication. As in the past I received a refresh token, that you can use after 1799 seconds.
But in my case the response to the refresh token does not contain a new refresh token.

So in my case, it has not been fixed.

I discovered also something else:

Linus Dietz (dielee) made a small modification in his project. See: https://github.com/Dielee/volvo2mqtt/pull/295
I thought, that we stopped that project in favor of the new HA integration of ThomasDDN>

Have you done that as well?
In 3 places he replaced http for https. If that would be essential, then I would expect, that it would be corrected at the server (Volvo) side and that it is not something we should correct.

However, it is not a big job to correct.

Regards
i just checked the logs again... it seems there are periods with a refresh token and without in the api responses from Volvo. The interesting thing is that at after exactly 7 days, it was in a period when there was no refresh_token present, but at exactly that moment it did have a refresh_token in the reply. My guess is that they changed the code so that the refresh token is only returned in the output at the moment it expires (that would be more safe, cause less change of intercepting that token). But the new code is not on all nodes. So depending which node answers your api call you will get an anwser with or without a refresh token.

What my code basically does: If a refresh code is returned, it stores it. If not, it just used the "old" one for future refresh_access_token calls. So it is can handle this inconsistent server behaviour (just lucky, i didn't have this scenario in mind when i made this "workaround", which now seems to be a "solution")
User avatar
mvveelen
Posts: 710
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Python Plugin: Volvo EV

Post by mvveelen »

I've migrated my Domoticz installation from a Raspberry Pi 3B+ to a NUC. Everything is working fine now, also the Volvo plugin.

But.

Once in a while I see a bunch of errors although the plugin is working fine.
What can be the cause of it and....what could be the solution to prevent these errors (which I didn't have on my RPi)? I could, of course, switch off error logging, but that's not a solution.

Update interval is (unchanged): 60

The errors:

Code: Select all

2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~~~~~~~~~~^^^
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3.13/ssl.py", line 1304, in recv_into
2025-10-26 10:30:01.490 Error: Volvo: return self.read(nbytes, buffer)
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~^^^^^^^^^^^^^^^^
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3.13/ssl.py", line 1138, in read
2025-10-26 10:30:01.490 Error: Volvo: return self._sslobj.read(len, buffer)
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
2025-10-26 10:30:01.490 Error: Volvo: ConnectionResetError: [Errno 104] Connection reset by peer
2025-10-26 10:30:01.490 Error: Volvo:
2025-10-26 10:30:01.490 Error: Volvo: During handling of the above exception, another exception occurred:
2025-10-26 10:30:01.490 Error: Volvo:
2025-10-26 10:30:01.490 Error: Volvo: Traceback (most recent call last):
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/requests/adapters.py", line 667, in send
2025-10-26 10:30:01.490 Error: Volvo: resp = conn.urlopen(
2025-10-26 10:30:01.490 Error: Volvo: method=request.method,
2025-10-26 10:30:01.490 Error: Volvo: ...<9 lines>...
2025-10-26 10:30:01.490 Error: Volvo: chunked=chunked,
2025-10-26 10:30:01.490 Error: Volvo: )
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 841, in urlopen
2025-10-26 10:30:01.490 Error: Volvo: retries = retries.increment(
2025-10-26 10:30:01.490 Error: Volvo: method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]
2025-10-26 10:30:01.490 Error: Volvo: )
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 474, in increment
2025-10-26 10:30:01.490 Error: Volvo: raise reraise(type(error), error, _stacktrace)
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/urllib3/util/util.py", line 38, in reraise
2025-10-26 10:30:01.490 Error: Volvo: raise value.with_traceback(tb)
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 787, in urlopen
2025-10-26 10:30:01.490 Error: Volvo: response = self._make_request(
2025-10-26 10:30:01.490 Error: Volvo: conn,
2025-10-26 10:30:01.490 Error: Volvo: ...<10 lines>...
2025-10-26 10:30:01.490 Error: Volvo: **response_kw,
2025-10-26 10:30:01.490 Error: Volvo: )
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 534, in _make_request
2025-10-26 10:30:01.490 Error: Volvo: response = conn.getresponse()
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 516, in getresponse
2025-10-26 10:30:01.490 Error: Volvo: httplib_response = super().getresponse()
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3.13/http/client.py", line 1430, in getresponse
2025-10-26 10:30:01.490 Error: Volvo: response.begin()
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~~~~^^
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3.13/http/client.py", line 331, in begin
2025-10-26 10:30:01.490 Error: Volvo: version, status, reason = self._read_status()
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~~~~~~~^^
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3.13/http/client.py", line 292, in _read_status
2025-10-26 10:30:01.490 Error: Volvo: line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3.13/socket.py", line 719, in readinto
2025-10-26 10:30:01.490 Error: Volvo: return self._sock.recv_into(b)
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~~~~~~~~~~^^^
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3.13/ssl.py", line 1304, in recv_into
2025-10-26 10:30:01.490 Error: Volvo: return self.read(nbytes, buffer)
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~^^^^^^^^^^^^^^^^
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3.13/ssl.py", line 1138, in read
2025-10-26 10:30:01.490 Error: Volvo: return self._sslobj.read(len, buffer)
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
2025-10-26 10:30:01.490 Error: Volvo: urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
2025-10-26 10:30:01.490 Error: Volvo:
2025-10-26 10:30:01.490 Error: Volvo: During handling of the above exception, another exception occurred:
2025-10-26 10:30:01.490 Error: Volvo:
2025-10-26 10:30:01.490 Error: Volvo: Traceback (most recent call last):
2025-10-26 10:30:01.490 Error: Volvo: File "/home/marco/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 323, in VolvoAPI
2025-10-26 10:30:01.490 Error: Volvo: status = requests.get(
2025-10-26 10:30:01.490 Error: Volvo: url,
2025-10-26 10:30:01.490 Error: Volvo: ...<5 lines>...
2025-10-26 10:30:01.490 Error: Volvo: timeout=TIMEOUT
2025-10-26 10:30:01.490 Error: Volvo: )
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/requests/api.py", line 73, in get
2025-10-26 10:30:01.490 Error: Volvo: return request("get", url, params=params, **kwargs)
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/requests/api.py", line 59, in request
2025-10-26 10:30:01.490 Error: Volvo: return session.request(method=method, url=url, **kwargs)
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/requests/sessions.py", line 589, in request
2025-10-26 10:30:01.490 Error: Volvo: resp = self.send(prep, **send_kwargs)
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/requests/sessions.py", line 703, in send
2025-10-26 10:30:01.490 Error: Volvo: r = adapter.send(request, **kwargs)
2025-10-26 10:30:01.490 Error: Volvo: File "/usr/lib/python3/dist-packages/requests/adapters.py", line 682, in send
2025-10-26 10:30:01.490 Error: Volvo: raise ConnectionError(err, request=request)
2025-10-26 10:30:01.490 Error: Volvo: requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
2025-10-26 10:30:01.490 Error: Volvo:
2025-10-26 10:30:01.490 Error: Volvo: During handling of the above exception, another exception occurred:
2025-10-26 10:30:01.490 Error: Volvo:
2025-10-26 10:30:01.490 Error: Volvo: Traceback (most recent call last):
2025-10-26 10:30:01.490 Error: Volvo: File "/home/marco/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 1712, in onHeartbeat
2025-10-26 10:30:01.490 Error: Volvo: _plugin.onHeartbeat()
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~~~~~~~~~^^
2025-10-26 10:30:01.490 Error: Volvo: File "/home/marco/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 1677, in onHeartbeat
2025-10-26 10:30:01.490 Error: Volvo: Heartbeat()
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~^^
2025-10-26 10:30:01.490 Error: Volvo: File "/home/marco/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 1426, in Heartbeat
2025-10-26 10:30:01.490 Error: Volvo: UpdateDevices()
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~~~^^
2025-10-26 10:30:01.490 Error: Volvo: File "/home/marco/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 1372, in UpdateDevices
2025-10-26 10:30:01.490 Error: Volvo: GetLocation() #Location must be known before GetRechargeStatus te detect local charging and to detect if carhasmoved
2025-10-26 10:30:01.490 Error: Volvo: ~~~~~~~~~~~^^
2025-10-26 10:30:01.490 Error: Volvo: File "/home/marco/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 1104, in GetLocation
2025-10-26 10:30:01.490 Error: Volvo: Location = VolvoAPI("https://api.volvocars.com/location/v1/vehicles/" + vin + "/location", "application/json")
2025-10-26 10:30:01.490 Error: Volvo: File "/home/marco/domoticz/plugins/Domoticz_VolvoRecharge_Plugin/plugin.py", line 359, in VolvoAPI
2025-10-26 10:30:01.490 Error: Volvo: output=status.text
2025-10-26 10:30:01.490 Error: Volvo: ^^^^^^
2025-10-26 10:30:01.490 Error: Volvo: UnboundLocalError: cannot access local variable 'status' where it is not associated with a value
RPi3b+/RFXCOM rfxtrx433E/Shelly/Sonoff Zigbee Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

Seems to be a server side issue: "ConnectionResetError: [Errno 104] Connection reset by peer".

The rest of the errors is collateral damage, cause i don';t have this exception handled in the code.. Plugin works fine, cause probably the next time it tries it works, you just miss one update.

Does this happen a lot? Cause i checked my logs, (i keep them for the 3 months) and never seen any of this..
User avatar
mvveelen
Posts: 710
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Python Plugin: Volvo EV

Post by mvveelen »

On my RPi it never happened before, but on the NUC it now happens 1, 2 or more often per day. Error handling would be nice. When a connection is missed, try again in X seconds.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Sonoff Zigbee Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

mvveelen wrote: Sunday 26 October 2025 13:45 On my RPi it never happened before, but on the NUC it now happens 1, 2 or more often per day. Error handling would be nice. When a connection is missed, try again in X seconds.
ok, currently have some other priorities, so will take a look sometimes, but may take a while. Feel free to make a PR. I am looking for a maintainer anyway since i'll be returning my volvo in few months (end of lease)
User avatar
mvveelen
Posts: 710
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Python Plugin: Volvo EV

Post by mvveelen »

OK, I added an error handler in plugin.py (thanks ChatGPT....), and now the error hasn't shown for over a day.

Let's hope you find someone who can take it over.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Sonoff Zigbee Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

mvveelen wrote: Wednesday 05 November 2025 17:34 OK, I added an error handler in plugin.py (thanks ChatGPT....), and now the error hasn't shown for over a day.

Let's hope you find someone who can take it over.
Can you create a pr? I Will review and check of i can merge…
User avatar
mvveelen
Posts: 710
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Python Plugin: Volvo EV

Post by mvveelen »

Never done that before and I'm not getting any further after clicking on New pull request, any other way to share it with you?
RPi3b+/RFXCOM rfxtrx433E/Shelly/Sonoff Zigbee Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Volvo EV

Post by akamming »

mvveelen wrote: Wednesday 05 November 2025 22:37 Never done that before and I'm not getting any further after clicking on New pull request, any other way to share it with you?
Go to chatgpt, and enter the prompt: make instructions for someone who has never used github before to create a PR for his or her code change on https://github.com/akamming/Domoticz_Vo ... rge_Plugin

Alternative, if you have not made a commit yet (if you do not know what it is, you did not): Do a "git diff" command and post the output here..
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest