Package: py-sucks
py-sucksThis is the successor ofhttps://github.com/wpietri/sucks.OverviewA 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 thesucks-users mailing
list.If you're curious about the protocol, I havea rough docstarted. 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.InstallationIf you have a recent version of Python 3, you should be able to
dopip install py-sucksto get the most recently released version of
this.UsageTo 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:%suckslogin
Ecovacsappemail:[youremail]Ecovacsapppassword:[yourpassword]yourtwo-lettercountrycode:us
yourtwo-lettercontinentcode:na
Configsaved.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:%sucksclean10You could have it clean for 15 minutes and then do an extra 10 minutes
of edging:%sucksclean15edge10If you wanted it to clean for 5 minutes and then stop without charging:%sucksclean5stopIf it's running amok and you'd just like it to stop where it is:%sucksstopTo tell it to go plug in:%suckschargeI 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:0 10 * * * /home/william/projects/sucks/sucks.sh clean -f 4/7 15 edge -f 1/14 10This 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 useYou are welcome to try using this as a python library for other efforts. The
API is still experimental, so expect changes. Please join themailing
listto participate in
shaping the API.A simple usage might go something like this:importsucksconfig=...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 cleaningtime.sleep(900)# clean for 15 minutesvacbot.run(Charge())# return to the chargerDevelopingIf 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 themailing listto discuss your plans.For more information seethe development documentation.See alsoThere are now similar libraries inJavascriptandGo.ThanksMy heartfelt thanks to:xmpppeek, a great library for examining XMPP traffic flows (yes, your vacuum speaks Jabbber!),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 fromhis own experimentswith his device, andAll the users who have given useful feedback and contributed code!