bittles / ha_ecovacs_bumper

Ecovacs component that works with bumper
GNU General Public License v3.0
4 stars 2 forks source link

Unable to prepare setup for platform 'ecovacs.vacuum': #19

Open guillaume042 opened 3 months ago

guillaume042 commented 3 months ago

Hello,

Unable to prepare setup for platform 'ecovacs.vacuum': Platform not found (cannot import name 'VacuumEntity' from 'homeassistant.components.vacuum' (/usr/src/homeassistant/homeassistant/components/vacuum/init.py)).

Might be the same as : https://github.com/Ligio/hacc-ozmo/issues/48

bittles commented 3 months ago

I’ll see if I can look at some of the code updates this weekend. Haven’t had HA setup in a year so not sure what’s needed there yet for how they do vacuum entities now but that link should help a lot thanks.

guillaume042 commented 3 months ago

Maybe not necessary, i've just see that they implemented bumper support in the official integration.

guillaume042 commented 3 months ago

I was trying to make an old ozmo 905 worked in HA but i'dont think your code is compatibe with it

bittles commented 3 months ago

From a quick glance the Ozmo 905 uses REST/MQTT (as opposed to XMPP) with xml format (as opposed to json). Bumper works with both the 900/901 and 600 which both also use those. It’s probably supported by running your own bumper server and then using this custom component. I’ve just got to update the code I guess they dropped the vacuum entity referenced so I have to look and see what they're using instead.

Bumper page for tested models under compatibility: https://github.com/bmartin5692/bumper

Here’s a page with their protocols and formats by model: https://deebot.readthedocs.io/home/models/

guillaume042 commented 3 months ago

Bumper is Ok with my 905. I'm using it through the ios application connected with bumper but i still can't manage to connect bumper to HA (or node red, or iobroker)..

bittles commented 2 months ago

Ok I pushed out two releases. Both of which SHOULD work. v1.7.0 includes minimal changes to let the component work along with some code HASS used to make the component asynchronous. Basically the component won't break if the connection to the vacuum can't complete. Try that and if it doesn't work try v1.6.0. That release has what looks like the bare minimum changes to let the component keep working. Let me know please since I can't actually test these out.

guillaume042 commented 2 months ago

I'm trying and make some really dirty things to your code ;)

homeassistant | 2024-04-28 14:38:31.527 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ecovacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant homeassistant | 2024-04-28 14:38:34.569 DEBUG (MainThread) [custom_components.ecovacs] Creating new Ecovacs component homeassistant | 2024-04-28 14:38:34.575 DEBUG (SyncWorker_6) [custom_components.ecovacs.sucks_api] Setting up EcoVacsAPI homeassistant | 2024-04-28 14:38:34.997 DEBUG (SyncWorker_6) [custom_components.ecovacs.sucks_api] calling main api user/login with (('account', 'wMDx1Pw+q8yjYevcwMAHkZ0Ac6ioVaYawYUXsl2m7czEA0a1FekJNA14gJivVyWlCJXZCsKSZ++seoq5Ed1qV9H3jQ452CM6WCrhAOYhZxpehLbdS1rj2upyba1MJ3Fy4AJAlde8s/oX6AMzl0wAHuwk1jHh50Z96uBgEpO2DBI='), ('password', 'EeGhwforuC9HUn9mBwNkMxHYANBY3sRCvR8FulyTB5ji4TY/ovuQKglOa09znOayVQZ0N3STiFmXoArYLPF6a7+Rt98RYpis2tT7gmUNarVIpGcBMaYpOfoWTpAJN246ciKKozPT/bWtWWxCUIP8d3KNhpNjzSXMXApmm3/XnJ0=')) homeassistant | 2024-04-28 14:38:35.046 WARNING (SyncWorker_6) [py.warnings] /usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'eco-us-api.ecovacs.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings homeassistant | 2024-04-28 14:38:35.497 DEBUG (SyncWorker_6) [custom_components.ecovacs.sucks_api] got {'code': '0000', 'data': {'accessToken': 'f21377fd2692477cbbe9090f40ef1bb6', 'email': 'null@null.com', 'isNew': None, 'loginName': 'dd74e633c68dc828cdf9', 'mobile': None, 'ucUid': 'dd74e633c68dc828cdf9', 'uid': 'dd74e633c68dc828cdf9', 'username': 'bumper', 'country': 'us'}, 'msg': 'The operation was successful.', 'success': True, 'time': 1714307915494} homeassistant | 2024-04-28 14:38:35.499 DEBUG (SyncWorker_6) [custom_components.ecovacs.sucks_api] calling main api user/getAuthCode with (('uid', 'dd74e633c68dc828cdf9'), ('accessToken', 'f21377fd2692477cbbe9090f40ef1bb6')) homeassistant | 2024-04-28 14:38:35.557 WARNING (SyncWorker_6) [py.warnings] /usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'eco-us-api.ecovacs.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings homeassistant | 2024-04-28 14:38:35.647 DEBUG (SyncWorker_6) [custom_components.ecovacs.sucks_api] got {'code': '0000', 'data': {'authCode': 'us_3c483ea44b7d4be19bf49392b6aaec96', 'ecovacsUid': 'dd74e633c68dc828cdf9'}, 'msg': 'The operation was successful.', 'success': True, 'time': 1714307915644} homeassistant | 2024-04-28 14:38:35.656 DEBUG (SyncWorker_6) [custom_components.ecovacs.sucks_api] calling portal api users/user.do function loginByItToken with {'todo': 'loginByItToken', 'country': 'US', 'resource': '39R9FWZJ', 'realm': 'ecouser.net', 'userId': 'dd74e633c68dc828cdf9', 'token': 'us_3c483ea44b7d4be19bf49392b6aaec96'} homeassistant | 2024-04-28 14:38:35.707 DEBUG (SyncWorker_6) [custom_components.ecovacs.sucks_api] got {'resource': '39R9FWZJ', 'result': 'ok', 'todo': 'result', 'token': 'us_3c483ea44b7d4be19bf49392b6aaec96', 'userId': 'dd74e633c68dc828cdf9'} homeassistant | 2024-04-28 14:38:35.709 DEBUG (SyncWorker_6) [custom_components.ecovacs.sucks_api] EcoVacsAPI connection complete homeassistant | 2024-04-28 14:38:35.709 DEBUG (SyncWorker_6) [custom_components.ecovacs.sucks_api] calling portal api users/user.do function GetDeviceList with {'todo': 'GetDeviceList', 'userid': 'dd74e633c68dc828cdf9', 'auth': {'with': 'users', 'userid': 'dd74e633c68dc828cdf9', 'realm': 'ecouser.net', 'token': 'us_3c483ea44b7d4be19bf49392b6aaec96', 'resource': '39R9FWZJ'}} homeassistant | 2024-04-28 14:38:35.757 DEBUG (SyncWorker_6) [custom_components.ecovacs.sucks_api] got {'devices': [{'class': '2pv572', 'company': 'eco-ng', 'did': 'dde9e524-a302-4937-b1ec-164f78fa81dd', 'name': 'E09Q13441B09HEW60187', 'nick': '', 'resource': 'P73A', 'mqtt_connection': False, 'xmpp_connection': False}], 'result': 'ok', 'todo': 'result'} homeassistant | 2024-04-28 14:38:35.759 DEBUG (SyncWorker_6) [custom_components.ecovacs] Ecobot devices: [{'class': '2pv572', 'company': 'eco-ng', 'did': 'dde9e524-a302-4937-b1ec-164f78fa81dd', 'name': 'E09Q13441B09HEW60187', 'nick': '', 'resource': 'P73A', 'mqtt_connection': False, 'xmpp_connection': False, 'iotmq': True}] homeassistant | 2024-04-28 14:38:35.759 INFO (SyncWorker_6) [custom_components.ecovacs] Discovered Ecovacs device on account: dde9e524-a302-4937-b1ec-164f78fa81dd with nickname

Better but not yet in HA stll working on it

guillaume042 commented 2 months ago

image

In french : "Et voila"

Not working yet but a lot better

guillaume042 commented 2 months ago

It seems to work for the basis..

Honestly i'm ashame to propose my changes there are so dirty...

bittles commented 2 months ago

I glanced over at your fork. Don't really see defining all the verify SSLs as False as being a problem since there's not really any purpose to using the component without bumper because the core ecovacs component has had a number of updates to it to bring in config flow and other ecovacs devices. I had only ever left it undefined as default with it needing to be specified in config.yaml so it could conceivably still be used with cloud connections back when my component as on par with the core's component. I assume it didn't work if it wasn't defaulted to False and just specified in config.yaml? Thanks for catching my bad indents that's what I was afraid of without being able to test it in HA properly.

guillaume042 commented 2 months ago

for the very ssl in config dunno why excatly but it won't work. It is really quick and dirty... i've seen a fork of sucks (py-sucks) as sucks is abandonned

guillaume042 commented 2 months ago

Anyway i can make a pull request as is but honeslty i will not find the time to 'repair' the ssl part.

bittles commented 2 months ago

Ya a pull request would be great since I can’t really test stuff out with this anymore. And I’ll add a blurb in the readme to point to your fork for anyone in the future needing this kinda niche thing in case it breaks again and you need to do anymore commits and people stumble on this repo first.