Skip to content

Landroid mower card for Home Assistant Lovelace UI

License

Notifications You must be signed in to change notification settings

Barma-lej/landroid-card

Repository files navigation

Landroid Card

HACS Buy Me A Coffee Latest release All releases Latest release

Landroid mower card for Home Assistant Lovelace UI

Live of landroid-card

Requirements

  • Landroid Cloud integration version 4 or above, If you use Landroid Cloud integration version less than 4, you can install Landroid Card version 0.3.2
  • Please enable sensors at least sensor.[mower_name]_rssi, sensor.[mower_name]_total_worktime and sensor.[mower_name]_battery for correct work.
  • To view the sensor values, you must enable them in the device settings. Most of them are disabled by default

Installation

Landroid Cloud

First, you need to install the Landroid Cloud Integration.

Install using HACS or follow this guide.

HACS

Just click on this button to add this repository to HACS

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Or you can manually add this repository to your HACS installation. Here is the manual process.

Manual

Do not use this method if you have already installed the card via HACS!

If you prefer not to use HACS, you can manually install the card:

  1. Download all js files from the latest release.

  2. Place them into your config/www folder.

  3. Add a reference to landroid-card.js in Lovelace. There are two ways to do this:

    1. Using the UI:

      • Navigate to the Resources page by following the link below: Open your Home Assistant instance and show your resources.

        Or go to "Settings" → "Dashboards" → then click on 3 dots in top right corner and choose "Resources".

      • Click the Plus button.

      • Set URL as /local/landroid-card.js.

      • Set Resource type as JavaScript Module.

      Note: If you do not see the Resources Tab, you will need to enable Advanced Mode in your User Profile.

    2. Using YAML: Add the following code to the lovelace section.

      resources:
        - url: /local/landroid-card.js
          type: module
  4. Add custom:landroid-card to Lovelace UI as you would with any other card (using either the editor or YAML configuration).

Usage

This card can be configured using the Lovelace UI editor.

  1. In Lovelace UI, click the three dots in the top left corner.
  2. Click Configure UI.
  3. Click the Plus button to add a new card.
  4. Find Custom: Landroid Card in the list.
  5. Choose an entity.
  6. You should now see a preview of the card!

Sorry, there is no support for actions, shortcuts, and stats in visual config yet.

A typical example of using this card in a YAML configuration would look like this:

type: custom:landroid-card
entity: lawn_mower.mower
image: default
image_size: '4'
show_animation: true
show_status: true
show_toolbar: true
shortcuts:
  - name: Notification
    service: automation.toggle
    icon: mdi:bell
    service_data:
      entity_id: automation.mower_notify_status
stats:
  default:
    - entity_id: sensor.mower_blades_total_on_time
      subtitle: Total blade time
      value_template: '{{ as_timedelta((value | float(0) * 3600) | round (0) | string) }}'
    - entity_id: sensor.mower_blades_current_on_time
      subtitle: Current blade time
      value_template: '{{ as_timedelta((value | float(0) * 3600) | round (0) | string) }}'
    - entity_id: sensor.mower_total_worktime
      subtitle: Work time
      value_template: '{{ as_timedelta((value | float(0) * 3600) | round (0) | string ) }}'
    - entity_id: sensor.mower_distance_driven
      value_template: '{{ (value | float(0) / 1000) | round(3) }}'
      unit: km
      subtitle: Distance
  mowing:
    - entity_id: sensor.mower_yaw
      subtitle: Yaw
      unit: °
    - entity_id: sensor.mower_roll
      subtitle: Roll
      unit: °
    - entity_id: sensor.mower_pitch
      subtitle: Pitch
      unit: °
settings:
  - switch.mower_party_mode
  - switch.mower_locked
  - number.mower_raindelay
  - number.mower_time_extension
  - number.mower_torque
  - select.mower_current_zone
  - button.mower_start_cutting_edge
  - button.mower_restart_baseboard

Here is an explanation of each option:

Name Type Default Description
type string custom:landroid-card Type of the card custom:landroid-card
entity string Required An entity_id within the lawn_mower domain.
camera string Optional An entity_id within the camera domain, for streaming the live Landroid camera.
camera_refresh integer 5 Update interval for the camera in seconds
image string default Path to an image of your mower. It's better to use png or svg formats.
image_size integer 4 Image size. It's an integer from 1 to 8. Each unit is equal to 50px (e.g., 2 * 50px = 100px )
image_left boolean false Show the image on the left side.
show_name boolean false Show the friendly name of the mower.
show_status boolean true Show the status of the mower.
show_toolbar boolean true Show the toolbar with actions.
compact_view boolean false Use a compact view without an image.
settings object Optional The list of device configuration entities is displayed by clicking the configuration button at the bottom of the card.
stats object Optional Custom per-state stats for your mower
actions object Optional Override default actions behavior with service invocations.
shortcuts object Optional List of shortcuts shown at the right bottom part of the card with custom actions for your mower.

settings object

You can define which configuration entities will be displayed by clicking the configuration button at the bottom of the card. You can see the available entities in the device settings of your lawnmower in the Configuration section.

settings:
  - switch.mower_party_mode
  - switch.mower_locked
  - number.mower_raindelay
  - number.mower_time_extension
  - number.mower_torque
  - select.mower_current_zone
  - button.mower_start_cutting_edge
  - button.mower_restart_baseboard

stats object

You can use any attribute of the mower or even any entity by entity_id to display in the stats section:

Name Type Description
entity_id string An entity_id with a state, e.g., sensor.mower.
attribute string The attribute name of the stat, e.g., total_blade_time.
value_template string Jinja2 template returning a value. Here is Home Assistant Templating. The value variable represents the entity_id or attribute state, e.g., "{{ as_timedelta((value | float(0) * 60) | string) }}"
unit string The unit of measure, e.g., hours.
subtitle string The friendly name of the stat, e.g., Blade time.
stats:
  default:
    - entity_id: sensor.mower_blades_total_on_time
      subtitle: Total blade time
      value_template: '{{ as_timedelta((value | float(0) * 3600) | string) }}'
    - entity_id: sensor.mower_blades_current_on_time
      subtitle: Current blade time
      value_template: '{{ as_timedelta((value | float(0) * 3600) | string) }}'
    - entity_id: sensor.mower_total_worktime
      subtitle: Work time
      value_template: '{{ as_timedelta((value | float(0) * 3600) | string ) }}'
    - entity_id: sensor.mower_distance_driven
      value_template: '{{ (value | float(0) / 1000) | round(3) }}'
      unit: km
      subtitle: Distance
  mowing:
    - entity_id: sensor.mower_yaw
      subtitle: Yaw
      unit: °
    - entity_id: sensor.mower_roll
      subtitle: Roll
      unit: °
    - entity_id: sensor.mower_pitch
      subtitle: Pitch
      unit: °

actions object

You can define service invocations to override default actions behavior. Available actions to override are start_mowing, edgecut, pause and dock.

Name Type Description
service string A service to call, e.g., script.mowing_zone_2.
service_data object service_data for the service call
actions:
  start_mowing:
    service: script.mowing_zone_2
  edgecut:
    service: landroid_cloud.setzone
    service_data:
      entity_id: lawn_mower.mower
      zone: '1'
  pause:
    service: landroid_cloud.ots
    service_data:
      entity_id: lawn_mower.mower
      boundary: true
      runtime: 60

shortcuts object

You can define custom scripts for custom actions, such as mowing a zone, and add them to this card with the shortcuts option.

Name Type Description
name string The friendly name of the action, e.g., Mowing a zone 2.
service string A service to call, e.g., script.mowing_zone_2.
icon string Any icon for the action button.
service_data object service_data for the service call
shortcuts:
  - name: Notification
    service: automation.toggle
    icon: mdi:bell
    service_data:
      entity_id: automation.mower_notify_status

Theming

This card can be styled by changing the values of these CSS properties (globally or per-card via card-mod):

Variable Default value Description
--lc-background var(--ha-card-background, var(--card-background-color, white)) Background of the card
--lc-primary-text-color var(--primary-text-color) Mower name, stats values, etc
--lc-secondary-text-color var(--secondary-text-color) Status, stats units and titles, etc
--lc-icon-color var(--secondary-text-color) Colors of icons
--lc-toolbar-background var(--lc-background) Background of the toolbar
--lc-toolbar-text-color var(--secondary-text-color) Color of the toolbar texts
--lc-toolbar-icon-color var(--secondary-text-color) Color of the toolbar icons
--lc-divider-color var(--entities-divider-color, var(--divider-color)) Color of dividers
--lc-spacing 10px Paddings and margins inside the card

Styling via a theme

Here is an example of customization via a theme. Read more in the Frontend documentation.

my-custom-theme:
  lc-background: '#17A8F4'
  lc-spacing: 5px

Styling via card-mod

You can use card-mod to customize the card on a per-card basis, like this:

type: 'custom:landroid-card'
style: |
  ha-card {
    --lc-background: #17A8F4;
    --lc-spacing: 5px;
  }
  ...

Animations

💡 Tip: Animations are applied only to the image property. Here's how they look:

Mowing Docking
Mowing animation Returning animation

Supported languages

This card supports translations. Please help add more translations and improve existing ones. Here's a list of supported languages:

  • Čeština (Czech)

  • Dansk (Danish)

  • Deutsch (German)

  • English

  • Español (Spanish)

  • Estonian

  • Français (French)

  • Italiano (Italian)

  • Nederlands (Dutch)

  • Polski (Polish)

  • Русский (Russian)

  • Slovenščina (Slovenian)

  • Svenska (Swedish)

  • Español (Spanish)

  • Your language?

Supported models

This card relies on basic Landroid services, like pause, start, stop, return_to_base, etc. It should work with Landroid lawnmowers; however, I can physically test it only with my own Worx Landroid M500 WR141E.

If this card works with your lawnmower, please open a PR and add your model to the list.

Vendor Model Name Max. Rain Delay
Worx WR130E Landroid S300 23 hr 30 min
Worx WR100SI Landroid S390
Worx WR141E Landroid M500 12 hr 30 min
Worx WR142E Landroid M700
Worx WR143E Landroid M1000
Worx WR147E Landroid L1000
Worx WR155E Landroid L2000 23 hr 30 min
Worx WR165E Landroid M500 Plus 23 hr 30 min
Worx WR167E Landroid M700 Plus 23 hr 30 min
Worx WR105SI Landroid S500
Worx WR206E Landroid M600
Kress Mission KR112 12 hr 00 min
Your mower?

If your lawnmower has been banned

If services and the app have stopped working:

  • Go to My Landroids.
  • Unlink your Landroid.
  • Open the app on a mobile device.
  • Add your Landroid again.

Development

Want to contribute to the project?

First of all, thanks! Check the contributing guidelines for more information.

Inspiration

This project is heavily inspired by:

Huge thanks for their ideas and efforts 👍

Thanks to all contributors

Please see the list of contributors who participated in this project.

License

MIT License

💡 Tip: If you like this project just buy me a cup of ☕️ or 🥤:

Buy Me A Coffee