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: Settings → Automations & Scenes → Scripts → Create New Script
Then configure the action as follows:
- Add action → Perform action
- Select Action:
Vacuum: Send command - Set Target: Entity
vacuum.deebot - Set Command:
clean - Configure Parameters with the YAML structure below
Script Configuration
1act: start2content: "4"3type: spotAreaParameter Explanation:
act: start- Initiates the cleaning action immediatelytype: 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:
- Via Developer Tools: Go to Developer Tools → States → Search for your vacuum entity (e.g.,
vacuum.deebot) - 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:
1sequence:2 - action: vacuum.send_command3 target:4 entity_id: vacuum.deebot5 data:6 command: clean7 params:8 act: start9 content: "1"10 type: spotArea11 - delay:12 seconds: 12013 - action: vacuum.send_command14 target:15 entity_id: vacuum.deebot16 data:17 command: clean18 params:19 act: start20 content: "3"21 type: spotAreaAutomation Trigger Example
Create an automation that triggers room-specific cleaning based on sensor data:
1alias: Clean Kitchen When Motion Detected2triggers:3 - trigger: state4 entity_id: binary_sensor.kitchen_motion5 to: "off"6 for:7 minutes: 308actions:9 - action: vacuum.send_command10 target:11 entity_id: vacuum.deebot12 data:13 command: clean14 params:15 act: start16 content: "2"17 type: spotAreaTemplate Service Call
For dynamic room selection using Home Assistant templates:
1action: vacuum.send_command2target:3 entity_id: vacuum.deebot4data:5 command: clean6 params:7 act: start8 content: "{{ states('input_select.target_room') }}"9 type: spotAreaDebugging and Validation
Checking Service Response
When testing commands via Developer Tools → Services, 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:
- Local network connection (for supported models)
- Ecovacs cloud API (for cloud-dependent models)
- 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.