# Xiaomi Vacuum Card

![](https://2426742268-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LIQDsbmCxoEk-2yQdYM%2F-LPbTKmtb3g-iWVWGqez%2F-LIbBumjCwvbhITkZd2F%2Fvacuum_card_example.png?generation=1540408048726815\&alt=media)

{% hint style="warning" %}
This card uses these components that you also need to install:

* [Xiaomi Mi Vacuum platform](https://www.home-assistant.io/components/vacuum.xiaomi_miio/)
  {% endhint %}

{% file src="<https://2426742268-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LIQDsbmCxoEk-2yQdYM%2F-LIbBslRwr2NoFiJ7KnL%2F-LIbBumlKQ7IbAw0N7RX%2Fvacuum_card.jpg?generation=1532887284179542&alt=media>" %}
Background for this card
{% endfile %}

```yaml
  - type: picture-elements
    image: /local/vacuum_card.jpg
    elements:
    - type: icon
      icon: mdi:bell-ring
      tap_action:
        action: call-service
        service: vacuum.locate
        service_data:
          entity_id: vacuum.xiaomi_vacuum_cleaner
      style:
        top: 80%
        left: 80%
        "--paper-item-icon-color": rgb(115, 122, 130)

    - type: icon
      icon: mdi:home
      tap_action:
        action: call-service
        service: vacuum.return_to_base
        service_data:
          entity_id: vacuum.xiaomi_vacuum_cleaner
      style:
        top: 80%
        left: 65%
        "--paper-item-icon-color": rgb(115, 122, 130)

    - type: icon
      icon: mdi:play
      tap_action:
        action: call-service
        service: vacuum.start
        service_data:
          entity_id: vacuum.xiaomi_vacuum_cleaner
      style:
        top: 80%
        left: 50%
        "--paper-item-icon-color": rgb(115, 122, 130)

    - type: icon
      icon: mdi:pause
      tap_action:
        action: call-service
        service: vacuum.pause
        service_data:
          entity_id: vacuum.xiaomi_vacuum_cleaner
      style:
        top: 80%
        left: 35%
        "--paper-item-icon-color": rgb(115, 122, 130)

    - type: icon
      icon: mdi:stop
      tap_action:
        action: call-service
        service: vacuum.stop
        service_data:
          entity_id: vacuum.xiaomi_vacuum_cleaner
      style:
        top: 80%
        left: 20%
        "--paper-item-icon-color": rgb(155, 122, 130)

    - type: state-label
      entity: sensor.vacuum_status
      style:
        top: 10%
        left: 5%
        color: rgb(255, 255, 255)
        transform: translate(0%,-50%)
        pointer-events: none
        text-shadow: 1px 1px black
        font-family: Trebuchet MS
        font-size: 90%
        font-weight: bold
        border-left-style: solid
        border-color: rgb(34, 154, 210)
        background-color: rgb(54, 65, 78)
        opacity: 0.8

    - type: state-label
      entity: sensor.vacuum_battery
      style:
        top: 10%
        right: 5%
        color: rgb(255, 255, 255)
        transform: translate(0%,-50%)
        pointer-events: none
        text-shadow: 1px 1px black
        font-family: Trebuchet MS
        font-size: 90%
        font-weight: bold
        border-right-style: solid
        border-color: rgb(34, 154, 210)
        background-color: rgb(54, 65, 78)
        opacity: 0.8
```

Here is the package for the sensors

{% hint style="warning" %}
Change 'xiaomi\_vacuum\_cleaner' on the states for your robots name in the template sensors
{% endhint %}

```yaml
  - platform: template
    sensors:
      vacuum_status:
        friendly_name: "Vacuum - Status"
        value_template: "Status: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.status }}"


  - platform: template
    sensors:
      vacuum_battery:
        friendly_name: "Vacuum - Battery"
        value_template: "Battery: {{ states.vacuum.xiaomi_vacuum_cleaner.attributes.battery_level }}"
        device_class: battery
        unit_of_measurement: '%'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sharethelove.io/picture-elements-cards/xiaomi-vacuum-card.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
