Skip to content

add CarState.odometer (Kilometerstand)#3210

Open
rleidner wants to merge 9 commits intoopenWB:masterfrom
rleidner:CarState_odometer
Open

add CarState.odometer (Kilometerstand)#3210
rleidner wants to merge 9 commits intoopenWB:masterfrom
rleidner:CarState_odometer

Conversation

@rleidner
Copy link
Collaborator

@rleidner rleidner commented Mar 16, 2026

Add odometer (Kilometerstand) to

_diff = int(_now - _carState.soc_timestamp)
if _diff > self.general_config.request_interval_charging and\
vehicle_update_data.plug_state and\
vehicle_update_data.charge_state and\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warum hast Du das geändert?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, gehört eigentlich nicht in diesen PR, aber der war eben offen.
Resultierte aus dieser Diskussion mit einem Tester: https://forum.openwb.de/viewtopic.php?p=140943#p140943
Solange nicht geladen wird erscheint ihm der Warn-Zustand im Status "zu hart".
Ich bin da "leidenschaftslos".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wenn zwischen Ladestop und letzter SoC-Berechnung noch geladen wurde, wird das nicht berechnet. Am saubersten wäre es, zu prüfen, ob seit der letzten Berechnung geladen wurde. Also ob vehicle_update_data.imported - last_imported > 0 ist.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, wird das nicht schon durch diese Bedingung in Zeile 141 erledigt?
(self.calculated_soc_state.last_imported or vehicle_update_data.imported)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.calculated_soc_state.last_imported und vehicle_update_data.imported sind absolute Zählerstände, d.h. in Z. 141 wird geprüft, ob die Zählerstände vorhanden sind, aber nicht ob es eine Differenz gibt. Die wird erst in calc_vehicle_data ausgerechnet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, verstanden. Ich habe es so eingebaut und getestet. Test sieht gut aus.

rleidner and others added 6 commits March 19, 2026 16:17
Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>
Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>
Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>
Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>
@rleidner rleidner changed the title add CarState.odometer (Km-Stand) add CarState.odometer (Kilometerstand) Mar 19, 2026
@rleidner rleidner requested a review from LKuemmel March 19, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants