Top Tags

Add specific rooms/areas to Home Assistant for vacuum cleaner

Add specific rooms or areas to Home Assistant for your vacuum cleaner

Understanding Vacuum Service Commands

Home Assistant's vacuum integration provides standardized service calls for controlling vacuum cleaners. The vacuum.send_command service allows you to send custom commands specific to your vacuum model (in this case, Deebot/Ecovacs devices). Each manufacturer implements different command structures and parameters.

Service Call Architecture

The vacuum.send_command service operates using the following REST API endpoint:

POST /api/services/vacuum/send_command

When called, Home Assistant forwards the service data to the vacuum integration, which then communicates with your specific device. For Deebot devices connected via Ecovacs integration, commands are translated and sent to the device's API.

Command Structure

Deebot vacuums support various command types through the spotArea (zone cleaning) feature:

  • act: Action to perform (e.g., "start" for beginning the clean)
  • type: Command type specifying what kind of cleaning (e.g., "spotArea" for zone/room-based cleaning)
  • content: The target identifier (room ID, zone ID, etc.)

Setup Instructions

Creating the Script in Home Assistant UI

Navigate through: SettingsAutomations & ScenesScriptsCreate New Script

Then configure the action as follows:

  1. Add action → Perform action
  2. Select Action: Vacuum: Send command
  3. Set Target: Entity vacuum.deebot
  4. Set Command: clean
  5. Configure Parameters with the YAML structure below

Script Configuration

yaml
1act: start
2content: "4"
3type: spotArea

Parameter Explanation:

  • act: start - Initiates the cleaning action immediately
  • type: spotArea - Specifies zone/room-based cleaning mode (vs full home cleaning)
  • content: "4" - Room identifier variable based on your Deebot's room mapping

Finding Your Room IDs

Room IDs are stored in your Deebot device attributes within Home Assistant. To find them:

  1. Via Developer Tools: Go to Developer ToolsStates → Search for your vacuum entity (e.g., vacuum.deebot)
  2. In Attributes section, look for values like:
    • rooms (list of available rooms)
    • room_mapping (ID to name mapping)
    • lastCleanMap (last cleaning zones)

Room IDs are typically numeric strings (e.g., "1", "4", "12") that correspond to physically defined areas in your home as mapped through the Deebot app.

Extended Implementation Examples

Multi-Room Cleaning Script

For cleaning multiple rooms sequentially, create a script that calls the vacuum service multiple times:

yaml
1sequence:
2 - action: vacuum.send_command
3 target:
4 entity_id: vacuum.deebot
5 data:
6 command: clean
7 params:
8 act: start
9 content: "1"
10 type: spotArea
11 - delay:
12 seconds: 120
13 - action: vacuum.send_command
14 target:
15 entity_id: vacuum.deebot
16 data:
17 command: clean
18 params:
19 act: start
20 content: "3"
21 type: spotArea

Automation Trigger Example

Create an automation that triggers room-specific cleaning based on sensor data:

yaml
1alias: Clean Kitchen When Motion Detected
2triggers:
3 - trigger: state
4 entity_id: binary_sensor.kitchen_motion
5 to: "off"
6 for:
7 minutes: 30
8actions:
9 - action: vacuum.send_command
10 target:
11 entity_id: vacuum.deebot
12 data:
13 command: clean
14 params:
15 act: start
16 content: "2"
17 type: spotArea

Template Service Call

For dynamic room selection using Home Assistant templates:

yaml
1action: vacuum.send_command
2target:
3 entity_id: vacuum.deebot
4data:
5 command: clean
6 params:
7 act: start
8 content: "{{ states('input_select.target_room') }}"
9 type: spotArea

Debugging and Validation

Checking Service Response

When testing commands via Developer ToolsServices, you can verify the service call succeeded by checking:

  • The vacuum's entity state changes
  • Device logs show the command was received
  • The Deebot app reflects the action

Common Parameter Issues

  • content not recognized: Room ID doesn't exist in your mapping. Verify via device states.
  • act parameter: Must be lowercase "start" for Deebot devices
  • type parameter: Case-sensitive; use "spotArea" exactly as specified

Integration Details

The Ecovacs/Deebot integration in Home Assistant communicates with your vacuum through:

  1. Local network connection (for supported models)
  2. Ecovacs cloud API (for cloud-dependent models)
  3. MQTT relay (if using MQTT-based communication)

Service parameters are validated against the integration's schema before transmission to prevent invalid commands from being sent to your device.