Anzeige von BMW-Fahrzeugdaten mit Hilfe von bimmer_connected

Begonnen von Jmr008, 22 Mai 2023, 13:39:50

Vorheriges Thema - Nächstes Thema

isy

Hier kann ich leider nicht weiterhelfen!
Über MQTT kann man auch schreiben, aber ob bimmerconnected das kann, solltest du im Git nachlesen bzw. nachfragen, sehr guter Support dort.
https://github.com/bimmerconnected
Ein Weg wird erst zu einem Weg, wenn man ihn geht

satprofi

#16
hallo.
klappt bei euch noch die abfrage? bei mir seit 26.4. 15:35 keine daten mehr.


"gelöst"
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

isy

Ein Weg wird erst zu einem Weg, wenn man ihn geht

Jmr008


satprofi

klappt heute wieder, dürfte serverproblem von bmw.at gewesen sein.
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

isy

Ein Weg wird erst zu einem Weg, wenn man ihn geht

satprofi

antwort vom entwickler

BMW seem to have updated their API and in the process it was very flaky.
Using the latest version (0.15.0) should work again


hatte am WE noch upgedated, aber erst Montag wieder verbindung.
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

satprofi

Hallo.
Klappt bei euch noch das modul? Seit freitag bekomme ich keine daten mehr, abfrage Script meldet sich mit

Client MyBMW sending CONNECT
Client MyBMW received CONNACK (0)
MyBMWQuotaError due to HTTPStatusError: Client error '429 Too Many Requests' for url 'ht
tps://customer.bmwgroup.com/gcdm/oauth/authenticate'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/authentication.py",
 line 419, in async_auth_flow
    response.raise_for_status()
  File "/usr/local/lib/python3.10/dist-packages/httpx/_models.py", line 759, in raise_fo
r_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '429 Too Many Requests' for url 'https://customer.bm
wgroup.com/gcdm/oauth/authenticate'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/bimmerconnected", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/cli.py", line 341, in m
ain
    loop.run_until_complete(args.func(args))
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/cli.py", line 137, in g
et_status
    await account.get_vehicles()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/account.py", line 101,
in get_vehicles
    await self._init_vehicles()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/account.py", line 78, i
n _init_vehicles
    vehicle_list_response = await client.post(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1877, in post
    return await self.request(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1559, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1646, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1671, in _send_h
andling_auth
    request = await auth_flow.__anext__()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/authentication.py",
 line 81, in async_auth_flow
    await self.login()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/authentication.py",
 line 130, in login
    token_data = await self._login_row_na()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/authentication.py",
 line 183, in _login_row_na
    response = await client.post(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1877, in post
    return await self.request(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1559, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1646, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1692, in _send_h
andling_auth
    raise exc
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1681, in _send_h
andling_auth
    next_request = await auth_flow.asend(response)
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/authentication.py",
 line 421, in async_auth_flow
    await handle_httpstatuserror(ex, log_handler=_LOGGER)
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/utils.py", line 86,
 in handle_httpstatuserror
    raise _ex_to_raise(_err_message) from ex
bimmer_connected.models.MyBMWQuotaError: HTTPStatusError: Client error '429 Too Many Req
uests' for url 'https://customer.bmwgroup.com/gcdm/oauth/authenticate'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429
Client MyBMW sending DISCONNECT
beelink@beelink-MINI:~$
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

isy

Gerade getestet und klappt wie immer.

Meine Logik beim PV Laden fragt den Status nur bei Statusänderung der Wallbox (GoE) ab.
Also 2 mal bei jedem Ladevorgang.
VG Helmut
Ein Weg wird erst zu einem Weg, wenn man ihn geht

satprofi

hmmm, dann warte ich ab.
das login script ist gleich geblieben, oder?
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

isy

Ein Weg wird erst zu einem Weg, wenn man ihn geht

satprofi

Zitat von: isy am 23 Juli 2024, 11:44:49Ja, ich habe ewig nichts geändert
Hallo.
lautet dein script wirklich so?
#!/bin/bash
PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
bimmerconnected status --json user passwd rest_of_world | mosquitto_pub -h 192.168.0.1 -p 1883 -u DVES_USER -P DVES_USER -d -t /bmw -l -i MyBMW --quiet

ich bekomme nämlich wieder dies als ausgabe, ohne aktualisierung
beelink@beelink-MINI:~$ /usr/local/bin/i3status
Client MyBMW sending CONNECT
Client MyBMW received CONNACK (0)
[b]MyBMWQuotaError due to HTTPStatusError: Client error '429 Too Many Requests' for url 'https://customer.bmwgroup.com/gcdm/oauth/authenticate'[/b]
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/authentication.py", line 419, in async_auth_flow
    response.raise_for_status()
  File "/usr/local/lib/python3.10/dist-packages/httpx/_models.py", line 759, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '429 Too Many Requests' for url 'https://customer.bmwgroup.com/gcdm/oauth/authenticate'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/bimmerconnected", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/cli.py", line 341, in main
    loop.run_until_complete(args.func(args))
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/cli.py", line 137, in get_status
    await account.get_vehicles()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/account.py", line 101, in get_vehicles
    await self._init_vehicles()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/account.py", line 78, in _init_vehicles
    vehicle_list_response = await client.post(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1877, in post
    return await self.request(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1559, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1646, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1671, in _send_handling_auth
    request = await auth_flow.__anext__()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/authentication.py", line 81, in async_auth_flow
    await self.login()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/authentication.py", line 130, in login
    token_data = await self._login_row_na()
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/authentication.py", line 183, in _login_row_na
    response = await client.post(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1877, in post
    return await self.request(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1559, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1646, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1692, in _send_handling_auth
    raise exc
  File "/usr/local/lib/python3.10/dist-packages/httpx/_client.py", line 1681, in _send_handling_auth
    next_request = await auth_flow.asend(response)
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/authentication.py", line 421, in async_auth_flow
    await handle_httpstatuserror(ex, log_handler=_LOGGER)
  File "/usr/local/lib/python3.10/dist-packages/bimmer_connected/api/utils.py", line 86, in handle_httpstatuserror
    raise _ex_to_raise(_err_message) from ex
bimmer_connected.models.[b]MyBMWQuotaError: HTTPStatusError: Client error '429 Too Many Requests' for url 'https://customer.bmwgroup.com/gcdm/oauth/authenticate'[/b]
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429
Client MyBMW sending DISCONNECT
beelink@beelink-MINI:~$
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

isy

Komme erst heute dazu, dir zu antworten.
Hier mein Skript:

#!/bin/bash
PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin bimmerconnected status --json <BMW_user> <BMW_Passwort> rest_of_world | mosquitto_pub -h 192.168.xxx.xx -p 1883 -u <mqtt2_user> -P <mqtt2_Passwort> -d -t /bmw -l -i MyBMW --quiet

Der Prozess soeben (beim Ein- oder Ausfahren aus der Garage und beim Anstecken des Ladekabels wird das Skript aufgerufen) funktioniert wie immer.

VG Helmut
Ein Weg wird erst zu einem Weg, wenn man ihn geht

satprofi

Zitat von: isy am 26 Juli 2024, 11:41:34Komme erst heute dazu, dir zu antworten.
Hier mein Skript:

#!/bin/bash
PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin bimmerconnected status --json <BMW_user> <BMW_Passwort> rest_of_world | mosquitto_pub -h 192.168.xxx.xx -p 1883 -u <mqtt2_user> -P <mqtt2_Passwort> -d -t /bmw -l -i MyBMW --quiet

Der Prozess soeben (beim Ein- oder Ausfahren aus der Garage und beim Anstecken des Ladekabels wird das Skript aufgerufen) funktioniert wie immer.

VG Helmut

Hallo.
Rufst du nur 1x ab? wie oft ist das maximum? ich rufe alle 15min. ab, wegen Ladezustand z.b.
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

isy

Eine Abfrage erfolgt nur auf folgende Events:
- Garage auf
- Garage zu
- Statusänderung der Wallbox

Den Rest steuert die Logik der PV-Überschussregelung.

Unser E-Auto wird überwiegend in der Stadt genutzt, so daß es eine Sonderfunktion gibt, die ab SOC < 10km das Auto auf ca. 25km (zeitgesteuert) auflädt, egal was die PV-Regelung eigentlich vorsieht.

Daher brauche ich den SOC nur bei obigen Events abfragen.

Ein Weg wird erst zu einem Weg, wenn man ihn geht