py-sucks


Namepy-sucks JSON
Version 0.9.10 PyPI version JSON
download
home_pagehttps://github.com/mib1185/py-sucks
Summarya library for controlling certain robot vacuums
upload_time2024-05-25 14:42:42
maintainerNone
docs_urlNone
authorWilliam Pietri
requires_pythonNone
licenseGPL-3.0
keywords home automation vacuum robot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Tests](https://github.com/mib1185/py-sucks/actions/workflows/tests.yaml/badge.svg)](https://github.com/mib1185/py-sucks/actions/workflows/tests.yaml)
[![PyPI version](https://badge.fury.io/py/py-sucks.svg)](https://pypi.org/project/py-sucks)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/py-sucks)](https://pypi.org/project/py-sucks)

# py-sucks

This is the successor of <https://github.com/wpietri/sucks>.

## Overview

A simple command-line python script to drive a robot vacuum. Currently
known to work with the Ecovacs Deebot N79, M80 Pro, M81, M88
Pro, and R95 MKII from both North America and Europe.

Does it work for your model as well? Join the discussion on the
[sucks-users mailing
list](https://groups.google.com/forum/#!forum/sucks-users).

If you're curious about the protocol, I have [a rough doc](http://github.com/mib1185/py-sucks/blob/master/protocol.md)
started. I'll happily accept pull requests for it.

Why the project name? Well, a) it's ridiculous that I needed to MITM
my own vacuum.  This is not the future I signed up for. And b),
it's a vacuum.

## Installation

If you have a recent version of Python 3, you should be able to
do `pip install py-sucks` 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.

With that ready, step one is to log in:

```bash
% sucks login
Ecovacs app email: [your email]
Ecovacs app password: [your password]
your two-letter country code: us
your two-letter continent code: na
Config saved.
```

That creates a config file in a platform-appropriate place. The password
is hashed before saving, so it's reasonably safe. (If it doesn't appear
to work for your continent, try "ww", their world-wide catchall.)

With that set up, you could have it clean in auto mode for 10 minutes
and return to its charger:

```bash
% sucks clean 10
```

You could have it clean for 15 minutes and then do an extra 10 minutes
of edging:

```bash
% sucks clean 15 edge 10
```

If you wanted it to clean for 5 minutes and then stop without charging:

```bash
% sucks clean 5 stop
```

If it's running amok and you'd just like it to stop where it is:

```bash
% sucks stop
```

To tell it to go plug in:

```bash
% sucks charge
```

I run mine from my crontab, but I didn't want it to clean every day,
so it also has a mode where it randomly decides to run or not based on
a frequency you give it. My crontab entry looks like this:

```plaintext
0 10 * * * /home/william/projects/sucks/sucks.sh clean -f 4/7 15 edge -f 1/14 10
```

This means that every day at 10 am, it might do something. 4 days out
of 7, it will do 15 minutes of automatic cleaning. 1 day out of 14,
it will do 10 minutes of edging. And afterward it will always go back to
charge.

## Library use

You are welcome to try using this as a python library for other efforts. The
API is still experimental, so expect changes. Please join the [mailing
list](https://groups.google.com/forum/#!forum/sucks-users) to participate in
shaping the API.

A simple usage might go something like this:

```python
import sucks

config = ...

api = EcoVacsAPI(config['device_id'], config['email'], config['password_hash'],
                         config['country'], config['continent'])
my_vac = api.devices()[0]
vacbot = VacBot(api.uid, api.REALM, api.resource, api.user_access_token, my_vac, config['continent'])
vacbot.connect_and_wait_until_ready()

vacbot.run(Clean())  # start cleaning
time.sleep(900)      # clean for 15 minutes
vacbot.run(Charge()) # return to the charger
```

## Developing

If you'd like to join in on developing, I recommend checking out the code,
setting up a virtual environment, and installing this package in editable
mode. You can confirm your environment works by running the tests. And please
do join the [mailing list](https://groups.google.com/forum/#!forum/sucks-users)
to discuss your plans.

For more information see [the development documentation](developing.md).

## See also

There are now similar libraries in [Javascript](https://github.com/joostth/sucks.js)
and [Go](https://github.com/skburgart/go-vacbot).

## Thanks

My heartfelt thanks to:

* [xmpppeek](https://www.beneaththewaves.net/Software/XMPPPeek.html), a great library for examining XMPP traffic flows (yes, your vacuum speaks Jabbber!),
* [mitmproxy](https://mitmproxy.org/), a fantastic tool for analyzing HTTPS,
* [click](http://click.pocoo.org/), a wonderfully complete and thoughtful library for making Python command-line interfaces,
* [requests](http://docs.python-requests.org/en/master/), a polished Python library for HTTP requests,
* [Decompilers online](http://www.javadecompilers.com/apk), 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](https://community.smartthings.com/t/ecovacs-deebot-n79/93410/33) with his device, and
* All the users who have given useful feedback and contributed code!



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mib1185/py-sucks",
    "name": "py-sucks",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "home automation vacuum robot",
    "author": "William Pietri",
    "author_email": "sucks-users@googlegroups.com",
    "download_url": "https://files.pythonhosted.org/packages/92/4f/46ef908bcb562bb85c99aea0850be285efbc482f99f9bc917404b0354f23/py-sucks-0.9.10.tar.gz",
    "platform": null,
    "description": "[![Tests](https://github.com/mib1185/py-sucks/actions/workflows/tests.yaml/badge.svg)](https://github.com/mib1185/py-sucks/actions/workflows/tests.yaml)\n[![PyPI version](https://badge.fury.io/py/py-sucks.svg)](https://pypi.org/project/py-sucks)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/py-sucks)](https://pypi.org/project/py-sucks)\n\n# py-sucks\n\nThis is the successor of <https://github.com/wpietri/sucks>.\n\n## Overview\n\nA simple command-line python script to drive a robot vacuum. Currently\nknown to work with the Ecovacs Deebot N79, M80 Pro, M81, M88\nPro, and R95 MKII from both North America and Europe.\n\nDoes it work for your model as well? Join the discussion on the\n[sucks-users mailing\nlist](https://groups.google.com/forum/#!forum/sucks-users).\n\nIf you're curious about the protocol, I have [a rough doc](http://github.com/mib1185/py-sucks/blob/master/protocol.md)\nstarted. I'll happily accept pull requests for it.\n\nWhy the project name? Well, a) it's ridiculous that I needed to MITM\nmy own vacuum.  This is not the future I signed up for. And b),\nit's a vacuum.\n\n## Installation\n\nIf you have a recent version of Python 3, you should be able to\ndo `pip install py-sucks` to get the most recently released version of\nthis.\n\n## Usage\n\nTo get started, you'll need to have already set up an EcoVacs account\nusing your smartphone.\n\nWith that ready, step one is to log in:\n\n```bash\n% sucks login\nEcovacs app email: [your email]\nEcovacs app password: [your password]\nyour two-letter country code: us\nyour two-letter continent code: na\nConfig saved.\n```\n\nThat creates a config file in a platform-appropriate place. The password\nis hashed before saving, so it's reasonably safe. (If it doesn't appear\nto work for your continent, try \"ww\", their world-wide catchall.)\n\nWith that set up, you could have it clean in auto mode for 10 minutes\nand return to its charger:\n\n```bash\n% sucks clean 10\n```\n\nYou could have it clean for 15 minutes and then do an extra 10 minutes\nof edging:\n\n```bash\n% sucks clean 15 edge 10\n```\n\nIf you wanted it to clean for 5 minutes and then stop without charging:\n\n```bash\n% sucks clean 5 stop\n```\n\nIf it's running amok and you'd just like it to stop where it is:\n\n```bash\n% sucks stop\n```\n\nTo tell it to go plug in:\n\n```bash\n% sucks charge\n```\n\nI run mine from my crontab, but I didn't want it to clean every day,\nso it also has a mode where it randomly decides to run or not based on\na frequency you give it. My crontab entry looks like this:\n\n```plaintext\n0 10 * * * /home/william/projects/sucks/sucks.sh clean -f 4/7 15 edge -f 1/14 10\n```\n\nThis means that every day at 10 am, it might do something. 4 days out\nof 7, it will do 15 minutes of automatic cleaning. 1 day out of 14,\nit will do 10 minutes of edging. And afterward it will always go back to\ncharge.\n\n## Library use\n\nYou are welcome to try using this as a python library for other efforts. The\nAPI is still experimental, so expect changes. Please join the [mailing\nlist](https://groups.google.com/forum/#!forum/sucks-users) to participate in\nshaping the API.\n\nA simple usage might go something like this:\n\n```python\nimport sucks\n\nconfig = ...\n\napi = EcoVacsAPI(config['device_id'], config['email'], config['password_hash'],\n                         config['country'], config['continent'])\nmy_vac = api.devices()[0]\nvacbot = VacBot(api.uid, api.REALM, api.resource, api.user_access_token, my_vac, config['continent'])\nvacbot.connect_and_wait_until_ready()\n\nvacbot.run(Clean())  # start cleaning\ntime.sleep(900)      # clean for 15 minutes\nvacbot.run(Charge()) # return to the charger\n```\n\n## Developing\n\nIf you'd like to join in on developing, I recommend checking out the code,\nsetting up a virtual environment, and installing this package in editable\nmode. You can confirm your environment works by running the tests. And please\ndo join the [mailing list](https://groups.google.com/forum/#!forum/sucks-users)\nto discuss your plans.\n\nFor more information see [the development documentation](developing.md).\n\n## See also\n\nThere are now similar libraries in [Javascript](https://github.com/joostth/sucks.js)\nand [Go](https://github.com/skburgart/go-vacbot).\n\n## Thanks\n\nMy heartfelt thanks to:\n\n* [xmpppeek](https://www.beneaththewaves.net/Software/XMPPPeek.html), a great library for examining XMPP traffic flows (yes, your vacuum speaks Jabbber!),\n* [mitmproxy](https://mitmproxy.org/), a fantastic tool for analyzing HTTPS,\n* [click](http://click.pocoo.org/), a wonderfully complete and thoughtful library for making Python command-line interfaces,\n* [requests](http://docs.python-requests.org/en/master/), a polished Python library for HTTP requests,\n* [Decompilers online](http://www.javadecompilers.com/apk), which was very helpful in figuring out what the Android app was up to,\n* Albert Louw, who was kind enough to post code from [his own experiments](https://community.smartthings.com/t/ecovacs-deebot-n79/93410/33) with his device, and\n* All the users who have given useful feedback and contributed code!\n\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "a library for controlling certain robot vacuums",
    "version": "0.9.10",
    "project_urls": {
        "Homepage": "https://github.com/mib1185/py-sucks"
    },
    "split_keywords": [
        "home",
        "automation",
        "vacuum",
        "robot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e0e3b6047d527aa0b24a7011bafa36ae249c474778162b07af23c2b2c068344d",
                "md5": "af07bd5e0e792fbe2d6a323e40393da9",
                "sha256": "71546674e8f7d040d126b2a9e0667bd77f8c6216bf4c48ed88e31229b285ddd8"
            },
            "downloads": -1,
            "filename": "py_sucks-0.9.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "af07bd5e0e792fbe2d6a323e40393da9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 25698,
            "upload_time": "2024-05-25T14:42:40",
            "upload_time_iso_8601": "2024-05-25T14:42:40.644636Z",
            "url": "https://files.pythonhosted.org/packages/e0/e3/b6047d527aa0b24a7011bafa36ae249c474778162b07af23c2b2c068344d/py_sucks-0.9.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "924f46ef908bcb562bb85c99aea0850be285efbc482f99f9bc917404b0354f23",
                "md5": "2d5f9d4f9a5da62f9f2c78f54c41cd0d",
                "sha256": "dc56781013b752b24e57fbbccfa9298ddf7b6e3874c6f9874bb5ad81d9ec3532"
            },
            "downloads": -1,
            "filename": "py-sucks-0.9.10.tar.gz",
            "has_sig": false,
            "md5_digest": "2d5f9d4f9a5da62f9f2c78f54c41cd0d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25638,
            "upload_time": "2024-05-25T14:42:42",
            "upload_time_iso_8601": "2024-05-25T14:42:42.318054Z",
            "url": "https://files.pythonhosted.org/packages/92/4f/46ef908bcb562bb85c99aea0850be285efbc482f99f9bc917404b0354f23/py-sucks-0.9.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-25 14:42:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mib1185",
    "github_project": "py-sucks",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "appveyor": true,
    "lcname": "py-sucks"
}
        
Elapsed time: 0.25136s