Ecovacs Deebot DM88 (robo vacuum cleaner)

Update: Ecovacs support has been released in 0.77!

I know we’ll need updates to this, including updating the component to use the new “state-based” Vacuum component, so please be mindful that any automations you set up today would need to be updated when that happens (but it should just be some service name changes, nothing huge)

1 Like

I had to add the fix to get my instance to discover my device, but now I don’t see any ecovac component even though the log files seem to suggest it loaded fine.

Debug Log:

2018-08-29 14:30:31 DEBUG (SyncWorker_1) [sucks] calling main api user/getAuthCode with ((‘uid’, ‘redacted_long_uid’), (‘accessToken’, ‘redacted’))
2018-08-29 14:30:31 DEBUG (SyncWorker_1) [sucks] got {‘code’: ‘0000’, ‘msg’: ‘操作成功’, ‘time’: 1535567431683, ‘data’: {‘authCode’: ‘redacted’, ‘ecovacsUid’: ‘redacted’}}
2018-08-29 14:30:32 DEBUG (SyncWorker_1) [sucks] calling user api loginByItToken with {‘country’: ‘US’, ‘resource’: ‘V9HMU00E’, ‘realm’: ‘ecouser.net’, ‘userId’: ‘redacted_long_uid’, ‘token’: ‘redacted’}
2018-08-29 14:30:33 DEBUG (SyncWorker_1) [sucks] got {‘todo’: ‘result’, ‘result’: ‘ok’, ‘userId’: ‘redacted_short_uid’, ‘resource’: ‘V9HMU00E’, ‘token’: ‘redacted’}
2018-08-29 14:30:33 DEBUG (SyncWorker_1) [sucks] EcoVacsAPI connection complete
2018-08-29 14:30:33 DEBUG (SyncWorker_1) [sucks] calling user api GetDeviceList with {‘userid’: ‘redacted_short_uid’, ‘auth’: {‘with’: ‘users’, ‘userid’: ‘redacted_short_uid’, ‘realm’: ‘ecouser.net’, ‘token’: ‘redacted’, ‘resource’: ‘V9HMU00E’}}
2018-08-29 14:30:33 DEBUG (SyncWorker_1) [sucks] got {‘todo’: ‘result’, ‘result’: ‘ok’, ‘devices’: [{‘did’: ‘E000P8U2318700123802’, ‘name’: ‘E000P8U2318700123802’, ‘class’: ‘155’, ‘resource’: ‘atom’, ‘nick’: ‘deebot’, ‘company’: ‘eco-legacy’}]}
2018-08-29 14:30:33 DEBUG (SyncWorker_1) [homeassistant.components.ecovacs] Ecobot devices: [{‘did’: ‘E000P8U2318700123802’, ‘name’: ‘E000P8U2318700123802’, ‘class’: ‘155’, ‘resource’: ‘atom’, ‘nick’: ‘deebot’, ‘company’: ‘eco-legacy’}]
2018-08-29 14:30:33 INFO (SyncWorker_1) [homeassistant.components.ecovacs] Discovered Ecovacs device on account: deebot
2018-08-29 14:30:34 DEBUG (SyncWorker_1) [homeassistant.components.ecovacs] Starting vacuum components

Have you checked the /dev-state/ page? You should have a vacuum.deebot from my reading there.

However, it’s weird that you don’t have any log entries from homeassistant.components.vacuum.ecovacs - did you set that to DEBUG as well? That’s where we should see the actual vacuum component be initialized.

Yeah nothing is showing there. :thinking:
image

Current log settings:

logger:
  default: critical
  logs:
    homeassistant.components.ecovacs: debug
    homeassistant.components.vacuum.ecovacs: debug
    sucks: debug
1 Like

Yeah, something is certainly wrong there. The very next line in your log should be
2018-08-29 13:54:43 DEBUG (event_thread_0) [sucks] ----------------- starting session ----------------

Can you verify that you can connect to the vacuum using your mobile app?

Also, you don’t have anything in your config like

vacuum:
  - platform: ecovacs

Right? I’m just trying to think of things that would cause the Ecovacs component to fail to make the Ecovacs vacuum platform start up. I may need to give you some modified versions of the files with a lot of debug output to track down where the disconnection is.

Edit: Oh, and what are you country and continent set to?

I verified that I can connect to the vacuum via the app, at least remotely (I am at work right now). I don’t have the vacuum platform in my config, although I did briefly add it to see if it would help yesterday, but same results.

ecovacs:
  username: !secret ecovacs_username
  password: !secret ecovacs_password
  country: 'us'
  continent: 'na'

Thanks for your help. I’ll double check the app when I get home. If you need me to get anymore info let me know.

Been waiting for this component for a long time - thanks @OverloadUT for making this happen.

And there is good news - and another comment :wink:

  1. The component works fine for me, although I had to remove the entries for country and continent - otherwise, the config check showed this:
    image

  2. When I hit ‘TURN ON’ in the UI, I assume my M80 Pro goes into ‘Auto Mode’. This wouldn’t be an issue, if I had access to the ‘Edge Mode’ somewhere else - but that doesn’t seem to be implemented. Is that still on the list? Can I help testing it?
    image

  3. The locate/find function doesn’t seem to work on my device, I normally don’t need it and would be happy to have the icon for ‘Edge Mode’ in its place

Woohoo! It’s awesome to see it working for someone! I also have an M80 Pro so it makes sense that that would be the most reliable model right now.

You are correct that Edge Mode is not currently supported - it’s something unique to Ecovacs, so I’ll need to add that as a custom service just for Ecovacs. I had actually meant to do that, but I must have forgotten about it because I never use it.

Unfortunately edge mode will not be supported in the default UI, which only ever has commands that are common to the vacuum parent component. You could make a script that triggers it to have a separate button in the UI though, once I add the service.

Locate does work for my M80 Pro, so I’m surprised that it does not for you!

Oh, I also just noticed that your vacuum’s name is None! That’s definitely incorrect, unless you actually named your vacuum that. What do you see in the Evocacs app when you look at your vacuum? Would you mind turning on debug logging and posting the output so I can see how your missing name is represented in the raw API responses (be sure to remove tokens and user ids)

I just want to say that it works fine with my deebot slim2 (homeassistant 0.77). Thank you!

Before I used a broadlink (IR signals) to remote control my deebot. Big advantage of the new component is, that now it is possible to turn off (go home) even when the deebot is in another room.

To control it with alexa and siri i used a switch template to be able to toggle between start cleaning and go home. It works, but is the recommended way to do it?

switch:
  - platform: template
    switches:
      vacuum:
        value_template: "{{ (states.vacuum.deebot_slim2.attributes.status) == 'auto' }}"
        turn_on:
          service: vacuum.turn_on
          data: {"entity_id": "vacuum.deebot_slim2"}
        turn_off:
          service: vacuum.return_to_base
          data: {"entity_id": "vacuum.deebot_slim2"}

Also is there a way to change “EINSCHALTEN” (german for “turn on”, see picure) to a toggle switch?Unbenannt

Noticed I’m getting these errors in my dev-info. If I remember correctly XMPP is what the vacuum uses to communicate.

The connection error doesn’t have much of a description but here’s what the other error gives:

Log Details (ERROR)
Fri Aug 31 2018 08:57:38 GMT-0400 (Eastern Daylight Time)

<TagSet object at 0x60fdb550 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x6616c230 tagSet <TagSet object at 0x65cd0c50 tags 0:0:4> encoding iso-8859-1>
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1492, in _process
    if not self.__read_xml():
  File "/srv/homeassistant/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1564, in __read_xml
    self.__spawn_event(xml)
  File "/srv/homeassistant/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1632, in __spawn_event
    handler.prerun(stanza_copy)
  File "/srv/homeassistant/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 64, in prerun
    self.run(payload, True)
  File "/srv/homeassistant/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
    self._pointer(payload)
  File "/srv/homeassistant/lib/python3.6/site-packages/sleekxmpp/features/feature_starttls/starttls.py", line 64, in _handle_starttls_proceed
    if self.xmpp.start_tls():
  File "/srv/homeassistant/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 889, in start_tls
    cert.verify(self._expected_server_name, self._der_cert)
  File "/srv/homeassistant/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 143, in verify
    cert_names = extract_names(raw_cert)
  File "/srv/homeassistant/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 73, in extract_names
    asn1Spec=OctetString())[0]
  File "/srv/homeassistant/lib/python3.6/site-packages/pyasn1/codec/ber/decoder.py", line 1318, in __call__
    '%s not in asn1Spec: %r' % (tagSet, asn1Spec)
pyasn1.error.PyAsn1Error: <TagSet object at 0x60fdb550 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x6616c230 tagSet <TagSet object at 0x65cd0c50 tags 0:0:4> encoding iso-8859-1>

I seem to be getting a different error than anyone else:

Error during setup of component ecovacs
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/setup.py", line 148, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/ecovacs.py", line 58, in setup
    devices = ecovacs_api.devices()
  File "/config/deps/lib/python3.6/site-packages/sucks/__init__.py", line 192, in devices
    'resource': self.resource
  File "/config/deps/lib/python3.6/site-packages/sucks/__init__.py", line 173, 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': 'REDACTED', 'auth': {'with': 'users', 'userid': 'REDACTED', 'realm': 'ecouser.net', 'token': 'REDACTED', 'resource': 'REDACTED'}}

I have a Deebot Ozmo 930. Here’s my configuration.yaml:

ecovacs:
  username: !secret ecovacs_username
  password: !secret ecovacs_password
  country: !secret ecovacs_country
  continent: !secret ecovacs_continent

From what I can tell, however, the sucks library doesn’t support the 930 so I presume that’s the issue.

That change wa0s made in the frontend recently and applies to all vacuums. I personally think it’s a regression and I’m going to dig in to why it was done.

Thanks for this - I’ll check and see if I can make any sense of it.

Could you share what your country and continent are set to? For non-US locations I think that’s one of the biggest risk points (we have to figure out what each and every country’s settings should be!)

I noticed the name issue as well, but it didn’t bother me that much.
Nevertheless, the name in the app is ‘DEEBOT M80 Pro’.

Re. the logging, I’m not really sure how to do that.
I added this to the config yaml, but what do I do next?

logger:
  default: critical
  logs:
    homeassistant.components.ecovacs: debug
    homeassistant.components.vacuum.ecovacs: debug
    sucks: debug

I got it to work by downgrading my pyasn1 package to 0.3.7 as mentioned here.

Thanks @OverloadUT for this awesome addition!

Looks like your getting the 1004 auth error. I had to fix mine by changing line 126 in the sucks __init__.py file.
From

    self.user_access_token = self.__call_login_by_it_token()['token']

To

    login_response = self.__call_login_by_it_token()
    self.user_access_token = login_response['token']
    self.uid = login_response['userId']

Sorry forgot they were in secrets, they’re us/na respectively.

Okay, so that fix got the vacuum entity created (with name None @OverloadUT ), however none of the commands work. The status does update when I control through the app.

Log is getting flooded with:
WARNING (event_thread_0) [sleekxmpp.basexmpp] resource property deprecated. Use boundjid.resource

Strange, I get those warnings too, but I can control my n79s with no problem.

I’m guessing the different model must take different commands. There’s already an issue in the sucks GitHub repo about the 930 not working. Locate actually does work, but I had no way of knowing that when I tested earlier from work :stuck_out_tongue:

Hi guys!
I opened the Github issue for the Ozmo 930:

The eracknaphobia patch solve the " GetDeviceList Auth 1004 Error" also for my Deebot.

Now I can see it in HA like a generic Deebot (vacuum.deebot), without model specification. Maybe for this reason I can’t interact with it.
The only working button is Locate: when I press it I hear the tipical boot sound (but not the recorded voice: “I’m here!”). All the other button: Activate, Stop, Clean spot, Return home… didn’t work.

I hope you could improve this fantastic script!
I’m here for betatesting with my Ozmo 930 :wink:

New error:
“resource property deprecated. Use boundjid.resource”