From 9652c47d42e8758a149f8116a415cd9e9b5dedf1 Mon Sep 17 00:00:00 2001 From: bittles Date: Wed, 18 Jan 2023 00:03:42 -0500 Subject: [PATCH 1/4] Update sucks.py --- custom_components/ecovacs/sucks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/custom_components/ecovacs/sucks.py b/custom_components/ecovacs/sucks.py index 264ac1e..8ee481b 100644 --- a/custom_components/ecovacs/sucks.py +++ b/custom_components/ecovacs/sucks.py @@ -7,6 +7,7 @@ import os from sleekxmppfs.xmlstream import ET from sleekxmppfs.exceptions import XMPPError +from . import sucks_api from .sucks_mqtt import EcoVacsIOTMQ from .sucks_xmpp import EcoVacsXMPP From 9b52bc8e1de191c107308a2d8b3112dfaee3829e Mon Sep 17 00:00:00 2001 From: bittles Date: Wed, 18 Jan 2023 00:27:35 -0500 Subject: [PATCH 2/4] update readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9195272..36cc863 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Home Assistant Ecovacs Custom Component with Bumper Support +# CURRENTLY NOT WORKING AS OF 1/18/23 with latest version until I can get time to look through code Based off the regular home assistant ecovacs components and bmartin's fork of sucks, https://github.com/bmartin5692/sucks. Replaces built in ecovacs component, with some upgrades and fixes. Allows SSL verification to be set to false to work with a self-hosted bumper server, https://github.com/bmartin5692/bumper, a replacement for Ecovacs servers to truly get local control. Works with bumper with my N79 and should work with other XMPP based ecovacs. Catches some XMPP messages now that the default HASS one misses (at least with my Ecovacs), including some initial queries and also life span for filters and brushes. Includes MQTT robot support from bmartin's fork that's basically unchanged in this since I don't have one of those robots. @@ -78,4 +79,4 @@ Make component async, use config_flow, create device and clean up some of the ha ### Misc Info From Making This Commit history is a bit of a mess. master branch shows changes from bmartins fork of sucks to v1.3.0 of this custom component. dev branch shows commits from my attempts at testing and getting this to work. -Added additional catches to sucks because my N79 sends some weird payloads, but attributes all pull in now for brush life spans. Couple initial queries it also sends weird that I'm in process of catching atm. As of version 1.3.0 (in the manifest.json) these initial queries and all attributes are working. Was using an implementation completely mine but saw in the MQTT class there were already catches for child payloads without the main payload having the expected td in its payload. Kept comments in giving credit and adapted them to work with xmpp. \ No newline at end of file +Added additional catches to sucks because my N79 sends some weird payloads, but attributes all pull in now for brush life spans. Couple initial queries it also sends weird that I'm in process of catching atm. As of version 1.3.0 (in the manifest.json) these initial queries and all attributes are working. Was using an implementation completely mine but saw in the MQTT class there were already catches for child payloads without the main payload having the expected td in its payload. Kept comments in giving credit and adapted them to work with xmpp. From a483d30625eafcd93cf256e5033a460450d57af3 Mon Sep 17 00:00:00 2001 From: bittles Date: Thu, 19 Jan 2023 16:52:06 -0500 Subject: [PATCH 3/4] fix error handling, bump to 1.5.2 --- custom_components/ecovacs/manifest.json | 2 +- custom_components/ecovacs/sucks.py | 36 +++++++++++++++++++++---- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/custom_components/ecovacs/manifest.json b/custom_components/ecovacs/manifest.json index b66e721..4434fbc 100644 --- a/custom_components/ecovacs/manifest.json +++ b/custom_components/ecovacs/manifest.json @@ -1,7 +1,7 @@ { "domain": "ecovacs", "name": "Ecovacs Bumper", - "version": "1.5.1", + "version": "1.5.2", "documentation": "https://github.com/bittles/ha_ecovacs_bumper", "issue_tracker": "https://github.com/bittles/ha_ecovacs_bumper/issues", "requirements": ["sleekxmppfs==1.4.1", "requests>=2.18", "pycryptodome>=3.4", "pycountry-convert>=0.5", "paho-mqtt>=1.4", "stringcase>=1.2"], diff --git a/custom_components/ecovacs/sucks.py b/custom_components/ecovacs/sucks.py index 8ee481b..f36fb87 100644 --- a/custom_components/ecovacs/sucks.py +++ b/custom_components/ecovacs/sucks.py @@ -106,14 +106,40 @@ class VacBot(): getattr(self, method)(ctl) def _handle_error(self, event): - if 'error' in event: - error = event['error'] - elif 'errs' in event: - error = event['errs'] - if not error == '': + if 'error' in event or 'errs' in event: + error = '' # init error var so it's available outside of first if loop + if 'error' in event: + error = event['error'] + elif 'errs' in event: + error = event['errs'] self.errorEvents.notify(error) LOGGER.error("*** error = " + error) +# if not error == '': + +""" +Errors +The bot broadcasts error codes for a number of cases. + + + +The latest error can be requested like so: + +Request +Response +However in some cases the robot sends to code 100 shortly after an error has occurred, meaning that we cannot trust the GetError request to contain the last relevant error. For example, if the robot gets stuck it broadcasts 102 HostHang, then proceeds to stop and broadcasts 100 NoError. + +Known error codes + +100 NoError: Robot is operational +101 BatteryLow: Low battery +102 HostHang: Robot is stuck +103 WheelAbnormal: Wheels are not moving as expected +104 DownSensorAbnormal: Down sensor is getting abnormal values +110 NoDustBox: Dust Bin Not installed +These codes are taken from model M81 Pro. Error codes may differ between models. +""" + def _handle_life_span(self, event): type = event['type'] try: From d5370a51521f52b3c14d098192bb423e6c7abbdb Mon Sep 17 00:00:00 2001 From: bittles Date: Thu, 19 Jan 2023 16:53:49 -0500 Subject: [PATCH 4/4] Update sucks.py --- custom_components/ecovacs/sucks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ecovacs/sucks.py b/custom_components/ecovacs/sucks.py index f36fb87..4edf027 100644 --- a/custom_components/ecovacs/sucks.py +++ b/custom_components/ecovacs/sucks.py @@ -7,7 +7,7 @@ import os from sleekxmppfs.xmlstream import ET from sleekxmppfs.exceptions import XMPPError -from . import sucks_api +#from . import sucks_api from .sucks_mqtt import EcoVacsIOTMQ from .sucks_xmpp import EcoVacsXMPP