Help Required on BMW Plugin

Python and python framework

Moderator: leecollings

Post Reply
Filip
Posts: 111
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Help Required on BMW Plugin

Post by Filip »

Hi all,
Who will be able to help as this topics requires a bit deeper technical knowledge.
I developed a while ago the https://github.com/FilipDem/Domoticz-BMW-plugin, relying on the bimmer_connected library (https://github.com/bimmerconnected/bimmer_connected).

All works fine and seems to be used by multiple people.

The plugin needs a username/password to access the BMW Connected Drive (and some other data); all handled by the bimmer_connected library. In theory it would be possible to install twice the plugin in case two cars need to be managed. However we are getting into trouble as described by MadPatrick in https://github.com/FilipDem/Domoticz-BM ... 3146468947.

See the logs added by MadPatrick ("BMW" is one car; "Mini" is a second car):

Code: Select all

2025-08-02 14:15:28.378 Error: Mini: (Bmw) failed to load 'plugin.py', Python Path used was '/home/patrick/domoticz/plugins/Bmw/:/usr/lib/python311.zip:/usr/lib/python3.11:/usr/lib/python3.11/lib-dynload:/usr/local/lib/python3.11/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.11/dist-packages'.
2025-08-02 14:15:28.379 Error: Mini: Traceback (most recent call last):
2025-08-02 14:15:28.379 Error: Mini: File "/home/patrick/domoticz/plugins/Bmw/plugin.py", line 109, in <module>
2025-08-02 14:15:28.379 Error: Mini: from bimmer_connected.account import MyBMWAccount
2025-08-02 14:15:28.379 Error: Mini: File "/usr/local/lib/python3.11/dist-packages/bimmer_connected/account.py", line 10, in <module>
2025-08-02 14:15:28.379 Error: Mini: from bimmer_connected.api.authentication import MyBMWAuthentication
2025-08-02 14:15:28.379 Error: Mini: File "/usr/local/lib/python3.11/dist-packages/bimmer_connected/api/authentication.py", line 14, in <module>
2025-08-02 14:15:28.379 Error: Mini: import jwt
2025-08-02 14:15:28.379 Error: Mini: File "/usr/local/lib/python3.11/dist-packages/jwt/__init__.py", line 1, in <module>
2025-08-02 14:15:28.379 Error: Mini: from .api_jwk import PyJWK, PyJWKSet
2025-08-02 14:15:28.379 Error: Mini: File "/usr/local/lib/python3.11/dist-packages/jwt/api_jwk.py", line 7, in <module>
2025-08-02 14:15:28.379 Error: Mini: from .algorithms import get_default_algorithms, has_crypto, requires_cryptography
2025-08-02 14:15:28.379 Error: Mini: File "/usr/local/lib/python3.11/dist-packages/jwt/algorithms.py", line 12, in <module>
2025-08-02 14:15:28.379 Error: Mini: from .utils import (
2025-08-02 14:15:28.379 Error: Mini: File "/usr/local/lib/python3.11/dist-packages/jwt/utils.py", line 7, in <module>
2025-08-02 14:15:28.379 Error: Mini: from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurve
2025-08-02 14:15:28.379 Error: Mini: File "/usr/local/lib/python3.11/dist-packages/cryptography/hazmat/primitives/asymmetric/ec.py", line 11, in <module>
2025-08-02 14:15:28.379 Error: Mini: from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
2025-08-02 14:15:28.379 Error: Mini: File "/usr/local/lib/python3.11/dist-packages/cryptography/exceptions.py", line 9, in <module>
2025-08-02 14:15:28.379 Error: Mini: from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
2025-08-02 14:15:28.379 Error: Mini: ImportError: PyO3 modules do not yet support subinterpreters, see https://github.com/PyO3/pyo3/issues/576
2025-08-02 14:15:28.451 Status: BMW: Initialized version 4.1.0, author 'Filip Demaertelaere'
2025-08-02 14:15:30.696 Status: BMW: Login successful! BMW iX1 xDrive30 and VIN xxxxxxxxxxxxxxxxxx  found! Updating the status...
Who would be able to give some hints on the problem? It stops on an "import" problem of the PyO3 modules ("do not yet support subinterpreters"). Probably because they are being imported a second time... Using only one plugin installation doesn't give this problem...
Would this be linked to the embedded python of Domoticz? Other ideas?

Thanks for your help!

Filip
User avatar
waltervl
Posts: 6007
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Help Required on BMW Plugin

Post by waltervl »

Not a python programmer but to debug, is it possible to run a double session (in 2 terminal sessions) with the bimmer_connected library?
Just to test if the issue is in the Domoticz side or the bimner_connected side.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest