Hello @Lokkye , I made a PR to add a widget and actions and triggers.
main ← vincentBesseau:feat/vacuum-map
ouvert 11:53AM - 05 Oct 26 UTC
## Résumé
Deux ajouts pour l'intégration Roborock :
1. **Carte de l'aspirateur… en widget de dashboard** (SDK `0.14`, widgets Gladys `5.1`).
2. **Déclencheurs et actions de scène** (l'aspirateur dans l'éditeur de scènes).
## 1. Carte en widget
- **Récupération** : `get_map_v1` (frame protocole `301`, déchiffrement AES‑128‑CBC + gunzip), transport local-first avec repli cloud.
- **Parseur RRMap** : format binaire → objet structuré (segments, robot, base, trajet, zones interdites, murs virtuels…), réconcilié avec `get_room_mapping` pour les **noms de pièces**.
- **Rendu PNG maison** (via `node:zlib`, sans dépendance) proche de l'app : pièces colorées, murs fins, zones interdites, murs virtuels, base/robot, **fond transparent** (s'adapte au thème clair/sombre).
- **Widget « Aspirateur »** : tuiles batterie / surface, carte, bloc état (état, dernier nettoyage, durée, **% de chaque consommable**) et **4 boutons** — Démarrer + Retour base fixes, et **2 boutons configurables** via les réglages.
- **Timestamp de début du dernier nettoyage** (`get_clean_summary`, mis en cache).
## 2. Scènes
Déclaré dans le manifest (`scene_triggers` / `scene_actions`), branché sur les données déjà pollées et les commandes RPC existantes.
**Déclencheurs** (émis sur transition via `publishSceneEvent`) :
`cleaning_started`, `cleaning_finished` (durée, surface), `returned_to_dock`, `battery_low` (≤ 20 %), `charging_complete`, `robot_error` (code + libellé), `consumable_worn` (≤ 10 %, par consommable), `state_changed`.
**Actions** (`onSceneAction`, chacune avec un champ `vacuum`) :
`start_cleaning`, `pause_cleaning`, `stop_cleaning`, `return_to_dock`, `clean_rooms` (noms de pièces → `app_segment_clean`), `set_fan_power` (silencieux/équilibré/turbo/max), `run_routine` (nom de routine → `executeRoutine`).
Les transitions sont détectées via un instantané par robot mis en cache entre deux polls (le premier poll ne fait qu'amorcer le cache). Les seuils sont gérés côté intégration (les filtres de scène sont à égalité seulement) et le niveau/pourcentage est exposé en variable de scène.
## Points d'attention
- ⚠️ **`gladys_version` passe à `>=5.1.0`** : les widgets de dashboard nécessitent Gladys 5.1.0 (c'était `>=4.86.0` sur `main`).
- **Bump de version patch** : `2.3.0` → `2.3.1`.
- **Transport local QV35A** : silencieux en TCP local quand il est à la base (en charge) → repli automatique sur le cloud, documenté.
## Tests
- `114` tests passent (`node --test`), `eslint` et `prettier --check` clean.
## Suite possible
Demande de fonctionnalité pour une **carte interactive** (sélection de pièces au clic → nettoyage ciblé), qui nécessiterait un composant frontend côté cœur : https://community.gladysassistant.com/t/composant-carte-interactive-zones-cliquables-pour-les-widgets-dintegration-externe/10959
🤖 Generated with [Claude Code](https://claude.com/claude-code)
I also made a request to one day select the rooms to clean on the map and thus evolve this widget
Hello
I’m developing a widget for the Roborock external integration that displays the vacuum cleaner map (via onWidgetGetImage). The rendering works very well, but I’m hitting a limit of the widget vocabulary: there is no way to make the map interactive.
Today, in a widget, we only have static components (image, value, gauge, status, chart, card-list) + button (limited to 4). The concrete limits:
• the map is a static image: impossible to detect a click on a room;
• no selectio…
I don’t know if you’ve seen what has been done for the external integrations of the Dreame robot (Demande d'intégration externe pour robot aspirateur/laveur DREAME - #39 par Chris75 ) and the Mammotion robot integration (Intégration externe - Mammotion - #41 par prohand )
After testing them extensively, I am really very satisfied with the result because now I can do without the official apps of the brand for all essential functions and settings
And it was developed by @guim31 @prohand in 1 week
guim31
October 5, 2026, 7:25pm
23
Yes but that’s because we’re too strong
Haha (to prompt Claude!)
Lokkye
October 6, 2026, 12:20pm
24
Thanks so much for your PR, I’m currently reviewing it and giving you some feedback
you noticed there were issues on the repo:
Lokkye
October 6, 2026, 2:00pm
28
No, I don’t know why I didn’t receive the emails , « I » am currently fixing it
Lokkye
October 6, 2026, 2:07pm
29
Version 2.5.0 released with code by @spenceur and 2 fixes
@Lokkye
I made a correction to the image jump that wasn’t very nice and added a condition for the scenes
main ← vincentBesseau:feat/map-live-rendering
ouvert 04:42PM - 06 Oct 26 UTC
## Résumé
Rend le **widget carte** stable au rafraîchissement et **quasi temps … réel pendant un nettoyage**, sans changer le vocabulaire du widget (toujours un PNG rendu côté serveur).
Avant : à chaque rafraîchissement la carte pouvait **« sauter »** (se redimensionner / clignoter), et elle n'avançait qu'au `ttl` du contenu.
## Ce que ça corrige
### A. Rendu à cadre fixe (`src/roborock/mapRender.js`)
La taille de sortie est désormais dérivée du **crop stable** (les pièces nommées) via une nouvelle option `targetLongestPx`, au lieu du poids en octets. Le même logement rend **toujours aux mêmes dimensions** → plus de reflow/rescale quand seuls le robot et le tracé bougent. Le garde-fou octets reste (réduction déterministe de la cible).
### B. Clé d'image = hash du rendu (`src/devices/mapWidget.js`, `index.js`)
La clé d'image est maintenant un **hash des octets PNG** (plus `mapSequence`). Le cœur ne **remplace l'`<img>` que si l'image a réellement changé** → plus de flash quand rien n'a bougé. `MAP_RENDER_VERSION` 7 → 8 pour invalider l'ancien cache. Le garde-fou 64 caractères de la clé est conservé.
### C. Quasi temps réel pendant le nettoyage (`index.js`)
- Suivi des robots ayant une **session de nettoyage active**.
- Pendant le nettoyage : cache carte **~8 s** (au lieu de 60 s) + **nudge `requestWidgetRefresh` toutes les ~15 s** (plafond cœur 1/10 s, no-op si aucun widget ouvert).
- Au repos : cache 60 s, pas de nudge.
→ La carte avance « par pas » de ~15 s pendant le ménage, puis se met en veille à la base.
## Limite connue
Le léger flash de chargement quand l'image change **vraiment** (pendant un nettoyage) reste géré par le frontend du cœur — une intégration externe ne peut pas faire de cross-fade. A + B le réduisent au strict minimum (même taille, swap uniquement sur vrai changement).
## D. Condition de scène « Nettoyé aujourd'hui »
Nouvelle feature **read-only `cleaned-today`** (0/1, 1 = l'aspirateur a tourné aujourd'hui), dérivée du dernier début de nettoyage. Elle permet une **condition de scène** « est-ce que l'aspirateur a tourné aujourd'hui ? » (ex. ne lancer un nettoyage que s'il n'a pas déjà tourné). Toujours publiée (même 0) pour que les deux branches de la condition fonctionnent. (`src/devices/lastClean.js`, `src/devices/convertDevice.js`, `index.js`.)
## Tests
- `128` tests passent (`node --test`), `eslint` OK.
- Nouveaux tests : dimensions de sortie stables quand seul le robot bouge (A) ; round-trip de la clé avec signature hash (B) ; `isCleanedToday` / état 0-1 (D).
Basé sur `main` (2.5.0) → **2.5.1** (patch).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sorry for the fix at this hour
hello I don’t see my card? Do I need to do something else?
Lokkye
October 7, 2026, 5:39am
33
@spenceur Sorry for the reaction time but a « small » headache kept me company all evening. I made a small change in your PR, we should avoid modifying the version number in the PRs as it’s another process that does it when building the Docker image.
It’s published under version 2.5.1
Hi, yes great widget for Roborock vacuums, it works perfectly for my Saros 10 R and S7 Max Ultra:
It even shows the last activity… what they don’t store
The widget is now only missing the room selection…
Language diversity… I’m even learning French:
Sorry, I have to point out my message:
offen 07:40AM - 11 Oct 26 UTC
Saros 10R:
( Main options: Vacuum, then mop / Vac & Mop / Mop / Vacuum )
Integr… ation:
( Car / Fast / Quiet / Low-noise / Deep cleaning / Vacuuming / Mopping )
<img width="199" height="354" alt="Image" src="https://github.com/user-attachments/assets/78d91998-0c85-4eec-8f77-945a30fad012" />
Test 1:
Cleaning - Quick - Room 13
<img width="203" height="354" alt="Image" src="https://github.com/user-attachments/assets/f1fc5b0f-2439-421e-9908-d91d8379fd5c" />
Result:
Vac&Mop - Room 12:
<img width="720" height="1640" alt="Image" src="https://github.com/user-attachments/assets/fd07d8e2-d713-41b7-938b-2abdd68af299" />
Test 2:
Cleaning - Quiet - Room 11
<img width="197" height="348" alt="Image" src="https://github.com/user-attachments/assets/59fedb8c-6e83-4aae-a029-40ae2e81fc73" />
Result:
Vac&Mop - Room 11
<img width="720" height="1640" alt="Image" src="https://github.com/user-attachments/assets/d2459529-c4bd-43e4-bf13-c15499510f5f" />
Test 4:
Cleaning - Vacuuming - Room 10
<img width="196" height="328" alt="Image" src="https://github.com/user-attachments/assets/3e104527-0077-4631-a790-dd67705074a8" />
Result:
Vac&Mop - Room 11
<img width="720" height="1640" alt="Image" src="https://github.com/user-attachments/assets/b473fc66-a7d7-467f-8427-2a49fd9b0d40" />
Translation is inconsistent: German - French - English:
<img width="194" height="346" alt="Image" src="https://github.com/user-attachments/assets/72a8d1d6-30b9-47e8-844c-1381ba5f20b7" />
It seems that with some newer Roborock models, the assignments between functions and between rooms may be different…
I really don’t want to stop, slow down, or otherwise interrupt the current momentum of development for integrations.
But the fundamental development of Claude without having the actual objects in front of you or corresponding access to test devices seems problematic.
Here’s the example of Roborock:
– Translation mess
– Room assignment is rather left to chance. Sometimes the integration takes the last setting, sometimes a completely different room, and sometimes it actually works.
– Subfunctions, especially on newer models, are not adjustable. Here’s an S7 Max Ultra with its subfunctions:
Vacuum
The integration does not offer the ability to assign suction power, number of cleanings, or distance to vacuuming.
Vac&Mop
Here too, the subfunctions are not offered, so suction power, cleaning intensity, number of cleanings, or distance
Mopping
– The integration does not offer the ability to combine rooms, so I cannot say: Please vacuum room 10 and 12. I am forced to first vacuum room 10 and then go through the process again with room 12.
Final result:
The integration seems to have been developed very quickly without sufficient testing. The widget also does not react stably. Sometimes the widget works, sometimes it doesn’t. Inconsistent state.
Again, I apologize, but the integration should not be published in its current state of development.
guim31
October 11, 2026, 8:31am
39
Even if I partly share your feelings, I don’t think the conclusion you draw is the right one.
Indeed, I have a Roborock S7 MaxV, so I can test and see that there are gaps.
The issue is rather that we need to find an effective balance between two situations:
either we wait for a developer to own the hardware and publish an integration (knowing that, in addition, they can’t own all the hardware from a single brand/protocol)
or we dive in and hope for user feedback (who don’t need to be developers).
I genuinely think there’s no debate.
After that, we could always determine whether we consider an integration as « beta » needing testers or « stable »… But even then, the line is blurry.
This is just my opinion, of course, and I especially find that your feedback is precious to quickly evolve the integration!
@guim31 : Don’t get me wrong, I’m the last person who wants to influence anyone here or is allowed to.
My reference to the test devices is based on the developer’s own notes:
The device layer (MQTT and local TCP transports, RPC commands) is covered by unit and end-to-end tests against fakes, but has never been exercised against a real robot on a Roborock account . The authentication chain, on the other hand, is verified end to end against the live cloud: region discovery, sendEmailCode, loginWithCode, the home id, and the Hawk-signed home data.
Found:
GitHub - callemand/gladys-roborock: Roborock robot vacuum integration for Gladys Assistant (Xiaomi Home account, local miIO with cloud fallback) · GitHub
With my own vacuums, I only noticed big differences to the older models, and this combination of the developer’s own notes and my tests led to my post.
If I’ve now stepped on someone’s « toes » (German idiom ), then my apologies.
Regards
Tom