Replies: 2 comments
-
Unfortunately if you want to manually configure tiles for every preset then you have to configure it separately for every preset. The one thing you can do is to use yaml anchors, but if you use graphical UI editor then it will be replaced by the code anyway. Example: type: custom:xiaomi-vacuum-map-card
preset_name: 1 этаж
map_source:
camera: camera.kuzya_map
activate_on_switch: true
activate:
service: dreame_vacuum.vacuum_select_map
target:
entity_id: vacuum.kuzya
service_data:
map_id: 1
calibration_source:
camera: true
entity: vacuum.kuzya
vacuum_platform: Tasshack/dreame-vacuum
map_modes:
- template: vacuum_clean_zone
- template: vacuum_clean_zone_predefined
predefined_selections:
- zones:
- - -333
- -4896
- 1008
- -1329
label:
text: Кухня
x: 275
"y": -2587
offset_y: 35
icon:
name: mdi:pot-mix
x: 275
"y": -2587
- zones:
- - 7466
- -4920
- 8863
- -2436
label:
text: Прихожая
x: 8200
"y": -3862
offset_y: 35
icon:
name: mdi:walk
x: 8200
"y": -3862
variables: {}
- name: Точечная уборка
icon: mdi:map-marker-plus
run_immediately: false
coordinates_rounding: true
coordinates_to_meters_divider: 1000
selection_type: MANUAL_POINT
max_selections: 999
repeats_type: EXTERNAL
max_repeats: 3
service_call_schema:
service: dreame_vacuum.vacuum_clean_spot
service_data:
points: "[[selection]]"
repeats: "[[repeats]]"
entity_id: "[[entity_id]]"
predefined_selections: []
variables: {}
- name: Уборка комнат
icon: mdi:floor-plan
run_immediately: false
coordinates_rounding: true
coordinates_to_meters_divider: 1000
selection_type: ROOM
max_selections: 60
repeats_type: EXTERNAL
max_repeats: 3
service_call_schema:
service: dreame_vacuum.vacuum_clean_segment
service_data:
segments: "[[selection]]"
repeats: "[[repeats]]"
entity_id: "[[entity_id]]"
predefined_selections:
- id: "1"
icon:
name: mdi:home-outline
x: 1450
"y": -800
label:
text: Гостиная
x: 1450
"y": -800
offset_y: 35
outline:
- - -750
- -4800
- - 3150
- -4800
- - 3150
- 1050
- - -750
- 1050
- id: "2"
icon:
name: mdi:home-outline
x: 5450
"y": -1900
label:
text: Коридор
x: 5450
"y": -1900
offset_y: 35
outline:
- - 1900
- -4850
- - 9300
- -4850
- - 9300
- 1000
- - 1900
- 1000
- id: "3"
icon:
name: mdi:home-outline
x: 1000
"y": -6850
label:
text: Кабинет
x: 1000
"y": -6850
offset_y: 35
outline:
- - -650
- -9250
- - 2800
- -9250
- - 2800
- -4850
- - -650
- -4850
- id: "4"
icon:
name: mdi:home-outline
x: 7800
"y": -700
label:
text: Ванная комната
x: 7800
"y": -700
offset_y: 35
outline:
- - 6550
- -2150
- - 8850
- -2150
- - 8850
- 650
- - 6550
- 650
variables: {}
icons: *icons
- icon: mdi:play
conditions:
- entity: vacuum.kuzya
value_not: cleaning
- entity: vacuum.kuzya
value_not: error
- entity: vacuum.kuzya
value_not: returning
tooltip: Start
tap_action:
action: call-service
service: vacuum.start
service_data:
entity_id: vacuum.kuzya
- icon: mdi:pause
conditions:
- entity: vacuum.kuzya
value_not: docked
- entity: vacuum.kuzya
value_not: idle
- entity: vacuum.kuzya
value_not: error
- entity: vacuum.kuzya
value_not: paused
tooltip: Pause
tap_action:
action: call-service
service: vacuum.pause
service_data:
entity_id: vacuum.kuzya
- icon: mdi:stop
conditions:
- entity: vacuum.kuzya
value_not: docked
- entity: vacuum.kuzya
value_not: idle
- entity: vacuum.kuzya
value_not: error
- entity: vacuum.kuzya
value_not: paused
tooltip: Stop
tap_action:
action: call-service
service: vacuum.stop
service_data:
entity_id: vacuum.kuzya
- icon: mdi:home-map-marker
conditions:
- entity: vacuum.kuzya
value_not: docked
- entity: vacuum.kuzya
value_not: returning
tooltip: Return to base
tap_action:
action: call-service
service: vacuum.return_to_base
service_data:
entity_id: vacuum.kuzya
- icon: mdi:map-marker
tooltip: Locate
tap_action:
action: call-service
service: vacuum.locate
service_data:
entity_id: vacuum.kuzya
- menu_id: fan_speed
icon: mdi:fan-remove
label: Тихий
conditions:
- entity: vacuum.kuzya
attribute: fan_speed
value: Silent
tooltip: Change fan speed
tap_action:
action: call-service
service: vacuum.set_fan_speed
service_data:
entity_id: vacuum.kuzya
fan_speed: Silent
- menu_id: fan_speed
icon: mdi:fan-speed-1
label: Стандарт
conditions:
- entity: vacuum.kuzya
attribute: fan_speed
value: Standard
tooltip: Change fan speed
tap_action:
action: call-service
service: vacuum.set_fan_speed
service_data:
entity_id: vacuum.kuzya
fan_speed: Standard
- menu_id: fan_speed
icon: mdi:fan-speed-2
label: Сильный
conditions:
- entity: vacuum.kuzya
attribute: fan_speed
value: Strong
tooltip: Change fan speed
tap_action:
action: call-service
service: vacuum.set_fan_speed
service_data:
entity_id: vacuum.kuzya
fan_speed: Strong
- menu_id: fan_speed
icon: mdi:fan-speed-3
label: Турбо
conditions:
- entity: vacuum.kuzya
attribute: fan_speed
value: Turbo
tooltip: Change fan speed
tap_action:
action: call-service
service: vacuum.set_fan_speed
service_data:
entity_id: vacuum.kuzya
fan_speed: Turbo
- icon: mdi:fan-alert
conditions:
- entity: vacuum.kuzya
attribute: fan_speed
value_not: Silent
- entity: vacuum.kuzya
attribute: fan_speed
value_not: Standard
- entity: vacuum.kuzya
attribute: fan_speed
value_not: Strong
- entity: vacuum.kuzya
attribute: fan_speed
value_not: Turbo
tooltip: Change fan speed
tap_action:
action: call-service
service: vacuum.set_fan_speed
service_data:
entity_id: vacuum.kuzya
fan_speed: Silent
tiles: *tiles
- tile_id: status
entity: vacuum.kuzya
label: Статус
attribute: status
icon: mdi:robot-vacuum
translations:
sleeping: Сон
starting: Уборка
charger disconnected: Зарядка отключена
idle: Простаивает
remote control active: Дистанционное управление
cleaning: Очистка
returning home: Возврат на базу
returning: Возврат на базу
manual mode: Ручной режим
charging: Зарядка
charging problem: Проблема зарядки
paused: Пауза
spot cleaning: Точечная очистка
error: Ошибка
shutting down: Отключение
updating: Обновление
docking: Парковка
going to target: Перемещение к цели
zone cleaning: Очистка зоны
segment cleaning: Уборка комнаты
emptying the bin: Очистка лотка
charging complete: Зарядка завершена
device offline: Устройство отключено
- tile_id: drying_progress
entity: vacuum.kuzya
label: Сушка
attribute: drying_progress
icon: mdi:progress-wrench
unit: "%"
- tile_id: battery_level
entity: vacuum.kuzya
label: Уровень заряда
attribute: battery_level
icon_source: vacuum.kuzya.attributes.battery_icon
unit: "%"
- tile_id: fan_speed
entity: vacuum.kuzya
label: Мощность всасывания
attribute: fan_speed
icon: mdi:fan
translations:
silent: Тихая
standard: Стандарт
medium: Средняя
turbo: Турбо
auto: Auto
gentle: Gentle
- tile_id: mop_pad_humidity
attribute: mop_pad_humidity
label: Влажность мопов
icon: mdi:water-percent
entity: vacuum.kuzya
precision: 0
translations:
moist: Влажные
slightly dry: Почти сухие
- tile_id: cleaned_area
attribute: cleaned_area
label: Площадь уборки
icon: mdi:ruler-square
unit: м²
entity: vacuum.kuzya
precision: 0
translations: {}
- tile_id: cleaning_time
attribute: cleaning_time
label: Время уборки
icon: mdi:timer-sand
unit: мин
entity: vacuum.kuzya
precision: 0
translations: {}
- tile_id: cleaning_count
attribute: cleaning_count
label: Количество уборок
icon: mdi:counter
unit: x
entity: vacuum.kuzya
precision: 0
translations: {}
- tile_id: total_cleaned_area
attribute: total_cleaned_area
label: Всего убрано
icon: mdi:set-square
unit: м²
entity: vacuum.kuzya
precision: 0
translations: {}
- tile_id: main_brush_left
entity: vacuum.kuzya
label: Основная щетка
attribute: main_brush_left
icon: mdi:progress-wrench
unit: "%"
- tile_id: side_brush_left
entity: vacuum.kuzya
label: Боковая щетка
attribute: side_brush_left
icon: mdi:progress-wrench
unit: "%"
- tile_id: filter_left
entity: vacuum.kuzya
label: Фильтр
attribute: filter_left
icon: mdi:progress-wrench
unit: "%"
- tile_id: mop_pad_left
entity: vacuum.kuzya
label: Мопы
attribute: mop_pad_left
icon: mdi:progress-wrench
unit: "%"
additional_presets:
- preset_name: 2 Этаж
entity: vacuum.kuzya
activate_on_switch: true
activate:
service: dreame_vacuum.vacuum_select_map
target:
entity_id: vacuum.kuzya
service_data:
map_id: 12
calibration_source:
camera: true
map_source:
camera: camera.kuzya_map
tiles: &tiles
map_modes:
- template: vacuum_clean_zone
- name: Точечная уборка
icon: mdi:map-marker-plus
run_immediately: false
coordinates_rounding: true
coordinates_to_meters_divider: 1000
selection_type: MANUAL_POINT
max_selections: 999
repeats_type: EXTERNAL
max_repeats: 3
service_call_schema:
service: dreame_vacuum.vacuum_clean_spot
service_data:
points: "[[selection]]"
repeats: "[[repeats]]"
entity_id: "[[entity_id]]"
predefined_selections: []
variables: {}
- name: Уборка комнат
icon: mdi:floor-plan
run_immediately: false
coordinates_rounding: true
coordinates_to_meters_divider: 1000
selection_type: ROOM
max_selections: 60
repeats_type: EXTERNAL
max_repeats: 3
service_call_schema:
service: dreame_vacuum.vacuum_clean_segment
service_data:
segments: "[[selection]]"
repeats: "[[repeats]]"
entity_id: "[[entity_id]]"
predefined_selections:
- id: "1"
icon:
name: mdi:home-outline
x: -600
"y": 2950
label:
text: Гардероб
x: -600
"y": 2950
offset_y: 35
outline:
- - -1450
- 800
- - 250
- 800
- - 250
- 5100
- - -1450
- 5100
- id: "2"
icon:
name: mdi:home-outline
x: -3050
"y": 1350
label:
text: Спальня Оксана
x: -3050
"y": 1350
offset_y: 35
outline:
- - -4750
- -800
- - -1450
- -800
- - -1450
- 5100
- - -4750
- 5100
- id: "3"
icon:
name: mdi:home-outline
x: 3600
"y": 2650
label:
text: Ванная
x: 3600
"y": 2650
offset_y: 35
outline:
- - 2400
- 1150
- - 4600
- 1150
- - 4600
- 4000
- - 2400
- 4000
- id: "4"
icon:
name: mdi:home-outline
x: -2450
"y": -3300
label:
text: Спальня Вячеслава
x: -2450
"y": -3300
offset_y: 35
outline:
- - -4800
- -5250
- - -150
- -5250
- - -150
- -1050
- - -4800
- -1050
- id: "5"
icon:
name: mdi:home-outline
x: 2500
"y": -3050
label:
text: Спальня Александры
x: 2500
"y": -3050
offset_y: 35
outline:
- - 400
- -5250
- - 4700
- -5250
- - 4700
- -700
- - 400
- -700
- id: "6"
icon:
name: mdi:home-outline
x: 3500
"y": 100
label:
text: Прачечная
x: 3500
"y": 100
offset_y: 35
outline:
- - 2350
- -1200
- - 4700
- -1200
- - 4700
- 1200
- - 2350
- 1200
- id: "7"
icon:
name: mdi:home-outline
x: 1350
"y": 2000
label:
text: Коридор 2 этажа
x: 1350
"y": 2000
offset_y: 35
outline:
- - -1500
- -1050
- - 2450
- -1050
- - 2450
- 5000
- - -1500
- 5000
variables: {}
- preset_name: Подвал
entity: vacuum.kuzya
activate_on_switch: true
activate:
service: dreame_vacuum.vacuum_select_map
target:
entity_id: vacuum.kuzya
service_data:
map_id: 25
calibration_source:
camera: true
map_source:
camera: camera.kuzya_map
tiles: &tiles
map_modes:
- template: vacuum_clean_zone
- name: Точечная уборка
icon: mdi:map-marker-plus
run_immediately: false
coordinates_rounding: true
coordinates_to_meters_divider: 1000
selection_type: MANUAL_POINT
max_selections: 999
repeats_type: EXTERNAL
max_repeats: 3
service_call_schema:
service: dreame_vacuum.vacuum_clean_spot
service_data:
points: "[[selection]]"
repeats: "[[repeats]]"
entity_id: "[[entity_id]]"
predefined_selections: []
variables: {}
- name: Уборка комнат
icon: mdi:floor-plan
run_immediately: false
coordinates_rounding: true
coordinates_to_meters_divider: 1000
selection_type: ROOM
max_selections: 60
repeats_type: EXTERNAL
max_repeats: 3
service_call_schema:
service: dreame_vacuum.vacuum_clean_segment
service_data:
segments: "[[selection]]"
repeats: "[[repeats]]"
entity_id: "[[entity_id]]"
predefined_selections:
- id: "1"
icon:
name: mdi:home-outline
x: 1900
"y": -1550
label:
text: Кинозал
x: 1900
"y": -1550
offset_y: 35
outline:
- - -650
- -3550
- - 5100
- -3550
- - 5100
- 2500
- - -650
- 2500
variables: {}
card_mod:
style: |
ha-card {
display: flex !important;
align-items: stretch;
flex-wrap: wrap;
justify-content: space-evenly;
}
.map-wrapper {
flex-grow: 3;
width: 300px;
}
.controls-wrapper {
flex-grow: 1;
width: 500px;
}
map_locked: true |
Beta Was this translation helpful? Give feedback.
0 replies
-
@PiotrMachowski |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. How to make one set of tiles for several floors in one vacuum cleaner? It is very inconvenient to duplicate tiles in different sets of maps every time. I tried to implement such a configuration. But in this case, the tiles are randomly generated.
Beta Was this translation helpful? Give feedback.
All reactions