Saltar al contenido principal

Integración domótica Mammotion, gratuita y de código abierto

Integración Mammotion para Gladys Assistant

Control your Mammotion mower (Luba, Yuka): mowing, pause, return to dock, battery and status.

info

La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.

Control your Mammotion robot lawn mower (Luba, Luba 2, Luba mini, Yuka…) from Gladys: start mowing, pause and resume, send the mower back to its dock, and follow its battery, status and mowing progress.

What you get​

Each mower of your Mammotion account shows up with:

  • Mowing (switch): on = start a job (or resume the paused one), off = pause;
  • Return to dock (switch): on = go back to the dock to charge, off = cancel. Like "Recharge" in the app: a job in progress stays paused, Mowing resumes it later;
  • Stop job (button): ends the job, the mower stays where it is (like "Stop" in the app). Return to dock then brings it home;
  • Refresh (button): asks the mower for its state right now;
  • Status: Mowing (45 %), Charging, Paused, Returning to dock, Offline…;
  • Battery (%) and Charging;
  • Blade height (mm);
  • during a job: Mowing progress (%), Elapsed and Remaining mowing time (min), Area to mow (m²);
  • Total mowing time (h), Total distance (km);
  • Map: a device of its own, "<mower> – Map" (image, Camera widget of the dashboard): the zones (bright green = zones of the next job, pale green = the others) with their name, the no-go zones (grey) and the mower (red dot);
  • the zones of the next job: one "Zone to mow – …" switch per zone of the map. Several zones can be on; none on = every zone. The zones are mowed in the order they are switched on, as in the app;
  • the other settings of the next job, "Setting – …": lists for the blade height, speed, spacing, angle type (optimal, custom, random), pattern (zigzag, chessboard, adaptive zigzag), perimeter laps, obstacle detection, no-go zone laps (0 to 3) and order; sliders for the custom angle (0 to 180°, as in the app) and the start progress (0 to 99 %). The lists follow the ranges of the model: on a Luba 2 X for instance, height from 25 to 70 mm by steps of 5, speed from 0.2 to 0.8 m/s, spacing from 20 to 35 cm.
  • zones without a name in the app are named as in the app ("Zone 1", "Zone 4"…).

Settings on the device (like the Dreame integration): pick the zones and the values in the lists of the mower (dashboard or scene), then turn Mowing on: the job starts with these settings.

  • At first, the lists take the "New mowing job" section of the configuration.
  • A choice in a list applies to that mower only.
  • Saving a new value in the configuration applies it to every mower.
  • The zone switches show up once the map is read (when the integration starts, mower on), after Update in the Discovery tab.

Start mowing from Gladys (mower "Ready", on its dock or not), the way Home Assistant does:

  • a job that stopped halfway (battery, rain…) carries on where it was;
  • otherwise Gladys plans a route over every zone of the map (named or not), or over those switched on in "Zone to mow – …", with the settings of the "New mowing job" section of the configuration (height, speed, spacing, angle, pattern, perimeter laps, obstacle detection…), then starts the job.

The Mammotion app keeps its settings on the phone: Gladys cannot read them, fill them in its configuration. This works with the mowers of the Mammotion broker (recent Luba 2, Luba mini, Yuka…), not with the Luba 1.

Configuration​

  1. Open the Configuration tab of the integration.
  2. Enter the email and password of your Mammotion app account.
  3. Set the refresh interval (300 s by default, between 30 and 3600 s): how often Gladys reads the mower status. Each read asks the mower for its state, which can briefly disturb the Mammotion app: keep 300 s or more.
  4. Save, then click Test the connection: the number of mowers found is displayed.
  5. Add your mowers from the Discovery tab. After an update of the integration, click Update in this tab to get the new features (the Refresh button for instance).

The Charging feature is deliberately not in the battery category. Gladys warns "battery level under X%" for every feature of the battery category below the threshold, whatever its type: a charging feature holds 0 or 1, so it was read as "0%". It is published as a binary input instead: same yes/no value, same use in a scene, no false alert.

Tip: create a second Mammotion account, share the mower with it from the app, and use that account here. Otherwise the app on your phone may be logged out when Gladys connects.

Widget, scene triggers and actions (Gladys 5.1)​

"Mammotion mower" widget​

In Dashboard → Edit → Add a widget, choose Mammotion mower, then the mower. The widget shows the state, the battery, the progress and remaining time of the job, and the buttons that make sense now: Start mowing (or Resume), Pause, Back to dock. It shows the last state received: opening the dashboard sends nothing to the mower.

Triggers​

TriggerWhen
A mower starts mowingA new job, or a paused one resumed
A mowing job endsFinished or stopped (a recharge in the middle of a job does not end it)
A mower is back on its dockIt starts charging
A mower has a problemOffline, location error, out of boundary, locked, failed update

Each fires once, on the change, never when the integration restarts. Variables: mower name, state, battery, and depending on the trigger the progress, "job paused to recharge" or the problem.

Actions​

  • Start mowing: a new job with the zones and settings chosen in Gladys, or a paused job resumed.
  • Pause mowing.
  • Send a mower back to its dock (the job is kept paused).
  • Read a mower: state, online, mowing, battery, progress, remaining time, problem. Tick "Ask the mower first" for a fresh value.

The first three return a result (started, resumed, already_mowing, paused, not_mowing, returning, already_docked).

Scene ideas​

  • Start mowing every Saturday at 10 am if it does not rain.
  • On Saturday, turn "Zone to mow – Front" and "Zone to mow – Side" on, the others off, then turn "Mowing" on; on Wednesday, turn them all off (every zone) then turn "Mowing" on.
  • Resume the paused job when the rain stops.
  • Send the mower back to its dock when the rain sensor detects rain.
  • Get a message when the mower has a problem ("A mower has a problem" trigger).
  • Get a message when the mowing job ends.

Troubleshooting​

  • No "Setting – …" lists on the mower: Discovery tab, Update button on the mower.

  • No "Zone to mow – …" switch, or the map says "Map not read yet": the mower has not sent its map yet (off, offline). It is read again at the next start of the integration and with each job started from Gladys. Then Update in the Discovery tab.

  • Show the map: Discovery tab, add the "<mower> – Map" device, then on the dashboard add a Camera widget and pick that device. The image follows the mower during a job (at most every 15 s).

  • Check a setting of the app: start a job from the Mammotion app, then look for "route settings seen" in the logs of the integration. The line shows what the app sent (towardMode = angle type, channelMode = pattern…).

  • "Mammotion cloud unreachable": check the email and password, then click Test the connection.

  • No mower found: make sure the mower shows up in the Mammotion app with this account (owner or shared).

  • Values do not change: press Refresh (on the dashboard) or Refresh the mowers now (Configuration tab). Recent mowers (Mammotion broker) push their state on their own; Gladys asks them for a report at most every 5 minutes (and right after a command), to stay within the Mammotion cloud quota and not cut the app on your phone.

  • Mowing does not start: read the logs. "The mower did not send its zones": the mower did not answer, try again. "Cannot start mowing now": the mower is not ready (returning to its dock, locked…).

  • "The battery level of … is under 20% (current: 0%)" while the battery is full: that was the old Charging feature, filed in the battery category, which holds 0 whenever the mower is not charging. The new Charging feature is a binary input. The old one stays on the mowers added before: open the Discovery tab and click Update on the mower — Gladys deletes the features that are no longer published, and the alert stops.

  • For details, read the integration logs with LOG_LEVEL=debug.

Parámetros de configuración​

Estos son los parámetros que Mammotion te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
Mammotion accountsectionNoUse the email and password of your Mammotion app account. Tip: create a second account, share the mower with it from the app, and use it here, so Gladys does not log you out of your phone.
EmailstringSí
PasswordsecretSí
Refresh interval (s)numberNoHow often each mower is read, in seconds. Each read asks the mower for its state, which can briefly disturb the Mammotion app: 300 s or more is advised.
Status languageselectNo
New mowing jobsectionNoSettings of a new job started from Gladys (Mowing switch ON, mower docked or ready). Each mower also shows them as "Zone to mow – …" switches and "Setting – …" lists, to change them for that mower only, from the dashboard or a scene. Saving a new value here applies it to every mower. The Mammotion app keeps its own settings on the phone: Gladys cannot read them.
Zones to mowstringNoZone names as shown in the app, separated by commas. Empty: every zone of the map. Each mower also shows one "Zone to mow – …" switch per zone of its map.
Blade height (mm)numberNoKept within the range of each mower model (e.g. 25 to 70 mm on a Luba 2).
Speed (m/s)selectNo
Path spacing (cm)numberNoKept within the range of each mower model (e.g. 20 to 32 cm on a Luba 2).
Path angleselectNoOptimal: the mower chooses. Custom: the angle below. Random: a new angle for each job.
Custom path angle (°)numberNoUsed when the path angle is "Custom".
Mowing patternselectNo
Perimeter lapsnumberNo
Obstacle detectionselectNo
No-go zone lapsnumberNo
Path orderselectNo
Start progress (%)numberNoStart the job at this share of the zone: 0 starts from the beginning.

Cómo instalar Mammotion en Gladys​

  1. En Gladys, abre Integraciones: Mammotion aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
  2. Haz clic en Instalar. Gladys descarga la imagen Docker (ghcr.io/prohand/gladys-mammotion:1.3.0), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración).
  3. Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
  4. También puedes instalarla directamente desde la URL de su repositorio: https://github.com/prohand/gladys-mammotion.

Mammotion requiere Gladys >=5.1.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.

¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.

Sobre las integraciones externas​

Mammotion es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene prohand, no el equipo principal de Gladys.

Suscríbete a la newsletter de Gladys Assistant

Unos pocos correos al mes sobre nuevas versiones y novedades del proyecto. Enviados por Pierre-Gilles Leymarie, fundador del proyecto. Puedes darte de baja cuando quieras 🙂