Luba mower Home Assistant Scheduler v2

About a year ago I shared my fully automated Luba mower scheduler for Home Assistant. It has been quietly mowing my lawns ever since, and a good number of you have been kind enough to fork it, star it, and open issues. Thank you. This is the update I promised myself I would write: a 2026 refresh that brings the project in line with the current Mammotion integration and, honestly, makes the whole thing simpler.

As always, a huge thank you to Michael Arthur for the Mammotion Home Assistant integration. None of this works without it, and it has come a long way in the last year.

Two mowers in action on the dashboard

Why the rewrite was needed

The original version told the mower what to do with the mammotion.start_mow service, passing it a list of area switches (switch.<mower>_area_back_lawn and friends) plus all the cutting parameters: angle, speed, blade height, and so on.

That worked well at the time, but the integration has moved on. On the current releases, and especially on the Luba 3, those switch.<mower>_area_* entities no longer reliably exist. Instead, each mowing task you save in the Mammotion app now shows up in Home Assistant as a button. If anyone following the old guide found that nothing happened when the scheduler fired, this is why: it was reaching for entities that were not there any more.

The new approach: press the saved task

The fix turns out to be much nicer than the thing it replaces. Rather than rebuilding a mow from scratch in YAML every time, the scheduler simply presses the saved-task button for that zone:

  • You set each zone up once in the Mammotion app, where you can see the cutting angle and pattern drawn on the map and tweak them until you are happy.
  • Each saved task appears in Home Assistant as a button, for example button.mower_back_lawn.
  • The scheduler presses that button at the scheduled time. The mow runs with exactly the settings you saved in the app.

So a mow script now boils down to this:

mow_lawn_1:
  alias: Mow Lawn 1
  sequence:
    # don't start if the mower is already out
    - condition: template
      value_template: "{{ states('lawn_mower.mower') not in ['mowing', 'returning'] }}"
    # run the saved task for this zone
    - action: button.press
      target:
        entity_id: button.mower_lawn_1
    # reschedule the next run from the chosen frequency
    - action: input_datetime.set_datetime
      target:
        entity_id: input_datetime.lawn_1_next_time
      data:
        datetime: >
          {% if is_state('input_select.lawn_1_schedule', 'twice per week') %}
            {{ (now() + timedelta(days=3)).strftime('%Y-%m-%d %H:%M:%S') }}
          {% else %}
            {{ (now() + timedelta(days=7)).strftime('%Y-%m-%d %H:%M:%S') }}
          {% endif %}

The big win is that the mower’s behaviour now lives in the app, where it belongs and where you can actually see it, and Home Assistant just decides when to set it going. It is far more robust across integration updates, because there are no fragile entity names baked into the automation.

What stayed, and what got simpler

All the bits people liked are still there:

  • Per-zone scheduling, once or twice a week, each lawn on its own timetable.
  • Rain delay, so it holds off when it is raining or rain is forecast.
  • Night block, so the mower never wanders out after dusk.
  • Automatic retries: if a mow is blocked, the next attempt is pushed forward an hour, skipping past the night.

A couple of things got noticeably simpler, which also answers the two questions I get asked most:

  • The dashboard now uses built-in cards only. No Mushroom, no map card, no camera card to hunt down in HACS. If you ever struggled to find camera-agora-card, you no longer need it: the camera is shown with Home Assistant’s built-in picture card.
  • GPS needs no extra hardware. The integration already provides a device_tracker from the mower’s own GPS, and the built-in map card shows it and centres itself. No trackers, no tags.

How it works in one paragraph

Each zone has a “next mow” time and a frequency. A small automation fires at that time and, if mowing is enabled, the zone is not set to never, it is not raining, it is not night, and the mower is idle, it presses the saved-task button and schedules the next run. If anything is blocking, it tries again in an hour. That is the whole idea.

Get it

The full set of files, with a step-by-step install guide and a short FAQ, is on GitHub:

đź”— github.com/shawwellpete/luba-mower-scheduler

Everything is written with neutral names (lawn_mower.mower, zones lawn_1 / lawn_2 / lawn_3) so you can drop it in and rename to suit. The README walks through where each file goes, which is the part that tripped a few people up the first time around.

If you were on the old version, the upgrade is mostly: create your zones as tasks in the Mammotion app, then point the scripts at the new buttons. The README covers it.

As ever, if you have questions or improvements, leave a comment or open an issue on GitHub. Happy mowing.

2 thoughts on “Luba mower Home Assistant Scheduler v2”

  1. Thanks for developing and posting that. Can the schedule be set to run every day and then stop when it’s raining, then continue after it stops? It says in your notes it can run on a schedual once or twide a week?

    1. It shouldn’t bee too tricky to change the scripts to make them daily. Take a look as you’ll need to adapt them for your garden anyway. If it is wet or rains predicted it keeps trying during daylight hours until the conditions are right.

Leave a Reply

Your email address will not be published. Required fields are marked *