项目作者: vanstinator

项目描述 :
stub
高级语言: JavaScript
项目地址: git://github.com/vanstinator/sprinkler-card.git
创建时间: 2020-06-08T23:39:09Z
项目社区:https://github.com/vanstinator/sprinkler-card

开源协议:MIT License

下载


I recently forked this project and development is underway converting the card to a sprinkler card. Assume things will break often

Vacuum Card

npm version
hacs
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 sprinkler cleaners. This card displays the state and allows to control your robot.

Preview of sprinkler-card

Installing

💡 Tip: If you like this project and want to get some stickers and postcards, consider becoming a patron:


Become a patron

or just buy me a cup of ☕️ or 🥤:


Buy Me A Coffee

HACS

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

Just search for Vacuum Card in plugins tab.

Manual

  1. Download sprinkler-card.js file from the latest-release.
  2. Put sprinkler-card.js file into your config/www folder.
  3. Add reference to sprinkler-card.js in Lovelace. There’s two way to do that:
    1. Using UI: ConfigurationLovelace DashboardsResources → Click Plus button → Set Url as /local/sprinkler-card.js → Set Resource type as JavaScript Module.
    2. Using YAML: Add following code to lovelace section.
      1. resources:
      2. - url: /local/sprinkler-card.js
      3. type: module
  4. Add custom:sprinkler-card to Lovelace UI as any other card (using either editor or YAML configuration).

Using the card

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 and stats in visual config yet.

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

  1. type: 'custom:sprinkler-card'
  2. entity: sprinkler.sprinkler_cleaner
  3. stats:
  4. default:
  5. - attribute: filter_left
  6. unit: hours
  7. subtitle: Filter
  8. - attribute: side_brush_left
  9. unit: hours
  10. subtitle: Side brush
  11. - attribute: main_brush_left
  12. unit: hours
  13. subtitle: Main brush
  14. - attribute: sensor_dirty_left
  15. unit: hours
  16. subtitle: Sensors
  17. cleaning:
  18. - attribute: cleaned_area
  19. unit: m2
  20. subtitle: Cleaning area
  21. - attribute: cleaning_time
  22. unit: minutes
  23. subtitle: Cleaning time
  24. actions:
  25. - name: Clean living room
  26. service: script.clean_living_room
  27. icon: 'mdi:sofa'
  28. - name: Clean bedroom
  29. service: script.clean_bedroom
  30. icon: 'mdi:bed-empty'
  31. - name: Clean kitchen
  32. service: script.clean_kitchen
  33. icon: 'mdi:silverware-fork-knife'

Here is what every option means:

Name Type Default Description
type string Required custom:sprinkler-card
entity string Required An entity_id within the sprinkler domain.
map string Optional An entity_id within the camera domain, for streaming live sprinkler map.
image string default Path to image of your sprinkler cleaner. Better to have png or svg.
show_name boolean true Show friendly name of the sprinkler.
show_toolbar boolean true Show toolbar with actions.
stats object Optional Custom per state stats for your sprinkler cleaner
actions object Optional Custom actions for your sprinkler cleaner.

stats object

Name Type Default Description
attribute string Optional Attribute name of the stat, i.e. filter_left.
unit string Optional Unit of measure, i.e. hours.
subtitle string Optional Friendly name of the stat, i.e. Filter.

actions object

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

Name Type Default Description
name string Optional Friendly name of the action, i.e. Clean bedroom.
service string Optional A service to call, i.e. script.clean_bedroom.
icon string Optional Any icon for action button.
service_data object service_data for service call

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:

Cleaning Docking
Cleaning anumation Returning 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)
  • Deutsche (German)
  • Français (French)
  • Italiano (Italian)
  • Nederlands (Dutch)
  • Polski (Polish)
  • Русский (Russian)
  • Español (Spanish)
  • Your language?

Supported models

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

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

  • Roborock S6
  • Roborock S5
  • Roborock S5 Max
  • Roborock S50
  • Roborock S4
  • Roborock E25
  • Xiaomi Mi Robot (STYJ02YM)
  • Xiaomi Mi Robot 1S
  • Roomba 675
  • Roomba 960
  • Dyson 360 Eye
  • Neato D7
  • Your sprinkler?

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 sprinkler card — this is where I noticed this sprinkler card design for the first time.

Huge thanks for their ideas and efforts 👍

License

MIT © Denys Dovhan