Repository navigation
Conversation
17 tasks
infy1995
marked this pull request as draft
November 29, 2026 21:54
infy1995
marked this pull request as ready for review
November 29, 2026 22:00
infy1995
marked this pull request as draft
November 30, 2026 08:24
infy1995
force-pushed
the
feat/a01-online-notice
branch
from
November 30, 2026 09:11
71288d7 to
ea7a537
Compare
infy1995
marked this pull request as ready for review
November 30, 2026 09:16
The cloud sends a notice (message protocol 500, `{"online": bool}`) on an A01
device's topic when it loses or regains the device, for example when it goes to
sleep and wakes up. The library dropped it, so a sleeping device could not be
told apart from one that stopped answering.
`device.dyad.is_online` (and `device.zeo.is_online`) now follows the notice.
Update listeners fire when it changes, and any data message from the device
also marks it online. The decoder lives in `protocols/online_notice.py`, so
other protocol families can use it. `A01DeviceSimulator.set_online()`
simulates it.
The cloud sends the same online notice on a V1 device's topic when it loses or regains the device, for example when the vacuum is switched off or loses the network. Without it a consumer cannot tell such a vacuum from one that stopped answering. `device.v1_properties.is_online` follows the notice, and any other message or a local connection marks the device online. `add_online_listener()` reports changes. `set_online()` moved to the base simulator, so V1 devices can be simulated offline too.
infy1995
force-pushed
the
feat/a01-online-notice
branch
from
November 30, 2026 09:27
ea7a537 to
fbd33de
Compare
This branch has not been deployed
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.
Summary
The Roborock cloud, not the device, publishes a notice on a V1 or A01 device topic when it loses or regains that device (message protocol 500, plain JSON
{"online": bool}). Thefalsenotice arrived while the device was cut off from the network, so the device could not have sent it. The library dropped the notice, so consumers could not tell a device the cloud has lost from one that only stopped answering.A01 (
device.dyad/device.zeo)is_onlineisNoneuntil something arrives, then follows the notice. Any data message from the device also marks it online.last_message_time.V1 (
device.v1_properties)is_onlineisNoneuntil something arrives, then follows the notice. Any other cloud or local message, and a successful local connection, mean online.add_online_listener()fires only whenis_onlinechanges.PropertiesApiandtraits.v1.createtake a new requiredonline_trackerargument.Testing helpers:
set_online()on the base device simulator. While offline it ignores commands, pushes nothing and drops the local connection.The A01 part is the first step of the Dyad traits work mentioned in #1021. Requests to offline devices and the MQTT health manager are unchanged.
Device check
Run with this branch, listening only. Network blocks were made in the router.
roborock.vacuum.a144)true;is_onlineTrueonce the library connectedfalseafter about 50 s,is_onlineFalse; unblocked:truefalse, then a local message setis_onlineback toTrue8 s laterroborock.wdv.a194)falseafter 5 minutes (sleep),trueafter docking (run with the A01 commit)falseafter about a minute,trueafter unblockSo the notice comes from the cloud when it loses or regains a device. It is not a sleep announcement from the device, and it does not say why the device was lost. Neither notice moved
last_message_time. The notice was not seen on the local connection.A notice sent while the library is not subscribed is missed, for example while the connect of an offline V1 device is waiting to retry.
Not checked: power loss as such, Zeo, and notices during an MQTT session outage.
Conflicts with open PRs
roborock/devices/traits/a01/__init__.py,_on_message. Whichever merges second keeps the notice handling and passesonline=Truethrough their_merge_datapoints. Both already conflict withmainindevice_feature.py.roborock/testing/channel.py; whichever merges second keeps both additions.start()whose data points are all unsupported sends nothing but would still mark the device online; whichever merges second should skip that.main; this PR adds no conflicting file.Tests
pytestunder WSL2 (Ubuntu): 3321 passed, 45 xfailed on Python 3.11 and 3.14pre-commit run --all-files: clean