A custom Lovelace card for Home Assistant that provides a Dreame-app-style interface for controlling Dreame vacuum robots. Built as a fork of Xiaomi Vacuum Map Card by Piotr Machowski, completely redesigned with a native Dreame look and feel.
- Status header with real-time display of vacuum state, cleaned area, cleaning time and battery level
- Interactive map with pinch-to-zoom and pan, powered by camera entity from the Dreame integration
- Tab navigation (Room / All / Zone) matching the official Dreame app layout
- Cleaning mode chip showing the current mode (sweep, mop, sweep+mop) with tap-to-cycle
- Cleaning progress bar displayed during active cleaning sessions
- Context-aware action buttons that adapt to vacuum state (clean/pause/resume/stop/dock)
- Pixel-perfect hit testing using the
segment_mapfrom the Dreame integration (blue channel encodes room IDs) - Canvas overlay with smooth edges: rooms dim when entering room mode, selected rooms become bright
- Label state management: selected room labels are bold and opaque, dimmed rooms have reduced opacity
- Selection counter shown on the clean button (e.g. "Clean (3)")
- Fallback polygon detection when segment_map is unavailable
- Manual rectangle drawing on the map
- Repeat counter (x1, x2, x3) for zone and room cleaning
- Built with Lit (Web Components) and TypeScript, bundled with Rollup
- Cached Context pattern avoids recreating closures on every render cycle
- Cached entity lookups for sibling sensor discovery (device_id based)
- Smooth overlay rendering: built at segment_map resolution then upscaled with browser smoothing
- Simplified editor with minimal configuration needed
- Open HACS in your Home Assistant instance
- Go to "Frontend" section
- Click the "+" button and add this repository as a custom repository
- Search for "Dreame Vacuum Map Card"
- Install
- Add to Lovelace resources:
url: /hacsfiles/dreame-vacuum-card/dreame-vacuum-card.js type: module
- Refresh your browser
- Download
dreame-vacuum-card.jsfrom the latest release - Save the file to
<ha config>/www/community/dreame-vacuum-card/ - Add to Lovelace resources:
url: /local/community/dreame-vacuum-card/dreame-vacuum-card.js type: module
- Refresh your browser
type: custom:dreame-vacuum-card
entity: vacuum.your_dreame_vacuum
map_source:
camera: camera.your_dreame_vacuum_map
calibration_source:
camera: true
vacuum_platform: tasshackDreameVacuum| Option | Type | Default | Description |
|---|---|---|---|
entity |
string | required | Vacuum entity ID |
map_source.camera |
string | required | Camera entity providing the map image |
calibration_source.camera |
boolean | true |
Use camera calibration points |
vacuum_platform |
string | tasshackDreameVacuum |
Platform identifier |
show_title |
boolean | false |
Show device name in the header |
map_locked |
boolean | false |
Disable map pan/zoom |
two_finger_pan |
boolean | false |
Require two fingers to pan |
language |
string | HA language | Override language for labels |
This card is designed to work with the foXaCe/dreame-vacuum integration (fork with segment_map support), which provides:
- Camera entity with the map image and room data (outlines, segment_map, calibration points)
- Vacuum entity with state and attributes
- Sensor entities for battery, cleaning time, cleaned area, cleaning progress, state
- Select entity for cleaning mode
The card automatically discovers sibling entities on the same device using device_id.
The Dreame integration provides a segment_map attribute on the camera entity: a base64-encoded PNG where the blue channel of each pixel encodes the room/segment ID. The card:
- Decodes the segment_map into an off-screen canvas (pick canvas)
- On click, maps the click coordinates to the pick canvas
- Reads the blue channel value to identify the room
- Toggles room selection and updates the overlay
When in room mode, a semi-transparent dark overlay dims the entire map. Selected rooms are "cut out" from the overlay, appearing bright. The overlay is:
- Built at the segment_map's native resolution (typically ~265x269)
- Upscaled to the camera image resolution with
imageSmoothingQuality: "high" - This produces smooth edges instead of blocky pixels
- Home Assistant 2024.1.0 or newer
- A Dreame vacuum robot
- foXaCe/dreame-vacuum integration installed and configured (fork with segment_map support)
# Install dependencies
npm install
# Build for production
npm run build
# Development build with watch
npm run devThis project is a fork of the Xiaomi Vacuum Map Card by Piotr Machowski. His work provided the foundation for map rendering, calibration, and coordinate conversion that this card builds upon.
MIT License - inherited from the original Xiaomi Vacuum Map Card.