Seite 6 von 7

Re: Rückmeldungen openWB software 2.1.3 Alpha 4

Verfasst: Sa Feb 24, 2024 6:43 am
von mrinas
Lena, ich hab noch ein weiteres zugegeben sehr spezifisches Problem - welches ich gerne selber fixe, brauche aber einen Tipp.

Wir beziehen den SoC für den e2008 inzwischen über Tronity, das funktioniert grundsätzlich. Nun gibt es in der Lieferung dieser Daten bisweilen Latenzen. Das macht sich insbesondere beim SoC-gesteuerten Laden bemerkbar. SoC wird während des Ladevorgangs berechnet, SoC erreicht, Ladung beendet. SoC wird abgerufen, ist alt, Ladung beginnt erneut.

Mein Plan: Ich bekomme von Tronity einen Zeitstempel von wann diese Daten sind. Ich liefere aus dem Tronity Modul nur dann neue Daten wenn diese tatsächlich neuer sind und die manuelle Berechnung aktiv ist. Etwas ähnliches gab es im 1.9er PSA Modul bereits.
Meine Frage: Welche Rückgabewert soll ich liefern bzw. wie die Verarbeitung im Modul abbrechen wenn ich keine daten liefern will, aber auch keine Exception erzeuge?
Screenshot 2024-02-24 073337.png
Screenshot 2024-02-24 073337.png (41.94 KiB) 1426 mal betrachtet

Re: Support: Tronity

Verfasst: Sa Mär 09, 2024 11:54 am
von Donny
Beim Tronity-Modul habe ich des öfteren das Problem, dass der SOC auf 0 springt. Fehler letztendlich: unsupported operand type(s) for -: 'float' and 'NoneType'
Das kommt aber zwischen zwei Abfragen bei Tronity -- sofern vermutlich eine Abfrage nicht möglich ist...
Sehr ihr hier eine Lösung?

Anbei die Logs und der verwendete SW-Stand: 2024-03-08 12:51:29 +0100 [07daf8fa7]
ksnip_20240309-113126.png
(142.22 KiB) Noch nie heruntergeladen

Main-Log:
Main_log.txt
(127.13 KiB) 6-mal heruntergeladen
SOC-Log:
SOC-Log.txt
(5.45 KiB) 7-mal heruntergeladen

Periodischer Fehler unsupported operand type(s) for -: 'float' and 'NoneType'

Verfasst: So Apr 07, 2024 8:57 am
von andlem
Fehler tritt auf nach Anstecken zum Laden, danach wiederholt er sich bei jedem SOC-Abfragen während der Ladung.

Software 2.1.3 Release

Hier das Log:

Code: Alles auswählen

2024-04-06 22:02:03,150 - {modules.common.configurable_vehicle:56} - {DEBUG:fetch soc_ev1} - Vehicle Instance <class 'modules.vehicles.tronity.config.TronityVehicleSoc'>
2024-04-06 22:02:03,153 - {modules.common.configurable_vehicle:57} - {DEBUG:fetch soc_ev1} - Calculated SoC-State CalculatedSocState(imported_start=None, manual_soc=None, soc_start=33)
2024-04-06 22:02:03,154 - {modules.common.configurable_vehicle:58} - {DEBUG:fetch soc_ev1} - Vehicle Update Data VehicleUpdateData(plug_state=False, charge_state=False, imported=None, battery_capacity=46000, efficiency=90, soc_from_cp=None, timestamp_soc_from_cp=None)
2024-04-06 22:02:03,156 - {modules.common.configurable_vehicle:59} - {DEBUG:fetch soc_ev1} - General Config GeneralVehicleConfig(use_soc_from_cp=False, request_interval_charging=300, request_interval_not_charging=3600, request_only_plugged=False)
2024-04-06 22:02:03,157 - {modules.common.component_context:25} - {DEBUG:fetch soc_ev1} - Update Komponente ['Tronity']
2024-04-06 22:02:03,158 - {modules.vehicles.tronity.api:17} - {DEBUG:fetch soc_ev1} - Fetching Tronity SOC
2024-04-06 22:02:03,160 - {modules.vehicles.tronity.api:29} - {DEBUG:fetch soc_ev1} - Found Token: <token entfernt>
2024-04-06 22:02:03,162 - {modules.vehicles.tronity.api:36} - {DEBUG:fetch soc_ev1} - Token still valid: {'sub': '<zahl entfernt>', 'appId': '<zahl entfernt>', 'vehicleId': None, 'scopes': [], 'role': 'user', 'iat': 1712433636, 'exp': 1712520036, 'aud': 'https://platform.tronity.io', 'iss': 'platform.tronity.io'}
2024-04-06 22:02:03,164 - {modules.vehicles.tronity.api:74} - {DEBUG:fetch soc_ev1} - Using existing Tronity Access Token
2024-04-06 22:02:03,183 - {urllib3.connectionpool:973} - {DEBUG:fetch soc_ev1} - Starting new HTTPS connection (1): api.tronity.tech:443
2024-04-06 22:02:03,183 - {urllib3.connectionpool:973} - {DEBUG:fetch soc_ev1} - Starting new HTTPS connection (1): api.tronity.tech:443
2024-04-06 22:02:03,403 - {urllib3.connectionpool:452} - {DEBUG:fetch soc_ev1} - https://api.tronity.tech:443 "GET /tronity/vehicles/660044a76d2a560014045091/last_record HTTP/1.1" 200 239
2024-04-06 22:02:03,403 - {urllib3.connectionpool:452} - {DEBUG:fetch soc_ev1} - https://api.tronity.tech:443 "GET /tronity/vehicles/660044a76d2a560014045091/last_record HTTP/1.1" 200 239
2024-04-06 22:02:03,407 - {modules.vehicles.tronity.api:99} - {DEBUG:fetch soc_ev1} - Retrieved Tronity data: {'odometer': 10061.8, 'range': 104, 'level': 33, 'charging': 'Disconnected', 'plugged': False, 'chargerPower': None, 'chargeRemainingTime': None, 'latitude': 48.47967, 'longitude': 9.19697, 'status': None, 'timestamp': 1712433560000, 'lastUpdate': 1712433560000}
2024-04-06 22:02:03,417 - {modules.common.configurable_vehicle:67} - {DEBUG:fetch soc_ev1} - Requested start soc from api: 33%
2024-04-06 22:02:03,421 - {modules.common.store._api:26} - {DEBUG:fetch soc_ev1} - Raw data CarState(soc=33, range=104, soc_timestamp=1712433560000)
2024-04-06 22:02:03,449 - {modules.common.store._api:30} - {INFO:store soc_ev1} - Saving CarState(soc=33, range=104, soc_timestamp=1712433560000)
2024-04-06 22:07:05,535 - {modules.common.configurable_vehicle:56} - {DEBUG:fetch soc_ev1} - Vehicle Instance <class 'modules.vehicles.tronity.config.TronityVehicleSoc'>
2024-04-06 22:07:05,540 - {modules.common.configurable_vehicle:57} - {DEBUG:fetch soc_ev1} - Calculated SoC-State CalculatedSocState(imported_start=None, manual_soc=None, soc_start=33)
2024-04-06 22:07:05,542 - {modules.common.configurable_vehicle:58} - {DEBUG:fetch soc_ev1} - Vehicle Update Data VehicleUpdateData(plug_state=True, charge_state=True, imported=2108981.93, battery_capacity=46000, efficiency=90, soc_from_cp=None, timestamp_soc_from_cp=None)
2024-04-06 22:07:05,547 - {modules.common.configurable_vehicle:59} - {DEBUG:fetch soc_ev1} - General Config GeneralVehicleConfig(use_soc_from_cp=False, request_interval_charging=300, request_interval_not_charging=3600, request_only_plugged=False)
2024-04-06 22:07:05,551 - {modules.common.component_context:25} - {DEBUG:fetch soc_ev1} - Update Komponente ['Tronity']
2024-04-06 22:07:05,553 - {modules.common.fault_state:49} - {ERROR:fetch soc_ev1} - Tronity: FaultState FaultStateLevel.ERROR, FaultStr <class 'TypeError'> ("unsupported operand type(s) for -: 'float' and 'NoneType'",), Traceback: 
Traceback (most recent call last):
  File "/var/www/html/openWB/packages/modules/common/configurable_vehicle.py", line 66, in update
    car_state = self._get_carstate_by_source(vehicle_update_data, source)
  File "/var/www/html/openWB/packages/modules/common/configurable_vehicle.py", line 111, in _get_carstate_by_source
    return CarState(soc=calc_soc.calc_soc(vehicle_update_data,
  File "/var/www/html/openWB/packages/modules/vehicles/common/calc_soc/calc_soc.py", line 13, in calc_soc
    imported_since_start = vehicle_update_data.imported - imported_start
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'

Re: Periodischer Fehler unsupported operand type(s) for -: 'float' and 'NoneType'

Verfasst: So Apr 07, 2024 9:21 am
von mrinas
andlem hat geschrieben: So Apr 07, 2024 8:57 am Fehler tritt auf nach Anstecken zum Laden, danach wiederholt er sich bei jedem SOC-Abfragen während der Ladung.

Software 2.1.3 Release

Hier das Log:

Code: Alles auswählen

2024-04-06 22:02:03,150 - {modules.common.configurable_vehicle:56} - {DEBUG:fetch soc_ev1} - Vehicle Instance <class 'modules.vehicles.tronity.config.TronityVehicleSoc'>
2024-04-06 22:02:03,153 - {modules.common.configurable_vehicle:57} - {DEBUG:fetch soc_ev1} - Calculated SoC-State CalculatedSocState(imported_start=None, manual_soc=None, soc_start=33)
2024-04-06 22:02:03,154 - {modules.common.configurable_vehicle:58} - {DEBUG:fetch soc_ev1} - Vehicle Update Data VehicleUpdateData(plug_state=False, charge_state=False, imported=None, battery_capacity=46000, efficiency=90, soc_from_cp=None, timestamp_soc_from_cp=None)
2024-04-06 22:02:03,156 - {modules.common.configurable_vehicle:59} - {DEBUG:fetch soc_ev1} - General Config GeneralVehicleConfig(use_soc_from_cp=False, request_interval_charging=300, request_interval_not_charging=3600, request_only_plugged=False)
2024-04-06 22:02:03,157 - {modules.common.component_context:25} - {DEBUG:fetch soc_ev1} - Update Komponente ['Tronity']
2024-04-06 22:02:03,158 - {modules.vehicles.tronity.api:17} - {DEBUG:fetch soc_ev1} - Fetching Tronity SOC
2024-04-06 22:02:03,160 - {modules.vehicles.tronity.api:29} - {DEBUG:fetch soc_ev1} - Found Token: <token entfernt>
2024-04-06 22:02:03,162 - {modules.vehicles.tronity.api:36} - {DEBUG:fetch soc_ev1} - Token still valid: {'sub': '<zahl entfernt>', 'appId': '<zahl entfernt>', 'vehicleId': None, 'scopes': [], 'role': 'user', 'iat': 1712433636, 'exp': 1712520036, 'aud': 'https://platform.tronity.io', 'iss': 'platform.tronity.io'}
2024-04-06 22:02:03,164 - {modules.vehicles.tronity.api:74} - {DEBUG:fetch soc_ev1} - Using existing Tronity Access Token
2024-04-06 22:02:03,183 - {urllib3.connectionpool:973} - {DEBUG:fetch soc_ev1} - Starting new HTTPS connection (1): api.tronity.tech:443
2024-04-06 22:02:03,183 - {urllib3.connectionpool:973} - {DEBUG:fetch soc_ev1} - Starting new HTTPS connection (1): api.tronity.tech:443
2024-04-06 22:02:03,403 - {urllib3.connectionpool:452} - {DEBUG:fetch soc_ev1} - https://api.tronity.tech:443 "GET /tronity/vehicles/660044a76d2a560014045091/last_record HTTP/1.1" 200 239
2024-04-06 22:02:03,403 - {urllib3.connectionpool:452} - {DEBUG:fetch soc_ev1} - https://api.tronity.tech:443 "GET /tronity/vehicles/660044a76d2a560014045091/last_record HTTP/1.1" 200 239
2024-04-06 22:02:03,407 - {modules.vehicles.tronity.api:99} - {DEBUG:fetch soc_ev1} - Retrieved Tronity data: {'odometer': 10061.8, 'range': 104, 'level': 33, 'charging': 'Disconnected', 'plugged': False, 'chargerPower': None, 'chargeRemainingTime': None, 'latitude': 48.47967, 'longitude': 9.19697, 'status': None, 'timestamp': 1712433560000, 'lastUpdate': 1712433560000}
2024-04-06 22:02:03,417 - {modules.common.configurable_vehicle:67} - {DEBUG:fetch soc_ev1} - Requested start soc from api: 33%
2024-04-06 22:02:03,421 - {modules.common.store._api:26} - {DEBUG:fetch soc_ev1} - Raw data CarState(soc=33, range=104, soc_timestamp=1712433560000)
2024-04-06 22:02:03,449 - {modules.common.store._api:30} - {INFO:store soc_ev1} - Saving CarState(soc=33, range=104, soc_timestamp=1712433560000)
2024-04-06 22:07:05,535 - {modules.common.configurable_vehicle:56} - {DEBUG:fetch soc_ev1} - Vehicle Instance <class 'modules.vehicles.tronity.config.TronityVehicleSoc'>
2024-04-06 22:07:05,540 - {modules.common.configurable_vehicle:57} - {DEBUG:fetch soc_ev1} - Calculated SoC-State CalculatedSocState(imported_start=None, manual_soc=None, soc_start=33)
2024-04-06 22:07:05,542 - {modules.common.configurable_vehicle:58} - {DEBUG:fetch soc_ev1} - Vehicle Update Data VehicleUpdateData(plug_state=True, charge_state=True, imported=2108981.93, battery_capacity=46000, efficiency=90, soc_from_cp=None, timestamp_soc_from_cp=None)
2024-04-06 22:07:05,547 - {modules.common.configurable_vehicle:59} - {DEBUG:fetch soc_ev1} - General Config GeneralVehicleConfig(use_soc_from_cp=False, request_interval_charging=300, request_interval_not_charging=3600, request_only_plugged=False)
2024-04-06 22:07:05,551 - {modules.common.component_context:25} - {DEBUG:fetch soc_ev1} - Update Komponente ['Tronity']
2024-04-06 22:07:05,553 - {modules.common.fault_state:49} - {ERROR:fetch soc_ev1} - Tronity: FaultState FaultStateLevel.ERROR, FaultStr <class 'TypeError'> ("unsupported operand type(s) for -: 'float' and 'NoneType'",), Traceback: 
Traceback (most recent call last):
  File "/var/www/html/openWB/packages/modules/common/configurable_vehicle.py", line 66, in update
    car_state = self._get_carstate_by_source(vehicle_update_data, source)
  File "/var/www/html/openWB/packages/modules/common/configurable_vehicle.py", line 111, in _get_carstate_by_source
    return CarState(soc=calc_soc.calc_soc(vehicle_update_data,
  File "/var/www/html/openWB/packages/modules/vehicles/common/calc_soc/calc_soc.py", line 13, in calc_soc
    imported_since_start = vehicle_update_data.imported - imported_start
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
Jup, ich hatte das neulich auch und konnte zumindest den Auslöser dafür finden. Ein Startwert wird nicht übergeben was dann zu diesem Fehler führt. Den Auslöser kenne ich allerdings nicht, auch ist mir nicht klar warum sich der Fehler im nächsten Laur nicht bereinigt. Ich such nachher mal meinen Post dazu raus und verlinke den hier.

Re: Periodischer Fehler unsupported operand type(s) for -: 'float' and 'NoneType'

Verfasst: So Apr 07, 2024 11:01 am
von andlem
mrinas hat geschrieben: So Apr 07, 2024 9:21 am
andlem hat geschrieben: So Apr 07, 2024 8:57 am Fehler tritt auf nach Anstecken zum Laden, danach wiederholt er sich bei jedem SOC-Abfragen während der Ladung.

Software 2.1.3 Release

Hier das Log:

Code: Alles auswählen

2024-04-06 22:02:03,150 - {modules.common.configurable_vehicle:56} - {DEBUG:fetch soc_ev1} - Vehicle Instance <class 'modules.vehicles.tronity.config.TronityVehicleSoc'>
2024-04-06 22:02:03,153 - {modules.common.configurable_vehicle:57} - {DEBUG:fetch soc_ev1} - Calculated SoC-State CalculatedSocState(imported_start=None, manual_soc=None, soc_start=33)
2024-04-06 22:02:03,154 - {modules.common.configurable_vehicle:58} - {DEBUG:fetch soc_ev1} - Vehicle Update Data VehicleUpdateData(plug_state=False, charge_state=False, imported=None, battery_capacity=46000, efficiency=90, soc_from_cp=None, timestamp_soc_from_cp=None)
2024-04-06 22:02:03,156 - {modules.common.configurable_vehicle:59} - {DEBUG:fetch soc_ev1} - General Config GeneralVehicleConfig(use_soc_from_cp=False, request_interval_charging=300, request_interval_not_charging=3600, request_only_plugged=False)
2024-04-06 22:02:03,157 - {modules.common.component_context:25} - {DEBUG:fetch soc_ev1} - Update Komponente ['Tronity']
2024-04-06 22:02:03,158 - {modules.vehicles.tronity.api:17} - {DEBUG:fetch soc_ev1} - Fetching Tronity SOC
2024-04-06 22:02:03,160 - {modules.vehicles.tronity.api:29} - {DEBUG:fetch soc_ev1} - Found Token: <token entfernt>
2024-04-06 22:02:03,162 - {modules.vehicles.tronity.api:36} - {DEBUG:fetch soc_ev1} - Token still valid: {'sub': '<zahl entfernt>', 'appId': '<zahl entfernt>', 'vehicleId': None, 'scopes': [], 'role': 'user', 'iat': 1712433636, 'exp': 1712520036, 'aud': 'https://platform.tronity.io', 'iss': 'platform.tronity.io'}
2024-04-06 22:02:03,164 - {modules.vehicles.tronity.api:74} - {DEBUG:fetch soc_ev1} - Using existing Tronity Access Token
2024-04-06 22:02:03,183 - {urllib3.connectionpool:973} - {DEBUG:fetch soc_ev1} - Starting new HTTPS connection (1): api.tronity.tech:443
2024-04-06 22:02:03,183 - {urllib3.connectionpool:973} - {DEBUG:fetch soc_ev1} - Starting new HTTPS connection (1): api.tronity.tech:443
2024-04-06 22:02:03,403 - {urllib3.connectionpool:452} - {DEBUG:fetch soc_ev1} - https://api.tronity.tech:443 "GET /tronity/vehicles/660044a76d2a560014045091/last_record HTTP/1.1" 200 239
2024-04-06 22:02:03,403 - {urllib3.connectionpool:452} - {DEBUG:fetch soc_ev1} - https://api.tronity.tech:443 "GET /tronity/vehicles/660044a76d2a560014045091/last_record HTTP/1.1" 200 239
2024-04-06 22:02:03,407 - {modules.vehicles.tronity.api:99} - {DEBUG:fetch soc_ev1} - Retrieved Tronity data: {'odometer': 10061.8, 'range': 104, 'level': 33, 'charging': 'Disconnected', 'plugged': False, 'chargerPower': None, 'chargeRemainingTime': None, 'latitude': 48.47967, 'longitude': 9.19697, 'status': None, 'timestamp': 1712433560000, 'lastUpdate': 1712433560000}
2024-04-06 22:02:03,417 - {modules.common.configurable_vehicle:67} - {DEBUG:fetch soc_ev1} - Requested start soc from api: 33%
2024-04-06 22:02:03,421 - {modules.common.store._api:26} - {DEBUG:fetch soc_ev1} - Raw data CarState(soc=33, range=104, soc_timestamp=1712433560000)
2024-04-06 22:02:03,449 - {modules.common.store._api:30} - {INFO:store soc_ev1} - Saving CarState(soc=33, range=104, soc_timestamp=1712433560000)
2024-04-06 22:07:05,535 - {modules.common.configurable_vehicle:56} - {DEBUG:fetch soc_ev1} - Vehicle Instance <class 'modules.vehicles.tronity.config.TronityVehicleSoc'>
2024-04-06 22:07:05,540 - {modules.common.configurable_vehicle:57} - {DEBUG:fetch soc_ev1} - Calculated SoC-State CalculatedSocState(imported_start=None, manual_soc=None, soc_start=33)
2024-04-06 22:07:05,542 - {modules.common.configurable_vehicle:58} - {DEBUG:fetch soc_ev1} - Vehicle Update Data VehicleUpdateData(plug_state=True, charge_state=True, imported=2108981.93, battery_capacity=46000, efficiency=90, soc_from_cp=None, timestamp_soc_from_cp=None)
2024-04-06 22:07:05,547 - {modules.common.configurable_vehicle:59} - {DEBUG:fetch soc_ev1} - General Config GeneralVehicleConfig(use_soc_from_cp=False, request_interval_charging=300, request_interval_not_charging=3600, request_only_plugged=False)
2024-04-06 22:07:05,551 - {modules.common.component_context:25} - {DEBUG:fetch soc_ev1} - Update Komponente ['Tronity']
2024-04-06 22:07:05,553 - {modules.common.fault_state:49} - {ERROR:fetch soc_ev1} - Tronity: FaultState FaultStateLevel.ERROR, FaultStr <class 'TypeError'> ("unsupported operand type(s) for -: 'float' and 'NoneType'",), Traceback: 
Traceback (most recent call last):
  File "/var/www/html/openWB/packages/modules/common/configurable_vehicle.py", line 66, in update
    car_state = self._get_carstate_by_source(vehicle_update_data, source)
  File "/var/www/html/openWB/packages/modules/common/configurable_vehicle.py", line 111, in _get_carstate_by_source
    return CarState(soc=calc_soc.calc_soc(vehicle_update_data,
  File "/var/www/html/openWB/packages/modules/vehicles/common/calc_soc/calc_soc.py", line 13, in calc_soc
    imported_since_start = vehicle_update_data.imported - imported_start
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
Jup, ich hatte das neulich auch und konnte zumindest den Auslöser dafür finden. Ein Startwert wird nicht übergeben was dann zu diesem Fehler führt. Den Auslöser kenne ich allerdings nicht, auch ist mir nicht klar warum sich der Fehler im nächsten Laur nicht bereinigt. Ich such nachher mal meinen Post dazu raus und verlinke den hier.
Der Fehler ist bei mir bisher reproduzierbar bei jedem Ladevorgang und tritt dann bei jeder SOC-Abfrage auf.

Re: Support: Tronity

Verfasst: So Apr 07, 2024 11:10 am
von mrinas
Interessant, ich hab den Fehler nur sporadisch, meistens geht alles gut, nur hin und wieder gibt's das Problem.

Re: Support: Tronity

Verfasst: Sa Apr 13, 2024 11:50 am
von andlem
Der genannte Fehler tritt immer noch genau wie beschrieben auf, d. h. bei jeder Ladung. Auch Neustart der WB hat nicht geholfen. Der WB liest als SoC 0% und lädt mein Auto immer auf 100% auf. Tronity zeigt den SoC korrekt an. Was kann ich noch beisteuern (Logfiles o. ä.), damit der Fehler gefunden werden kann? So wie es jetzt ist, habe ich das Tronity-Abo, das ich dafür abgeschlossen habe, für mich leider nutzlos.

Re: Support: Tronity

Verfasst: Sa Apr 13, 2024 12:19 pm
von andlem
Wenn ich allerdings in der GUI auf "Refresh SoC" drücke, wird der korrekte SoC von Tronity abgeholt und angezeigt. Danach funktioniert auch der Ladevorgang und die Fehlermeldungen bleiben aus.

Re: Support: Tronity

Verfasst: So Apr 14, 2024 3:41 pm
von andlem
Das hat auch nur einmal funktioniert. Heute ist wieder der SoC beim Beginn der Ladung auf 0 gesprungen und bleibt dort jetzt auch, egal, ob ich Refresh drücke.

Re: Support: Tronity

Verfasst: Fr Apr 19, 2024 8:08 am
von andlem
Das Problem ließ sich beheben durch Deaktivieren des BMW-SoC-Moduls beim Zweitfahrzeug. Dieses liefert seit einiger Zeit Fehler, weil BMW etwas geändert hat, was in der openWB-Implementierung des SoC-Moduls noch nicht nachgezogen wurde. Ich hätte hier eigentlich keinen Seiteneffekt auf die anderen Komponenten erwartet. Evtl. wird die Exception nicht früh genug gefangen …