Bonjour à tous,
Je me permets de reprendre le topic de @JohnDoe car je viens d’acquérir un aspirateur robot Deebot Ecovacs Ozmo T8 AIVI et je suis à la recherche d’un moyen de l’intégrer sur mon serveur Jeedom afin de pouvoir intéragir avec lors, par exemple, des scénarios.
J’ai aussi tenté d’utiliser la librairie « Sucks » mais lorsque je tente, par exemple, de lancer un programme de nettoyage de 10min, j’ai cette erreur :
trifly@debian:~/scripts/sucks$ sucks login
Ecovacs app email: xxx.xxx@gmail.com
Ecovacs app password:
your two-letter country code [fr]:
your two-letter continent code [eu]:
Config saved.
trifly@debian:~/scripts/sucks$ sucks clean 10
sleekxmppfs.basexmpp WARNING fulljid property deprecated. Use boundjid.resource
performing clean command
Traceback (most recent call last):
File "/home/trifly/.local/bin/sucks", line 10, in <module>
sys.exit(cli())
File "/home/trifly/.local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/trifly/.local/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/trifly/.local/lib/python3.7/site-packages/click/core.py", line 1290, in invoke
return _process_result(rv)
File "/home/trifly/.local/lib/python3.7/site-packages/click/core.py", line 1224, in _process_result
value = ctx.invoke(self.result_callback, value, **ctx.params)
File "/home/trifly/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/trifly/.local/lib/python3.7/site-packages/sucks/cli.py", line 219, in run
vacbot.run(action.vac_command)
File "/home/trifly/.local/lib/python3.7/site-packages/sucks/__init__.py", line 416, in run
self.send_command(action.to_xml())
File "/home/trifly/.local/lib/python3.7/site-packages/sucks/__init__.py", line 413, in send_command
self.xmpp.send_command(xml, self._vacuum_address())
File "/home/trifly/.local/lib/python3.7/site-packages/sucks/__init__.py", line 482, in send_command
c.send()
File "/home/trifly/.local/lib/python3.7/site-packages/sleekxmppfs/stanza/iq.py", line 235, in send
raise IqError(result)
sleekxmppfs.exceptions.IqError: <iq type="error" to="ejlieqrbb9de592c@ecouser.net/237c3b6bb019a3ccb2f22e05 8e123bd4" from="96ed5bdf-f10e-4e81-8527-85e9727d9446@x5d34r.ecorobot.net/atom" id="fa72973e-7583-4030-83db -8f87c71597e7-3"><error type="wait" code="404"><recipient-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-s tanzas" /></error></iq>
^CException ignored in: <module 'threading' from '/usr/lib/python3.7/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 1281, in _shutdown
t.join()
File "/usr/lib/python3.7/threading.py", line 1032, in join
self._wait_for_tstate_lock()
File "/usr/lib/python3.7/threading.py", line 1048, in _wait_for_tstate_lock
elif lock.acquire(block, timeout):
Je me suis mis à la recherche d’autre librairies et suis tombé sur ce projet :
Après installation, la 1ère partie de connexion à mon compte ecovacs pour récupérer le token semble OK :
trifly@debian:~/scripts/ecovacs-deebot.js$ node ecovacs.js
Connected!
Toutefois, la 2nde partie concernant la connexion à l’aspirateur, j’ai quelques warnings donc une erreur d’authentification :
trifly@debian:~/scripts/ecovacs-deebot.js$ node ecovacs.js
(node:26565) UnhandledPromiseRejectionWarning: failure code 1004 (auth error) for call GetDeviceList and parameters {"auth":{"with":"users","realm":"ecouser.net","resource":"apirateu"}}
(node:26565) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26565) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Connected!
Malgré cela, je ne sais pas trop si cela fonctionne car je ne sais pas trop comment, par la suite, utiliser les différents « shortcuts » possibles :
Si quelqu’un a déjà utilisé cette librairie JS ou s’il connait une autre manière de faire, je suis preneur
Merci à vous !