maps - mikey0000/Mammotion-HA GitHub Wiki

Maps Setup

This guide covers installing and configuring a custom GPS map card for your Mammotion mower using HACS and local resources.

1. Install Custom Repositories

First, you need to add the required repositories to HACS:

  1. Open HACS in Home Assistant.
  2. Click the three dots in the top right corner and select Custom repositories.
  3. Add the following URLs one by one:
    • Repository: https://github.com/nathan-gs/ha-map-card
      • Type: Dashboard
    • Repository: https://github.com/mikey0000/ha-mammotion-assets
      • Type: Dashboard
  4. Click ADD for each.

2. Install the Map Card

  1. In HACS, search for Map Card.
  2. Install the plugin.
  3. Reload your browser to ensure the frontend resource is detected.

3. Prepare Media Assets

To show a custom icon for your mower on the map:

  1. Open a File Manager (like the File Editor or Samba) in Home Assistant.
  2. Navigate to your /config/www/ folder.
  3. Media images are provided in ha-mammotion-assets in dist/assets
    • The public URL for this file will be /local/media/your_picture_name.png.

4. Configure the GPS Map Card

Add a Manual Card to your dashboard and paste the following YAML.

Important

Replace device_tracker.your_luba_id with your actual mower's entity ID.

type: custom:map-card
theme_mode: light
focus_entity: device_tracker.yuka_mntxvhbe_offset
tile_layer_url: /local/assets/tiles/{z}/{x}/{y}.png
zoom: 22
plugins:
  - name: geoJson
    url: /local/community/ha-mammotion-assets/dist/geojson.js
    options:
      offset_lat: -13.8
      offset_lon: -13.3
      rotation_deg: 0
      entity_id: lawn_mower.yuka_mntxvhbe
entities:
  - entity: device_tracker.yuka_mntxvhbe_offset
    picture: >-
      /local/community/ha-mammotion-assets/dist/assets/map/dc_newui_icon_map_yuka_mn_white.png
    size: 24
    display: marker
card_size: 7
tile_layers:
  - url: >-
      https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}
default_zoom: 20
tile_layer_options:
  maxZoom: 24
  maxNativeZoom: 21
  minZoom: 14

GeoJson Areas

These will be fetched automatically along with mow progress map data

Offset

The offset allows you to make the same adjustment to the map as you would in the Mammotion app to align satellite view with the mower.

Key Parameters:

  • focus_entity: Keeps the map centered on your mower.
  • history_start: Shows the path taken by the mower in the last 24 hours.
  • tile_layers: We use ArcGIS World Imagery for a high-quality satellite view.

Full Example

type: custom:map-card
theme_mode: light
focus_entity: device_tracker.yuka_mntxvhbe_offset
tile_layer_url: /local/assets/tiles/{z}/{x}/{y}.png
zoom: 22
plugins:
  - name: geoJson
    url: /local/community/ha-mammotion-assets/dist/geojson.js
    options:
      offset_lat: -13.8
      offset_lon: -13.3
      rotation_deg: 0
      entity_id: lawn_mower.yuka_mntxvhbe
entities:
  - entity: device_tracker.yuka_mntxvhbe_offset
    picture: >-
      /local/community/ha-mammotion-assets/dist/assets/map/dc_newui_icon_map_yuka_mn_white.png
    size: 24
    display: marker
card_size: 7
tile_layers:
  - url: >-
      https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}
default_zoom: 20
tile_layer_options:
  maxZoom: 24
  maxNativeZoom: 21
  minZoom: 14
⚠️ **GitHub.com Fallback** ⚠️