FIXED: Ecovacs Deebot 2019 & OZMO Series - Working Library

Hello,
I’m new at homeassistant since a few days. Very nice tool. My Landroid is already working and also some Tasmota devices via MQTT.
I tried integration of “Deebot 960/950/920 vacuum” via HACS. My configuration.yaml:

vacuum:
  - platform: deebot
    username: !secret YOUR_ECOVACS_USERNAME
    password: !secret YOUR_ECOVACS_PASSWORD
    country: DE
    continent: DE
    deviceid: !secret YOUR_DEEBOT_TOKEN
    # Optional
    live_map: False                    # Enable Live Map.. may cause issues on low power hardware | Default: True
    show_color_rooms: False           # Enable draw room colors as in the app | Default: False
    livemappath: 'www/live_map.png'   # Path where to save live_map

However I see no entities for Deebot and get following error in log:

 Protokolldetails ( ERROR )

Logger: homeassistant.components.vacuum
Source: custom_components/deebot/vacuum.py:99
Integration: Vacuum (documentation, issues)
First occurred: 16:59:35 (1 occurrences)
Last logged: 16:59:35
Error while setting up deebot platform for vacuum

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.7/socket.py", line 748, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

Has anyone an idea, why is not working?

Regards
Michael

Thank you Andrea for your work. I just bought a Ozmo 920, wich is a great device, and I was very sad to see it couldn’t work in Home Assistant (using ecovacs integration). I was deciding to give it back to the seller. Now wiht your library everything works fine (I didn’t test all) and i love my ozmo even more!
Thanks!

Hmm, seems I habe fixed mit by myself. Settings country and location to us / na.

Thx :slight_smile: @Micha70

Hey @Veuchez, did you work this out? I can’t seem to figure it out myself. Which yaml exactly do they get put in, I tried in the Lovelace yaml, didn’t work, also in the script, that didn’t work either.

Hi. Thanks for developing this and great thread by all! More of a question than issue … I have everything setup with specific icons in the Lovelace card in Home Assistant for each room. I also have HomeKit Bridge setup. I’m trying to figure out a way to get a switch to appear in Home app in iOS so that I can create a scene or ask Siri to clean a specific room by turning on that switch. I can’t seem to figure that out. Basically have a switch appear for each room that sends the Ozmo to clean that room. Any thoughts?

UPDATE: the simplest solution is the best. HomeKit integration will publish scripts as switches. Just check the box in configuration and voilà.

Hi all.
I am just trying to set this up for the first time after stumbling across it.

I am getting a heap of TypeError: argument of type 'NoneType' is not iterable errors

There are other examples of this in this thread, but all have been resolved by updating. Everything is up to date.

Do i just need to fiddle until i get the continent and the country correct ?

Hello!
Yes sure, if you look at a few posts below what you answered you will find my configuration!

Okay I’m making progress with this. I’ve now got the area cleans working. Now I want to add spot cleans, so I can select something like my lounge room rug, just the same way as I can select the rooms. The difference being that the command it sends is map instead of area.

I’m doing something wrong with the syntax because it fails to call the script saying “‘list’ object has not attribute ‘items’”. Obviously it appears the script isn’t populating the vacuum.send_command with any data but I can’t understand how to get to it.

vacuum_clean_zone:
  alias: Cleaning Zone
  sequence:
  - service: vacuum.send_command
    data_template:
      command: spot_area 
      entity_id: vacuum.4c5b488e_71ab_4b1f_b14e_ad1b90f8b9d6_2 
      params: >- 
        {% if is_state('input_boolean.deebot_lounge_rug', 'on') %} 
            map: >-
              {%- set x = "" %}
              {% if is_state('input_boolean.deebot_lounge_rug', 'on') %}
                {% set x = x + "200.0,2000.0,1800.0,-1300.0 " %}
              {% endif %}
            {{x[:-1]}}      
        {% else %}
            area: >-
              {%- set x = "" %}
              {% if is_state('input_boolean.deebot_kitchen', 'on') %}
                {% set x = x + "5," %}
              {% endif %}
              {% if is_state('input_boolean.deebot_masterwir', 'on') %}
                {% set x = x + "2," %}
              {% endif %}
              {% if is_state('input_boolean.deebot_guest','on') %}
                {% set x = x + "4," %}
              {% endif %}  
              {% if is_state('input_boolean.deebot_flynnbed','on') %}
                {% set x = x + "7," %}
              {% endif %}
              {% if is_state('input_boolean.deebot_masterbed', 'on') %}
                {% set x = x + "1," %}
              {% endif %}  
              {% if is_state('input_boolean.deebot_mainbath', 'on') %}
                {% set x = x + "3," %}
              {% endif %}
              {% if is_state('input_boolean.deebot_lounge', 'on') %}
                {% set x = x + "0," %}
              {% endif %}
                {{x[:-1]}}
        {% endif %}         

#        cleanings: >-
#              {%- if is_state('input_boolean.deebot_times', 'on') -%}2{%- else
#              -%}1{%- endif -%}
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_kitchen 
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_masterwir
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_guest
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_flynnbed
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_masterbed
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_mainbath
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_lounge
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_lounge_rug   
vacuum_script_set_water:
  alias: set vacuum water level
  sequence:
  - service: vacuum.send_command
    data:
      command: set_water_level
      entity_id: vacuum.4c5b488e_71ab_4b1f_b14e_ad1b90f8b9d6_2
      params:
        level: low|medium|high

Took me some tries to get mine working, so here some notes for anybody interested:

I have a Deebot 900 - NO OZMO. Got it from Amazon.de a while ago: https://www.amazon.de/Ecovacs-Saugroboter-intelligenter-Navigation-Alexa-Steuerung/dp/B07BBZFRZG/

I use https://github.com/Ligio/hacc-ozmo which can be installed when adding manually in HACS as well:
image

configuration.yaml:

deebot:
  username: [email protected]
  password: mypassword
  country: us
  continent: na

Thank you very much @MaxW !

But are you sure it’s available in HACS becaus I am only able to find one Deebot related integration and it’s another one not working with the Deebot 900.

KR

Oh, it might be possible I added it manually a while ago. As there is no HACS related files in that repository it seems likely. Will edit my post later, thanks for pointing out :v:

@Andrea_Liosi
Hi, I search Deebot-for-hassio in my Hacs but I can’t find it.
Any clue? I wold like to try it. Thx

Anyone could explain me why my card is broken (no info and missing icon) after the xiaomi-vacuum-card upgrade?
Before it works like a charme.
Solutions? Thanks
Immagine 2020-09-18 133325

Thanks for all the help - I am new to Home Assistant and have just integrated the Ozmo950. I am hoping someone can help me with the card, so that my “quick spot zones” are displayes in a second row:

    - type: 'custom:xiaomi-vacuum-card'
      entity: vacuum.deedee
      image: /local/img/vacuum.png
      name: DeeDee
      vendor: xiaomi
      state:
        status:
          key: robot_status
        mode:
          icon: mdi:robot-vacuum
          label: 'Fan speed: '
      attributes:
        filter: False
        sensor: False
        main_brush:
          key: component_brush
          unit: '%'
        side_brush:
          key: component_sideBrush
          unit: '%'
        water_level:
          key: 'water_level'
          label: 'Water level: '
      buttons:
        clean_hallway:
          icon: mdi:road-variant
          label: Clean Hallway
          tap_action:
          action: call-service
          service: vacuum.send_command
          service_data:
            command: spot_area
            entity_id: vacuum.deedee
            params:
              cleanings: 1
              rooms: 0
          type: state-icon
        clean_bedroom:
          icon: mdi:bed-empty
          label: Clean Bedroom
          tap_action:
          action: call-service
          service: vacuum.send_command
          service_data:
            command: spot_area
            entity_id: vacuum.deedee
            params:
              cleanings: 1
              rooms: 4
          type: state-icon
        clean_bathroom_toilet:
          icon: mdi:shower
          label: Clean Bathroom & Toilet
          tap_action:
          action: call-service
          service: vacuum.send_command
          service_data:
            command: spot_area
            entity_id: vacuum.deedee
            params:
              cleanings: 1
              rooms: 6
          type: state-icon
        clean_lounge:
          icon: mdi:sofa
          label: Clean Living Room
          tap_action:
          action: call-service
          service: vacuum.send_command
          service_data:
            command: spot_area
            entity_id: vacuum.deedee
            params:
              cleanings: 1
              rooms: 11
          type: state-icon
        clean_dining_room:
          icon: mdi:silverware-variant
          label: Clean Dining Room
          tap_action:
          action: call-service
          service: vacuum.send_command
          service_data:
            command: spot_area
            entity_id: vacuum.deedee
            params:
              cleanings: 1
              rooms: 9
          type: state-icon
        clean_kitchen:
          icon: mdi:toaster-oven
          label: Clean Kitchen
          tap_action:
          action: call-service
          service: vacuum.send_command
          service_data:
            command: spot_area
            entity_id: vacuum.deedee
            params:
              cleanings: 1
              rooms: 10
          type: state-icon
2 Likes

Hi, I took advantage of your setting x my 950, as soon as you solve x the second row I would be interested too!
Thank you!

for the Gods love I can`t setup this to run properly …

anyone can do a proper tutorial ?

I have the deebot 950

Has anyone got a deebot to work in HomeKit via h.a?

hey!

Yeah, I got it working for homekit and also a working card right now in HA.

  1. The card I have been using instead of the Xiaomi Vacuum card mentioned above (the one that is broken right now for the OZMO 950) is this one: https://github.com/denysdovhan/vacuum-card. Just install it via HACS.
  • It does work, but I did not get it to display sensor information on the brushes - as I do not really care about that, I did not investigate further. Here is the code in my configuration.yaml:
vacuum:
    - platform: deebot
      username: insert your e-mail here
      password: insert your password here
      country: DE
      continent: EU
      deviceid: insert your device ID here

This is the lovelace UI code, just add it via the GUI and then “manual code”:

actions:
  - icon: 'mdi:silverware-fork-knife'
    name: Clean Kitchen
    service: script.vacuum_clean_kitchen
  - icon: 'mdi:hanger'
    name: Clean Lounge
    service: script.vacuum_clean_lounge
  - icon: 'mdi:paper-roll-outline'
    name: Clean Bathroom
    service: script.vacuum_clean_lounge
  - icon: 'mdi:desktop-classic'
    name: Clean Study
    service: script.vacuum_clean_study
buttons:
  locate: true
  start: true
  stop: true
entity: vacuum.juan_son
icons:
  start: 'mdi:some-icon'
  stop: 'mdi:other-icon'
labels:
  battery: Battery
  filter: Filter
  main_brush: Main Brush
  mode: Mode
  side_brush: Side Brush
  water_level: Water
name: Juan Son
type: 'custom:vacuum-card'
vendor: deebot

And then it looks like that in HA:
image

If the integration via the configuration.yaml of the deebot worked, you can click on it and should see something like that:
image

These numbers behind lounge or living room are important, as you need them for the stand-alone scripts to e.g. clean your bathroom via a HA script. They are the content of the scripts below:

And, here are these scripts:

script:
  vacuum_clean_kitchen:
    alias: clean kitchen
    sequence:
      - service: vacuum.send_command
        data_template:
          entity_id: vacuum.juan_son
          command: clean
          params:
            act: start
            content: '2,'
            count: 1
            type: spotArea

  vacuum_clean_lounge:
    alias: clean lounge
    sequence:
      - service: vacuum.send_command
        data_template:
          entity_id: vacuum.juan_son
          command: clean
          params:
            act: start
            content: '15,'
            count: 1
            type: spotArea

  vacuum_clean_study:
    alias: clean office
    sequence:
      - service: vacuum.send_command
        data_template:
          entity_id: vacuum.juan_son
          command: clean
          params:
            act: start
            content: '13,'
            count: 1
            type: spotArea

  vacuum_clean_bathroom:
    alias: clean bathroom
    sequence:
      - service: vacuum.send_command
        data_template:
          entity_id: vacuum.juan_son
          command: clean
          params:
            act: start
            content: '5,'
            count: 1
            type: spotArea

Basically, this is everything you need to integrate the deebot, display it via lovelace and add scripts to it to clean different rooms. Everything else (start, stop, pause, return to base) I handle via the official Alexa skill from Ecovacs for the OZMO 950 which is dumb, but does the trick for the basic functions.

  1. Adding these scripts to Homekit is pretty straightforward as well. I just installed the Home Kit Bridge via Settings --> Integrations --> Plus Button --> Homekit Bridge. This will take you through everything. via the GUI. You do need an Apple TV or iPad as a hub I think. Then you can decide what you want to expose to Home Kit and you can see the scripts (e.g. clean bathroom) right in Homekit on your iPhone.

I hope I answered all of the questions!

2 Likes

Hi @XRyu ,

I have T8 AIVI and ECOVACS Home app connect to China server. I have some confusing in my configuration:

username : ECOVACS ID (ECxxxxBH)
country : CN
continent: ww
deviceid: SERIAL NUMBER (E09Axxxxxxxxxxxx0100)

With this config I have error log:


Error while setting up deebot platform for vacuum
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 159, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

Can you help me

ecovacs_id is not good, you have to put your login credentials that you use for the mobile application and you must also add the password.
see if below

deebot:
  username: YOUR_ECOVACS_USERNAME
  password: YOUR_ECOVACS_PASSWORD
  country: YOUR_TWO_LETTER_COUNTRY_CODE
  continent: YOUR_TWO_LETTER_CONTINENT_CODE
  deviceid:
    - YOUR_ROBOT_ID