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
Functionality
You can see all of the commands supported here
Sending Commands
Here is an example that requires no manual intervention and can be done all automatically. You can skip some steps by caching values or looking at them and grabbing them manually.
import asyncio
from roborock import HomeDataProduct, DeviceData, RoborockCommand
from roborock.version_1_apis import RoborockMqttClientV1, RoborockLocalClientV1
from roborock.web_api import RoborockApiClient
async def main():
web_api = RoborockApiClient(username="youremailhere")
# Login via your password
user_data = await web_api.pass_login(password="pass_here")
# Or login via a code
await web_api.request_code()
code = input("What is the code?")
user_data = await web_api.code_login(code)
# Get home data
home_data = await web_api.get_home_data_v2(user_data)
# Get the device you want
device = home_data.devices[0]
# Get product ids:
product_info: dict[str, HomeDataProduct] = {
product.id: product for product in home_data.products
}
# Create the Mqtt(aka cloud required) Client
device_data = DeviceData(device, product_info[device.product_id].model)
mqtt_client = RoborockMqttClientV1(user_data, device_data)
networking = await mqtt_client.get_networking()
local_device_data = DeviceData(device, product_info[device.product_id].model, networking)
local_client = RoborockLocalClientV1(local_device_data)
# You can use the send_command to send any command to the device
status = await local_client.send_command(RoborockCommand.GET_STATUS)
# Or use existing functions that will give you data classes
status = await local_client.get_status()
asyncio.run(main())
Supported devices
You can find what devices are supported here. Please note this may not immediately contain the latest devices.
Credits
Thanks @rovo89 for https://gist.github.com/rovo89/dff47ed19fca0dfdda77503e66c2b7c7 And thanks @PiotrMachowski for https://github.com/PiotrMachowski/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
File details
Details for the file python_roborock-2.9.1.tar.gz
.
File metadata
- Download URL: python_roborock-2.9.1.tar.gz
- Upload date:
- Size: 57.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f27763d15af67be0c71fc69cc446b2dd596efa2a3e66f1f63e56d0ce5c95e05 |
|
MD5 | b94c31a8b6433d33af5954916a41b316 |
|
BLAKE2b-256 | d94d66a7e42fb114620cdcdc54d26aba597734723f20fa2dc4bf6fa20969413e |
Provenance
The following attestation bundles were made for python_roborock-2.9.1.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-2.9.1.tar.gz
- Subject digest:
7f27763d15af67be0c71fc69cc446b2dd596efa2a3e66f1f63e56d0ce5c95e05
- Sigstore transparency entry: 162064956
- Sigstore integration time:
- Permalink:
Python-roborock/python-roborock@6211a8163d130c41594daf65e36be2d87788a5c6
- 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@6211a8163d130c41594daf65e36be2d87788a5c6
- Trigger Event:
push
- Statement type:
File details
Details for the file python_roborock-2.9.1-py3-none-any.whl
.
File metadata
- Download URL: python_roborock-2.9.1-py3-none-any.whl
- Upload date:
- Size: 66.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f009e91ec9c05ca81edfb052ac2c2c3447b9fa05f5bb3f7507f2f1855025038 |
|
MD5 | ba2c4cac7c8f5c5c640b7093f93efec1 |
|
BLAKE2b-256 | 5d48db3b2e11eb591c49d62bef564bda99f3c3707817c7861eb25afa3eaf4a7e |
Provenance
The following attestation bundles were made for python_roborock-2.9.1-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-2.9.1-py3-none-any.whl
- Subject digest:
4f009e91ec9c05ca81edfb052ac2c2c3447b9fa05f5bb3f7507f2f1855025038
- Sigstore transparency entry: 162064958
- Sigstore integration time:
- Permalink:
Python-roborock/python-roborock@6211a8163d130c41594daf65e36be2d87788a5c6
- 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@6211a8163d130c41594daf65e36be2d87788a5c6
- Trigger Event:
push
- Statement type: