---
title: "Vacuum"
description: "Spook adds actions that step a robot vacuum in Home Assistant to its next or previous fan speed, through all of its own or only the ones you pick."
canonical_url: "https://spook.boo/vacuum"
---
# Vacuum

> Spook adds actions that step a robot vacuum in Home Assistant to its next or previous fan speed, through all of its own or only the ones you pick.

The vacuum integration is how Home Assistant controls robot vacuums.

Home Assistant can set a vacuum to a fan speed, but not step it to the next one. A button that gives the robot more suction, one press at a time, has to be a template. Spook adds that step.

## Actions

Spook adds two actions for vacuums. You find them wherever you add an action, marked with a 👻.

### Next and previous fan speed

Steps a vacuum to its next fan speed, like from `quiet` to `balanced`, or back to the previous one. Only through the speeds you pick, if you like.

Think of a button by the kitchen door that gives the robot more suction after dinner, one press at a time, and a second button for less. Without this, each button is a template that finds the speed in the list and takes its neighbour, minding the ends. This action does the step for you, the same way it does for [the fan of a thermostat](https://spook.boo/climate#next-and-previous-fan-mode).

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **next fan speed**, and select **Vacuum: Next fan speed 👻**. Or search for **previous fan speed**, and select **Vacuum: Previous fan speed 👻**, to go the other way.
3. Under **Targets**, choose the vacuums.
4. Leave **Cycle** on to go round at the end. Turn it off to stop there.
5. Leave **Options** empty to step through all of the fan speeds it has, or fill in the ones to step through, in order, like `quiet`, `balanced` and `turbo`.
6. Select **Save**.

Just want to see it work? [Try next fan speed](https://my.home-assistant.io/redirect/developer_call_service/?service=vacuum.next_fan_speed) or [try previous fan speed](https://my.home-assistant.io/redirect/developer_call_service/?service=vacuum.previous_fan_speed) opens it in your Home Assistant, ready to run once.

**Technical details**

| Action properties |
| --- |
| Action | Vacuum: Next fan speed 👻 |
| Action name | `vacuum.next_fan_speed` |
| Action targets | Yes, `vacuum` entities with fan speeds |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=vacuum.next_fan_speed) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=vacuum.next_fan_speed) |

| Action properties |
| --- |
| Action | Vacuum: Previous fan speed 👻 |
| Action name | `vacuum.previous_fan_speed` |
| Action targets | Yes, `vacuum` entities with fan speeds |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=vacuum.previous_fan_speed) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=vacuum.previous_fan_speed) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `cycle` | boolean | No | `true` |
| `options` | list | No | All of the vacuum's own |

Both work the same way:

- Without **Options**, they step through the vacuum's own list, in the order the vacuum gives it.
- With **Options**, they step through those, in the order you give them, and skip the rest.
- A vacuum at a fan speed that is not in that list, or that does not say, goes to the first one with next, and to the last one with previous.
- With **Cycle** on, the last goes round to the first, and the first back to the last. With **Cycle** off, a vacuum at the end stays there, and is sent nothing.
- A vacuum already where the step would take it, like one with a single fan speed in the list, is sent nothing.
- Spook sets the new fan speed the way `vacuum.set_fan_speed` does. That action hands any speed to the vacuum, listed or not. Spook only steps to a speed the vacuum lists.

**Example actions in YAML**

More suction from a button, one speed up per press, stopping at `turbo` rather than going round to `quiet`:

```yaml
triggers:
  - trigger: state
    entity_id: input_button.more_suction
    not_from: unavailable
actions:
  - action: vacuum.next_fan_speed
    target:
      entity_id: vacuum.robot
    data:
      cycle: false
      options:
        - quiet
        - balanced
        - turbo
```

And less, stopping at `quiet`:

```yaml
action: vacuum.previous_fan_speed
target:
  entity_id: vacuum.robot
data:
  cycle: false
  options:
    - quiet
    - balanced
    - turbo
```

**Known limitations**

- A vacuum without fan speeds cannot be targeted. Named outright, it is refused with an error. Picked up through an area, a device, a floor or a label, it is passed over, and the others are stepped. One that says it has fan speeds but lists none is sent nothing, also when named outright, and also with **Options**.
- Every option has to be one the vacuum has. One it does not have refuses the whole call with an error that names it, and no vacuum in the call is changed, not even the ones that have it. `vacuum.set_fan_speed` would send it anyway; this check is the only one.
- An option given twice is refused: at that speed, there is no telling which of the two the vacuum is at.
- The names of the fan speeds differ from one integration to the next. Look them up in the `fan_speed_list` attribute of the vacuum.


## Sitemap

See the full [sitemap](https://spook.boo/sitemap.md) for all pages.
