Skip to content

feat(sensor): poll consumable maintenance/replacement alerts#54

Draft
jgus wants to merge 2 commits into
sjmotew:masterfrom
jgus:feat/consumable-alerts
Draft

feat(sensor): poll consumable maintenance/replacement alerts#54
jgus wants to merge 2 commits into
sjmotew:masterfrom
jgus:feat/consumable-alerts

Conversation

@jgus

@jgus jgus commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ Stacked on #52. Until #52 merges, this PR's diff includes its commits;
opened as a draft and will be marked ready (diff narrowing to just this feature)
once #52 lands in master.

Summary

Adds a periodic consumable/get_consumable_info query (at startup, then every
~30 min) and exposes the robot's maintainItems / replaceItems as two
problem binary sensors. The specific parts (mop, dust bag, side brush, …) are
listed in an items attribute.

Per-part life percentages are cloud-only and not available over the LAN protocol,
so these alert lists are what the robot exposes locally — but they're enough to
drive "time to clean/replace X" notifications.

Depends on #52

Uses the description-driven binary-sensor framework introduced in #52. Review/merge
that first; this branch is based on it (will rebase onto master once it lands).

Testing

tests/test_binary_sensor.py, test_models.py, test_coordinator.py updated;
suite green.

Relates to

jgus and others added 2 commits June 15, 2026 12:29
…gnostics

Decoded the full RobotBaseStatus proto and corrected mislabeled fields
parsed into state: battery_health→curingAgentConsumptionPercent (f38),
session_id→bindedUuid (f13), timestamp→stationBagHealthResetTime (f36),
upgrade status (read f2, not f4=stage), download state (read f3, not
f1=type); BaseStatusField/UpgradeStatusField enums corrected to match.

Added diagnostics from fields the robot already broadcasts:
  - sensors: dust bag health (f35), detergent remaining (f41)
  - binary_sensors (problem, field-gated): error/fault (f1, exposing
    code/level/detail + a best-effort help-center link), clean-water and
    sewage tanks, dust box, dust bag, station dust bag

Binary sensors are now description-driven; ha_stubs gains the
BinarySensorEntityDescription stub for the new tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a periodic consumable/get_consumable_info query (at startup and every
~30 min) and expose maintainItems/replaceItems as two problem
binary_sensors, with the specific parts (mop, dust bag, side brush, …)
listed in an `items` attribute. Per-part life % is cloud-only and not
available on the LAN protocol, so these alert lists are what the robot
exposes locally.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant