Skip to content

Expose vacuum_position as an image entity attribute - #52

Open
adriB0u wants to merge 1 commit into
Python-roborock:mainfrom
adriB0u:expose-vacuum-position
Open

adriB0u wants to merge 1 commit into
Python-roborock:mainfrom
adriB0u:expose-vacuum-position

Conversation

@adriB0u

@adriB0u adriB0u commented Dec 3, 2026

Copy link
Copy Markdown

Adds the robot position to the image entity's attributes, next to calibration_points, rooms and zones:

vacuum_position:
  x: 25601
  y: 25351
  a: -96

Why

The coordinator already refreshes the map, with the robot position in it, about every 30 s while cleaning. But no entity exposes that position. The only way to read it is the core roborock.get_vacuum_current_position action, which fetches the map again on every call. A card that follows the robot therefore doubles the cloud map requests, once per open screen.

With the attribute, a card reads the position from state and makes no extra request. It uses native map coordinates, like rooms and zones, so the consumer applies calibration_points itself. vacuum_position is also the attribute name that xiaomi-vacuum-map-card already reads, as Xiaomi Cloud Map Extractor exposed it.

This is a lighter take on the use case in #49 (robot position for a 3D floor plan overlay). It does not add the cleaning path, so no large arrays go into state or the recorder.

Testing

Ran on HA with a Roborock S7: after a restart, image.<map>_custom shows vacuum_position matching roborock.get_vacuum_current_position at the dock. A 3D floor plan card follows the attribute instead of calling the action. Not yet checked during a full cleaning run.

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