Hello sir! How are you?
Yes, this is a very common problem with this project. Maps gets rotated, mirrored out of the blue.
I’ve been problem-free for months now. My solution was to create a scripts that starts a full cleanup, waits a few seconds and send the vacuum home. This recreates a brand new map and stores it on the current map memory.
You will only see the current location mapped, so you will need to take him for a spin using the manual mode controls on the Xiaomi app so you can take it to every room and map all of it. After this procedure is done, return home and you will have a base map that will not change until if you don’t change the docking station location. If the map is messed up again, just return home and run the recreate map script again.
Now you can use the FloleVac app and get all zones coordinates with the new and correct map generated. Add them to your HA project and test it.
Don’t worry if the map gets messed up, just recreate the map and the coordinates will work just like before, since your docking station is on the same position (ZERO, ZERO coordinate) the vacuum will know were to go.
Here are my configs on a single package file:
sensor:
- platform: template
sensors:
xiaomi_battery_level:
entity_id: vacuum.aspirador
friendly_name: 'Bateria do aspirador'
value_template: '{{ states.vacuum.aspirador.attributes.battery_level | float | int }}'
unit_of_measurement: '%'
device_class: battery
switch:
- platform: template
switches:
aspirador:
friendly_name: "Aspirador"
value_template: "{% if is_state('vacuum.aspirador', 'cleaning') %}on{% else %}off{% endif %}"
turn_on:
service: input_select.select_option
entity_id: input_select.zonas_de_aspiracao
data_template:
option: "Casa toda"
turn_off:
service: vacuum.return_to_base
data:
entity_id: vacuum.aspirador
icon_template: mdi:robot-vacuum
input_select:
estados_de_succao:
name: 'Tipo de aspiração'
initial: Balanceado
options:
- Silencioso
- Balanceado
- Turbo
- Turbo máximo
- Pano úmido
zonas_de_aspiracao:
name: Qual a zona a aspirar?
options:
- Escolher zona
- Casa toda
- Sala inteira
- Tapete
- Mesa de jantar
- Entrada
- Cozinha
- Banheiro social
- Banheiro da suíte
- Quarto
- Suite
- Suíte mais banheiro
- Quartos e banheiros
- Somente piso
automation:
#Coloca o aspirador em modo silencioso
- alias: Aspirador - Modo de aspiração
trigger:
platform: state
entity_id: input_select.estados_de_succao
action:
- service_template: >
{% if trigger.to_state.state == 'Silencioso' %}
script.aspirador_set_quiet
{% elif trigger.to_state.state == 'Balanceado' %}
script.aspirador_set_balanced
{% elif trigger.to_state.state == 'Turbo' %}
script.aspirador_set_turbo
{% elif trigger.to_state.state == 'Turbo máximo' %}
script.aspirador_set_max
{% elif trigger.to_state.state == 'Pano úmido' %}
script.aspirador_set_mop
{% endif %}
#Escolher a zona a aspirar
- alias: Aspirador - Escolher a zona para aspirar
hide_entity: True
trigger:
platform: state
entity_id: input_select.zonas_de_aspiracao
from: 'Escolher zona'
action:
- service_template: >
{% if states.input_select.zonas_de_aspiracao.state == "Casa toda" %}
script.aspirador_zona_casa_toda
{% elif states.input_select.zonas_de_aspiracao.state == "Sala inteira" %}
script.aspirador_zona_sala_inteira
{% elif states.input_select.zonas_de_aspiracao.state == "Tapete" %}
script.aspirador_zona_tapete
{% elif states.input_select.zonas_de_aspiracao.state == "Mesa de jantar" %}
script.aspirador_zona_mesa_jantar
{% elif states.input_select.zonas_de_aspiracao.state == "Entrada" %}
script.aspirador_zona_entrada
{% elif states.input_select.zonas_de_aspiracao.state == "Cozinha" %}
script.aspirador_zona_cozinha
{% elif states.input_select.zonas_de_aspiracao.state == "Banheiro social" %}
script.aspirador_zona_banheiro_social
{% elif states.input_select.zonas_de_aspiracao.state == "Banheiro da suíte" %}
script.aspirador_zona_banheiro_suite
{% elif states.input_select.zonas_de_aspiracao.state == "Quarto" %}
script.aspirador_zona_quarto
{% elif states.input_select.zonas_de_aspiracao.state == "Suite" %}
script.aspirador_zona_suite
{% elif states.input_select.zonas_de_aspiracao.state == "Suíte mais banheiro" %}
script.aspirador_zona_suite_e_banheiro
{% elif states.input_select.zonas_de_aspiracao.state == "Quartos e banheiros" %}
script.aspirador_zona_quartos_e_banheiros
{% elif states.input_select.zonas_de_aspiracao.state == "Somente piso" %}
script.aspirador_zona_mop
{% else %}
{% endif %}
- delay: 00:01:00
- wait_template: "{{is_state('vacuum.aspirador', 'docked')}}"
- delay: 00:00:15
- service: input_select.select_option
entity_id: input_select.zonas_de_aspiracao
data_template:
option: "Escolher zona"
- service: input_select.select_option
entity_id: input_select.estados_de_succao
data_template:
option: "Turbo"
- alias: Aspirador - Avisar quando terminar
initial_state: True
trigger:
- platform: state
entity_id: vacuum.aspirador
to: 'paused'
for:
hours: 0
minutes: 0
seconds: 30
- platform: state
entity_id: vacuum.aspirador
to: 'docked'
- platform: state
entity_id: vacuum.aspirador
to: 'error'
action:
- service_template: >
{% if trigger.to_state.state == 'paused' %}
script.aspirador_alerta_parado
{% elif trigger.to_state.state == 'docked' %}
script.aspirador_alerta_carregando
{% elif trigger.to_state.state == 'error' %}
script.aspirador_alerta_erro
{% endif %}
script:
aspirador_set_quiet:
sequence:
service: vacuum.set_fan_speed
data:
entity_id: vacuum.aspirador
fan_speed: Quiet
aspirador_set_balanced:
sequence:
service: vacuum.set_fan_speed
data:
entity_id: vacuum.aspirador
fan_speed: Balanced
aspirador_set_turbo:
sequence:
service: vacuum.set_fan_speed
data:
entity_id: vacuum.aspirador
fan_speed: Turbo
aspirador_set_max:
sequence:
service: vacuum.set_fan_speed
data:
entity_id: vacuum.aspirador
fan_speed: Max
aspirador_set_mop:
sequence:
service: vacuum.set_fan_speed
data:
entity_id: vacuum.aspirador
fan_speed: 105
# Zonas
aspirador_zona_casa_toda:
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[17327,20045,27427,32995,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_sala_inteira:
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[23745,21949,25745,31299,1],[22491,25343,23741,27643,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_tapete:
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[23804,23551,25004,25301,2]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_mesa_jantar:
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[23573,26400,25823,28850,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_entrada:
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[23620,28957,24920,31307,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_cozinha:
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[18839,29577,23689,31177,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_banheiro_social:
sequence:
- service: input_select.select_option
entity_id: input_select.estados_de_succao
data:
option: Turbo
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[18885,25636,21185,26786,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_banheiro_suite:
sequence:
- service: input_select.select_option
entity_id: input_select.estados_de_succao
data:
option: Turbo
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[18815,24240,21115,25390,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_quarto:
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[18484,27011,21984,29461,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_suite:
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[18931,21286,22581,23936,1],[21250,23964,22100,25464,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_suite_e_banheiro:
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[18897,21234,22497,25434,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_quartos_e_banheiros:
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[18554,21238,22454,29338,1]]
- service: script.aspirador_alerta_iniciando
aspirador_zona_mop:
sequence:
- service: input_select.select_option
entity_id: input_select.estados_de_succao
data:
option: Pano úmido
- service: vacuum.send_command
data:
entity_id: vacuum.aspirador
command: app_zoned_clean
params: [[18554,21238,22454,29338,1],[22528,25448,25878,27598,1],[25164,22181,25814,25431,1],[18854,29557,24854,31407,1],[23607,27587,25857,29537,1]]
- service: script.aspirador_alerta_iniciando
aspirador_voltar_dock:
alias: Aspirador casa - Parar e voltar
sequence:
- service: vacuum.return_to_dock
entity_id: vacuum.aspirador
# Alertas
aspirador_alerta_iniciando:
alias: Aspirador casa - Iniciando
sequence:
- service: notify.TUDO
data_template:
title: "Alerta Casa"
message: "O aspirador iniciou a limpeza na zona: {{ states.input_select.zonas_de_aspiracao.state | lower }}."
- service: persistent_notification.create
data:
title: "Alerta Casa ({{now().strftime('%H:%M')}})"
message: "O aspirador iniciou a limpeza na zona: {{ states.input_select.zonas_de_aspiracao.state | lower }}"
- condition: state
entity_id: input_boolean.boa_noite
state: 'off'
- service: media_player.volume_set
entity_id: media_player.sala, media_player.suite
data:
volume_level: 0.7
- service: tts.amazon_polly_say
entity_id: media_player.sala, media_player.suite
data_template:
message: <speak><amazon:auto-breaths frequency='medium'>E lá vai ele... Iniciando a limpeza na zona {{ states.input_select.zonas_de_aspiracao.state | lower }}.</amazon:auto-breaths></speak>
aspirador_alerta_parado:
alias: Aspirador casa - Parado
sequence:
- service: notify.TUDO
data_template:
title: "Alerta Casa"
message: "O aspirador parou. Estava limpando a zona: {{ states.input_select.zonas_de_aspiracao.state | lower }}. {% if 'error' in states.vacuum.aspirador.state %}Código de erro: {{ states.vacuum.aspirador.attributes.error }}.{% else %}{% endif %}"
- service: persistent_notification.create
data:
title: "Alerta Casa ({{now().strftime('%H:%M')}})"
message: "O aspirador parou. Estava limpando a zona: {{ states.input_select.zonas_de_aspiracao.state | lower }}. {% if 'error' in states.vacuum.aspirador.state %}Código de erro: {{ states.vacuum.aspirador.attributes.error }}.{% else %}{% endif %}"
- condition: state
entity_id: input_boolean.boa_noite
state: 'off'
- service: media_player.volume_set
entity_id: media_player.sala, media_player.suite
data:
volume_level: 0.7
- service: tts.amazon_polly_say
entity_id: media_player.sala, media_player.suite
data_template:
message: <speak><amazon:auto-breaths frequency='medium'>O aspirador parou limpando a zona {{ states.input_select.zonas_de_aspiracao.state | lower }}. {% if 'error' in states.vacuum.aspirador.state %}Código de erro é {{ states.vacuum.aspirador.attributes.error }}.{% else %}{% endif %}</amazon:auto-breaths></speak>
aspirador_alerta_carregando:
alias: Aspirador casa - Voltou para casa
sequence:
- condition: template
value_template: "{% if is_state('input_select.zonas_de_aspiracao', 'Escolher zona') %}False{% else %}True{% endif %}"
- service: notify.TUDO
data_template:
title: "Alerta Casa"
message: "O aspirador terminou seu trabalho na zona {{ states.input_select.zonas_de_aspiracao.state | lower }}. Limpou cerca de {{ states.vacuum.aspirador.attributes.cleaned_area }} metros quadrados durante {{ states.vacuum.aspirador.attributes.cleaning_time }} minutos e está carregando no momento."
- service: persistent_notification.create
data:
title: "Alerta Casa ({{now().strftime('%H:%M')}})"
message: "O aspirador terminou seu trabalho na zona {{ states.input_select.zonas_de_aspiracao.state | lower }}. Limpou cerca de {{ states.vacuum.aspirador.attributes.cleaned_area }} metros quadrados durante {{ states.vacuum.aspirador.attributes.cleaning_time }} minutos e está carregando no momento."
- condition: state
entity_id: input_boolean.boa_noite
state: 'off'
- service: media_player.volume_set
entity_id: media_player.sala, media_player.suite
data:
volume_level: 0.7
- service: tts.amazon_polly_say
entity_id: media_player.sala, media_player.suite
data_template:
message: <speak><amazon:auto-breaths frequency='medium'>Olha quem está de volta! O aspirador terminou seu trabalho na zona {{ states.input_select.zonas_de_aspiracao.state | lower }}. Limpou cerca de {{ states.vacuum.aspirador.attributes.cleaned_area }} metros quadrados durante {{ states.vacuum.aspirador.attributes.cleaning_time }} minutos e está carregando no momento.</amazon:auto-breaths></speak>
aspirador_alerta_erro:
alias: Aspirador casa - Erro
sequence:
- service: notify.TUDO
data_template:
title: "Alerta Casa"
message: "O aspirador está parado e acusou erro limpando a zona {{ states.input_select.zonas_de_aspiracao.state | lower }}."
- service: persistent_notification.create
data:
title: "Alerta Casa ({{now().strftime('%H:%M')}})"
message: "O aspirador está parado e acusou erro limpando a zona {{ states.input_select.zonas_de_aspiracao.state | lower }}."
- condition: state
entity_id: input_boolean.boa_noite
state: 'off'
- service: media_player.volume_set
entity_id: media_player.sala, media_player.suite
data:
volume_level: 0.7
- service: media_player.play_media
data:
entity_id: media_player.sala, media_player.suite
media_content_id: 'https://DDNS/local/audio/tts/alerta_aspirador_parado_erro.mp3'
media_content_type: 'audio/mp3'
# HomeKit scripts
aspirador_homekit_zona_toda_casa:
alias: Aspirador casa - Aspirar zona casa toda
sequence:
- service: input_select.select_option
entity_id: input_select.zonas_de_aspiracao
data_template:
option: "Casa toda"
- delay: 00:00:10
aspirador_homekit_zona_sala:
alias: Aspirador casa - Aspirar zona sala inteira
sequence:
- service: input_select.select_option
entity_id: input_select.zonas_de_aspiracao
data_template:
option: "Sala inteira"
- delay: 00:00:10
aspirador_homekit_zona_mesa_jantar:
alias: Aspirador casa - Aspirar zona mesa de jantar
sequence:
- service: input_select.select_option
entity_id: input_select.zonas_de_aspiracao
data_template:
option: "Mesa de jantar"
- delay: 00:00:10
aspirador_homekit_zona_tapete:
alias: Aspirador casa - Aspirar zona tapete
sequence:
- service: input_select.select_option
entity_id: input_select.zonas_de_aspiracao
data_template:
option: "Tapete"
- delay: 00:00:10
aspirador_homekit_zona_entrada:
alias: Aspirador casa - Aspirar zona entrada
sequence:
- service: input_select.select_option
entity_id: input_select.zonas_de_aspiracao
data_template:
option: "Entrada"
- delay: 00:00:10
aspirador_homekit_zona_cozinha:
alias: Aspirador casa - Aspirar zona cozinha
sequence:
- service: input_select.select_option
entity_id: input_select.zonas_de_aspiracao
data_template:
option: "Cozinha"
- delay: 00:00:10
aspirador_homekit_zona_quartos:
alias: Aspirador casa - Aspirar zona quartos e banheiros
sequence:
- service: input_select.select_option
entity_id: input_select.zonas_de_aspiracao
data_template:
option: "Quartos e banheiros"
- delay: 00:00:10
aspirador_homekit_zona_mop:
alias: Aspirador casa - Aspirar zona somente piso
sequence:
- service: input_select.select_option
entity_id: input_select.zonas_de_aspiracao
data_template:
option: "Somente piso"
- delay: 00:00:10
# Outros
aspirador_recriar_mapa:
alias: Aspirador casa - Recriar mapa
sequence:
- service: vacuum.start
entity_id: vacuum.aspirador
- delay: 00:00:08
- service: vacuum.stop
entity_id: vacuum.aspirador
- delay: 00:00:02
- service: vacuum.return_to_base
entity_id: vacuum.aspirador
# Customize
homeassistant:
customize:
switch.aspirador:
icon: mdi:robot-vacuum
input_select.estados_de_succao:
icon: mdi:speedometer
input_select.zonas_de_aspiracao:
icon: mdi:map-marker
input_number.aspirador_passadas:
icon: mdi:shuffle-disabled
script.aspirador_recriar_mapa:
icon: mdi:home-map-marker
This is my current UI:
Here is the lovelace config:
- type: entities
title: Aspirador
show_header_toggle: false
entities:
- entity: vacuum.aspirador
secondary_info: last-changed
- sensor.xiaomi_battery_level
- entity: script.aspirador_recriar_mapa
name: Recriar mapa
- input_select.estados_de_succao
- input_select.zonas_de_aspiracao
- type: custom:entity-attributes-card
entity: vacuum.aspirador
heading_name: Status
heading_state: Valor
filter:
include:
- key: vacuum.aspirador.cleaning_time
name: Tempo limpando (último)
unit: minutos
- key: vacuum.aspirador.cleaned_area
name: Área limpa (último)
unit: metros
- key: vacuum.aspirador.main_brush_left
name: Escova principal
unit: horas
- key: vacuum.aspirador.side_brush_left
name: Escova lateral
unit: horas
- key: vacuum.aspirador.filter_left
name: Filtro
unit: horas
- key: vacuum.aspirador.sensor_dirty_left
name: Sensores
unit: horas
It has been months now without any problems with zone cleaning. If I need to clean it up by removing the vacuum manually from the dock, I just need to recreate the map using the script and all works just fine.
And yes, some of these scripts has more than one zone on the same command, works just fine.
Sorry that everything is in portuguese, I hope you can understand the main idea here.
Hope it helps!