Git Product home page Git Product logo

sucks's People

Contributors

eracknaphobia avatar joe248 avatar overloadut avatar torbjornaxelsson avatar wpietri avatar zenconomy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sucks's Issues

Feature idea: status command/monitoring

Being able to request the current status of the bot, or being able to listen for status updates from the bot (not sure how these commands are implemented in the api)

For example, I have an issue with the robot getting stuck, giving up and going into suspended mode, when all it would need to is back up or rotate a little bit to get unstuck. If I could detect it going into suspended mode while not in the charger (or even better, be alerted when it gets stuck), I could tell issue a back/rotate command to get it going again. Or just send me an alarm to let me know that the little fella got stuck.

PyAsn error and Ozmo 930 support

Hi,
Thank you so much for your ecovacs script.
Unfortunately I have a problem with the connection setup. can you please take a look at it?

thank you

DEBUG Event triggered: ssl_cert
ERROR Connection error.
ERROR <TagSet object at 0x7fd848a31d30 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x7fd8481cc898 encoding iso-8859-1 tagSet <TagSet object at 0x7fd84b9849b0 tags 0:0:4>>
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 1492, in _process
if not self.__read_xml():
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 1564, in __read_xml
self.__spawn_event(xml)
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 1632, in __spawn_event
handler.prerun(stanza_copy)
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/handler/callback.py", line 64, in prerun
self.run(payload, True)
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
self._pointer(payload)
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/features/feature_starttls/starttls.py", line 64, in _handle_starttls_proceed
if self.xmpp.start_tls():
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 889, in start_tls
cert.verify(self._expected_server_name, self._der_cert)
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/cert.py", line 134, in verify
cert_names = extract_names(raw_cert)
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/cert.py", line 73, in extract_names
asn1Spec=OctetString())[0]
File "/usr/local/lib/python3.5/dist-packages/pyasn1/codec/ber/decoder.py", line 1318, in call
'%s not in asn1Spec: %r' % (tagSet, asn1Spec)
pyasn1.error.PyAsn1Error: <TagSet object at 0x7fd848a31d30 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x7fd8481cc898 encoding iso-8859-1 tagSet <TagSet object at 0x7fd84b9849b0 tags 0:0:4>>
DEBUG reconnecting...
DEBUG Event triggered: session_end
DEBUG SEND (IMMED): </stream:stream>
INFO Waiting for </stream:stream> from server
DEBUG Event triggered: disconnected
DEBUG ==== TRANSITION connected -> disconnected
DEBUG connecting...
DEBUG Waiting 2.1977662435578362 seconds before connecting.
DEBUG No remaining DNS records to try.
DEBUG Waiting 3.661543940220445 seconds before connecting.

Installation Error

Greetings,

I'm trying to install on a raspberry pi zero w, but i get the following error

pi@raspberrypi:~ $ pip3 install sucks
Collecting sucks
  Downloading https://files.pythonhosted.org/packages/46/5b/a55b4f2e0b33f71f577cd9d442b6554b2f9ac10d08d593fe59826083a0c5/sucks-0.8.4-py3-none-any.whl
Collecting pycountry-convert>=0.5 (from sucks)
  Downloading https://files.pythonhosted.org/packages/9b/e7/26c14899a43c34e04a58e3772007afe79dbd64fac15d2fbaeedff24082f2/pycountry_convert-0.7.2-py3-none-any.whl
Collecting click>=6 (from sucks)
  Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
    100% |████████████████████████████████| 71kB 421kB/s 
Collecting stringcase>=1.2 (from sucks)
  Downloading https://www.piwheels.org/simple/stringcase/stringcase-1.2.0-py3-none-any.whl
Collecting pycryptodome>=3.4 (from sucks)
  Downloading https://files.pythonhosted.org/packages/00/cc/c623e25aa38e947a449a9b67c3a1c65f2db56aeb43b541cb197dc659f78d/pycryptodome-3.6.3.tar.gz (7.1MB)
    100% |████████████████████████████████| 7.1MB 11kB/s 
Collecting sleekxmpp>=1.3 (from sucks)
  Downloading https://www.piwheels.org/simple/sleekxmpp/sleekxmpp-1.3.3-py3-none-any.whl (434kB)
    100% |████████████████████████████████| 440kB 177kB/s 
Collecting requests>=2.18 (from sucks)
Exception:
Traceback (most recent call last):
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 391, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
    response.begin()
  File "/usr/lib/python3.5/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
    "Cache-Control": "max-age=600",
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
    total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'

Supporting other Ecovacs robots and non-US locations

Hey! Thanks for taking your time to put this project together.

I just downloaded and tried it out. I'm in Canada so had to change country to ca, then I was able to login. Once logged in, if I try to run any command, it stops with the response below.

I have the Deebot M81 pro which I suppose could be the cause.

DEBUG    SEND: <iq id="6a6842cd-e361-4f9c-8716-7331c3258003-3" to="[email protected]/atom" from="[email protected]/49116f9d9e23a3f1618d51bdd194fed8" type="set"><query xmlns="com:ctl"><ctl td="Charge"><charge type="go" /></ctl></query></iq>

DEBUG    RECV: <iq type="error" to="[email protected]/49116f9d9e23a3f1618d51bdd194fed8" from="[email protected]/atom" id="6a6842cd-e361-4f9c-8716-7331c3258003-3"><error type="wait" code="404"><recipient-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>

I'm attaching the complete debug output as well. Any ideas? Thanks :)

sucks-debug.txt

Not Working with cmdswitch2

Hi everybody,
thanks to @bmartin5692 for your great fork so i could controll my D601.
I would like to control it via Homebridge f.e. with cmdswitch2 but the commands don‘t work with it. If i Type the commands via shell it works very fine. Hope spmebody could help

Charge command fails if it's already charging

If its cleaning, sucks charge works ok:

sucks.cli DEBUG waiting on charge_status for value charging sucks DEBUG *** charge_status = returning sucks DEBUG *** charge_status = returning sucks DEBUG *** clean_status = stop fan_speed = None sucks DEBUG *** sending ping *** sucks DEBUG *** charge_status = charging sucks.cli DEBUG wait complete; charge_status is now charging done

But if its charging,

sucks.cli DEBUG waiting on charge_status for value charging sucks DEBUG *** charge_status = returning sucks DEBUG *** sending ping *** sucks DEBUG *** sending ping *** sucks DEBUG *** sending ping ***

it keeps as this forever.

In my particular use case I will try to use the library, but perhaps you would like to correct that for cli users.

Thanks again.

Run until battery low?

I could probably just try it out and see what happens, but if I want the vac to just run as long as it can and then return to the base like it normally would in "Auto" mode, can I just set a large number for the clean time and it'll just do its thing and come back without affecting the script?

Say I do, sucks clean 240. Will it clean then return to the base on its own when the battery dies? Will this have any kind of negative impact? Will the script end on its own?

Alexa Skill

hi,

This looks great! Can you package it as an Alexa so that we can control the N79 through Alexa?

Jordan.

D900 support

My D900 is with the patched sucks version not working.
At first, there was the "GetDeviceList"-Failure, but I changed the code and now,the following issue appears:

sleekxmpp.exceptions.IqError:`

The used ID's from above don't match the ID's which are used in my APP but the login was correctly registered.

Checking it with the APP, it works well.

Any Idea

Deebot Slim 2 Support?

Is it possible to get support for Deebot Slim 2? Currently I don't get through the login process...

charge command works, but not clean

Hi,
My bot: DEEBOT OZMO 610
I looked in every issue (open and closed) but couldn't find anything like this.
I setup sucks yesterday on my RPi using the official server (not bumper) and was able to send the bot charging (for testing purpose I didn't try cleaning). After, I wanted to try the suggestion in #64, than I realized that vacbot.run(Charge()) is working, but vacbot.run(Clean()) and sucks clean 10 are not.

Sometime I get an timeout error (on the charge-command, too)

$ sucks clean 1
sleekxmpp.basexmpp WARNING  fulljid property deprecated. Use boundjid.resource
sleekxmpp.xmlstream.cert WARNING  Could not find pyasn1 and pyasn1_modules. SSL certificate COULD NOT BE VERIFIED.
sleekxmpp.xmlstream.cert WARNING  Could not find pyasn1 and pyasn1_modules. SSL certificate expiration COULD NOT BE VERIFIED.
performing clean command
sleekxmpp.xmlstream.handler.waiter WARNING  Timed out waiting for IqWait_**
Traceback (most recent call last):
  File "/home/kirika/venv/sucks/bin/sucks", line 10, in <module>
    sys.exit(cli())
  File "/home/kirika/venv/sucks/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/kirika/venv/sucks/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/kirika/venv/sucks/lib/python3.7/site-packages/click/core.py", line 1164, in invoke
    return _process_result(rv)
  File "/home/kirika/venv/sucks/lib/python3.7/site-packages/click/core.py", line 1102, in _process_result
    **ctx.params)
  File "/home/kirika/venv/sucks/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/kirika/venv/sucks/lib/python3.7/site-packages/sucks/cli.py", line 219, in run
    vacbot.run(action.vac_command)
  File "/home/kirika/venv/sucks/lib/python3.7/site-packages/sucks/__init__.py", line 416, in run
    self.send_command(action.to_xml())
  File "/home/kirika/venv/sucks/lib/python3.7/site-packages/sucks/__init__.py", line 413, in send_command
    self.xmpp.send_command(xml, self._vacuum_address())
  File "/home/kirika/venv/sucks/lib/python3.7/site-packages/sucks/__init__.py", line 482, in send_command
    c.send()
  File "/home/kirika/venv/sucks/lib/python3.7/site-packages/sleekxmpp/stanza/iq.py", line 233, in send
    raise IqTimeout(self)
sleekxmpp.exceptions.IqTimeout: <iq id="**" to="**@130.ecorobot.net/atom" from="[email protected]/**" type="set"><query xmlns="com:ctl"><ctl td="Clean"><clean type="auto" speed="standard" /></ctl></query></iq>

If the error doesn't appear on the clean-command, it just goes on, but the bot didn't receive it and just stays still doing nothing.

$ sucks --debug clean 1
sucks.cli  DEBUG    will run [<sucks.cli.CliAction object at 0x75daf730>, <sucks.cli.CliAction object at 0x75dafab0>]
sucks      DEBUG    Setting up EcoVacsAPI
# removed these debug-lines
sleekxmpp.basexmpp WARNING  fulljid property deprecated. Use boundjid.resource
sleekxmpp.xmlstream.cert WARNING  Could not find pyasn1 and pyasn1_modules. SSL certificate COULD NOT BE VERIFIED.
sleekxmpp.xmlstream.cert WARNING  Could not find pyasn1 and pyasn1_modules. SSL certificate expiration COULD NOT BE VERIFIED.
sucks      DEBUG    ----------------- starting session ----------------
sucks      DEBUG    event = {}
performing clean command
sucks      DEBUG    Sending command <iq id="**" to="**@130.ecorobot.net/atom" from="[email protected]/**" type="set"><query xmlns="com:ctl"><ctl td="Clean"><clean type="auto" speed="standard" /></ctl></query></iq>
waiting for 60.0s
sucks      DEBUG    *** sending ping ***
sucks      DEBUG    *** battery_status = 100%sucks      DEBUG    *** battery_status = 100%
sucks      DEBUG    *** sending ping ***
performing charge command
sucks      DEBUG    Sending command <iq id="**" to="[email protected]/atom" from="[email protected]/**" type="set"><query xmlns="com:ctl"><ctl td="Charge"><charge type="go" /></ctl></query></iq>
sucks.cli  DEBUG    waiting on charge_status for value charging
sucks      DEBUG    *** charge_status = returning
sucks      DEBUG    *** clean_status = auto fan_speed = high
sucks      DEBUG    *** charge_status = charging
sucks.cli  DEBUG    wait complete; charge_status is now charging
done

Alexa skill for Deebot N79

Hi,

Can someone help to provide instructions to use this code with Alexa, as an Alexa custom skill, including instructions with speech utterances and Lambda function?

Thanks,
Jordan.

Error creating config file during login

Hi,

I have background in engineering but I'm a bit new to python. I'm running on Mac OS High Sierra, using Python3.

After running sucks login and entering the info, I receive the following error:

Traceback (most recent call last):
File "/usr/local/bin/sucks", line 11, in
sys.exit(cli())
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1092, in invoke
rv.append(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/sucks/cli.py", line 113, in login
write_config(config)
File "/usr/local/lib/python3.6/site-packages/sucks/cli.py", line 57, in write_config
with open(config_file(), 'w') as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/user-name/.config/sucks.conf'

My understanding, according to the readme file, is the file should be .config.sucks.conf however it is trying to write to .config/sucks.conf. I believe the error is at this line. Maybe a special case for MacOS must be added?

Happy to help if I can.

AttributeError: 'module' object has no attribute 'lru_cache'

I was trying out the library for the first time and run into a few issues, in the end I figured it out but I thought it might be helpful to other and maybe good to add to the README.md.

After successfully running sudo pip install -e .
sucks login gives me:

Traceback (most recent call last):
File "/usr/local/bin/sucks", line 11, in
load_entry_point('sucks', 'console_scripts', 'sucks')()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 572, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 2752, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 2405, in load
return self.resolve()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py", line 2411, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/opt/ecovacs/sucks/cli.py", line 7, in
from pycountry_convert import country_alpha2_to_continent_code
File "/usr/local/lib/python2.7/dist-packages/pycountry_convert/init.py", line 17, in
from .country_mappings import (
File "/usr/local/lib/python2.7/dist-packages/pycountry_convert/country_mappings.py", line 15, in
@functools.lru_cache()
AttributeError: 'module' object has no attribute 'lru_cache'

It looked like an issue with the pycountry_convert library but it wasn't.

I am kind of a newbie in python and I remember seeing that this was a python3 project.
python -V

Python 2.7.9

So I changed /usr/local/bin/sucks so that it uses python3:
#!/usr/bin/python3

Re ran the install commands:
sudo pip3 install pipenv sudo pip3 install -e .

And... tada!

Not sure if I did the right thing here, let me know if not.

Oh and note that my first sucks charge call timed out for some reason ("sleekxmpp.exceptions.IqTimeout...") retried and all further calls worked fine.

Get Current Status of device

I have it working on my machines and with my DR98. Perfect. Now my domotica system triggers the robot to start cleaning, once no-one is at home anymore. And it will stop and go back to charge, once someone returns home.

However... It would be nice to check the current state of the device. "sucks status" or something.
This would make it even more smart.

Also I assume "sucks clean 60" always starts a new cleaning job once I initiated "sucks charge" before that? In other words, it doesn't continue where it left the last job?

Anyways, already very happy with this

Feature idea: Move/Rotate deebot for a certain amount of time.

I'm not sure if this might be out of the scope of this project, but it'd be pretty useful to be able to move/rotate the bot itself for a certain amount of time.

What's interesting right now is that if you send the command "TurnLeft" or "TurnRight" the bot will just rotate in a complete 360 degree fashion. I'm assuming that the app itself only sends a subsequent stop command right as you let go of the button itself. (I haven't taken the time to intercept the connections from the app myself yet unfortunately.)

While this might not be of much use for this project's original goals, it might be useful as a foundation for other people to work from and create some nifty and elaborate projects. Maybe even some more advanced pathfinding/ai logic when it's commanded to go to home base.

Personally, this was actually my entire goal from the start. I was intending to investigate the small "upgrade" port on the bot and see how far I could get with it physically... until I found this workflow which is a lot easier to deal with. (this probably also saved me from accidentally bricking my deebot or damaging it's internals too.)

Anyway, I can work on some python for this idea throughout the week and post it here when I get a chance.

Installation doesn't work as expected

When using Terminal (running on MacOs 10.13.6), I try to use:
pip install sucks

Error I get is:
Could not find a version that satisfies the requirement sucks (from versions: )
No matching distribution found for sucks

I do have Python3 installed correctly, but it seems it cannot find sucks

Unable to start sucks or setup login

Followed setup guide on the Git page, but it just gives me errors. pip installed sucks just fine, but trying to setup login or issuing commands fails. Tried several ways to use this and nothing works. How do you actually use this?

Operating System: Debian GNU/Linux 9 (stretch)
Kernel: Linux 4.18.0-0.bpo.3-amd64
Architecture: x86-64

root@omvnas:~# % sucks login
bash: fg: %: no such job
root@omvnas:~# sucks login

  File "/usr/local/bin/sucks", line 7, in <module>
    from sucks.cli import cli
  File "/usr/local/lib/python2.7/dist-packages/sucks/__init__.py", line 360
    def is_charging(self) -> bool:
                          ^
SyntaxError: invalid syntax

root@omvnas:~# % sucks clean 10
bash: fg: %: no such job

Ran from the bin folder where it's located even
root@omvnas:/bin# sucks login

Traceback (most recent call last):
  File "/usr/local/bin/sucks", line 7, in <module>
    from sucks.cli import cli
  File "/usr/local/lib/python2.7/dist-packages/sucks/__init__.py", line 360
    def is_charging(self) -> bool:
                          ^
SyntaxError: invalid syntax

Tried running via python and still nothing

>>> sucks login

File "<stdin>", line 1
    sucks login
              ^
SyntaxError: invalid syntax

Getting no status on bmartin5692's fork

I try to get the status of the bot since 2 days, but all I get is None.
I'm creating the issue here, since @bmartin5692 doesn't allow issues on his repo?

This error seems to be like #57, but I didn't even see the response, just the commands I sent.

If I do sucks charge, it waits, till the bot finds the dock and charges.
On running Clean(), vacbot.disconnect(wait=True) didn't wait till it finishes cleaning (no idea if this is intended and only waits for starting to clean).
So I assume cli.py can get the status, since it can wait till the bot starts to charge?

import os
import configparser
import itertools
import logging
from sucks import *

config_file = os.path.expanduser('~/.config/sucks.conf')

parser = configparser.ConfigParser()
with open(config_file) as fp:
    parser.read_file(itertools.chain(['[global]'], fp), source=config_file)
    config = parser['global']

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'], monitor=True)
vacbot.connect_and_wait_until_ready()

logger = logging.getLogger('sucks')
logger.setLevel('DEBUG')
#vacbot.run(VacBotCommand("SetWaterPermeability", {"v": "3"}))
vacbot.request_all_statuses()
#vacbot.send_ping()

# Everything bellow returns None
print(getattr(vacbot, 'vacuum_status'))
vacbot.run(GetCleanState())
vacbot.run(GetChargeState())
vacbot.run(GetBatteryState())
# I've tried these a while back, I assume these are wrong anyways
#print(vacbot.run(VacBotCommand("GetError")))
#print(vacbot.run(VacBotCommand("GetChargeState")))
#print(vacbot.run(VacBotCommand("GetBatteryInfo")))
#print(vacbot.run(VacBotCommand("GetVersion", {"name": "FW"})))
#print(vacbot.run(VacBotCommand("GetLog")))

#vacbot.run(Clean())  # start cleaning
vacbot.disconnect(wait=True)

OZMO 630 Series

I have an OZMO 630 Series vac that I cannot start via sucks. Everything else seems to work fine and sucks is able to see when the device is running already (eg a times or manual switch on/off) but it can't switch the device on. I can send it back to the charger, the charge state shows, I can get it to do the location beeps, and even change fan speed. Howevr, I cannot get it to start the vac running.

How to login from Australia

Hi All,

Currently trying to get sucks to work with my 930

I can login via the US settings on such login however when it hen try sucks clean 10 its just errors on and on eabout device unavailable...

Can someone please provide a step by step on how you got your Ozmo 930 working? as I can't make heads or tails of whats heppening..

Certificate expired error when trying to clean

Version of sucks built directly from master branch:

~/work/sucks  $ pip show sucks                                                                                                                                
Name: sucks                                                                                                                                                   
Version: 0.9.3                                                                                                                                                
Summary: a library for controlling certain robot vacuums                                                                                                      
Home-page: https://github.com/wpietri/sucks                                                                                                                   
Author: William Pietri                                                                                                                                        
Author-email: [email protected]                                                                                                                    
License: GPL-3.0
Location: /home/user/.local/lib/python3.6/site-packages

Config:

~/work/sucks  $ cat ~/.config/sucks.conf                                                                                                                     
email=***
password_hash=***
device_id=***
country=de
continent=eu

Error messages?

~/work/sucks  $ sucks clean 1                                                                                                                                
sleekxmpp.basexmpp WARNING  fulljid property deprecated. Use boundjid.resource
sleekxmpp.xmlstream.xmlstream ERROR    Certificate has expired.
sleekxmpp.xmlstream.xmlstream WARNING  Failed to send b"<stream:stream to='ecouser.net' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'
xml:lang='en' version='1.0'>"
sleekxmpp.xmlstream.xmlstream ERROR    Socket Error #9: Bad file descriptor
sleekxmpp.xmlstream.xmlstream ERROR    Certificate has expired.
sleekxmpp.xmlstream.xmlstream WARNING  Failed to send b"<stream:stream to='ecouser.net' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'
xml:lang='en' version='1.0'>"
sleekxmpp.xmlstream.xmlstream ERROR    Socket Error #9: Bad file descriptor
sleekxmpp.xmlstream.xmlstream ERROR    Certificate has expired.
sleekxmpp.xmlstream.xmlstream WARNING  Failed to send b"<stream:stream to='ecouser.net' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'
xml:lang='en' version='1.0'>"
sleekxmpp.xmlstream.xmlstream ERROR    Socket Error #9: Bad file descriptor
^C
Aborted!
^CException ignored in: <module 'threading' from '/usr/lib64/python3.6/threading.py'>                                                                        
Traceback (most recent call last):
  File "/usr/lib64/python3.6/threading.py", line 1294, in _shutdown
    t.join()
  File "/usr/lib64/python3.6/threading.py", line 1056, in join
    self._wait_for_tstate_lock()
  File "/usr/lib64/python3.6/threading.py", line 1072, in _wait_for_tstate_lock                                                                              
    elif lock.acquire(block, timeout):
KeyboardInterrupt

Is this a known problem? Is it restricted to just the European or German endpoint? Is there a workaround?

Errors when run via homebridge

When I run sucks from the terminal it works, but when I run it via the CmdSwitch2 plugin in Homebridge it sometimes fails with the following error:

[5/3/2018, 6:37:21 PM] [CMD Switch] Vacuum is off.
[5/3/2018, 6:37:22 PM] [CMD Switch] Failed to turn on Vacuum
[5/3/2018, 6:37:22 PM] [CMD Switch] Traceback (most recent call last):
  File "/usr/local/bin/sucks", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 676, in main
    _verify_python3_env()
  File "/usr/local/lib/python3.6/site-packages/click/_unicodefun.py", line 118, in _verify_python3_env
    'for mitigation steps.' + extra)
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment.  Consult http://click.pocoo.org/python3/for mitigation steps.

This system lists a couple of UTF-8 supporting locales that
you can pick from.  The following suitable locales where
discovered: af_ZA.UTF-8, am_ET.UTF-8, be_BY.UTF-8, bg_BG.UTF-8, ca_ES.UTF-8, cs_CZ.UTF-8, da_DK.UTF-8, de_AT.UTF-8, de_CH.UTF-8, de_DE.UTF-8, el_GR.UTF-8, en_AU.UTF-8, en_CA.UTF-8, en_GB.UTF-8, en_IE.UTF-8, en_NZ.UTF-8, en_US.UTF-8, es_ES.UTF-8, et_EE.UTF-8, eu_ES.UTF-8, fi_FI.UTF-8, fr_BE.UTF-8, fr_CA.UTF-8, fr_CH.UTF-8, fr_FR.UTF-8, he_IL.UTF-8, hr_HR.UTF-8, hu_HU.UTF-8, hy_AM.UTF-8, is_IS.UTF-8, it_CH.UTF-8, it_IT.UTF-8, ja_JP.UTF-8, kk_KZ.UTF-8, ko_KR.UTF-8, lt_LT.UTF-8, nl_BE.UTF-8, nl_NL.UTF-8, no_NO.UTF-8, pl_PL.UTF-8, pt_BR.UTF-8, pt_PT.UTF-8, ro_RO.UTF-8, ru_RU.UTF-8, sk_SK.UTF-8, sl_SI.UTF-8, sr_YU.UTF-8, sv_SE.UTF-8, tr_TR.UTF-8, uk_UA.UTF-8, zh_CN.UTF-8, zh_HK.UTF-8, zh_TW.UTF-8

Any idea what might be happening here?

Here is the relevant section of my homebridge config.json:

{
	"platform": "cmdSwitch2",
	"name": "CMD Switch",
	"switches": [{
     	"name" : "Vacuum",
     	"on_cmd": "sucks clean 120",
     	"off_cmd": "sucks charge",
     	"state_cmd": "python3 ~/.homebridge/vacstate.py",
     	"polling": true,
     	"interval": 120,
     	"timeout": 20
                 }]
},

When I flip the switch in the Home app or ask Siri to turn on the vacuum, it's attempting to run sucks clean 120 but getting the above error.

Feature idea: RESTful API

It would be really neat to have a simple REST server on top of sucks to simplify integration with other apps and services.

I'd be happy to help with implementation but I'm more familiar with node than python so probably better if I stick to testing for now :)

Status request

This is more a feature request than an issue. I would like to have some kind of status reporting.

My use case would be controlling the vac from openhab or cron. In order to do that I would like to know first if the machine is fully charged (or else raise an alarm), then make it clean and then make sure that it's back to its base.

I'm experimenting with direct talking via HTTP/XMPP but is really a mess. Would love to have it packed into sucks.

Thanks a lot!

sucks error handling

My N79s is malfunctioning according to app. Sucks previously worked correctly so I gave it a try. Looks like sucks doesn't handle errors? Using sucks 0.9.3

$ sucks clean 10
sleekxmpp.basexmpp WARNING  fulljid property deprecated. Use boundjid.resource
sleekxmpp.xmlstream.cert WARNING  Could not find pyasn1 and pyasn1_modules. SSL certificate COULD NOT BE VERIFIED.
sleekxmpp.xmlstream.cert WARNING  Could not find pyasn1 and pyasn1_modules. SSL certificate expiration COULD NOT BE VERIFIED.
performing clean command
waiting for 600.0s
sleekxmpp.xmlstream.xmlstream ERROR    Error processing stream handler: general
Traceback (most recent call last):
  File "/home/furlongm/src/sucks/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1686, in _event_runner
    handler.run(args[0])
  File "/home/furlongm/src/sucks/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
    self._pointer(payload)
  File "/home/furlongm/src/sucks/lib/python3.6/site-packages/sucks/__init__.py", line 458, in _handle_ctl
    s(as_dict)
  File "/home/furlongm/src/sucks/lib/python3.6/site-packages/sucks/__init__.py", line 289, in _handle_ctl
    getattr(self, method)(ctl)
  File "/home/furlongm/src/sucks/lib/python3.6/site-packages/sucks/__init__.py", line 292, in _handle_error
    error = event['error']
KeyError: 'error'
sleekxmpp.stanza.rootstanza ERROR    Error handling {jabber:client}iq stanza
Traceback (most recent call last):
  File "/home/furlongm/src/sucks/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1686, in _event_runner
    handler.run(args[0])
  File "/home/furlongm/src/sucks/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
    self._pointer(payload)
  File "/home/furlongm/src/sucks/lib/python3.6/site-packages/sucks/__init__.py", line 458, in _handle_ctl
    s(as_dict)
  File "/home/furlongm/src/sucks/lib/python3.6/site-packages/sucks/__init__.py", line 289, in _handle_ctl
    getattr(self, method)(ctl)
  File "/home/furlongm/src/sucks/lib/python3.6/site-packages/sucks/__init__.py", line 292, in _handle_error
    error = event['error']
KeyError: 'error'

Help integrating with homebridge?

I'm trying to use this to integrate a Deebot N79 with HomeKit via homebridge, and I've encountered a bit of a problem. Apologies if this is obvious, but I'm not a programmer, just a tinkerer.

With homebridge I can use plugins like cmdswitch2 to run command line commands as switches via HomeKit. cmdSwitch2 lets me define an "on command" to run when the switch is turned on, an "off command" to run when the switch is turned off, and a "state command" that can be run periodically to check the state of the device and tell if it's currently on or off. Usually this is used for something like a wakeonlan command (on), a sleep command (off), and something like a ping to tell if the target device is on (status).

I'd like to set a long or open ended "clean" command as an "on command" but be able to interrupt it with a "charge" or "stop" command at any time, rather than having the script run for the entire cleaning cycle. It would also be nice if there were a command that would output the current state of the vacuum. Is something like that possible?

Not able to clean

After I have logged in with "sucks login" and then start the cleaning program (eg. clean 1) error messages appear.

ERROR    call to GetDeviceList failed with {'todo': 'result', 'result': 'fail', 'errno': 1004, 'error': 'auth error'}
Traceback (most recent call last):
  File "/usr/local/bin/sucks", line 11, in <module>
    load_entry_point('sucks==0.8.4', 'console_scripts', 'sucks')()
  File "/home/nick/.local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/nick/.local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/nick/.local/lib/python3.6/site-packages/click/core.py", line 1093, in invoke
    return _process_result(rv)
  File "/home/nick/.local/lib/python3.6/site-packages/click/core.py", line 1031, in _process_result
    **ctx.params)
  File "/home/nick/.local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/nick/.local/lib/python3.6/site-packages/sucks/cli.py", line 211, in run
    vacuum = api.devices()[0]
  File "/home/nick/.local/lib/python3.6/site-packages/sucks/__init__.py", line 112, in devices
    'resource': self.resource
  File "/home/nick/.local/lib/python3.6/site-packages/sucks/__init__.py", line 93, in __call_user_api
    "failure {} ({}) for call {} and parameters {}".format(json['error'], json['errno'], function, params))
RuntimeError: failure auth error (1004) for call GetDeviceList and parameters {'todo': 'GetDeviceList', 'userid': '20180511213956_c...............', 'auth': {'with': 'users', 'userid': '20180511213956_c......', 'realm': 'ecouser.net', 'token': 'fQVh----', 'resource': 'b0d3524a'}}

I read that some problems are existing with the "GetDeviceList" but how else should I start cleaning??

sleekxmpp.basexmpp ERROR day is out of range for month

  • Login works
  • Server used: eu
  • any further command throws the following error
sleekxmpp.basexmpp WARNING  fulljid property deprecated. Use boundjid.resource                                          
sleekxmpp.basexmpp ERROR    day is out of range for month
Traceback (most recent call last):                                                                                    
  File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1492, in _process
    if not self.__read_xml():                                                                                      
  File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1564, in __read_xml
    self.__spawn_event(xml)                                                                                                                     
  File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1632, in __spawn_event
    handler.prerun(stanza_copy)                                                                                    
  File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 64, in prerun
    self.run(payload, True)                                                                                
  File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
    self._pointer(payload)                                                                                        
  File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/features/feature_starttls/starttls.py", line 64, in _handle_starttls_proceed
    if self.xmpp.start_tls():                                            
  File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 889, in start_tls     
    cert.verify(self._expected_server_name, self._der_cert)     
  File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 133, in verify           
    not_before, not_after = extract_dates(raw_cert)
  File "/home/bernhard/.local/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 111, in extract_dates 
    not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ')
  File "/usr/lib/python3.6/_strptime.py", line 565, in _strptime_datetime                                                                       
    tt, fraction = _strptime(data_string, format)
  File "/usr/lib/python3.6/_strptime.py", line 528, in _strptime                                                   
    datetime_date(year, 1, 1).toordinal() + 1              
ValueError: day is out of range for month

Syntax error on login command

Hello,

I installed sucks on my RPI today (v0.9.3) with Python 3.4.2 but I get the following error when I run the "sucks login" command:

Traceback (most recent call last):
File "/usr/local/bin/sucks", line 7, in <module>
from sucks.cli import cli
File "/usr/local/lib/python2.7/dist-packages/sucks/__init__.py", line 360
def is_charging(self) -> bool:
^
SyntaxError: invalid syntax

If you can help me, I would really like to drive my ecovacs. And sorry, but I'm a python beginner...

Thanks !

License needed, and any chance for a PyPi library?

Hey there!

I am planning on adding support for Deebot to Home Assistant. Your code here will get me most of the way!

However, you currently don't have a LICENSE file in the project that I could find. Could you add a license so I know if I could use this?

Second, do you plan on turning this in to a library and publishing to PyPi? I will do it if you aren't planning on it, which brings up the subquestion: would you want that as PRs to this repo, or should a library version be an entirely different project that's just based on the code discoveries here?

Installation issue

Hello,

I've successfully installed sucks on Raspbian with Python 3.5.3. When I try to invoke login ("sucks login"), I get "-bash: sucks: command not found".

I've confirmed that it is installed for Python3 using "pip3 freeze".

I am new to Python, so I may be doing something entirely wrong. Any ideas?

Thanks,

Kyle

Consider a way that multiple vacbots can be controlled

Hi @wpietri. Thanks for an awesome API.

I recently bought a 2nd vacbot (black friday!) and I noticed I can only control one unit at a time using the CLI. It looks like the following line is hardcoded to always choose the first device from GetDevices:

vacuum = api.devices()[0]

I'm wondering whether you'd consider allowing for some arguments to select a vacuum. Some thoughts:

  • I treat them as a swarm, so personally I'm ok with issuing any command to every device in the list. I imagine this is easiest to implement (e.g. with a for loop).
  • Others might like to be able to select a device from the list, but I'm not sure how the EcoVacs reports devices. Is device[0] always the same? Is there a way to get the friendly name I assign in the iOS app (e.g. "Living Room")? How would the user specify the robot? By number? By friendly name? By selecting from a menu?

Thanks for your consideration.

Does nothing, also no errors thrown

So, after having all the errors that others have descibed in the issues, I managed to get this error free by using pyasn1=0.1.9 and pyasn1-modules=0.1.5, also sleekxmpp=1.3.1.

I have changed the file __init__.py to use the shorter userid that you can see when you use command sudo sucks --debug clean 10. The shorter userid gets returned from the servers. If you hardcode that in to the init file, I get to see my device and device name.

After that it stops. (it does give a warning about fulljid being deprecated, but that is it).

How do I proceed from here?

Other regions (ar - sa)

Hi, this is probably an ecovac issue, but if I use ar (argentina), and sa (South America), it doesn't work because users-sa.ecouser.net doesn't exists.

It works great using us-na.

Thanks for the great work.

Script never exits

I'm running sucks on a Raspberry Pi and want to trigger it with an iOS 12 Shortcut over SSH. The robot (M88) drives off and does what it's supposed to do, however the script never exits, which confuses the Shortcut. I don't know if that's expected behaviour or the result of all the error messages that sucks throws at me, which I don't know how to get rid of:

Example: Result of sucks charge:

sleekxmpp.basexmpp WARNING  fulljid property deprecated. Use boundjid.resource
sleekxmpp.xmlstream.cert WARNING  Could not find pyasn1 and pyasn1_modules. SSL certificate COULD NOT BE VERIFIED.
sleekxmpp.xmlstream.cert WARNING  Could not find pyasn1 and pyasn1_modules. SSL certificate expiration COULD NOT BE VERIFIED.
performing charge command
sleekxmpp.basexmpp WARNING  resource property deprecated. Use boundjid.resource
sleekxmpp.basexmpp WARNING  resource property deprecated. Use boundjid.resource
sleekxmpp.xmlstream.handler.waiter WARNING  Timed out waiting for IqWait_1ff1a9bd-bd01-4983-87a6-4cd56a7dd1f4-3
Traceback (most recent call last):
  File "/usr/local/bin/sucks", line 11, in <module>
    sys.exit(cli())
  File "/home/pi/.local/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/.local/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/pi/.local/lib/python3.5/site-packages/click/core.py", line 1093, in invoke
    return _process_result(rv)
  File "/home/pi/.local/lib/python3.5/site-packages/click/core.py", line 1031, in _process_result
    **ctx.params)
  File "/home/pi/.local/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/.local/lib/python3.5/site-packages/sucks/cli.py", line 219, in run
    vacbot.run(action.vac_command)
  File "/home/pi/.local/lib/python3.5/site-packages/sucks/__init__.py", line 412, in run
    self.send_command(action.to_xml())
  File "/home/pi/.local/lib/python3.5/site-packages/sucks/__init__.py", line 409, in send_command
    self.xmpp.send_command(xml, self._vacuum_address())
  File "/home/pi/.local/lib/python3.5/site-packages/sucks/__init__.py", line 478, in send_command
    c.send()
  File "/home/pi/.local/lib/python3.5/site-packages/sleekxmpp/stanza/iq.py", line 233, in send
    raise IqTimeout(self)
sleekxmpp.exceptions.IqTimeout: <iq id="[ID removed]" from="[ID removed] @ecouser.net/[ID removed]" to="[ID removed]@107.ecorobot.net/atom" type="set"><query xmlns="com:ctl"><ctl td="Charge"><charge type="go" /></ctl></query></iq>
sleekxmpp.basexmpp WARNING  resource property deprecated. Use boundjid.resource
sleekxmpp.basexmpp WARNING  resource property deprecated. Use boundjid.resource
sleekxmpp.basexmpp WARNING  resource property deprecated. Use boundjid.resource
[…and so on…]

The sucks stop command is the only one that exits. Sometimes. I'm running 0.9.2.

Backwards

Hi,

I was about to program a manual way through different rooms in the flat and realized one Action is missing in "init.py", I've added:

'backward' : 'backward',

in class VacBotCommand. Otherwise it is not possible to get the Bot from the charging station.
Would be nice if you could add it :)

Errors Ozmo 930

Hi, I've integrated my ozmo 930 in hassio with this modiffied solution:

https://community.home-assistant.io/t/fixed-ecovacs-deebot-2019-ozmo-series-working-library/126319/38

I have some errors and I don't know if its a library problem with this model.

  • turn_off: it send 930 to base, show returning status, then charging status but then AUTO status instead OFF. Then AUTO status and ON state don’t change anymore (more than 30 mins waiting. If I restart ha I get off status.

  • Error on ha start: (SyncWorker_1) [sleekxmppfs.basexmpp] fulljid property deprecated. Use boundjid.resource

  • Error on status of brushes, filters. Don’t show this info

I don't know if this forum is the correct place to this questions but, any help will great! thanks

VacBot.*_status never gets set

I've been able to use the sucks library to start and stop my Ecovacs N79s. However, I can't get it to accurately to report status on anything.

I'm using the Cmdswitch2-Ecovacs script: https://github.com/EtienneMD/Cmdswitch2-Ecovacs to integrate with Homebridge.

Running the script through the debugger, I can see the request to get charge status:

DEBUG:sucks:Sending command <iq id="XXX" to="XXX" from="XXX" type="set"><query xmlns="com:ctl"><ctl td="GetChargeState" /></query></iq> DEBUG:sleekxmpp.xmlstream.xmlstream:SEND: <iq id="XXX" to="XXX" from="XXX" type="set"><query xmlns="com:ctl"><ctl td="GetChargeState" /></query></iq> DEBUG:sleekxmpp.xmlstream.xmlstream:RECV: <iq to="XXX" type="result" id="XXX" from="XXX" /> DEBUG:sleekxmpp.xmlstream.xmlstream:RECV: <iq to="XXX" type="set" id="25665" from="XXX"><query xmlns="com:ctl"><ctl id="" ret="ok" errno=""><charge type="SlotCharging" /></ctl></query></iq>

I see the response is sending the correct answer, but inside EcoVacsXMPP._handl_ctl(), the message.getpayload() call only returns the outer element and none of the <charge> element that actually contains the information. I'm guessing this is why the status information isn't being set.

I don't know enough about SleekXMPP to get to the next step. I'm hoping you can shed some light as to where to look to solve the problem.

Getting started using sucks as a library

Hello,

I am trying to use use sucks as a library to get some info for my domotica system. I have programming experience but I have not much (almost none) python experience.

This is the code I have so far for getting the battery state:

from sucks.cli import *

config = read_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()

print(GetBatteryState())

But when I execute this code I get a lot of errors:

 python3 deebot.py
WARNING:sleekxmpp.basexmpp:fulljid property deprecated. Use boundjid.resource
ERROR:sleekxmpp.basexmpp:day is out of range for month
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 1492, in _process
    if not self.__read_xml():
  File "/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 1564, in __read_xml
    self.__spawn_event(xml)
  File "/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 1632, in __spawn_event
    handler.prerun(stanza_copy)
  File "/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/handler/callback.py", line 64, in prerun
    self.run(payload, True)
  File "/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
    self._pointer(payload)
  File "/usr/local/lib/python3.4/dist-packages/sleekxmpp/features/feature_starttls/starttls.py", line 64, in _handle_starttls_proceed
    if self.xmpp.start_tls():
  File "/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 889, in start_tls
    cert.verify(self._expected_server_name, self._der_cert)
  File "/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/cert.py", line 133, in verify
    not_before, not_after = extract_dates(raw_cert)
  File "/usr/local/lib/python3.4/dist-packages/sleekxmpp/xmlstream/cert.py", line 111, in extract_dates
    not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ')
  File "/usr/lib/python3.4/_strptime.py", line 500, in _strptime_datetime
    tt, fraction = _strptime(data_string, format)
  File "/usr/lib/python3.4/_strptime.py", line 465, in _strptime
    datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month
ERROR:sleekxmpp.basexmpp:day is out of range for month

I installed sucks with "pip3 install sucks" and I checked if these libraries are installed and "requests-mock, nose, pycountry-convert, pycryptodome, requests, click, sleekxmpp"
I'm proberbly doing something stupid ;) but please help me out

Best Regads, Martijn

GetDeviceList failed

None of the calls seem to work, with the exception of login. I repeatedly get:
ERROR call to GetDeviceList failed with {'result': 'fail', 'error': 'auth error', 'todo': 'result', 'errno': 1004}

Ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.