This Homebridge plugin allows you to control your Dreame robot vacuum through Apple's Home app and Siri. It supports both cloud-based connection via Xiaomi Mi Home or direct local IP connection.
- Main Control via Fan Service: The vacuum appears as a fan in HomeKit, allowing you to turn it on/off and adjust suction power.
- Suction Power Control: 4 power levels (Silent, Standard, Turbo, Max).
- Room, Zone, and Spot Cleaning: Create switches for specific rooms, zones, or spot cleaning.
- Water Level Control (optional): If your vacuum is compatible, enable a service to adjust the mop water flow (Low, Medium, High).
- Battery Monitoring: View battery level, charging status, and receive low battery alerts.
- Maintenance Tracking: Monitor filter and brush wear directly from HomeKit.
- Cloud Connection: Automatic device discovery via Mi Cloud with email/password authentication.
- Local Control: Direct IP connection when cloud is not available or preferred.
- Homebridge installed
- Node.js v14 or higher
- A compatible Dreame robot vacuum
- Device authentication token (for local connection) or Mi Home account (for cloud connection)
- Install the Mi Home app on your mobile device
- Log in with your Mi Home account
- Ensure your vacuum is properly set up and visible in the app
- Note: Two-factor authentication is supported if enabled on your account
- Install the Mi Home app on your mobile device
- Connect to the same network as your vacuum
- Go to app settings
- Tap multiple times on "About" to enable developer mode
- Navigate to "Plugins" > "Get Token"
- Select your vacuum and note the displayed token
- Install the plugin via Homebridge UI or by running:
npm install -g homebridge-dreame-vacuum
For alpha testing builds:
npm install -g homebridge-dreame-vacuum@next
-
Create a configuration file in your Homebridge config directory (usually
~/.homebridge/config.json) using the example below. -
Restart Homebridge to apply the changes.
{
"platforms": [
{
"platform": "DreameVacuumPlatform",
"name": "Dreame Vacuum",
"email": "your_email@example.com",
"password": "your_password",
"countryCode": "us",
"refreshInterval": 60,
"debug": false
}
]
}{
"platforms": [
{
"platform": "DreameVacuumPlatform",
"name": "Dreame Vacuum",
"token": "your_device_token_here",
"deviceId": "your_device_id_here",
"address": "192.168.1.100",
"countryCode": "us",
"refreshInterval": 60,
"debug": false
}
]
}{
"platforms": [
{
"platform": "DreameVacuumPlatform",
"name": "Dreame Vacuum",
"token": "your_device_token_here",
"deviceId": "your_device_id_here",
"countryCode": "us",
"refreshInterval": 60,
"debug": false,
"enableMop": true,
"rooms": [
{
"id": "16",
"name": "Kitchen"
},
{
"id": "17",
"name": "Living Room"
}
],
"zones": [
{
"name": "Living Room Carpet",
"coordinates": [2500, 2500, 3500, 3500],
"cleanings": 2
}
],
"spots": [
{
"name": "Under Table",
"coordinates": [2750, 2750]
}
]
}
]
}platform: Must be"DreameVacuumPlatform"name: Display name for your device in HomeKit
email: Your Mi Home account emailpassword: Your Mi Home account password
token: Device authentication tokendeviceId: Unique device identifieraddress: Local IP address of your vacuum
countryCode: Region code (e.g., "us", "fr", "de"). Default: "us"refreshInterval: State refresh interval in seconds. Default: 60debug: Enable debug logging. Default: falseenableMop: Enable mop control if your device supports it. Default: false
-
rooms: For room cleaning (automatically discovered from device)id: Room identifier (provided by the vacuum)name: Room name (as shown in the Mi Home app)
-
zones(optional): For custom rectangular cleaning areasname: Switch name in HomeKitcoordinates: Array of 4 numbers[x1, y1, x2, y2]defining the zonecleanings: Number of cleaning passes (default: 1)
-
spots(optional): For spot cleaning specific pointsname: Switch name in HomeKitcoordinates: Array of 2 numbers[x, y]defining the center point
- The vacuum appears as a Fan service in HomeKit
- On/Off: Start/stop cleaning
- Rotation Speed: Adjust suction power (Silent, Standard, Turbo, Max)
- Displays current battery level
- Shows charging status
- Provides low battery alerts
- Tracks filter life
- Provides maintenance notifications
- Appears as a separate switch
- Controls water flow for mopping (Low, Medium, High)
- Rooms, Zones, Spots: Each configured room, zone, or spot appears as a switch in HomeKit. Toggle it to start the corresponding cleaning action. The switch will automatically turn off when done.
- Water Level: If enabled, an additional fan service appears to control the water flow.
Leverage HomeKit's powerful automation capabilities to schedule cleanings and create smart rules.
Automation Examples:
- Scheduled Cleaning: "Every day at 10 AM, turn on the 'Kitchen' switch."
- Location-Based: "When the last person leaves home, turn on the 'Living Room' and 'Bedroom' switches."
- Battery Alerts: "When battery level drops below 20%, send a notification."
- After Cleaning: "When vacuum returns to dock, turn off all room switches."
- Custom Scenes: Create a "Full Clean" scene that activates all desired room switches at once.
-
Connection Issues
- Ensure your vacuum is connected to the same network as your Homebridge server
- Verify your token and device ID are correct
- Check if your vacuum's firmware is up to date
-
Missing Features
- Some features may not be available on all Dreame vacuum models
- Ensure you're using the latest version of the plugin
-
Cloud Connection Problems
- Verify your email and password are correct
- Check if your region is properly set in the Mi Home app
- Two-factor authentication is supported - follow the prompts in the Homebridge log
For support, please open an issue on GitHub.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the ISC License - see the LICENSE file for details.
debug: Enable debug logging (default: false)enableMop: Enable mop-related services (default: false)zones: Array for configuring custom cleaning zonesspots: Array for configuring custom spot cleaning points
To test the plugin locally:
-
Start Homebridge in debug mode:
DEBUG=* homebridge -D -
Check the logs for any errors or warnings
-
Verify all services appear correctly in the Home app
-
Test each feature to ensure proper functionality
These variables are read by the test setup in test/setup.js and can be used during local development:
MIHOME_EMAIL=your_email@example.com
MIHOME_PASSWORD=your_password
DEVICE_IP=192.168.1.100
DEVICE_TOKEN=abcdef0123456789abcdef0123456789
Notes:
- Tests skip cloud-dependent cases automatically if
MIHOME_EMAILandMIHOME_PASSWORDare not set. - Runtime production behavior is not affected by test-only code; any test-specific logic is gated and disabled in production.
- Initial release with cloud and local connection support
- Complete HomeKit integration with all major features
- Support for room, zone, and spot cleaning
- Battery and maintenance monitoring
To set up the development environment:
- Clone the repository
- Install dependencies:
npm install
- Build the project:
npm run build
- Link for local development:
npm link
- miio - For the Xiaomi device communication library
- homebridge - For the HomeKit bridge framework
This project is not affiliated with, authorized, maintained, sponsored or endorsed by Dreame or Xiaomi or any of its affiliates or subsidiaries. This is an independent and unofficial plugin.
-
Token Security
- Your device token is sensitive information. Never share your
config.jsonfile or commit it to version control. - Add
config.jsonto your.gitignorefile.
- Your device token is sensitive information. Never share your
-
Network Security
- Ensure your Homebridge server is running on a secure network.
- Use a strong password for your Mi Home account when using cloud connection.
-
Two-Factor Authentication
- It's highly recommended to enable two-factor authentication on your Mi Home account.
- The plugin supports 2FA and will prompt for the verification code when needed.
ISC