2.9.2 • Published 8 days ago

vacuum-card v2.9.2

Weekly downloads
46
License
MIT
Repository
-
Last release
8 days ago

SWUbanner

Vacuum Card

npm version hacs GitHub Sponsors Patreon Buy Me A Coffee Twitter

Vacuum cleaner card for Home Assistant Lovelace UI

By default, Home Assistant does not provide any card for controlling vacuum cleaners. This card displays the state and allows to control your robot.

Preview of vacuum-card

Installing

💡 Tip: If you like this project, consider giving me a tip for the time I spent building this project:

HACS

This card is available in HACS (Home Assistant Community Store).

Just search for Vacuum Card in plugins tab.

Manual

  1. Download vacuum-card.js file from the latest-release.
  2. Put vacuum-card.js file into your config/www folder.
  3. Add reference to vacuum-card.js in Lovelace. There's two way to do that:

    1. Using UI: ConfigurationLovelace DashboardsResources Tab → Click Plus button → Set Url as /local/vacuum-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 following code to lovelace section.

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

Usage

This card can be configured using Lovelace UI editor.

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

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

Typical example of using this card in YAML config would look like this:

type: 'custom:vacuum-card'
entity: vacuum.vacuum_cleaner
actions:
  start:
    service: xiaomi_miio.vacuum_clean_segment
    service_data:
      entity_id: vacuum.vacuum_cleaner
      segments: [16, 20]
stats:
  default:
    - attribute: filter_left
      unit: hours
      subtitle: Filter
    - attribute: side_brush_left
      unit: hours
      subtitle: Side brush
    - attribute: main_brush_left
      unit: hours
      subtitle: Main brush
    - attribute: sensor_dirty_left
      unit: hours
      subtitle: Sensors
  cleaning:
    - entity_id: sensor.vacuum_main_brush_left
      value_template: '{{ (value | float(0) / 3600) | round(1) }}'
      subtitle: Main brush
      unit: hours
    - attribute: cleaning_time
      unit: minutes
      subtitle: Cleaning time
shortcuts:
  - name: Clean living room
    service: script.clean_living_room
    icon: 'mdi:sofa'
  - name: Clean bedroom
    service: script.clean_bedroom
    icon: 'mdi:bed-empty'
  - name: Clean kitchen
    service: script.clean_kitchen
    icon: 'mdi:silverware-fork-knife'

Here is what every option means:

NameTypeDefaultDescription
typestringRequiredcustom:vacuum-card
entitystringRequiredAn entity_id within the vacuum domain.
mapstringOptionalAn entity_id within the camera domain, for streaming live vacuum map.
map_refreshinteger5Update interval for map camera in seconds
imagestringdefaultPath to image of your vacuum cleaner. Better to have png or svg.
show_namebooleantrueShow friendly name of the vacuum.
show_statusbooleantrueShow status of the vacuum.
show_toolbarbooleantrueShow toolbar with actions.
compact_viewbooleanfalseCompact view without image.
statsobjectOptionalCustom per state stats for your vacuum cleaner
actionsobjectOptionalOverride default actions behavior with service invocations.
shortcutsarrayOptionalList of shortcuts shown at the right bottom part of the card with custom actions for your vacuum cleaner.

stats object

You can use any attribute of vacuum or even any entity by entity_id to display by stats section. You can also combine attribute with entity_id to extract an attribute value of specific entity:

NameTypeDefaultDescription
entity_idstringOptionalAn entity_id with state, i.e. sensor.vacuum.
attributestringOptionalAttribute name of the stat, i.e. filter_left.
value_templatestringOptionalJinja2 template returning a value. value variable represents the entity_id or attribute state.
unitstringOptionalUnit of measure, i.e. hours.
subtitlestringOptionalFriendly name of the stat, i.e. Filter.

actions object

You can defined service invocations to override default actions behavior. Available actions to override are start, pause, resume, stop, locate and return_to_base.

NameTypeDefaultDescription
servicestringOptionalA service to call, i.e. script.clean_bedroom.
service_dataobjectservice_data for service call

shortcuts object

You can defined custom scripts for custom actions i.e cleaning specific room and add them to this card with shortcuts option.

NameTypeDefaultDescription
namestringOptionalFriendly name of the action, i.e. Clean bedroom.
servicestringOptionalA service to call, i.e. script.clean_bedroom.
iconstringOptionalAny icon for action button.
service_dataobjectservice_data for service call

Theming

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

VariableDefault valueDescription
--vc-backgroundvar(--ha-card-background, var(--card-background-color, white))Background of the card
--vc-primary-text-colorvar(--primary-text-color)Vacuum name, stats values, etc
--vc-secondary-text-colorvar(--secondary-text-color)Status, stats units and titles, etc
--vc-icon-colorvar(--secondary-text-color)Colors of icons
--vc-toolbar-backgroundvar(--vc-background)Background of the toolbar
--vc-toolbar-text-colorvar(--secondary-text-color)Color of the toolbar texts
--vc-toolbar-icon-colorvar(--secondary-text-color)Color of the toolbar icons
--vc-divider-colorvar(--entities-divider-color, var(--divider-color))Color of dividers
--vc-spacing10pxPaddings and margins inside the card

Styling via theme

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

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

Styling via card-mod

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

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

Animations

I've added some animations for this card to make it alive. Animations are applied only for image property. Here's how they look like:

CleaningDocking
Cleaning anumationReturning anumation

Supported languages

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

  • English
  • Українська (Ukrainian)
  • Deutsch (German)
  • Français (French)
  • Italiano (Italian)
  • Nederlands (Dutch)
  • Polski (Polish)
  • Русский (Russian)
  • Español (Spanish)
  • Čeština (Czech)
  • Magyar (Hungarian)
  • עִבְרִית (Hebrew)
  • Português (Portuguese)
  • Português Brasileiro (Brazilian Portuguese)
  • Svenska (Swedish)
  • Norsk bokmål (Norwegian)
  • Norsk nynorsk (Norwegian)
  • Dansk (Danish)
  • 한국어 (Korean)
  • Suomi (Finnish)
  • Català (Catalan)
  • 正體中文 (Traditional Chinese)
  • Việt Nam (Vietnamese)
  • Lietuvių (Lithuanian)
  • Română (Romanian)
  • 简体中文 (Simplified Chinese)
  • 日本語 (Japanese)
  • Your language?

Supported models

This card relies on basic vacuum services, like pause, start, stop, return_to_base, etc. It should work with any robot vacuum, however I can physically test it only with my own robot vacuum.

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

  • Roborock S8 (Ultra Pro), S7 (MaxV), S6 (MaxV, Pure), S5 (Max), S50, S4 (Max), E25, E4, Q5 Pro
  • Mijia Robot Vacuum Cleaner 1C (STYTJ01ZHM)
  • Xiaomi Mi Robot (STYJ02YM), Mi Robot 1S, Mi Roborock V1 (SDJQR02RR), Mijia 1C, Mi Robot Vacuum-Mop P, Robot Vacuum E10
  • Roomba 670, 675, 676, 960980, 981, i3, i7+, e5, S9, s9+, j7
  • Braava M6
  • Dyson 360 Eye
  • Neato D7, D6, D4
  • Shark IQ
  • Ecovacs Deebot 950, Deebot OZMO T8 AIVI, Deebot N79, Deebot N8, Deebot N8+, T9 AIVI, Deebot T20 Ombi
  • Eufy Robovac 30c, Robovac 15C Max, Robovac X8 Hybrid, Robovac G40
  • EcoVacs T9 AIVI
  • Dreame Z10 Pro, L10 Pro, D9, F9
  • 360 S7 Pro
  • KaBum! Smart 500
  • Honiture Q6 Lite
  • Neabot NoMo N1 Plus
  • Kyvol E31
  • Setti+ RV800
  • Your vacuum?

Development

Want to contribute to the project?

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

Inspiration

This project is heavily inspired by:

  • MacBury Smart House — basically, this project is a refinement of MacBury's custom card.
  • Benji vacuum card — this is where I noticed this vacuum card design for the first time.

Huge thanks for their ideas and efforts 👍

License

MIT © Denys Dovhan

2.9.2

8 days ago

2.9.1

8 days ago

2.8.2

8 days ago

2.9.0

8 days ago

2.8.1

1 month ago

2.8.0

5 months ago

2.7.4

9 months ago

2.7.3

10 months ago

2.7.6

8 months ago

2.7.5

8 months ago

2.7.0

11 months ago

2.7.2

10 months ago

2.7.1

11 months ago

2.6.4

11 months ago

2.6.1

2 years ago

2.6.3

2 years ago

2.6.2

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.6.0

2 years ago

2.5.0

2 years ago

2.3.2

2 years ago

2.5.2

2 years ago

2.5.1

2 years ago

2.3.3

2 years ago

2.5.3

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.7

2 years ago

2.2.6

2 years ago

2.3.0

2 years ago

2.3.1

2 years ago

2.2.1

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.0

2 years ago

2.0.0

2 years ago

1.25.0

2 years ago

1.25.1

2 years ago

2.1.0

2 years ago

1.24.1

3 years ago

1.24.0

3 years ago

1.23.0

3 years ago

1.22.10

3 years ago

1.22.7

3 years ago

1.22.8

3 years ago

1.22.9

3 years ago

1.22.3

3 years ago

1.22.4

3 years ago

1.22.5

3 years ago

1.22.6

3 years ago

1.21.0

3 years ago

1.21.1

3 years ago

1.21.2

3 years ago

1.22.0

3 years ago

1.22.1

3 years ago

1.22.2

3 years ago

1.20.0

3 years ago

1.19.1

3 years ago

1.19.0

3 years ago

1.18.0

3 years ago

1.17.1

3 years ago

1.17.0

3 years ago

1.16.2

3 years ago

1.16.1

3 years ago

1.16.0

3 years ago

1.15.0

3 years ago

1.14.0

3 years ago

1.13.0

3 years ago

1.12.0

4 years ago

1.10.0

4 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.6.0

4 years ago

0.5.2

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.5.1

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago