A package to control Roborock vacuums.
Project description
Roborock
Roborock library for online and offline control of your vacuums.
Installation
Install this via pip (or your favourite package manager):
pip install python-roborock
Example Usage
See examples/example.py for a more full featured example, or the API documentation for more details.
Here is a basic example:
import asyncio
from roborock.web_api import RoborockApiClient
from roborock.devices.device_manager import create_device_manager, UserParams
async def main():
email_address = "youremailhere@example.com"
web_api = RoborockApiClient(username=email_address)
# Send a login code to the above email address
await web_api.request_code()
# Prompt the user to enter the code
code = input("What is the code?")
user_data = await web_api.code_login(code)
# Create a device manager that can discover devices.
user_params = UserParams(username=email_address, user_data=user_data)
device_manager = await create_device_manager(user_params)
devices = await device_manager.get_devices()
# Get all vacuum devices. Each device generation has different capabilities
# and APIs available so to find vacuums we filter by the v1 PropertiesApi.
for device in devices:
if not device.v1_properties:
continue
# The PropertiesAPI has traits different device commands such as getting
# status, sending clean commands, etc. For this example we send a
# command to refresh the current device status.
status_trait = device.v1_properties.status
await status_trait.refresh()
print(status_trait)
asyncio.run(main())
Functionality
The library interacts with devices through specific API properties based on the device protocol:
- Standard Vacuums (V1 Protocol): Most robot vacuums use this. Interaction is done through
device.v1_properties, which contains traits likestatus,consumables, andmaps. Use thecommandtrait for actions like starting or stopping cleaning. - Wet/Dry Vacuums & Washing Machines (A01 Protocol): Devices like the Dyad and Zeo use this. Interaction is done through
device.a01_propertiesusingquery_values()andset_value().
You can find detailed documentation for Devices and Traits.
Supported devices
You can find what devices are supported here. Please note this may not immediately contain the latest devices.
Acknowledgements
- Thanks to @rovo89 for Login APIs gist.
- Thanks to @PiotrMachowski for Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_roborock-4.12.0.tar.gz.
File metadata
- Download URL: python_roborock-4.12.0.tar.gz
- Upload date:
- Size: 126.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a74e5e814ef3c2b65c525620b55f0c361ae8db0e535f90d4588b2525d5f58501
|
|
| MD5 |
3b4b63fb637a39b5eb7fe7e1ee5e3c39
|
|
| BLAKE2b-256 |
c0a2400cc89b5abeda28a0185cb1b5afc6defae4585faf98f93f1e376e04ee22
|
Provenance
The following attestation bundles were made for python_roborock-4.12.0.tar.gz:
Publisher:
ci.yml on Python-roborock/python-roborock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_roborock-4.12.0.tar.gz -
Subject digest:
a74e5e814ef3c2b65c525620b55f0c361ae8db0e535f90d4588b2525d5f58501 - Sigstore transparency entry: 898226490
- Sigstore integration time:
-
Permalink:
Python-roborock/python-roborock@5e285694b329701c019d804540493d856299a138 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Python-roborock
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@5e285694b329701c019d804540493d856299a138 -
Trigger Event:
push
-
Statement type:
File details
Details for the file python_roborock-4.12.0-py3-none-any.whl.
File metadata
- Download URL: python_roborock-4.12.0-py3-none-any.whl
- Upload date:
- Size: 165.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d024eb94ee85f95325552c3ee23b7319c5b6aeb99cabec1e5862a236aa48aeba
|
|
| MD5 |
8a50c1b8e7c805bc413ecb8c592ce85b
|
|
| BLAKE2b-256 |
5f5bccf795e2e581a4d6696d1341b3d9ce07e329d96b1028695f17cde516788e
|
Provenance
The following attestation bundles were made for python_roborock-4.12.0-py3-none-any.whl:
Publisher:
ci.yml on Python-roborock/python-roborock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_roborock-4.12.0-py3-none-any.whl -
Subject digest:
d024eb94ee85f95325552c3ee23b7319c5b6aeb99cabec1e5862a236aa48aeba - Sigstore transparency entry: 898226535
- Sigstore integration time:
-
Permalink:
Python-roborock/python-roborock@5e285694b329701c019d804540493d856299a138 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Python-roborock
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@5e285694b329701c019d804540493d856299a138 -
Trigger Event:
push
-
Statement type: