FIXED: Ecovacs Deebot 2019 & OZMO Series - Working Library

In general… it seems that I’m not able to transform parametric values, code included in {{, % or whatever else… into the final result value inside the lovelace.yaml…

Am I missing something?

I’m very close to the solution…

With notify.notify I can read the value of x, and it’s correct… but it doesn’t work with rooms… :frowning:

              - type: 'custom:config-template-card'    
                entities:
                  - input_boolean.deebot_times
                  - input_boolean.deebot_cucina
                  - input_boolean.deebot_sala
                  - input_boolean.deebot_camera
                  - input_boolean.deebot_bagno_grande
                  - input_boolean.deebot_bagno_piccolo
                  - input_boolean.deebot_corridoio
                  - input_boolean.deebot_aurora
                  - input_boolean.deebot_giovanni
                card:
                    type: 'custom:button-card'
                    color: white
                    entity: null
                    icon: 'mdi:view-dashboard-outline'
                    name: Stanze
                    styles:
                      card:
                        - font-size: 12px
                        - background-color: black
                        - color: white
                    tap_action:
                      action: call-service
                      service: vacuum.send_command
                      #service: notify.notify
                      service_data:
                        command: spot_area
                        entity_id: vacuum.aspirapolvere
                        params:
                          cleanings: >-
                              {%- if is_state('input_boolean.deebot_times', 'on') -%}2{%- else
                              -%}1{%- endif -%}
                          rooms: >-
                              {%- set x = "" %}
                              {% if is_state('input_boolean.deebot_cucina', 'on') %}
                                {% set x = x + "1," %}
                              {% endif %}
                              {% if is_state('input_boolean.deebot_sala', 'on') %}
                                {% set x = x + "0," %}
                              {% endif %}
                              {% if is_state('input_boolean.deebot_camera', 'on') %}
                                {% set x = x + "3," %}
                              {% endif %}
                              {% if is_state('input_boolean.deebot_bagno_grande','on') %}
                                {% set x = x + "5," %}
                              {% endif %}  
                              {% if is_state('input_boolean.deebot_bagno_piccolo','on') %}
                                {% set x = x + "8," %}
                              {% endif %}
                              {% if is_state('input_boolean.deebot_corridoio', 'on') %}
                                {% set x = x + "2," %}
                              {% endif %}  
                              {% if is_state('input_boolean.deebot_aurora', 'on') %}
                                {% set x = x + "7," %}
                              {% endif %}
                              {% if is_state('input_boolean.deebot_giovanni', 'on') %}
                                {% set x = x + "6," %}
                              {% endif %}
                                {{x[:-1]}}

I’m not so good with templates… I submitted a topic request: link

We nee dto wait :wink:

Ok! I solved it in this way:

image

vacuum_clean_zone:
  alias: Pulisci zona
  sequence:
  - service: vacuum.send_command
    data_template:
      command: "{{command}}"
      entity_id: "{{entity_id}}"
      params:
        act: start
        content: >
            {%- set x = "" %} 
            {% if is_state('input_boolean.clean_kitchen_boolean', 'on') %} 
            {% set x = x + "0," %} 
            {% endif %} 
            {% if is_state('input_boolean.clean_living_boolean', 'on') %} 
            {% set x = x + "2," %} 
            {% endif %} 
            {% if is_state('input_boolean.clean_lunch_boolean', 'on') %} 
            {% set x = x + "10," %} 
            {% endif %} 
            {% if is_state('input_boolean.clean_disimpegno_boolean', 'on') %} 
            {% set x = x + "3," %} 
            {% endif %} 
            {% if is_state('input_boolean.clean_little_bathroom_boolean', 'on') %} 
            {% set x = x + "5," %} 
            {% endif %} 
            {% if is_state('input_boolean.clean_bathroom_boolean', 'on') %} 
            {% set x = x + "4," %} 
            {% endif %} 
            {% if is_state('input_boolean.clean_bedroom_boolean', 'on') %} 
            {% set x = x + "6," %} 
            {% endif %} 
            {% if is_state('input_boolean.clean_little_bedroom_boolean', 'on') %} 
            {% set x = x + "9," %} 
            {% endif %} 
            {{x[:-1]}}
        count: "{{count}}"
        type: "{{type}}"
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.clean_kitchen_boolean
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.clean_living_boolean 
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.clean_lunch_boolean
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.clean_disimpegno_boolean
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.clean_little_bathroom_boolean
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.clean_bathroom_boolean
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.clean_bedroom_boolean
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.clean_little_bedroom_boolean

UI:

cards:
  - color: auto
    entity: null
    icon: 'mdi:map-marker-radius'
    name: Localizza
    styles:
      card:
        - font-size: 12px
    tap_action:
      action: call-service
      service: vacuum.locate
      service_data:
        entity_id: vacuum.robi
    type: 'custom:button-card'
  - type: entity-button
    icon: 'mdi:robot-vacuum-variant'
    name: Pulisci
    tap_action:
      action: call-service
      service: script.vacuum_clean_zone
      service_data:
        command: clean
        entity_id: vacuum.robi
        count: 1
        type: spotArea
  - color: auto
    entity: null
    icon: 'mdi:robot-vacuum'
    name: Dock
    styles:
      card:
        - font-size: 12px
    tap_action:
      action: call-service
      service: vacuum.return_to_base
      service_data:
        entity_id: vacuum.robi
    type: 'custom:button-card'
type: horizontal-stack

Firstly I select the rooms and the “Pulisci” button.

2 Likes

Thanks!!! I will try it…

Why do you repeat this for each room?

` - service: input_boolean.turn_off
    data:`

It works now!!! Even if I don’t understand the use of input_boolean.turn_off… :slight_smile:

I was also able to change the color of the fan/water level to indicate the selected one :slight_smile:

              - type: 'custom:config-template-card'    
                entities:
                  - sensor.deebot_water_level
                variables:
                  - states['sensor.deebot_water_level'].state
                card:
                        color: "${vars[0] === 'ultrahigh' ? 'yellow' : 'white'}"
                        entity: null
                        icon: 'mdi:flask-empty-plus'
                        name: Altissima
                        styles:
                          card:
                            - font-size: 12px
                            - background-color: black
                            - color: white
                        tap_action:
                          action: call-service
                          service: vacuum.send_command
                          service_data:
                            command: set_water
                            entity_id: vacuum.aspirapolvere
                            params:
                              amount: ultrahigh
                        type: 'custom:button-card'

My last two problems and I can consider this integration completed :slight_smile:

  • How to make the number of cleanings a parameter in the script you provided
  • How to read the status of the vacuum (in dock, charging, cleaning… etc…)

Because I prefer to reset the status of all inputs after the cleeaning

For the number of cleanings you should just pass the number dynamically from the script using a spicific input to read that… for instance an input_select

Hello. is it possible to have a detailed guide do i have files to set up for your identities? I also have a 950

1 Like

@Gabriele_Mandalari

I fixed your script. The parameters name were wrong. I added a debug line in the code vacuum.py to check the parameters passed. Now cleanings/rooms should be ok (my error was that I inverted them :frowning: silly one…). Your error was about the name of parameters (not count/content, but they must be rooms/cleanings).

Please check if it works with 2 times cleaning… I didn’t have time for it. I saw that rooms are passed properly if I call the service from HA and then open the app (but in the app there’s no way to check the number of times it should clean…)

vacuum_clean_zone:
  alias: Pulisci zona
  sequence:
  - service: vacuum.send_command
    data_template:
      command: spot_area 
      entity_id: vacuum.aspirapolvere 
      params:
        rooms: >-
              {%- set x = "" %}
              {% if is_state('input_boolean.deebot_cucina', 'on') %}
                {% set x = x + "1," %}
              {% endif %}
              {% if is_state('input_boolean.deebot_sala', 'on') %}
                {% set x = x + "0," %}
              {% endif %}
              {% if is_state('input_boolean.deebot_camera', 'on') %}
                {% set x = x + "3," %}
              {% endif %}
              {% if is_state('input_boolean.deebot_bagno_grande','on') %}
                {% set x = x + "5," %}
              {% endif %}  
              {% if is_state('input_boolean.deebot_bagno_piccolo','on') %}
                {% set x = x + "8," %}
              {% endif %}
              {% if is_state('input_boolean.deebot_corridoio', 'on') %}
                {% set x = x + "2," %}
              {% endif %}  
              {% if is_state('input_boolean.deebot_aurora', 'on') %}
                {% set x = x + "7," %}
              {% endif %}
              {% if is_state('input_boolean.deebot_giovanni', 'on') %}
                {% set x = x + "6," %}
              {% endif %}
                {{x[:-1]}}
        cleanings: >-
              {%- if is_state('input_boolean.deebot_times', 'on') -%}2{%- else
              -%}1{%- endif -%}
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_cucina
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_sala 
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_camera
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_bagno_grande
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_bagno_piccolo
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_corridoio
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_aurora
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_giovanni
  - service: input_boolean.turn_off
    data:
       entity_id: input_boolean.deebot_times       

It’s not my mistake … the integration comes with that configuration and it works properly for me.

+1

Can someone please share a more detail step by step guide in using the custom component ?

Thanks.

@Gabriele_Mandalari

This is the code snippet inside the custom component

        if command == 'spot_area':
            return self.device.SpotArea(params['rooms'], params['cleanings'])

So rooms and cleanings are the parameters he expects :slight_smile: I dunno why with content and count it works, but the number of cleanings was not working for me before

1 Like

Hi,
I wanted to inform that I installed “And3rsL / Deebot-for-hassio” via HACS and that it also works correctly with Deebot 960, thanks @Andrea_Liosi
I was able to configure everything, including zone cleaning.
At the moment, just for my ignorance, I’ve problem to load the map (last_clean_image) of the last cleaning in the right way into frontend.
I tried to make a simple image card and pass them the last_clean_image attribute or the sensor created specifically

 platform: template
 sensors:
   vacuum_last_clean_image:
     friendly_name: "Vacuum Last Clean Image"
     value_template: "{{ state_attr('vacuum.robi', 'last_clean_image') }}"
     entity_picture_template: "{{ state_attr('vacuum.robi', 'last_clean_image') }}"

but it probably doesn’t work because image/picture card doesn’t take the templates as URL or I don’t know the right solution.
The only way I managed to load the image (last_clean_image) was to create a camera in configuration.yaml and then create an image entity as a card.
Can anyone tell me a simpler and less invasive way to load the last_clean_image map?
Thanks.

      - card:
          entity: sensor.deebot_last_clean_image
          image: '${states[''sensor.deebot_last_clean_image''].state}'
          type: 'custom:hui-image-element'
        entities:
          - sensor.deebot_last_clean_image
        style:
          height: 5%
          left: 35%
          top: 45%
          transform: 'translate(0%,2%)'
          width: 5%
        type: 'custom:config-template-card'

  - platform: template
    sensors:
      deebot_last_clean_image:
        friendly_name: "Immagine Ultima Pulizia"
        unit_of_measurement: ''
        value_template: "{{ state_attr('vacuum.aspirapolvere', 'last_clean_image') }}"

I lost hours and hours of testing instead I just had to write here to get the solution. Thanks a lot @StefanoGiu

Do you know if there is a way to also have the map in real time while the vacuum is cleaning?
A map where you can see the vacuum that moves through all the rooms. To understand the map in real time as seen on the official Ecovacs mobile application. Thanks.

It doesn’t come out from the plugin data. You can ask the developer on GitHub to add this feature.

Nice to know is working in the 960 too! i will add it in the custom component description

Sorry but for now there is no support for live map

Yes, work very well on Deebot Ozmo 960, thanks for your work @Andrea_Liosi and hope you can add live map feature in the future.

I only encountered a problem, probably also happens on the 950, if the command is spot_area the cleanings = 2 does not work then it does not perform 2 cleaning passes instead if the command is custom_area and I pass the coordinates of an area the cleanings = 2 works.