External integration - Mammotion

Hello,

Here is a new external integration that will soon be available on the store to manage your Mammotion lawn mowers:

I just installed this integration and it’s not working
I did create a 2nd mammotion account to avoid disconnections

I’ll put the log in the next message

[2026-09-29T09:46:08.275Z] [INFO] Starting the Mammotion integration...
[2026-09-29T09:46:08.490Z] [INFO] [gladys-sdk] connected to Gladys (http://)
[2026-09-29T10:25:10.406Z] [INFO] onConfigUpdated -> new configuration received
[2026-09-29T10:25:10.622Z] [INFO] [mammotion] Logged in to the Mammotion cloud
[2026-09-29T10:25:15.441Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-09-29T10:25:15.452Z] [ERROR] Mammotion initialization failed GladysApiError: devices[0].poll_frequency: invalid poll frequency
    at HttpClient.request (/app/node_modules/@gladysassistant/integration-sdk/lib/http-client.js:49:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async refreshMowers (file:///app/index.js:68:3)
    at async initialize (file:///app/index.js:110:20)
    at async file:///app/index.js:202:3
    at async GladysIntegration._runHandler (/app/node_modules/@gladysassistant/integration-sdk/lib/gladys-integration.js:1590:7)
    at async GladysIntegration._handleMessage (/app/node_modules/@gladysassistant/integration-sdk/lib/gladys-integration.js:1430:9) {
  status: 400,
  code: 'BAD_REQUEST'
}
[2026-09-29T10:25:19.213Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-09-29T10:28:41.138Z] [INFO] onConfigUpdated -> new configuration received
[2026-09-29T10:28:42.406Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-09-29T10:28:42.415Z] [ERROR] Mammotion initialization failed GladysApiError: devices[0].poll_frequency: invalid poll frequency
    at HttpClient.request (/app/node_modules/@gladysassistant/integration-sdk/lib/http-client.js:49:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async refreshMowers (file:///app/index.js:68:3)
    at async initialize (file:///app/index.js:110:20)
    at async file:///app/index.js:202:3
    at async GladysIntegration._runHandler (/app/node_modules/@gladysassistant/integration-sdk/lib/gladys-integration.js:1590:7)
    at async GladysIntegration._handleMessage (/app/node_modules/@gladysassistant/integration-sdk/lib/gladys-integration.js:1430:9) {
  status: 400,
  code: 'BAD_REQUEST'
}
[2026-09-29T10:28:54.595Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-09-29T10:33:43.443Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-09-29T10:33:43.453Z] [ERROR] Mammotion initialization failed GladysApiError: devices[0].poll_frequency: invalid poll frequency
    at HttpClient.request (/app/node_modules/@gladysassistant/integration-sdk/lib/http-client.js:49:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async refreshMowers (file:///app/index.js:68:3)
    at async initialize (file:///app/index.js:110:20) {
  status: 400,
  code: 'BAD_REQUEST'
}

It’s available in 1.0.1 :wink: :

Cause

  • Gladys only accepts a few fixed values for poll_frequency, in milliseconds: 1000, 2000, 10000, 15000, 30000, or 60000. I checked this in Gladys’s source code.
  • The integration sent the user-set interval in seconds (e.g., 60). Gladys therefore responded with « 400 invalid poll frequency. Â»
  • This error stopped the startup on every attempt, hence the repeated errors in the logs.

Fix

  • src/devices/mower.js: The mower is now sent to Gladys with 30000 ms if the interval is under 60 s, otherwise 60000 ms.
  • index.js: As Gladys polls at most every 60 s, the integration ignores requests that arrive before the chosen interval. A 5 s margin absorbs small Gladys delays.
  • The setting in the configuration screen doesn’t change: still from 30 to 3600 s, 60 s by default.

still having a small issue:

LOG

[2026-09-29T16:17:25.356Z] [INFO] Starting the Mammotion integration...
[2026-09-29T16:17:25.573Z] [INFO] [gladys-sdk] connected to Gladys (http://172.30.0.1:80)
[2026-09-29T16:17:26.212Z] [INFO] [mammotion] Logged in to the Mammotion cloud
[2026-09-29T16:17:32.304Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-09-29T16:17:32.415Z] [WARN] First poll failed for Luba-VPMBS8RA: user device not bind
[2026-09-29T16:20:26.253Z] [INFO] 1 mower(s) found on the Mammotion account

Correction published in the new version 1.0.2 :wink:

Well, it doesn’t work: the robot is detected but none of the states work



Could you please test with the new version 1.0.4?
If you still encounter bugs, don’t hesitate to include the logs as well, which can be very helpful :wink:

The cause

  • The message user device not bind comes from Aliyun, the old cloud of Mammotion.
  • Your Luba is indeed found on the Mammotion account, but it is not linked to Aliyun. However, the integration only read the status from Aliyun, so no value was received.
  • Recent accounts and firmware use the Mammotion MQTT server. There, the mower itself sends its status (battery, state, cutting height, counters). There is no on-demand reading.

The fix

  • New file src/mammotion/mqtt.js: it connects to the Mammotion MQTT server, follows each mower, and keeps its latest values.
  • Upon discovery, a mower absent from Aliyun is marked to use MQTT.
  • If Aliyun responds with « not bind Â», the integration also switches to MQTT.
  • Received values are sent to Gladys immediately, at most once every 15 seconds per mower.
  • Mowing and Return to Base commands only go through the Mammotion API for these mowers.
  • Lint, format, and tests pass (52 tests, including 6 new ones).

What you should know

  • Values arrive when the mower publishes them, not at startup. There may still be « No recent value Â» for a few minutes.
  • Your Luba is an older model. I’m not sure if it sends these status messages without being asked.
  • If nothing arrives, the next step would be to ask it for its status reports and decode them. This is more complex to code.

It’s still not working


Logs:

[2026-09-30T20:00:40.238Z] [INFO] Starting the Mammotion integration...
[2026-09-30T20:00:40.439Z] [INFO] [gladys-sdk] connected to Gladys 
[2026-09-30T20:00:40.739Z] [INFO] [mammotion] Logged in to the Mammotion cloud
[2026-09-30T20:00:45.731Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-09-30T20:00:46.245Z] [INFO] [mammotion-mqtt] Connected to the Mammotion broker mqtt-eu.mammotion.com
[2026-09-30T20:00:46.304Z] [INFO] [mammotion-mqtt] Following Luba-VPMBS8RA on the Mammotion broker
[2026-09-30T20:01:16.125Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-10-01T14:35:37.820Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-10-01T14:36:34.624Z] [INFO] onSetValue <- ext:ext-prohand-gladys-mammotion:mower:nNlJJBp0Cxx538To70i6000000:dock = 1
[2026-10-01T14:36:34.626Z] [INFO] [mammotion] Sending "dock" to Luba-VPMBS8RA
[2026-10-01T14:36:44.989Z] [WARN] Refresh after command failed for Luba-VPMBS8RA: states[0]: must have a numeric "state" or a string "text"

It would be great if other people could test it, because I feel like my model (Luba 2), which is from March 2025, is already too old!! @JKBS64

Thanks for the logs
Can you test with the new version 1.0.5 please :slight_smile:

The cause

  • The mower’s « Status » text was sent to Gladys in the wrong place: in the form state: { text: "..." }.
  • Gladys expects the text in a separate text field, like text: "...".
  • Gladys then refuses the entire submission, not just that line. This is the error states[0]: must have a numeric "state" or a string "text" in your logs.
  • Result: no value is recorded. Hence « No recent value » and « No value recorded » on all lines.

What I changed

  • src/devices/mower.js: the status is now sent in the text field.

There you go, the robot connected successfully and retrieved the information after 1 hour!


So the 2 buttons don’t do anything, unfortunately, and the information takes a very long time to retrieve

Log

[2026-10-01T15:22:16.622Z] [INFO] Starting the Mammotion integration...
[2026-10-01T15:22:16.825Z] [INFO] [gladys-sdk] connected to Gladys (http://172.30.0.1:80)
[2026-10-01T15:22:17.155Z] [INFO] [mammotion] Logged in to the Mammotion cloud
[2026-10-01T15:22:21.985Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-10-01T15:22:22.526Z] [INFO] [mammotion-mqtt] Connected to the Mammotion broker mqtt-eu.mammotion.com
[2026-10-01T15:22:22.581Z] [INFO] [mammotion-mqtt] Following Luba-VPMBS8RA on the Mammotion broker
[2026-10-01T15:22:40.572Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-10-01T16:02:24.996Z] [INFO] onSetValue <- ext:ext-prohand-gladys-mammotion:mower:nNlJJBp0Cxx538To70i6000000:mowing = 1
[2026-10-01T16:02:24.998Z] [INFO] [mammotion] Sending "start" to Luba-VPMBS8RA
[2026-10-01T16:04:09.610Z] [INFO] onSetValue <- ext:ext-prohand-gladys-mammotion:mower:nNlJJBp0Cxx538To70i6000000:dock = 1
[2026-10-01T16:04:09.611Z] [INFO] [mammotion] Sending "dock" to Luba-VPMBS8RA
[2026-10-01T16:06:29.162Z] [INFO] onSetValue <- ext:ext-prohand-gladys-mammotion:mower:nNlJJBp0Cxx538To70i6000000:dock = 1
[2026-10-01T16:06:29.163Z] [INFO] [mammotion] Sending "dock" to Luba-VPMBS8RA

It’s fixed in version 1.0.6

1. Mow / Return to Base commands did nothing

  • Cause: the command was sent to the wrong robot card. Except for the Luba 1, all mowers (including your Luba-VP) wait for these commands on their « navigation Â» card. We were sending them to the main card.
  • Why no errors in the logs: the cloud accepted the command and transmitted it, then the mower ignored it without saying anything.
  • Fix: the command is sent to the correct card, with the same rule as PyMammotion (the library used by Home Assistant).

2. Information took about 1 hour to arrive

  • Cause: we were waiting for the mower to send its status on its own, which it rarely does.
  • Fix: with each update, the integration asks the mower for its status, just like the Mammotion app does. The response arrives in a few seconds and Gladys is updated for the status, battery, and cutting height.
  • Total mowing time and total distance remain on the old schedule (they change little).
  • The Refresh button and the update 10 seconds after a command also make this request.

Well, it’s not conclusive:

  • the « return to base Â» button works, but the mammotion app keeps disconnecting and reconnecting
  • the « mowing Â» button does nothing, but it crashes the mammotion app…
    The info still isn’t coming through
    I specify that I do have 2 different mammotion accounts

I’d really like someone to test on another model!

Also, will there be other functions/info available?
because the goal is to replace the mammotion app, like the external integration « Dreame Â» which allows you to use only gladys, and all the changes made on gladys appear very quickly on the dreame app

Log:

[2026-10-02T13:25:32.777Z] [INFO] Starting the Mammotion integration...
[2026-10-02T13:25:33.065Z] [INFO] [gladys-sdk] connected to Gladys (http://172.30.0.1:80)
[2026-10-02T13:25:33.400Z] [INFO] [mammotion] Logged in to the Mammotion cloud
[2026-10-02T13:25:38.161Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-10-02T13:25:38.796Z] [INFO] [mammotion-mqtt] Connected to the Mammotion broker mqtt-eu.mammotion.com
[2026-10-02T13:25:38.830Z] [INFO] [mammotion-mqtt] Following Luba-VPMBS8RA on the Mammotion broker
[2026-10-02T13:33:35.019Z] [INFO] onSetValue <- ext:ext-prohand-gladys-mammotion:mower:nNlJJBp0Cxx538To70i6000000:dock = 1
[2026-10-02T13:33:35.021Z] [INFO] [mammotion] Sending "dock" to Luba-VPMBS8RA
[2026-10-02T13:33:53.821Z] [WARN] [mammotion] Report request refused for Luba-VPMBS8RA: Device not responding
[2026-10-02T13:37:18.218Z] [INFO] onSetValue <- ext:ext-prohand-gladys-mammotion:mower:nNlJJBp0Cxx538To70i6000000:mowing = 1
[2026-10-02T13:37:18.219Z] [INFO] [mammotion] Sending "start" to Luba-VPMBS8RA

Indeed, it would be great if someone else could test, but I still sent your prompt to Claude:

What was happening, according to your logs (I compared with PyMammotion, the code used by Home Assistant):

  • Information not being received: the mower only listens to the cloud ~10 seconds after a « sync » message. We never sent it, so it ignored our requests: that’s the « Device not responding » in the log.
  • App disconnecting constantly: every 60 seconds, we requested a report from the mower. Each request replaced the app’s request, which then thought the mower was lost. Additionally, it exceeded the Mammotion cloud quota (around 600 messages per 12 hours).
  • Mowing crashing the app: we sent a simple « start » without a route. The app, however, first prepares a route on the map (zones, settings).

What I changed:

  • A « sync » is sent before each command and each report request.
  • A report request is sent at most every 5 minutes, and only right after a command or a click on « Refresh ». No request is sent when the mower is already sending its data, for example when the app is open.
  • Mow button: it resumes only a paused mow. If no task is paused, Gladys refuses (with a message in the logs) instead of crashing the app. A new mow is therefore still started from the app.
  • New information:
    • progress in the status, for example « Mowing (45 %) »;
    • remaining mowing time (min);
    • more reliable « Charging »;
    • total time and total distance read from the mower.
  • Clearer logs: « First data received from … » when data arrives, and a warning if the server refuses the subscription.

It’s available in 1.0.7

I admit I don’t see the point of this integration anymore, since it can only pause/resume!
Not even a mow it can’t start!
Is it my model at fault or is it the mammotion API that doesn’t allow it?

You can start mowing here:

image

Maybe the button isn’t appropriate
Have you tried the latest version I deployed (1.0.7)?

Yes!
And the « mow Â» button crashes my Mammotion app and disconnects the robot
Note: I don’t have a « refresh Â» button and I had to change the refresh time in the config, which was still set to 60, replaced by 300


Log:

[2026-10-02T14:28:59.403Z] [INFO] Starting the Mammotion integration...
[2026-10-02T14:28:59.623Z] [INFO] [gladys-sdk] connected to Gladys (http://172.30.0.1:80)
[2026-10-02T14:28:59.921Z] [INFO] [mammotion] Logged in to the Mammotion cloud
[2026-10-02T14:29:05.132Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-10-02T14:29:05.792Z] [INFO] [mammotion-mqtt] Connected to the Mammotion broker mqtt-eu.mammotion.com
[2026-10-02T14:29:05.826Z] [INFO] [mammotion-mqtt] Following Luba-VPMBS8RA on the Mammotion broker
[2026-10-02T14:29:05.947Z] [INFO] [mammotion-mqtt] First data received from Luba-VPMBS8RA (device_protobuf_msg_event)
[2026-10-02T14:30:34.618Z] [INFO] onConfigUpdated -> new configuration received
[2026-10-02T14:30:36.022Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-10-02T14:30:38.200Z] [INFO] 1 mower(s) found on the Mammotion account
[2026-10-02T14:32:39.644Z] [INFO] onSetValue <- ext:ext-prohand-gladys-mammotion:mower:nNlJJBp0Cxx538To70i6000000:mowing = 1
[2026-10-02T14:32:39.644Z] [WARN] Luba-VPMBS8RA: No paused job to resume: start a new job from the Mammotion app
[2026-10-02T14:37:05.631Z] [INFO] 1 mower(s) found on the Mammotion account

Hello, yes I will test this weekend, my model is a Yuka mini. I’ll keep you posted.

Thanks for the feedback! In 1.0.8:

  • the Mow button now starts a real mow when the mower is ready: it resumes an interrupted mow, otherwise it prepares a route across all zones on the map (like Home Assistant), then starts;
  • a rejected command no longer sends anything to the mower: that’s what was causing the Mammotion app to disconnect;
  • new Refresh button on the dashboard (click on « Update » in the Discovery tab to get it);
  • remaining time goes to 0 when not mowing;
  • recommended interval: 300 s.

To choose a single zone, you still need to go through the app. If mowing doesn’t start, send me the logs: they indicate the zones found and the step that’s blocking.