├── xiaomi_vacuum_card.png ├── README.md ├── sensor.yaml └── home.yaml /xiaomi_vacuum_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fraiss-c/Lovelace-xiaomi-vacuum-card/HEAD/xiaomi_vacuum_card.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lovelace-xiaomi-vacuum-card 2 | [![Buy Me A Coffee][buymeacoffee-image]][buymeacoffee-url] 3 | 4 | Home Assistant Lovelace UI card made for Xiaomi Roborock vacuums (compatible with other vacuum robots). 5 | The design is based on the Roborock S50 V2, but new backgrounds can be easily done. 6 | 7 | ![Xiaomi vacuum card preview](https://user-images.githubusercontent.com/16242137/88160973-aef3a400-cc0f-11ea-905b-b50c21d14ef0.PNG) 8 | 9 | The icons on the card have the following behavior:\ 10 | ![play](https://user-images.githubusercontent.com/16242137/88162994-54a81280-cc12-11ea-88cc-619d1808a6c6.png): Start cleaning.\ 11 | ![stop](https://user-images.githubusercontent.com/16242137/88162928-40fcac00-cc12-11ea-89c9-0b013802eab6.png): Stop cleaning.\ 12 | ![home](https://user-images.githubusercontent.com/16242137/88163120-7d300c80-cc12-11ea-8af6-cc8348690230.png): Return to base.\ 13 | ![target](https://user-images.githubusercontent.com/16242137/88163189-95a02700-cc12-11ea-8fb3-8ade5e0c755a.png): Go to my `/vacuum` lovelace view where my floorplan is displayed to launch room cleaning.\ 14 | ![bell-ring](https://user-images.githubusercontent.com/16242137/88163532-18c17d00-cc13-11ea-85b4-6dcf6550941f.png): Locate the vacuum. 15 | 16 | 17 | ## Installation 18 | 19 | The card is made of 3 components: 20 | - `sensor.yaml` file which contains the code needed to create the entities. 21 | - `home.yaml` containing the code to add in your `ui-lovelace.yaml` file. 22 | - `xiaomi_vacuum_card.png` the background image. 23 | 24 | If you liked this card, you can buy me a ☕️: 25 | 26 | Buy Me A Coffee 27 | 28 | [buymeacoffee-url]: https://www.buymeacoffee.com/gagooga 29 | [buymeacoffee-image]: https://img.shields.io/badge/support-buymeacoffee-222222.svg?style=flat-square 30 | -------------------------------------------------------------------------------- /sensor.yaml: -------------------------------------------------------------------------------- 1 | - platform: template 2 | sensors: 3 | vacuum_status: 4 | friendly_name: "Vacuum - Status" 5 | value_template: "Status: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.status }}" 6 | 7 | - platform: template 8 | sensors: 9 | vacuum_name: 10 | friendly_name: "Vacuum - Name" 11 | value_template: "{{ states.vacuum.xiaomi_vacuum_cleaner.attributes.friendly_name }}" 12 | 13 | - platform: template 14 | sensors: 15 | vacuum_mode: 16 | friendly_name: "Vacuum - Mode" 17 | value_template: "Mode: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.fan_speed }}" 18 | 19 | - platform: template 20 | sensors: 21 | vacuum_area: 22 | friendly_name: "Vacuum - Area" 23 | value_template: "Area: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.cleaned_area }}" 24 | unit_of_measurement: 'm²' 25 | 26 | - platform: template 27 | sensors: 28 | vacuum_time: 29 | friendly_name: "Vacuum - Time" 30 | value_template: "Time: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.cleaning_time }}" 31 | unit_of_measurement: 'min' 32 | 33 | - platform: template 34 | sensors: 35 | vacuum_main_brush: 36 | friendly_name: "Vacuum - Main Brush" 37 | value_template: "Main Brush: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.main_brush_left }}" 38 | unit_of_measurement: 'h' 39 | 40 | - platform: template 41 | sensors: 42 | vacuum_side_brush: 43 | friendly_name: "Vacuum - Side Brush" 44 | value_template: "Side Brush: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.side_brush_left }}" 45 | unit_of_measurement: 'h' 46 | 47 | - platform: template 48 | sensors: 49 | vacuum_filter: 50 | friendly_name: "Vacuum - Filter" 51 | value_template: "Filter: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.filter_left }}" 52 | unit_of_measurement: 'h' 53 | 54 | - platform: template 55 | sensors: 56 | vacuum_sensor: 57 | friendly_name: "Vacuum - Sensor" 58 | value_template: "Sensor: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.sensor_dirty_left }}" 59 | unit_of_measurement: 'h' 60 | 61 | - platform: template 62 | sensors: 63 | vacuum_battery: 64 | friendly_name: "Vacuum - Battery" 65 | value_template: "Battery: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.battery_level }}" 66 | device_class: battery 67 | unit_of_measurement: '%' -------------------------------------------------------------------------------- /home.yaml: -------------------------------------------------------------------------------- 1 | badges: [] 2 | icon: 'mdi:home' 3 | panel: false 4 | path: default_view 5 | theme: '' 6 | title: '' 7 | cards: 8 | - type: picture-elements 9 | image: /local/Vacuum/xiaomi_vacuum_card.png 10 | elements: 11 | - type: state-label 12 | entity: sensor.vacuum_name 13 | style: 14 | top: 10% 15 | left: 50% 16 | # OPERATION 17 | - type: state-label 18 | entity: sensor.vacuum_area 19 | style: 20 | top: 25% 21 | left: 33% 22 | font-size: 80% 23 | - type: state-label 24 | entity: sensor.vacuum_status 25 | style: 26 | top: 34% 27 | left: 10% 28 | font-size: 80% 29 | - type: state-label 30 | entity: sensor.vacuum_battery 31 | style: 32 | top: 51% 33 | left: 9% 34 | font-size: 80% 35 | - type: state-label 36 | entity: sensor.vacuum_mode 37 | style: 38 | top: 71% 39 | left: 9% 40 | font-size: 80% 41 | # MAINTENANCE 42 | - type: state-label 43 | entity: sensor.vacuum_time 44 | style: 45 | top: 25% 46 | left: 66% 47 | font-size: 80% 48 | - type: state-label 49 | entity: sensor.vacuum_sensor 50 | style: 51 | top: 33% 52 | left: 93% 53 | font-size: 80% 54 | - type: state-label 55 | entity: sensor.vacuum_side_brush 56 | style: 57 | top: 42% 58 | left: 91% 59 | font-size: 80% 60 | - type: state-label 61 | entity: sensor.vacuum_main_brush 62 | style: 63 | top: 57% 64 | left: 91% 65 | font-size: 75% 66 | - type: state-label 67 | entity: sensor.vacuum_filter 68 | style: 69 | top: 71% 70 | left: 93% 71 | font-size: 80% 72 | # ICONS 73 | - type: icon 74 | icon: mdi:play 75 | tap_action: 76 | action: call-service 77 | service: vacuum.start 78 | service_data: 79 | entity_id: vacuum.xiaomi_vacuum_cleaner 80 | style: 81 | top: 92% 82 | left: 17% 83 | - type: icon 84 | icon: mdi:stop 85 | tap_action: 86 | action: call-service 87 | service: vacuum.stop 88 | service_data: 89 | entity_id: vacuum.xiaomi_vacuum_cleaner 90 | style: 91 | top: 92% 92 | left: 33% 93 | - type: icon 94 | icon: mdi:home 95 | tap_action: 96 | action: call-service 97 | service: vacuum.return_to_base 98 | service_data: 99 | entity_id: vacuum.xiaomi_vacuum_cleaner 100 | style: 101 | top: 92% 102 | left: 50% 103 | - type: icon 104 | icon: mdi:target 105 | tap_action: 106 | action: navigate 107 | navigation_path: vacuum 108 | style: 109 | top: 92% 110 | left: 67% 111 | - type: icon 112 | icon: mdi:bell-ring 113 | tap_action: 114 | action: call-service 115 | service: vacuum.locate 116 | service_data: 117 | entity_id: vacuum.xiaomi_vacuum_cleaner 118 | style: 119 | top: 92% 120 | left: 83% 121 | --------------------------------------------------------------------------------