mirror of
https://github.com/Lash-L/RoborockCustomMap.git
synced 2026-06-04 20:48:26 +02:00
main
* Add map rotation constants Introduce rotation configuration constants for map image handling. Adds rotation options (0, 90, 180, 270) and dispatcher signal name. * Add per-map rotation select entity Add SelectEntity to control map rotation per map_flag. Rotation value is persisted via RestoreEntity and stored in hass.data. Dispatcher signal notifies image entities when rotation changes. * Enable rotation select platform and initialize storage Register SELECT platform and initialize rotation storage in hass.data. Add proper unload cleanup and reload behavior. * Add backend map rotation with executor offloading Implement backend image rotation using Pillow. Rotation is applied in async_add_executor_job to avoid blocking the event loop. Includes defensive validation and fallback handling. * Add translations for rotation select entity Add English and German translations for map rotation select entity. Includes user-friendly labels for rotation options. * Document map rotation select entity in README Add documentation for the per-map rotation select entity. Explains: - How to rotate maps (0/90/180/270) - Where to find the rotation select entity - That calibration points are rotated as well - That no reload is required Also clarifies usage with Xiaomi Vacuum Map Card. * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Store rotation state per device and map instead of only map_flag. This prevents multiple Roborock devices with identical map_flag values from sharing rotation state and dispatcher signals. * Fix image rotation lookup for multiple Roborock devices * Fix thread-safe state update on rotation change I found and fixed a thread-safety issue in the rotation update signal. The image entity now schedules the state update back onto the Home Assistant event loop before calling `async_write_ha_state()`, instead of calling it directly from the dispatcher callback. --------- Co-authored-by: Luke Lashley <conway220@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Roborock Custom Map
you MUST be on 2025.4b or later
This allows you to use the core Roborock integration with the Xiaomi Map Card
If you would like to support me, you can do so here:
Setup
- Install the Roborock Core Integration and set it up
- It is recommended that you first disable the Image entities within the core integration. Open each image entity, hit the gear icon, then trigger the toggle by enabled.
- Install this integration(See the installing via HACS section below)
- This integration works by piggybacking off of the Core integration, so the Core integration will do all the data updating to help prevent rate-limits. But that means that the core integration must be setup and loaded first. If you run into any issues, make sure the Roborock integration is loaded first, and then reload this one.
- Setup the map card like normal! An example configuration would look like
type: custom:xiaomi-vacuum-map-card
vacuum_platform: Roborock
entity: vacuum.s7
map_source:
camera: image.s7_downstairs_full_custom
calibration_source:
camera: true
Map rotation (new)
If your map is displayed sideways or upside down, you can rotate the map directly in Home Assistant.
This integration provides a Select entity per map to control rotation:
select.<...>_rotation- Options:
0°,90°,180°,270°(labels depend on your HA language)
This rotates both:
- the map image
- and the calibration points used by the Xiaomi Vacuum Map Card
(so rooms/zones and interactions stay aligned after rotation)
How to use
- Go to Settings → Devices & services → Roborock Custom Map
- Open the device/entities list
- Find the
… rotationselect entity for your map and choose the correct rotation
No reload is required; the map updates immediately.
- You can hit Edit on the card and then Generate Room Configs to allow for cleaning of rooms. It might generate extra keys, so check the yaml and make sure there are no extra 'predefined_sections'
Installation
Installing via HACS
or
- Go to HACS->Integrations
- Add this repo(https://github.com/Lash-L/RoborockCustomMap) into your HACS custom repositories
- Search for Roborock Custom Map and Download it
- Restart your HomeAssistant
- Go to Settings->Devices & Services
- Add the Roborock Custom Map integration
Alternative/optional
Once you set up this integration, you can generate a static config in the lovelace card, and theoretically, you should be able to use that code with your Roborock CORE integration. However, it wont stay up to date if the map calibrations change significantly, or rooms change. So I'd only do this when I was sure everything was good!
Description
Add support for working with Piotr Machowski's map card for the official Roborock integration
Readme
82 KiB
Languages
Python
100%