use QoS=2 when clearing set-topics #2430
Merged
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.
Siehe auch im Forum diverse Beiträge im Berechnung+Manuell Support-Thread, insbesondere meine "Diskussion" mit zut ab hier bis Seite 16 und dort insbesondere die gefundene Ursache ab hier (auf Seite 15).
Die Web-UI sendet Befehle an die openWB mit QoS=2:
openWB/web/live.js
Line 904 in 216379d
Das ist auch sinnvoll, denn der Befehl soll auch jeden Fall ausgeführt werden, also qos>=1 und er soll nicht mehrmals ausgeführt werden, also QoS=2.
Die OpenWB cleared das Topic aber mit QoS=0:
openWB/runs/mqttsub.py
Line 1673 in 81845c9
Dadurch ist die Reihenfolge in der die Nachrichten kommen nicht garantiert. Wie in dem entsprechenden Thread im Forum zu sehen ist, ist das Problem nicht nur theoretisch, sondern zumindest in Verbindung mit der openWB-Cloud real: Manchmal kommt die "clear"-Nachricht in der Cloud vor dem "set" an. Damit verliert das "clear" seine Wirkung und wenn die Verbindung zwischen openWB und Cloud unterbrochen und erneut aufgebaut wird, ist noch eine alte Nachricht mit "retain" in der Cloud und führt dazu, dass ungewollte Befehle ausgeführt werden.
Dieser PR behebt das Problem, indem auch das "clear" mit QoS=2 gesendet wird.