Repository navigation
soc_vwid/VWEUDA: improve ending thread when no longer configured #3577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Die Logik, dass der Thread dauerhaft läuft und über die Broker-Config beendet wird, bleibt so erhalten.
Was spricht dagegen, die Abfrage über das übliche SoC-Intervall zu starten und dann max 15 Minuten auf Daten zu warten und beim Erhalt von Daten den Thread zu beenden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das Portal stellt alle 15 min Daten zur Verfügung, die das Modul abholen sollte.
Manche der Datensets sind auch mal unvollständig oder mit älterem Zeitstempel als frühere Daten.
Das SoC-Modul soll alle Daten auswerten und im CarState den sinnvollsten Status melden.
Wenn nur im Abfrage-Intervall am Portal abgefragt wird, kann es passieren daß immer mal wieder so ein "schlechtes" Datenset als letztes genommen würde.
Deshalb soll asynchrone PollingThread laufen solange das Modul aktiv/konfiguriert ist.
Das entspricht auch dem Vorgehen im Homeassistant, dort wird auch ständig abgefragt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dann kann der Thread 15 Min laufen und dann das sinnvollste Datenpaket nehmen, was er in dieser Zeit bekommen hat?
Homeassistant hat eine komplett andere Software-Architektur als openWB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das Portal hat noch viele erratische Verhaltensweisen, die ich mit dem asynchronen Vorgehen so gut wie möglich ausbügeln kann, vor allem wird die gesamte Historie der von Portal bereitgestellten Daten benutzt.
Ich habe beim Portal-Support ca. 8 Tickets offen, die verschiedene Probleme ansprechen, leider bisher ohne Reaktion.
Ich würde daher den aktuellen Ansatz erst mal so lassen.
Das Modul wird voraussichtlich etlichen Support-Aufwand generieren, wenn mehr Benutzer das Modul nutzen würden, das die Probleme des Portals erst mal bei jedem hochkochen werden.
Das ist schlecht wegen der vielen Rückfragen und gut weil man die Benutzer an den Portal-Support verweisen kann.
Vielleicht erzeugt das dann genug Druck bei VW/Cariad, das Portal zu verbessern.
Wenn es für eine Freigabe in eine openWB (Patch-) Release nicht geeignet sein sollte, ist das für mich auch OK.
Vielleicht findet sich ja auch jemand, der das noch anpassen will.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ich habe jetzt noch Plausibilitätschecks eingebaut, damit ein schon erreichtes Ergebnis nicht durch ältere oder fehlende Daten wieder verschlechtert wird.
Das grundsätzliche Konstrukt, dass der parallel Thread permanent läuft und alle verfügbaren und sinnvollen Daten in den CarState einarbeitet muß ich beibehalten.
Wenn sich der Thread immer wieder beenden würde kann das m.E. nicht funktionieren.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, dann lassen wir das erstmal so und das VW-Modul bleibt aus dem Patch draußen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK für mich, bei der aktuellen Datenqualität würde es im Patch vermutlich auch zuviel Rückfragen und Frustration geben.
Im master wäre es irgendwann aber schon gut.
Bevor es weiter als im master ist würde ich auch noch weiteres anpassen:
Ich arbeite momentan auch an einem neuen SoC-Modul für das Tibber-API, das eine Reihe von EV-Herstellern ausser VW & Co unterstützt und die Daten in meinen Tests sehr zeitnah und bisher zuverlässig liefert (soc, range, soc_timestamp). KM-Stand/odometer habe ich dort noch nicht gefunden.
Wird aber noch etwas dauern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guter Plan