Skip to main content

Deebot client library in python 3

Project description

Client Library for Deebot devices (Vacuums)

PyPI - Downloads Buy Me A Coffee

IMPORTANT: Contribution only

This project is maintained in our spare time. Please be patient and respectful.

It's not related to Ecovacs or Deebot and we don't get any support from them.

As all is reverse engineered it might take some time to add new features and we can't guarantee that all features will be added.

Unfortunately some people think we are paid to do this and get angry if things don't work as they expect. As result of this, we decided that this project is in a contribution only mode.

This means, if you want something to be supported/added, you have to provide a fix yourself, wait for someone else to fix it or pay someone to do it. Members will still review and help on pull requests.

Installation

If you have a recent version of Python 3, you should be able to do pip install deebot-client to get the most recently released version of this.

Usage

To get started, you'll need to have already set up an EcoVacs account using your smartphone.

You are welcome to try using this as a python library for other efforts. A simple usage might go something like this:

import aiohttp
import asyncio
import logging
import time

from deebot_client.api_client import ApiClient
from deebot_client.authentication import Authenticator, create_rest_config
from deebot_client.commands.json.clean import Clean, CleanAction
from deebot_client.events import BatteryEvent
from deebot_client.mqtt_client import MqttClient, create_mqtt_config
from deebot_client.util import md5
from deebot_client.device import Device

device_id = md5(str(time.time()))
account_id = "your email or phonenumber (cn)"
password_hash = md5("yourPassword")
country = "DE"


async def main():
  async with aiohttp.ClientSession() as session:
    logging.basicConfig(level=logging.DEBUG)
    rest_config = create_rest_config(session, device_id=device_id, alpha_2_country=country)

    authenticator = Authenticator(rest_config, account_id, password_hash)
    api_client = ApiClient(authenticator)

    devices_ = await api_client.get_devices()

    bot = Device(devices_.mqtt[0], authenticator)

    mqtt_config = create_mqtt_config(device_id=device_id, country=country)
    mqtt = MqttClient(mqtt_config, authenticator)
    await bot.initialize(mqtt)

    async def on_battery(event: BatteryEvent):
      # Do stuff on battery event
      if event.value == 100:
        # Battery full
        pass

    # Subscribe for events (more events available)
    bot.events.subscribe(BatteryEvent, on_battery)

    # Execute commands
    await bot.execute_command(Clean(CleanAction.START))
    await asyncio.sleep(900)  # Wait for...
    await bot.execute_command(Charge())


if __name__ == '__main__':
  loop = asyncio.get_event_loop()
  loop.create_task(main())
  loop.run_forever()

A more advanced example can be found here.

Note for Windows users

This library cannot be used out of the box with Windows due a limitation in the requirement aiomqtt. More information and a workaround can be found here

Thanks

My heartfelt thanks to:

  • deebotozmo, After all, this is a debotozmo fork :)
  • sucks, deebotozmo was forked from it :)
  • xmpppeek, a great library for examining XMPP traffic flows ( yes, your vacuum speaks Jabber!),
  • mitmproxy, a fantastic tool for analyzing HTTPS,
  • click, a wonderfully complete and thoughtful library for making Python command-line interfaces,
  • requests, a polished Python library for HTTP requests,
  • Decompilers online, which was very helpful in figuring out what the Android app was up to,
  • Albert Louw, who was kind enough to post code from his own experiments with his device, and
  • All the users who have given useful feedback and contributed code!

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

deebot_client-18.3.0.tar.gz (232.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

deebot_client-18.3.0-cp314-cp314-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.14Windows x86-64

deebot_client-18.3.0-cp314-cp314-musllinux_1_2_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

deebot_client-18.3.0-cp314-cp314-musllinux_1_2_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ ARM64

deebot_client-18.3.0-cp314-cp314-manylinux_2_34_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

deebot_client-18.3.0-cp314-cp314-manylinux_2_34_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

deebot_client-18.3.0-cp314-cp314-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

deebot_client-18.3.0-cp314-cp314-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

File details

Details for the file deebot_client-18.3.0.tar.gz.

File metadata

  • Download URL: deebot_client-18.3.0.tar.gz
  • Upload date:
  • Size: 232.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for deebot_client-18.3.0.tar.gz
Algorithm Hash digest
SHA256 ecc595f43f8ec9152ec991155ae1ca238b7b1e2ecbed10ddf80d8ea6ce892e4c
MD5 eda206d30e66bbe7063c6de39303e365
BLAKE2b-256 cdc5cc191188f8c2c38aaaef44c24a25019cc140e108ae2a2e9bc809bfea1b6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for deebot_client-18.3.0.tar.gz:

Publisher: ci.yml on DeebotUniverse/client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deebot_client-18.3.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for deebot_client-18.3.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e539afc318b748f5b12572cbb7b1fadfa01d274854068059fb3a0175854673e1
MD5 e40b9742a227295cdf28eab0d7a80aee
BLAKE2b-256 c5452c22e7250859b1c34cbecd2cb431866e77d8397e2451ee9458933d58216a

See more details on using hashes here.

Provenance

The following attestation bundles were made for deebot_client-18.3.0-cp314-cp314-win_amd64.whl:

Publisher: ci.yml on DeebotUniverse/client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deebot_client-18.3.0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for deebot_client-18.3.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ec10fdb549433b11bb11003d67277aed1c9621f80c937d26dec5f3e3e08f0288
MD5 e6fe2ada4efa59ebf09ca8103abda50d
BLAKE2b-256 3454163c7b1ae0bde5a820c7140457962dd2601f227b00d7ee8fd1139aeec704

See more details on using hashes here.

Provenance

The following attestation bundles were made for deebot_client-18.3.0-cp314-cp314-musllinux_1_2_x86_64.whl:

Publisher: ci.yml on DeebotUniverse/client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deebot_client-18.3.0-cp314-cp314-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for deebot_client-18.3.0-cp314-cp314-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8a7b90b57999b42160bedc8ddb6d0db5b0c8c75eb34503e1b768674304f97110
MD5 ace8a790d73055602b818ec29e673037
BLAKE2b-256 9fc55e91390c219e452dadaf8683b4815f1faf1290fd45337feecaa74e33d87d

See more details on using hashes here.

Provenance

The following attestation bundles were made for deebot_client-18.3.0-cp314-cp314-musllinux_1_2_aarch64.whl:

Publisher: ci.yml on DeebotUniverse/client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deebot_client-18.3.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for deebot_client-18.3.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bfa60ca3b83e144f8f3a8efd12654eea2f4455cdd6b98fa72964f6c98f9a4ee0
MD5 926c91ed9ba026a7ea98d68632aafae5
BLAKE2b-256 20f4de120400480921fd3a758c3910c6cbe3de0d1db4b014e6a48440725a11bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for deebot_client-18.3.0-cp314-cp314-manylinux_2_34_x86_64.whl:

Publisher: ci.yml on DeebotUniverse/client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deebot_client-18.3.0-cp314-cp314-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for deebot_client-18.3.0-cp314-cp314-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 053e58d9fdc17a40ae9f226ca44a145c1537dc7869ffe4dc90a7b48972f8fdeb
MD5 b2f1274c8ad5e41c34f56a216ce84699
BLAKE2b-256 8c85384d296122fff664fd5626b94d1f4888800bcb4f70ce15d719cc6a0fa45a

See more details on using hashes here.

Provenance

The following attestation bundles were made for deebot_client-18.3.0-cp314-cp314-manylinux_2_34_aarch64.whl:

Publisher: ci.yml on DeebotUniverse/client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deebot_client-18.3.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for deebot_client-18.3.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f87f449067cc6892964c93464f7f5baba875e47b9d688d620dc0c308b5444b73
MD5 64815a9bd06492c6106d7153e19daff8
BLAKE2b-256 dd515b8d0a56439e4e6cb61b3b42d2d509a1cf45068cd8421f779eb44c90662b

See more details on using hashes here.

Provenance

The following attestation bundles were made for deebot_client-18.3.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: ci.yml on DeebotUniverse/client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deebot_client-18.3.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for deebot_client-18.3.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 330191d2e368c20b574052f66d5a2d0509cc5c8ce1efa7f842743d94646ffce1
MD5 d1fbe682844d29e67ea8bedf34df7a9a
BLAKE2b-256 472d77734de84d49bf0863883be2d6cf353a50686dbd7fe041f227092cb56f57

See more details on using hashes here.

Provenance

The following attestation bundles were made for deebot_client-18.3.0-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: ci.yml on DeebotUniverse/client.py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page