Home

Awesome

xiaomi-vacuum-card

Simple card for various robot vacuums in Home Assistant's Lovelace UI

GH-release GH-downloads GH-last-commit GH-code-size hacs_badge

Integrated support for most vacuums from the following brands/models: Xiaomi, Roomba, Neato, Robovac, Valetudo, Ecovacs, Deebot

Installation

Manually add xiaomi-vacuum-card.js to your <config>/www/ folder and add the following to the configuration.yaml file:

lovelace:
  resources:
    - url: /local/xiaomi-vacuum-card.js?v=4.5.0
      type: module

OR install using HACS and add this (if in YAML mode):

lovelace:
  resources:
    - url: /hacsfiles/lovelace-xiaomi-vacuum-card/xiaomi-vacuum-card.js
      type: module

The above configuration can be managed directly in the Configuration -> Lovelace Dashboards -> Resources panel when not using YAML mode, or added by clicking the "Add to lovelace" button on the HACS dashboard after installing the plugin.

If you want to use the vacuum background image, download and add img/vacuum.png to <config>/www/img/ or configure your own preferred path.

Configuration

NameTypeDefaultDescription
typestringRequiredcustom:xiaomi-vacuum-card
entitystringRequiredvacuum.my_xiaomi_vacuum
namestring/boolfriendly_nameOverride friendly name (set to false to hide)
imagestring/boolfalseSet path/filename of background image (i.e. /local/img/vacuum.png)
stateEntity Data(see below)Set to false to hide all states
attributesEntity Data(see below)Set to false to hide all attributes
buttonsButton Data(see below)Set to false to hide button row

Entity Data

Default vacuum attributes under each list:

See examples on how to customize, hide or add custom attributes.

NameTypeDefaultDescription
keystringRequiredAttribute/state key on vacuum entity
iconstringOptional icon
labelstringOptional label text
unitstringOptional unit

Button Data

Default buttons include start, pause, stop, spot (hidden), locate and return. See examples on how to customize, hide or add custom buttons/actions.

NameTypeDefaultDescription
iconstringRequiredShow or hide stop button
servicestringRequiredService to call (i.e vacuum.start)
showbooltrueShow or hide button
labelstringOptional label on hover
service_dataobjectData applied to the service call

Other vendors

This card was originally written for Xiaomi (Roborock) vacuum cleaners, but version 2.0 and later has added support for some other vendors too. If you want any other vendors to be added, feel free to open an issue or contribute directly with a PR.

NameTypeDefaultDescription
vendorstringxiaomiSupported vendors: xiaomi, xiaomi_mi, valetudo, ecovacs, deebot, deebot_slim, robovac, roomba, neato

Note: Default attributes and buttons may change for each vendor integration.

Screenshots

xiaomi-vacuum-card

xiaomi-vacuum-card-no-title

xiaomi-vacuum-card-image

xiaomi-vacuum-card-no-buttons

Examples

Basic configuration:

- type: custom:xiaomi-vacuum-card
  entity: vacuum.xiaomi_vacuum_cleaner
- type: custom:xiaomi-vacuum-card
  entity: vacuum.xiaomi_vacuum_cleaner
  image: /local/custom/folder/background.png
  name: My Vacuum
  vendor: xiaomi

Hide state, attributes and/or buttons:

- type: custom:xiaomi-vacuum-card
  entity: vacuum.xiaomi_vacuum_cleaner
  state: false
  attributes: false
  buttons: false

Hide specific state values, attributes and/or buttons:

- type: custom:xiaomi-vacuum-card
  entity: vacuum.xiaomi_vacuum_cleaner
  state:
    mode: false
  attributes:
    main_brush: false
    side_brush: false
  buttons:
    pause: false
    locate: false

Customize specific state values, attributes and/or buttons:

- type: custom:xiaomi-vacuum-card
  entity: vacuum.xiaomi_vacuum_cleaner
  state:
    status:
      key: state
    mode:
      icon: mdi:robot-vacuum
      label: 'Fan speed: '
      unit: 'percent'
  attributes:
    main_brush:
      key: component_main_brush
    side_brush:
      key: component_side_brush
  buttons:
    pause:
      icon: mdi:stop
      label: Hold
      service: vacuum.stop

Show default clean spot button:

- type: custom:xiaomi-vacuum-card
  entity: vacuum.xiaomi_vacuum_cleaner
  buttons:
    spot:
      show: true

Add custom attributes:

- type: custom:xiaomi-vacuum-card
  entity: vacuum.xiaomi_vacuum_cleaner
  attributes:
    clean_area:
      key: 'clean_area'
      label: 'Cleaned area: '
      unit: ' m2'

Add custom buttons and service calls:

- type: custom:xiaomi-vacuum-card
  entity: vacuum.xiaomi_vacuum_cleaner
  buttons:
    new_button:
      icon: mdi:light-switch
      label: Custom button!
      service: light.turn_off
      service_data:
        entity_id: light.living_room

Translations:

- type: custom:xiaomi-vacuum-card
  entity: vacuum.xiaomi_vacuum_cleaner
  attributes:
    main_brush:
      label: 'Hovedkost: '
      unit: ' timer'
    side_brush:
      label: 'Sidekost: '
      unit: ' timer'
    filter:
      label: 'Filtere: '
    sensor:
      label: 'Sensorer: '
  buttons:
    start:
      label: Start!
    pause:
      label: Stopp!
    stop:
      label: Hammertime

Disclaimer

This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with the Xiaomi Corporation, or any of its subsidiaries or its affiliates. The official Xiaomi website can be found at https://www.mi.com/global/.

My cards

xiaomi-vacuum-card | multiple-entity-row | github-entity-row | battery-entity-row | attribute-entity-row

BMC