Repository navigation
fix(mqtt): only mark a vacuum online from its own MQTT traffic - #312
Merged
Merged
Conversation
record_mqtt_message marked a vacuum connected on any message whose topic named it, including app and Home Assistant requests on rr/m/i/.../<duid>. An offline vacuum that a client polls then reported online until that client's MQTT connection closed. Only the vacuum's own c2b publishes on rr/d/i/<did>/... now mark it connected, and the proxy marks it connected as soon as it logs in with its own MQTT credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lash-L
added a commit
that referenced
this pull request
Nov 29, 2026
Bump the package to 1.3.0-rc2 and point the opt-in Beta add-on at it. The v1.3.0-rc1 release build failed on a flaky test (fixed in #308), so no rc1 image was published; rc2 replaces it and adds #312, #313 and #314. The stable add-on stays on 1.2.1. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Offline vacuums were reported as
online: truein home data (/v2,/v3,/v4/user/homes/...),/user/devices/{duid}and the device list.RuntimeState.record_mqtt_messagemarked a vacuum connected on any MQTT message whose topic named it. That includes the requests the app and Home Assistant publish onrr/m/i/<u>/<mqtt_usr>/<duid>, which they send whether or not the vacuum is there. Each request setconnected=Trueand tied the vacuum to the client's connection, so an offline vacuum read online for as long as Home Assistant kept its MQTT session open. In the app, the device list then offers start/pause/dock on a vacuum that can't receive them instead of showing it offline.Now:
c2bonrr/d/i/<did>/...) mark it connected. App/HA traffic is still logged and still feeds pairing events.RuntimeState.record_device_mqtt_login, called from the proxy when a vacuum authenticates with its own MQTT credentials, marks it connected right away, before its first publish.Not an rc1 regression; this has been the behaviour since the first commit.
Proof that it works
Tested on:
main)What I did and what happened:
online: true(Home Assistant had polled it on its open MQTT session), S7false, a87true.falseuntil the a87 logged in; it readtrueabout 8 s later.get_statuson the Q7's and S7's app→robot topics (the server logged both PUBLISHes) and read home data before, during (session held open 20 s) and after: Q7 and S7 stayedfalse, the a87 stayedtrue. No errors in the server log.tests/test_home_data_online.py: two new cases reproduce an app-polled offline vacuum reading online on the old code and pass with the fix.test_admin_api.py::test_ui_api_health_and_vacuums_require_admin_authrelied on app traffic marking a vacuum connected and now publishes on the vacuum's own topic.Not tested live: a vacuum that really drops off (it still reads online for up to the 180 s grace).
Screenshots (required for any UI change)
No UI changes.
🤖 Generated with Claude Code