What's Actually Useful About the Roborock Map in Home Assistant
Roborock Q5 Pro in Home Assistant: set up the interactive map card from HACS, clean single rooms by segment and track brush and filter wear.
The Roborock integration is built into HA. No HACS is needed, but you do need a Roborock cloud account to authenticate. Add the integration, sign in, and the vacuum appears. What it doesn't tell you is that the interesting part comes from a separate HACS card that renders the live map.
The Robot page on the wall tablet
On the wall tablet the map takes the left half and everything else sits in one column on the right. The map is blurred in the pictures because it is my floor plan. The code further down is from the first version of this setup, so its entity names and the percentage sensors are old.
Map: zones and go-to
The map card draws a zone cleanup or sends the robot to a spot. Zone cleanup is a rectangle you draw on the map, go-to is a tap. The padlock in the corner locks panning and zooming, so a bump doesn't move the map. The calibration comes from the map image itself, so there are no points to set by hand, and two_finger_pan makes a one-finger swipe scroll the page instead of the map.
type: custom:xiaomi-vacuum-map-card
entity: vacuum.robo
vacuum_platform: Roborock
map_source:
camera: image.robo_map
calibration_source:
camera: true
map_modes:
- template: vacuum_clean_zone
- template: vacuum_goto
two_finger_pan: true
Room buttons and suction
The four buttons (Full, Living, Bedroom, Kitchen) press button entities that the Roborock integration creates from the routines saved in the Roborock app. A press is one button.press call, so there are no room ids to look up, and the Kitchen button runs a routine I named "After meals". The chips below set the suction: Quiet, Balanced, Turbo or Max, and the active one is coloured.

Maintenance as percent and hours
The filter, side brush, main brush and sensors each show a percentage and the hours left, like "91% - 137h of 150h". My version of the integration reports only hours left, so the template divides by the part's rated life: 150 h for the filter, 200 h for the side brush, 300 h for the main brush and 30 h for the sensors.
secondary: >
{% set left = states('sensor.robo_filter_time_left') | float(0) %}
{{ ([[left / 150 * 100, 0] | max, 100] | min) | round(0) | int }}% - {{ left | round(0) | int }}h of 150h
Mop
Mop mode is a select entity. The intensity row only shows when the robot reports a value, and hides itself while the state is unknown, so the page has no row that says "Unknown".
The integration
Cloud polling, 5-second refresh. Local communication is possible but requires extracting keys from the device firmware, which I didn't bother with. For anything that matters (starting a clean, checking battery, room segments), cloud polling is fast enough.
Entities after setup:
vacuum.roborock_s5_max
sensor.roborock_battery
sensor.roborock_status
sensor.roborock_last_clean_area
sensor.roborock_main_brush_left — percentage of life remaining
sensor.roborock_side_brush_left
sensor.roborock_filter_left
sensor.roborock_sensor_dirty_left
The map card
custom:xiaomi-vacuum-map-card (HACS) is what makes this setup actually useful. It renders the live map with your room zones labeled, and tapping a room starts cleaning just that segment.
type: custom:xiaomi-vacuum-map-card
entity: vacuum.roborock_s5_max
map_source:
camera: camera.roborock_map
calibration_source:
auto: true
rooms:
- id: 16
name: Living Room
icon: mdi:sofa
- id: 17
name: Kitchen
icon: mdi:silverware-fork-knife
- id: 18
name: Bedroom
icon: mdi:bed
- id: 19
name: Office
icon: mdi:desk
map_modes:
- template: vacuum_clean_segment
- template: vacuum_goto
Finding your room IDs: open Developer Tools → Template, and evaluate {{ state_attr('vacuum.roborock_s5_max', 'room_list') }}. The IDs are integers assigned when the map was created in the app. Mine started at 16, and yours will probably be different.
The card lives inside a glass stack-in-card. Map cards need border-radius: 0 on the inner card, and the outer container needs overflow: hidden. Otherwise the map's corners bleed outside the rounded glass wrapper.
type: custom:stack-in-card
card_mod:
style: |
ha-card {
background: rgba(255,255,255,0.05) !important;
backdrop-filter: blur(15px) !important;
border: 1px solid rgba(255,255,255,0.10) !important;
box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
border-radius: 28px !important;
overflow: hidden !important;
}
ha-card::before { display: none !important; }
cards:
- type: custom:xiaomi-vacuum-map-card
# ...
card_mod:
style: |
ha-card { border-radius: 0; box-shadow: none; border: none; }
Maintenance sensors
The brush and filter sensors count down from 100% to 0%. I ignored them for too long, and then the main brush warning notification showed up at 8%. The brush turned out to be much more worn than I expected from a percentage.
Now I have colored indicator cards for each component, using custom:mushroom-template-card (HACS, Mushroom suite) with card_mod (HACS) for the color logic:
type: custom:mushroom-template-card
primary: "{{ states('sensor.roborock_main_brush_left') }}%"
secondary: Main brush
icon: mdi:brush
icon_color: >
{% set pct = states('sensor.roborock_main_brush_left') | int(100) %}
{% if pct > 40 %}green{% elif pct > 20 %}orange{% else %}red{% endif %}
And a persistent notification (not a push, since I don't need my phone buzzing about a brush) when anything drops below 20%:
alias: Roborock — Maintenance alert
trigger:
- platform: numeric_state
entity_id: [sensor.roborock_main_brush_left, sensor.roborock_filter_left,
sensor.roborock_side_brush_left]
below: 20
action:
- service: persistent_notification.create
data:
title: "Roborock — check maintenance"
message: >
{{ trigger.entity_id | replace('sensor.roborock_','') | replace('_left','')
| replace('_',' ') | title }} at {{ trigger.to_state.state }}%.
notification_id: roborock_maintenance
The automation I use every day
Clean while I'm out, dock before I get back:
alias: Roborock — Clean on departure
trigger:
- platform: state
entity_id: person.rolf
to: not_home
for:
minutes: 5
condition:
- condition: time
after: "09:00:00"
before: "18:00:00"
- condition: state
entity_id: vacuum.roborock_s5_max
state: docked
action:
- service: vacuum.start
target:
entity_id: vacuum.roborock_s5_max
alias: Roborock — Dock on return
trigger:
- platform: state
entity_id: person.rolf
to: home
condition:
- condition: state
entity_id: vacuum.roborock_s5_max
state: cleaning
action:
- service: vacuum.return_to_base
target:
entity_id: vacuum.roborock_s5_max
The 5-minute delay on departure matters. Without it, a brief GPS blip triggers a clean, and the vacuum is halfway through the kitchen when I walk back through the door two minutes later.
I've had the dock-on-return automation save me from stepping on the vacuum in the dark exactly once. Worth it.
New posts in your feed reader: follow with RSS In Google Search: add szimnau.dk as a preferred source