{"_id":"@balxyzz/vacuum-card","name":"@balxyzz/vacuum-card","dist-tags":{"latest":"2.9.2"},"versions":{"2.9.2":{"name":"@balxyzz/vacuum-card","version":"2.9.2","description":"Vacuum cleaner card for Home Assistant Lovelace UI","main":"dist/vacuum-card.js","scripts":{"start":"rollup -c --watch","lint":"eslint src","lint:fix":"eslint src --fix","format":"prettier --write .","build":"rollup -c","test":"npm run lint && npm run build","prepare":"husky install"},"keywords":["home-assistant","homeassistant","hass","automation","lovelace","custom-cards","vacuum"],"author":{"name":"Denys Dovhan","email":"denysdovhan@gmail.com","url":"http://denysdovhan.com/"},"license":"MIT","dependencies":{"custom-card-helpers":"^1.6.4","ha-template":"^1.2.2","home-assistant-js-websocket":"^9.2.1","jonbitco1":"^1.1.4","lit":"^2.0.0","lodash":"^4.17.21"},"devDependencies":{"@babel/core":"^7.9.6","@babel/plugin-transform-runtime":"^7.17.0","@babel/preset-env":"^7.16.11","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-commonjs":"^25.0.0","@rollup/plugin-image":"^3.0.1","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.1","@rollup/plugin-replace":"^5.0.2","@semantic-release/git":"^10.0.1","@types/lodash":"^4.14.195","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","eslint":"^8.9.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.25.4","husky":"^9.0.11","lint-staged":"^15.2.2","postcss":"^8.4.6","postcss-preset-env":"^9.1.3","prettier":"^3.0.3","rollup":"^2.7.6","rollup-plugin-minify-html-literals":"^1.2.6","rollup-plugin-postcss":"^4.0.2","rollup-plugin-postcss-lit":"^2.0.0","rollup-plugin-serve":"^2.0.1","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.35.0","semantic-release":"^23.0.2","typescript":"^5.0.4"},"browserslist":["last 2 versions","not dead"],"lint-staged":{"*.js":"eslint --fix","**/*":"prettier --write --ignore-unknown"},"prettier":{"singleQuote":true},"release":{"branches":["main"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"angular","releaseRules":[{"type":"chore","scope":"deps","release":"patch"}]}],"@semantic-release/release-notes-generator","@semantic-release/npm",["@semantic-release/github",{"assets":[{"path":"dist/vacuum-card.js","label":"vacuum-card.js"}]}],"@semantic-release/git"]},"repository":{"type":"git","url":"git+https://github.com/bal3367/1.git"},"bugs":{"url":"https://github.com/bal3367/1/issues"},"homepage":"https://github.com/bal3367/1#readme","_id":"@balxyzz/vacuum-card@2.9.2","gitHead":"11b0264be41a6824ea20d9f2ae96921878e54792","_nodeVersion":"20.12.1","_npmVersion":"10.5.0","dist":{"integrity":"sha512-t1x85zzW9pNfJmf6M16KzVx3Wx1cz5TmbodL3rPYuhfmafHcjs6/8Aup4NRW5SHFausnJwR1jpQc+/hi8i99bw==","shasum":"3afd76f8ac3459e37f9c1293024c5276607ac8fe","tarball":"https://registry.npmjs.org/@balxyzz/vacuum-card/-/vacuum-card-2.9.2.tgz","fileCount":54,"unpackedSize":230429,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgO5h3+Gr1MEIYFAZaNTsqHnvj4VNw4qlbo15AHz1pIAIhAN9RHzl3HKowcvoIq+x50mb0TSyXr9KqetmQG2oH8bt4"}]},"_npmUser":{"name":"balxyzz","email":"qobaciqawop1@sizaq.com"},"directories":{},"maintainers":[{"name":"balxyzz","email":"qobaciqawop1@sizaq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vacuum-card_2.9.2_1714825493745_0.8216543216338685"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-04T12:24:53.656Z","2.9.2":"2024-05-04T12:24:53.907Z","modified":"2024-05-04T12:24:54.201Z"},"maintainers":[{"name":"balxyzz","email":"qobaciqawop1@sizaq.com"}],"description":"Vacuum cleaner card for Home Assistant Lovelace UI","homepage":"https://github.com/bal3367/1#readme","keywords":["home-assistant","homeassistant","hass","automation","lovelace","custom-cards","vacuum"],"repository":{"type":"git","url":"git+https://github.com/bal3367/1.git"},"author":{"name":"Denys Dovhan","email":"denysdovhan@gmail.com","url":"http://denysdovhan.com/"},"bugs":{"url":"https://github.com/bal3367/1/issues"},"license":"MIT","readme":"[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://stand-with-ukraine.pp.ua/)\n\n# Vacuum Card\n\n[![npm version][npm-image]][npm-url]\n[![hacs][hacs-image]][hacs-url]\n[![GitHub Sponsors][gh-sponsors-image]][gh-sponsors-url]\n[![Patreon][patreon-image]][patreon-url]\n[![Buy Me A Coffee][buymeacoffee-image]][buymeacoffee-url]\n[![Twitter][twitter-image]][twitter-url]\n\n> Vacuum cleaner card for [Home Assistant][home-assistant] Lovelace UI\n\nBy default, Home Assistant does not provide any card for controlling vacuum cleaners. This card displays the state and allows to control your robot.\n\n![Preview of vacuum-card][preview-image]\n\n## Installing\n\n**💡 Tip:** If you like this project, consider giving me a tip for the time I spent building this project:\n\n<a href=\"https://www.buymeacoffee.com/denysdovhan\" target=\"_blank\">\n  <img src=\"https://cdn.buymeacoffee.com/buttons/default-black.png\" alt=\"Buy Me A Coffee\" width=\"150px\">\n</a>\n\n### HACS\n\nThis card is available in [HACS][hacs] (Home Assistant Community Store).\n\nJust search for `Vacuum Card` in plugins tab.\n\n### Manual\n\n1. Download `vacuum-card.js` file from the [latest-release].\n2. Put `vacuum-card.js` file into your `config/www` folder.\n3. Add reference to `vacuum-card.js` in Lovelace. There's two way to do that:\n\n   1. **Using UI:** _Configuration_ → _Lovelace Dashboards_ → _Resources Tab_ → Click Plus button → Set _Url_ as `/local/vacuum-card.js` → Set _Resource type_ as `JavaScript Module`.\n      **Note:** If you do not see the Resources Tab, you will need to enable _Advanced Mode_ in your _User Profile_\n   2. **Using YAML:** Add following code to `lovelace` section.\n\n      ```yaml\n      resources:\n        - url: /local/vacuum-card.js\n          type: module\n      ```\n\n4. Add `custom:vacuum-card` to Lovelace UI as any other card (using either editor or YAML configuration).\n\n## Usage\n\nThis card can be configured using Lovelace UI editor.\n\n1. In Lovelace UI, click 3 dots in top left corner.\n2. Click _Configure UI_.\n3. Click Plus button to add a new card.\n4. Find _Custom: Vacuum Card_ in the list.\n5. Choose `entity`.\n6. Now you should see the preview of the card!\n\n_Sorry, no support for `actions`, `shortcuts` and `stats` in visual config yet._\n\nTypical example of using this card in YAML config would look like this:\n\n```yaml\ntype: 'custom:vacuum-card'\nentity: vacuum.vacuum_cleaner\nactions:\n  start:\n    service: xiaomi_miio.vacuum_clean_segment\n    service_data:\n      entity_id: vacuum.vacuum_cleaner\n      segments: [16, 20]\nstats:\n  default:\n    - attribute: filter_left\n      unit: hours\n      subtitle: Filter\n    - attribute: side_brush_left\n      unit: hours\n      subtitle: Side brush\n    - attribute: main_brush_left\n      unit: hours\n      subtitle: Main brush\n    - attribute: sensor_dirty_left\n      unit: hours\n      subtitle: Sensors\n  cleaning:\n    - entity_id: sensor.vacuum_main_brush_left\n      value_template: '{{ (value | float(0) / 3600) | round(1) }}'\n      subtitle: Main brush\n      unit: hours\n    - attribute: cleaning_time\n      unit: minutes\n      subtitle: Cleaning time\nshortcuts:\n  - name: Clean living room\n    service: script.clean_living_room\n    icon: 'mdi:sofa'\n  - name: Clean bedroom\n    service: script.clean_bedroom\n    icon: 'mdi:bed-empty'\n  - name: Clean kitchen\n    service: script.clean_kitchen\n    icon: 'mdi:silverware-fork-knife'\n```\n\nHere is what every option means:\n\n| Name           |   Type    | Default      | Description                                                                                               |\n| -------------- | :-------: | ------------ | --------------------------------------------------------------------------------------------------------- |\n| `type`         | `string`  | **Required** | `custom:vacuum-card`                                                                                      |\n| `entity`       | `string`  | **Required** | An entity_id within the `vacuum` domain.                                                                  |\n| `map`          | `string`  | Optional     | An entity_id within the `camera` domain, for streaming live vacuum map.                                   |\n| `map_refresh`  | `integer` | `5`          | Update interval for map camera in seconds                                                                 |\n| `image`        | `string`  | `default`    | Path to image of your vacuum cleaner. Better to have `png` or `svg`.                                      |\n| `show_name`    | `boolean` | `true`       | Show friendly name of the vacuum.                                                                         |\n| `show_status`  | `boolean` | `true`       | Show status of the vacuum.                                                                                |\n| `show_toolbar` | `boolean` | `true`       | Show toolbar with actions.                                                                                |\n| `compact_view` | `boolean` | `false`      | Compact view without image.                                                                               |\n| `stats`        | `object`  | Optional     | Custom per state stats for your vacuum cleaner                                                            |\n| `actions`      | `object`  | Optional     | Override default actions behavior with service invocations.                                               |\n| `shortcuts`    |  `array`  | Optional     | List of shortcuts shown at the right bottom part of the card with custom actions for your vacuum cleaner. |\n\n### `stats` object\n\nYou 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:\n\n| Name             |   Type   | Default  | Description                                                                                          |\n| ---------------- | :------: | -------- | ---------------------------------------------------------------------------------------------------- |\n| `entity_id`      | `string` | Optional | An entity_id with state, i.e. `sensor.vacuum`.                                                       |\n| `attribute`      | `string` | Optional | Attribute name of the stat, i.e. `filter_left`.                                                      |\n| `value_template` | `string` | Optional | Jinja2 template returning a value. `value` variable represents the `entity_id` or `attribute` state. |\n| `unit`           | `string` | Optional | Unit of measure, i.e. `hours`.                                                                       |\n| `subtitle`       | `string` | Optional | Friendly name of the stat, i.e. `Filter`.                                                            |\n\n### `actions` object\n\nYou can defined service invocations to override default actions behavior. Available actions to override are `start`, `pause`, `resume`, `stop`, `locate` and `return_to_base`.\n\n| Name           |   Type   | Default                           | Description                                     |\n| -------------- | :------: | --------------------------------- | ----------------------------------------------- |\n| `service`      | `string` | Optional                          | A service to call, i.e. `script.clean_bedroom`. |\n| `service_data` | `object` | `service_data` for `service` call |\n\n### `shortcuts` object\n\nYou can defined [custom scripts][ha-scripts] for custom actions i.e cleaning specific room and add them to this card with `shortcuts` option.\n\n| Name           |   Type   | Default                           | Description                                        |\n| -------------- | :------: | --------------------------------- | -------------------------------------------------- |\n| `name`         | `string` | Optional                          | Friendly name of the action, i.e. `Clean bedroom`. |\n| `service`      | `string` | Optional                          | A service to call, i.e. `script.clean_bedroom`.    |\n| `icon`         | `string` | Optional                          | Any icon for action button.                        |\n| `service_data` | `object` | `service_data` for `service` call |\n\n## Theming\n\nThis card can be styled by changing the values of these CSS properties (globally or per-card via [`card-mod`][card-mod]):\n\n| Variable                    | Default value                                                    | Description                          |\n| --------------------------- | ---------------------------------------------------------------- | ------------------------------------ |\n| `--vc-background`           | `var(--ha-card-background, var(--card-background-color, white))` | Background of the card               |\n| `--vc-primary-text-color`   | `var(--primary-text-color)`                                      | Vacuum name, stats values, etc       |\n| `--vc-secondary-text-color` | `var(--secondary-text-color)`                                    | Status, stats units and titles, etc  |\n| `--vc-icon-color`           | `var(--secondary-text-color)`                                    | Colors of icons                      |\n| `--vc-toolbar-background`   | `var(--vc-background)`                                           | Background of the toolbar            |\n| `--vc-toolbar-text-color`   | `var(--secondary-text-color)`                                    | Color of the toolbar texts           |\n| `--vc-toolbar-icon-color`   | `var(--secondary-text-color)`                                    | Color of the toolbar icons           |\n| `--vc-divider-color`        | `var(--entities-divider-color, var(--divider-color))`            | Color of dividers                    |\n| `--vc-spacing`              | `10px`                                                           | Paddings and margins inside the card |\n\n### Styling via theme\n\nHere is an example of customization via theme. Read more in the [Frontend documentation](https://www.home-assistant.io/integrations/frontend/).\n\n```yaml\nmy-custom-theme:\n  vc-background: '#17A8F4'\n  vc-spacing: 5px\n```\n\n### Styling via card-mod\n\nYou can use [`card-mod`][card-mod] to customize the card on per-card basis, like this:\n\n```yaml\ntype: 'custom:vacuum-card'\nstyle: |\n  ha-card {\n    --vc-background: #17A8F4;\n    --vc-spacing: 5px;\n  }\n  ...\n```\n\n## Animations\n\nI've added some animations for this card to make it alive. Animations are applied only for `image` property. Here's how they look like:\n\n|              Cleaning               |                Docking                |\n| :---------------------------------: | :-----------------------------------: |\n| ![Cleaning anumation][cleaning-gif] | ![Returning anumation][returning-gif] |\n\n## Supported languages\n\nThis card supports translations. Please, help to add more translations and improve existing ones. Here's a list of supported languages:\n\n- English\n- Українська (Ukrainian)\n- Deutsch (German)\n- Français (French)\n- Italiano (Italian)\n- Nederlands (Dutch)\n- Polski (Polish)\n- Русский (Russian)\n- Español (Spanish)\n- Čeština (Czech)\n- Magyar (Hungarian)\n- עִבְרִית (Hebrew)\n- Português (Portuguese)\n- Português Brasileiro (Brazilian Portuguese)\n- Svenska (Swedish)\n- Norsk bokmål (Norwegian)\n- Norsk nynorsk (Norwegian)\n- Dansk (Danish)\n- 한국어 (Korean)\n- Suomi (Finnish)\n- Català (Catalan)\n- 正體中文 (Traditional Chinese)\n- Việt Nam (Vietnamese)\n- Lietuvių (Lithuanian)\n- Română (Romanian)\n- 简体中文 (Simplified Chinese)\n- 日本語 (Japanese)\n- [_Your language?_][add-translation]\n\n## Supported models\n\nThis 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.\n\nIf this card works with your vacuum cleaner, please open a PR and your model to the list.\n\n- **Roborock** S8 (Ultra Pro), S7 (MaxV), S6 (MaxV, Pure), S5 (Max), S50, S4 (Max), E25, E4, Q5 Pro\n- **Mijia** Robot Vacuum Cleaner 1C (STYTJ01ZHM)\n- **Xiaomi** Mi Robot (STYJ02YM), Mi Robot 1S, Mi Roborock V1 (SDJQR02RR), Mijia 1C, Mi Robot Vacuum-Mop P, Robot Vacuum E10\n- **Roomba** 670, 675, 676, 960980, 981, i3, i7+, e5, S9, s9+, j7\n- **Braava** M6\n- **Dyson** 360 Eye\n- **Neato** D7, D6, D4\n- **Shark** IQ\n- **Ecova**cs Deebot 950, Deebot OZMO T8 AIVI, Deebot N79, Deebot N8, Deebot N8+, T9 AIVI, Deebot T20 Ombi\n- **Eufy** Robovac 30c, Robovac 15C Max, Robovac X8 Hybrid, Robovac G40\n- **EcoVacs** T9 AIVI\n- **Dreame** Z10 Pro, L10 Pro, D9, F9\n- 360 S7 Pro\n- KaBum! Smart 500\n- Honiture Q6 Lite\n- Neabot NoMo N1 Plus\n- Kyvol E31\n- Setti+ RV800\n- [_Your vacuum?_][edit-readme]\n\n## Development\n\nWant to contribute to the project?\n\nFirst of all, thanks! Check [contributing guideline](./CONTRIBUTING.md) for more information.\n\n## Inspiration\n\nThis project is heavily inspired by:\n\n- [MacBury Smart House][macbury-smart-house] — basically, this project is a refinement of MacBury's custom card.\n- [Benji][bbbenji-card] vacuum card — this is where I noticed this vacuum card design for the [first time](https://github.com/bbbenji/synthwave-hass/issues/29).\n\nHuge thanks for their ideas and efforts 👍\n\n## License\n\nMIT © [Denys Dovhan][denysdovhan]\n\n<!-- Badges -->\n\n[npm-url]: https://npmjs.org/package/vacuum-card\n[npm-image]: https://img.shields.io/npm/v/vacuum-card.svg?style=flat-square\n[hacs-url]: https://github.com/hacs/integration\n[hacs-image]: https://img.shields.io/badge/hacs-default-orange.svg?style=flat-square\n[gh-sponsors-url]: https://github.com/sponsors/denysdovhan\n[gh-sponsors-image]: https://img.shields.io/github/sponsors/denysdovhan?style=flat-square\n[patreon-url]: https://patreon.com/denysdovhan\n[patreon-image]: https://img.shields.io/badge/support-patreon-F96854.svg?style=flat-square\n[buymeacoffee-url]: https://patreon.com/denysdovhan\n[buymeacoffee-image]: https://img.shields.io/badge/support-buymeacoffee-222222.svg?style=flat-square\n[twitter-url]: https://twitter.com/denysdovhan\n[twitter-image]: https://img.shields.io/badge/twitter-%40denysdovhan-00ACEE.svg?style=flat-square\n\n<!-- References -->\n\n[home-assistant]: https://www.home-assistant.io/\n[hacs]: https://hacs.xyz\n[preview-image]: https://github.com/denysdovhan/vacuum-card/assets/3459374/43808d3d-65a4-4e65-9531-4f248fa8861c\n[cleaning-gif]: https://user-images.githubusercontent.com/3459374/81119202-fa60b500-8f32-11ea-9b23-325efa93d7ab.gif\n[returning-gif]: https://user-images.githubusercontent.com/3459374/81119452-765afd00-8f33-11ea-9dc5-9c26ba3f8c45.gif\n[latest-release]: https://github.com/denysdovhan/vacuum-card/releases/latest\n[ha-scripts]: https://www.home-assistant.io/docs/scripts/\n[edit-readme]: https://github.com/denysdovhan/vacuum-card/edit/master/README.md\n[card-mod]: https://github.com/thomasloven/lovelace-card-mod\n[add-translation]: https://github.com/denysdovhan/vacuum-card/blob/master/CONTRIBUTING.md#how-to-add-translation\n[macbury-smart-house]: https://macbury.github.io/SmartHouse/HomeAssistant/Vacuum/\n[bbbenji-card]: https://gist.github.com/bbbenji/24372e423f8669b2e6713638d8f8ceb2\n[denysdovhan]: https://denysdovhan.com\n","readmeFilename":"README.md"}