├── eng ├── www │ └── roidmi-eve-plus.jpg ├── secrets.yaml ├── ui-lovelace.yaml └── packages │ └── xiaomi_vacuum.yaml ├── rus ├── www │ └── roidmi-eve-plus.jpg ├── secrets.yaml ├── packages │ ├── yandex_station.yaml │ └── xiaomi_vacuum.yaml └── ui-lovelace.yaml └── README.md /eng/www/roidmi-eve-plus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poisondima/Roidmi-EVE-Plus/HEAD/eng/www/roidmi-eve-plus.jpg -------------------------------------------------------------------------------- /rus/www/roidmi-eve-plus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poisondima/Roidmi-EVE-Plus/HEAD/rus/www/roidmi-eve-plus.jpg -------------------------------------------------------------------------------- /eng/secrets.yaml: -------------------------------------------------------------------------------- 1 | # Use this file to store secrets like usernames and passwords. 2 | # Learn more at https://home-assistant.io/docs/configuration/secrets/ 3 | 4 | #Xiaomi vacuum 5 | xiaomi_vacuum_host: Х.Х.Х.Х 6 | xiaomi_vacuum_token: 7a32***************255 7 | xiaomi_cloud_did: ХХХХХХХХХ 8 | 9 | #xiaomi_cloud_map_extractor for vacuum 10 | xiaomi_cloud_username: xxxxxx@gmail.com 11 | xiaomi_cloud_password: your_password_xiaomi_cloud 12 | -------------------------------------------------------------------------------- /rus/secrets.yaml: -------------------------------------------------------------------------------- 1 | # Используйте этот файл для хранения секретов, таких как имена пользователей и пароли. 2 | # Узнайте больше на https://home-assistant.io/docs/configuration/secrets/ 3 | 4 | #Xiaomi vacuum 5 | xiaomi_vacuum_host: Х.Х.Х.Х 6 | xiaomi_vacuum_token: 7a32***************255 7 | xiaomi_cloud_did: ХХХХХХХХХ 8 | 9 | #xiaomi_cloud_map_extractor for vacuum 10 | xiaomi_cloud_username: xxxxxx@gmail.com 11 | xiaomi_cloud_password: your_password_xiaomi_cloud 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Roidmi EVE Plus в Home Assistant 2 | ## Модель roidmi.vacuum.v60 3 | ### Русский мануал: 4 | **Минимальная версия HA должна быть 2022.7.X** 5 | 1. Для подключения пылесоса устанавливаем через HACS [Xiaomi Miot Auto](https://github.com/al-one/hass-xiaomi-miot). 6 | 2. Для визуального отображения карты устанавливаем через HACS [Xiaomi Cloud Map Extractor](https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor). 7 | 3. Если не использовали 'packages', то их нужно прописать в 'configuration.yaml'. [Мануал с официального сайта](https://www.home-assistant.io/docs/configuration/packages/) или [мой пример](https://github.com/poisondima/Roidmi-EVE-Plus/issues/3#issuecomment-1030576544). 8 | 4. Во всех скриптах и lovelace я использую имя объекта пылесоса `vacuum.vacuum_cleaner_robot_cleaner`, вам нужно **заменить на свое**. 9 | 5. Дальше можно использовать файлы настроек из папки `rus`. 10 | 11 | #### Управление уборкой по комнатам с помощью голоса через Алису: 12 | 1. Устанавливаем через HACS [Yandex Smart Home](https://docs.yaha-cloud.ru/v0.6.x/install/component/) и настраиваем подключение к Яндексу. 13 | 2. Устанавливаем через HACS [Yandex.Station](https://github.com/AlexxIT/YandexStation) и настраиваем подключение к Яндексу. 14 | 2. Переносим файл настроек из папки `rus\packages\yandex_station.yaml`. 15 | 3. Перезапускаем HA, должна пройти синхронизация с Яндексом. 16 | 4. Проверяем через [Веб-версию Квазар](https://yandex.ru/quasar/iot) или Мобильное приложение "Умный дом" появится новое устройство `Yandex Intents`, а во вкладке `Сценарии` должны появиться сценарии по уборки для каждой комнаты. 17 | 5. Дальше говорим Алисе: `Алиса, убери на кухне`. 18 | 19 | ### English manual: 20 | **The minimum HA version must be 2022.7.X** 21 | 1. To connect the vacuum cleaner install through HACS [Xiaomi Miot Auto](https://github.com/al-one/hass-xiaomi-miot). 22 | 2. To display the map visually, install through HACS [Xiaomi Cloud Map Extractor](https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor). 23 | 3. If you didn't use 'packages', you need to put them in 'configuration.yaml'. [Manual from official site](https://www.home-assistant.io/docs/configuration/packages/) or [my example](https://github.com/poisondima/Roidmi-EVE-Plus/issues/3#issuecomment-1030576544). 24 | 4. In all scripts and lovelace I use name of vacuum cleaner object `vacuum.vacuum_cleaner_robot_cleaner`, you need to **change it with yours**. 25 | 5. Further you can use files for settings from the `eng` folder. 26 | 27 | ![Roidmi-EVE-Plus_2022-10-06](https://user-images.githubusercontent.com/39500249/194393400-d733bd17-01e7-4614-84f4-5b97113fb6d7.png) 28 | -------------------------------------------------------------------------------- /rus/packages/yandex_station.yaml: -------------------------------------------------------------------------------- 1 | yandex_station: 2 | yandex_station: 3 | intents: 4 | Убери в коридоре: Слышь робот, давай быстро едь убирай в коридоре 5 | Убери в прихожей: Слышь робот, давай быстро едь убирай в прихожей 6 | Убери в зале: Слышь робот, давай быстро едь убирай в зале 7 | Убери в кабинете: Слышь робот, давай быстро едь убирай в кабинете 8 | Убери в спальне: Слышь робот, давай быстро едь убирай в спальне 9 | Убери на кухне: Слышь робот, давай быстро едь убирай на кухне 10 | 11 | yandex_smart_home: 12 | filter: # не забудьте добавить другие, важные для вас, устройства 13 | include_entities: 14 | # этот плеер отвечает за работу `intents` 15 | - media_player.yandex_intents 16 | 17 | automation: 18 | - alias: yandex_room_cleaner 19 | mode: single 20 | trigger: 21 | # room id 1 22 | - platform: event 23 | event_type: yandex_intent 24 | event_data: 25 | text: 'Убери в прихожей' 26 | id: 'в прихожей' 27 | # room id 2 28 | - platform: event 29 | event_type: yandex_intent 30 | event_data: 31 | text: 'Убери в зале' 32 | id: 'в зале' 33 | # room id 3 34 | - platform: event 35 | event_type: yandex_intent 36 | event_data: 37 | text: 'Убери в спальне' 38 | id: 'в спальне' 39 | # room id 4 40 | - platform: event 41 | event_type: yandex_intent 42 | event_data: 43 | text: 'Убери на кухне' 44 | id: 'на кухне' 45 | # room id 5 46 | - platform: event 47 | event_type: yandex_intent 48 | event_data: 49 | text: 'Убери в кабинете' 50 | id: 'в кабинете' 51 | # room id 6 52 | - platform: event 53 | event_type: yandex_intent 54 | event_data: 55 | text: 'Убери в коридоре' 56 | id: 'в коридоре' 57 | action: 58 | - service: script.turn_on 59 | entity_id: script.telegram_send_message 60 | data_template: 61 | variables: 62 | emoji: "\U0001F469" 63 | message: | 64 | {%- set text = trigger.id %} 65 | Алиса дала задание убрать {{text}} 66 | target: 67 | #- !secret telegram_bot_chat_id_poison 68 | - !secret telegram_bot_chat_id_sasha 69 | sound: "auto" 70 | - service: script.turn_on 71 | entity_id: script.vacuum_clean_select_room 72 | data_template: 73 | variables: 74 | rooms: | 75 | {%- set text = '' -%} 76 | {%- if (trigger.id == 'в прихожей') %}{%- set text = '1' %}{% endif %} 77 | {%- if (trigger.id == 'в зале') %}{%- set text = '2' %}{% endif %} 78 | {%- if (trigger.id == 'в спальне') %}{%- set text = '3' %}{% endif %} 79 | {%- if (trigger.id == 'на кухне') %}{%- set text = '4' %}{% endif %} 80 | {%- if (trigger.id == 'в кабинете') %}{%- set text = '5' %}{% endif %} 81 | {%- if (trigger.id == 'в коридоре') %}{%- set text = '6' %}{% endif %} 82 | {%- set text = '[2,"{\\"mapId\\":1661872392,\\"segmentId\\":[' + text + ']}"]' %} 83 | {{text}} 84 | -------------------------------------------------------------------------------- /rus/ui-lovelace.yaml: -------------------------------------------------------------------------------- 1 | title: 'Пылесос' 2 | #panel: true 3 | icon: mdi:robot-vacuum 4 | cards: 5 | - type: picture-elements 6 | title: 'Roidmi EVE Plus' 7 | image: '/local/roidmi-eve-plus.jpg' 8 | elements: 9 | - type: icon 10 | icon: mdi:play 11 | tap_action: 12 | action: call-service 13 | service: vacuum.start 14 | service_data: 15 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 16 | style: 17 | top: 95% 18 | left: 25% 19 | color: '#3090C7' 20 | - type: icon 21 | icon: mdi:pause 22 | tap_action: 23 | action: call-service 24 | service: vacuum.pause 25 | service_data: 26 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 27 | style: 28 | top: 95% 29 | left: 35% 30 | color: '#3090C7' 31 | - type: icon 32 | icon: mdi:stop 33 | tap_action: 34 | action: call-service 35 | service: vacuum.stop 36 | service_data: 37 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 38 | style: 39 | top: 95% 40 | left: 45% 41 | color: '#3090C7' 42 | - type: icon 43 | icon: mdi:home 44 | tap_action: 45 | action: call-service 46 | service: vacuum.return_to_base 47 | service_data: 48 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 49 | style: 50 | top: 95% 51 | left: 55% 52 | color: '#3090C7' 53 | - type: icon 54 | icon: mdi:crosshairs 55 | tap_action: 56 | action: call-service 57 | service: vacuum.clean_spot 58 | service_data: 59 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 60 | style: 61 | top: 95% 62 | left: 65% 63 | color: '#3090C7' 64 | - type: icon 65 | icon: mdi:bell-ring 66 | tap_action: 67 | action: call-service 68 | service: vacuum.locate 69 | service_data: 70 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 71 | style: 72 | top: 95% 73 | left: 75% 74 | color: '#3090C7' 75 | - type: state-label 76 | entity: sensor.vacuum_operation 77 | style: 78 | top: 8% 79 | left: 1% 80 | color: rgb(255, 255, 255) 81 | transform: translate(0%,-50%) 82 | pointer-events: none 83 | font-family: Trebuchet MS 84 | font-size: 90% 85 | font-weight: bold 86 | border-color: rgb(34, 154, 210) 87 | background-color: '#3090C7' 88 | border-radius: 6px 89 | - type: state-label 90 | entity: sensor.vacuum_accessories 91 | style: 92 | top: 8% 93 | right: 1% 94 | color: rgb(255, 255, 255) 95 | transform: translate(0%,-50%) 96 | pointer-events: none 97 | font-family: Trebuchet MS 98 | font-size: 90% 99 | font-weight: bold 100 | border-color: rgb(34, 154, 210) 101 | background-color: '#3090C7' 102 | border-radius: 6px 103 | - type: state-label 104 | entity: vacuum.vacuum_cleaner_robot_cleaner 105 | tap-action: 106 | action: more-info 107 | style: 108 | top: 10% 109 | right: 38% 110 | color: rgb(255, 255, 255) 111 | transform: translate(0%,-50%) 112 | font-family: Trebuchet MS 113 | font-size: 150% 114 | font-weight: bold 115 | border-color: rgb(34, 154, 210) 116 | border-radius: 6px 117 | background-color: '#cccccc' 118 | - type: state-label 119 | entity: sensor.vacuum_total_cleaned_area 120 | prefix: "Общая площадь: " 121 | style: 122 | top: 28% 123 | right: 1% 124 | color: '#000000' 125 | transform: translate(0%,-50%) 126 | pointer-events: none 127 | font-family: Trebuchet MS 128 | font-size: 76% 129 | font-weight: bold 130 | border-right-style: solid 131 | border-color: rgb(34, 154, 210) 132 | - type: state-label 133 | entity: sensor.vacuum_total_cleaning_time 134 | prefix: "Общее время: " 135 | style: 136 | top: 38% 137 | right: 1% 138 | color: '#000000' 139 | transform: translate(0%,-50%) 140 | pointer-events: none 141 | font-family: Trebuchet MS 142 | font-size: 76% 143 | font-weight: bold 144 | border-right-style: solid 145 | border-color: rgb(34, 154, 210) 146 | - type: state-label 147 | entity: sensor.vacuum_cleaned_area 148 | prefix: "Площадь: " 149 | style: 150 | top: 48% 151 | right: 1% 152 | color: '#000000' 153 | transform: translate(0%,-50%) 154 | pointer-events: none 155 | font-family: Trebuchet MS 156 | font-size: 76% 157 | font-weight: bold 158 | border-right-style: solid 159 | border-color: rgb(34, 154, 210) 160 | - type: state-label 161 | entity: sensor.vacuum_cleaning_time 162 | prefix: "Время: " 163 | style: 164 | top: 58% 165 | right: 1% 166 | color: '#000000' 167 | transform: translate(0%,-50%) 168 | pointer-events: none 169 | font-family: Trebuchet MS 170 | font-size: 76% 171 | font-weight: bold 172 | border-right-style: solid 173 | border-color: rgb(34, 154, 210) 174 | - type: state-label 175 | prefix: "Статус: " 176 | entity: sensor.vacuum_status_fix 177 | style: 178 | top: 28% 179 | left: 1% 180 | color: '#000000' 181 | transform: translate(0%,-50%) 182 | pointer-events: none 183 | font-family: Trebuchet MS 184 | font-size: 80% 185 | font-weight: bold 186 | border-left-style: solid 187 | border-color: '#3090C7' 188 | - type: state-label 189 | prefix: "Заряд: " 190 | entity: sensor.vacuum_cleaner_battery_level 191 | style: 192 | top: 38% 193 | left: 1% 194 | color: '#000000' 195 | transform: translate(0%,-50%) 196 | pointer-events: none 197 | font-family: Trebuchet MS 198 | font-size: 80% 199 | font-weight: bold 200 | border-left-style: solid 201 | border-color: rgb(34, 154, 210) 202 | - type: state-label 203 | prefix: "Скорость: " 204 | entity: sensor.vacuum_fan_speed 205 | style: 206 | top: 48% 207 | left: 1% 208 | color: '#000000' 209 | transform: translate(0%,-50%) 210 | pointer-events: none 211 | font-family: Trebuchet MS 212 | font-size: 80% 213 | font-weight: bold 214 | border-left-style: solid 215 | border-color: rgb(34, 154, 210) 216 | - type: state-label 217 | entity: sensor.vacuum_cleaning_count 218 | prefix: "Кол-во уборок: " 219 | style: 220 | top: 58% 221 | left: 1% 222 | color: '#000000' 223 | transform: translate(0%,-50%) 224 | pointer-events: none 225 | font-family: Trebuchet MS 226 | font-size: 80% 227 | font-weight: bold 228 | border-left-style: solid 229 | border-color: rgb(34, 154, 210) 230 | - type: vertical-stack 231 | cards: 232 | - type: picture-glance 233 | #title: 'Карта пылесоса' 234 | entities: [] 235 | camera_image: camera.xiaomi_cloud_map_extractor 236 | - type: entities 237 | entities: 238 | - entity: script.vacuum_download_map 239 | - type: entities 240 | title: 'Уборка комнат' 241 | show_header_toggle: false 242 | entities: 243 | - input_boolean.vacuum_room1 244 | - input_boolean.vacuum_room2 245 | - input_boolean.vacuum_room3 246 | - input_boolean.vacuum_room4 247 | - input_boolean.vacuum_room5 248 | - input_boolean.vacuum_room6 249 | - script.vacuum_start_clean 250 | - type: divider 251 | - script.vacuum_start_clean_all 252 | - type: entities 253 | title: 'Датчики пылесоса' 254 | show_header_toggle: false 255 | entities: 256 | # - sensor.vacuum_status 257 | - sensor.vacuum_status_fix 258 | - sensor.vacuum_fault 259 | - sensor.vacuum_sweep_mode 260 | - input_select.vacuum_mode 261 | - input_select.vacuum_sweep_type 262 | # - sensor.vacuum_cleaner_battery_level 263 | # - sensor.vacuum_cleaning_count 264 | # - sensor.vacuum_fan_speed 265 | - binary_sensor.vacuum_mop 266 | - input_select.vacuum_water_level 267 | - input_boolean.vacuum_double_clean 268 | - input_boolean.vacuum_edge_sweep 269 | - input_number.vacuum_volume 270 | - input_boolean.vacuum_mute 271 | - input_boolean.vacuum_lidar_collision 272 | - input_boolean.vacuum_led_switch 273 | - input_boolean.vacuum_auto_boost 274 | - sensor.vacuum_on 275 | # - sensor.vacuum_cleaned_area 276 | # - sensor.vacuum_cleaning_time 277 | # - sensor.vacuum_total_cleaned_area 278 | # - sensor.vacuum_total_cleaning_time 279 | - type: entities 280 | title: 'Датчики станции' 281 | show_header_toggle: false 282 | entities: 283 | - sensor.vacuum_charging_state 284 | - input_select.vacuum_work_station_freq 285 | - input_boolean.vacuum_station_key 286 | - input_boolean.vacuum_station_led 287 | - sensor.vacuum_station_type 288 | - type: entities 289 | title: 'Расходные материалы' 290 | show_header_toggle: false 291 | entities: 292 | - type: section 293 | label: 'Щетка снизу' 294 | - sensor.vacuum_cleaner_brush_life_level 295 | - sensor.vacuum_cleaner_brush_left_time 296 | - script.vacuum_reset_brush_life_level 297 | - type: section 298 | label: 'Боковая щетка' 299 | - sensor.vacuum_cleaner_brush_life_level_2 300 | - sensor.vacuum_cleaner_brush_left_time_2 301 | - script.vacuum_reset_brush_life_level_2 302 | - type: section 303 | label: 'Датчики' 304 | - sensor.vacuum_cleaner_brush_life_level_3 305 | - sensor.vacuum_cleaner_brush_left_time_3 306 | - script.vacuum_reset_brush_life_level_3 307 | - type: section 308 | label: 'Фильтр HEPA' 309 | - sensor.vacuum_cleaner_filter_life_level 310 | - sensor.vacuum_cleaner_filter_left_time 311 | - script.vacuum_reset_filter_life_level 312 | 313 | -------------------------------------------------------------------------------- /eng/ui-lovelace.yaml: -------------------------------------------------------------------------------- 1 | title: 'Vacuum cleaner' 2 | #panel: true 3 | icon: mdi:robot-vacuum 4 | cards: 5 | - type: picture-elements 6 | title: 'Roidmi EVE Plus' 7 | image: '/local/roidmi-eve-plus.jpg' 8 | elements: 9 | - type: icon 10 | icon: mdi:play 11 | tap_action: 12 | action: call-service 13 | service: vacuum.start 14 | service_data: 15 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 16 | style: 17 | top: 95% 18 | left: 25% 19 | color: '#3090C7' 20 | - type: icon 21 | icon: mdi:pause 22 | tap_action: 23 | action: call-service 24 | service: vacuum.pause 25 | service_data: 26 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 27 | style: 28 | top: 95% 29 | left: 35% 30 | color: '#3090C7' 31 | - type: icon 32 | icon: mdi:stop 33 | tap_action: 34 | action: call-service 35 | service: vacuum.stop 36 | service_data: 37 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 38 | style: 39 | top: 95% 40 | left: 45% 41 | color: '#3090C7' 42 | - type: icon 43 | icon: mdi:home 44 | tap_action: 45 | action: call-service 46 | service: vacuum.return_to_base 47 | service_data: 48 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 49 | style: 50 | top: 95% 51 | left: 55% 52 | color: '#3090C7' 53 | - type: icon 54 | icon: mdi:crosshairs 55 | tap_action: 56 | action: call-service 57 | service: vacuum.clean_spot 58 | service_data: 59 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 60 | style: 61 | top: 95% 62 | left: 65% 63 | color: '#3090C7' 64 | - type: icon 65 | icon: mdi:bell-ring 66 | tap_action: 67 | action: call-service 68 | service: vacuum.locate 69 | service_data: 70 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 71 | style: 72 | top: 95% 73 | left: 75% 74 | color: '#3090C7' 75 | - type: state-label 76 | entity: sensor.vacuum_operation 77 | style: 78 | top: 8% 79 | left: 1% 80 | color: rgb(255, 255, 255) 81 | transform: translate(0%,-50%) 82 | pointer-events: none 83 | font-family: Trebuchet MS 84 | font-size: 90% 85 | font-weight: bold 86 | border-color: rgb(34, 154, 210) 87 | background-color: '#3090C7' 88 | border-radius: 6px 89 | - type: state-label 90 | entity: sensor.vacuum_accessories 91 | style: 92 | top: 8% 93 | right: 1% 94 | color: rgb(255, 255, 255) 95 | transform: translate(0%,-50%) 96 | pointer-events: none 97 | font-family: Trebuchet MS 98 | font-size: 90% 99 | font-weight: bold 100 | border-color: rgb(34, 154, 210) 101 | background-color: '#3090C7' 102 | border-radius: 6px 103 | - type: state-label 104 | entity: vacuum.vacuum_cleaner_robot_cleaner 105 | tap-action: 106 | action: more-info 107 | style: 108 | top: 10% 109 | right: 38% 110 | color: rgb(255, 255, 255) 111 | transform: translate(0%,-50%) 112 | font-family: Trebuchet MS 113 | font-size: 150% 114 | font-weight: bold 115 | border-color: rgb(34, 154, 210) 116 | border-radius: 6px 117 | background-color: '#cccccc' 118 | - type: state-label 119 | entity: sensor.vacuum_total_cleaned_area 120 | prefix: "Total area: " 121 | style: 122 | top: 28% 123 | right: 1% 124 | color: '#000000' 125 | transform: translate(0%,-50%) 126 | pointer-events: none 127 | font-family: Trebuchet MS 128 | font-size: 76% 129 | font-weight: bold 130 | border-right-style: solid 131 | border-color: rgb(34, 154, 210) 132 | - type: state-label 133 | entity: sensor.vacuum_total_cleaning_time 134 | prefix: "Total time: " 135 | style: 136 | top: 38% 137 | right: 1% 138 | color: '#000000' 139 | transform: translate(0%,-50%) 140 | pointer-events: none 141 | font-family: Trebuchet MS 142 | font-size: 76% 143 | font-weight: bold 144 | border-right-style: solid 145 | border-color: rgb(34, 154, 210) 146 | - type: state-label 147 | entity: sensor.vacuum_cleaned_area 148 | prefix: "Area: " 149 | style: 150 | top: 48% 151 | right: 1% 152 | color: '#000000' 153 | transform: translate(0%,-50%) 154 | pointer-events: none 155 | font-family: Trebuchet MS 156 | font-size: 76% 157 | font-weight: bold 158 | border-right-style: solid 159 | border-color: rgb(34, 154, 210) 160 | - type: state-label 161 | entity: sensor.vacuum_cleaning_time 162 | prefix: "Time: " 163 | style: 164 | top: 58% 165 | right: 1% 166 | color: '#000000' 167 | transform: translate(0%,-50%) 168 | pointer-events: none 169 | font-family: Trebuchet MS 170 | font-size: 76% 171 | font-weight: bold 172 | border-right-style: solid 173 | border-color: rgb(34, 154, 210) 174 | - type: state-label 175 | prefix: "Status: " 176 | entity: sensor.vacuum_status_fix 177 | style: 178 | top: 28% 179 | left: 1% 180 | color: '#000000' 181 | transform: translate(0%,-50%) 182 | pointer-events: none 183 | font-family: Trebuchet MS 184 | font-size: 80% 185 | font-weight: bold 186 | border-left-style: solid 187 | border-color: '#3090C7' 188 | - type: state-label 189 | prefix: "Charge: " 190 | entity: sensor.vacuum_cleaner_battery_level 191 | style: 192 | top: 38% 193 | left: 1% 194 | color: '#000000' 195 | transform: translate(0%,-50%) 196 | pointer-events: none 197 | font-family: Trebuchet MS 198 | font-size: 80% 199 | font-weight: bold 200 | border-left-style: solid 201 | border-color: rgb(34, 154, 210) 202 | - type: state-label 203 | prefix: "Speed: " 204 | entity: sensor.vacuum_fan_speed 205 | style: 206 | top: 48% 207 | left: 1% 208 | color: '#000000' 209 | transform: translate(0%,-50%) 210 | pointer-events: none 211 | font-family: Trebuchet MS 212 | font-size: 80% 213 | font-weight: bold 214 | border-left-style: solid 215 | border-color: rgb(34, 154, 210) 216 | - type: state-label 217 | entity: sensor.vacuum_cleaning_count 218 | prefix: "Cleaning number: " 219 | style: 220 | top: 58% 221 | left: 1% 222 | color: '#000000' 223 | transform: translate(0%,-50%) 224 | pointer-events: none 225 | font-family: Trebuchet MS 226 | font-size: 80% 227 | font-weight: bold 228 | border-left-style: solid 229 | border-color: rgb(34, 154, 210) 230 | - type: vertical-stack 231 | cards: 232 | - type: picture-glance 233 | #title: 'Vacuum cleaner map' 234 | entities: [] 235 | camera_image: camera.xiaomi_cloud_map_extractor 236 | - type: entities 237 | entities: 238 | - entity: script.vacuum_download_map 239 | - type: entities 240 | title: 'Room cleaning' 241 | show_header_toggle: false 242 | entities: 243 | - input_boolean.vacuum_room1 244 | - input_boolean.vacuum_room2 245 | - input_boolean.vacuum_room3 246 | - input_boolean.vacuum_room4 247 | - input_boolean.vacuum_room5 248 | - input_boolean.vacuum_room6 249 | - script.vacuum_start_clean 250 | - type: divider 251 | - script.vacuum_start_clean_all 252 | - type: entities 253 | title: 'Vacuum cleaner sensors' 254 | show_header_toggle: false 255 | entities: 256 | # - sensor.vacuum_status 257 | - sensor.vacuum_status_fix 258 | - sensor.vacuum_fault 259 | - sensor.vacuum_sweep_mode 260 | - input_select.vacuum_mode 261 | - input_select.vacuum_sweep_type 262 | # - sensor.vacuum_cleaner_battery_level 263 | # - sensor.vacuum_cleaning_count 264 | # - sensor.vacuum_fan_speed 265 | - binary_sensor.vacuum_mop 266 | - input_select.vacuum_water_level 267 | - input_boolean.vacuum_double_clean 268 | - input_boolean.vacuum_edge_sweep 269 | - input_number.vacuum_volume 270 | - input_boolean.vacuum_mute 271 | - input_boolean.vacuum_lidar_collision 272 | - input_boolean.vacuum_led_switch 273 | - input_boolean.vacuum_auto_boost 274 | - sensor.vacuum_on 275 | # - sensor.vacuum_cleaned_area 276 | # - sensor.vacuum_cleaning_time 277 | # - sensor.vacuum_total_cleaned_area 278 | # - sensor.vacuum_total_cleaning_time 279 | - type: entities 280 | title: 'Station sensors' 281 | show_header_toggle: false 282 | entities: 283 | - sensor.vacuum_charging_state 284 | - input_select.vacuum_work_station_freq 285 | - input_boolean.vacuum_station_key 286 | - input_boolean.vacuum_station_led 287 | - sensor.vacuum_station_type 288 | - type: entities 289 | title: 'Expendable materials' 290 | show_header_toggle: false 291 | entities: 292 | - type: section 293 | label: 'Brush from below' 294 | - sensor.vacuum_cleaner_brush_life_level 295 | - sensor.vacuum_cleaner_brush_left_time 296 | - script.vacuum_reset_brush_life_level 297 | - type: section 298 | label: 'Side brush' 299 | - sensor.vacuum_cleaner_brush_life_level_2 300 | - sensor.vacuum_cleaner_brush_left_time_2 301 | - script.vacuum_reset_brush_life_level_2 302 | - type: section 303 | label: 'Sensors' 304 | - sensor.vacuum_cleaner_brush_life_level_3 305 | - sensor.vacuum_cleaner_brush_left_time_3 306 | - script.vacuum_reset_brush_life_level_3 307 | - type: section 308 | label: 'HEPA filter' 309 | - sensor.vacuum_cleaner_filter_life_level 310 | - sensor.vacuum_cleaner_filter_left_time 311 | - script.vacuum_reset_filter_life_level 312 | -------------------------------------------------------------------------------- /eng/packages/xiaomi_vacuum.yaml: -------------------------------------------------------------------------------- 1 | xiaomi_vacuum: 2 | homeassistant: 3 | customize: 4 | vacuum.vacuum_cleaner_robot_cleaner: 5 | miot_local: true # Force to read and write data in LAN 6 | miot_cloud: false # Enable miot cloud for entity (read, write, action) 7 | #miot_cloud_write: true # (Optional) Enable miot cloud (only write) 8 | miot_cloud_action: true # (Optional) Enable miot cloud (only action) 9 | sensor.vacuum_cleaner_battery_level: 10 | friendly_name: 'Charge level' 11 | icon: 'mdi:battery' 12 | sensor.vacuum_charging_state: 13 | friendly_name: 'Charging status' 14 | icon: 'mdi:state-machine' 15 | sensor.vacuum_status: 16 | friendly_name: 'Mode of operation' 17 | icon: 'mdi:state-machine' 18 | sensor.vacuum_status_fix: 19 | friendly_name: 'Vacuum Cleaner Status' 20 | icon: 'mdi:autorenew' 21 | sensor.vacuum_sweep_mode: 22 | friendly_name: 'Cleaning type' 23 | icon: 'mdi:format-list-bulleted-type' 24 | sensor.vacuum_fan_speed: 25 | friendly_name: 'Fan speed' 26 | icon: 'mdi:speedometer' 27 | sensor.vacuum_fault: 28 | friendly_name: 'Error' 29 | icon: 'mdi:alert-circle' 30 | sensor.vacuum_on: 31 | friendly_name: 'Switch state' 32 | icon: 'mdi:nintendo-switch' 33 | binary_sensor.vacuum_mop: 34 | friendly_name: 'Water container' 35 | icon: 'mdi:cup-water' 36 | sensor.vacuum_cleaner_filter_life_level: 37 | friendly_name: 'Percentage left' 38 | icon: 'mdi:percent-outline' 39 | sensor.vacuum_cleaner_filter_left_time: 40 | friendly_name: 'Time left' 41 | icon: 'mdi:calendar-clock' 42 | sensor.vacuum_cleaner_brush_life_level: 43 | friendly_name: 'Percentage left' 44 | icon: 'mdi:percent-outline' 45 | sensor.vacuum_cleaner_brush_left_time: 46 | friendly_name: 'Time left' 47 | icon: 'mdi:calendar-clock' 48 | sensor.vacuum_cleaner_brush_life_level_2: 49 | friendly_name: 'Percentage left' 50 | icon: 'mdi:percent-outline' 51 | sensor.vacuum_cleaner_brush_left_time_2: 52 | friendly_name: 'Time left' 53 | icon: 'mdi:calendar-clock' 54 | sensor.vacuum_cleaner_brush_life_level_3: 55 | friendly_name: 'Percentage left' 56 | icon: 'mdi:percent-outline' 57 | sensor.vacuum_cleaner_brush_left_time_3: 58 | friendly_name: 'Time left' 59 | icon: 'mdi:calendar-clock' 60 | sensor.vacuum_cleaning_time: 61 | friendly_name: 'Time of last harvest' 62 | unit_of_measurement: 'min.' 63 | icon: 'mdi:timer-outline' 64 | sensor.vacuum_total_cleaning_time: 65 | friendly_name: 'Total cleaning time' 66 | unit_of_measurement: 'min.' 67 | icon: 'mdi:timer-outline' 68 | sensor.vacuum_cleaned_area: 69 | friendly_name: 'Area of the last cleaning' 70 | unit_of_measurement: 'm ²' 71 | icon: 'mdi:ruler' 72 | sensor.vacuum_total_cleaned_area: 73 | friendly_name: 'Total cleaning area' 74 | unit_of_measurement: 'm ²' 75 | icon: 'mdi:ruler' 76 | sensor.vacuum_cleaning_count: 77 | friendly_name: 'Number of cleanings' 78 | icon: 'mdi:robot-vacuum' 79 | sensor.vacuum_operation: 80 | friendly_name: 'Operation' 81 | sensor.vacuum_accessories: 82 | friendly_name: 'Working time' 83 | 84 | # roidmi.vacuum.v60 (Roidmi EVE Plus) 85 | xiaomi_miot: 86 | username: !secret xiaomi_cloud_username 87 | password: !secret xiaomi_cloud_password 88 | # server_country: cn 89 | device_customizes: 90 | roidmi.vacuum.v60: 91 | exclude_miot_services: map 92 | camera: 93 | - platform: xiaomi_cloud_map_extractor 94 | host: !secret xiaomi_vacuum_host 95 | token: !secret xiaomi_vacuum_token 96 | username: !secret xiaomi_cloud_username 97 | password: !secret xiaomi_cloud_password 98 | #store_map: true 99 | force_api: roidmi 100 | country: "cn" 101 | colors: 102 | color_map_inside: [32, 115, 185] 103 | color_map_outside: [230, 233, 238] #colors on the outside of the card 104 | color_map_wall: [91, 96, 99] #wall color 105 | color_map_wall_v2: [93, 109, 126] 106 | color_grey_wall: [93, 109, 126] 107 | color_path: [255, 255, 255] 108 | color_goto_path: [0, 255, 0] 109 | color_predicted_path: [255, 255, 0, 0] 110 | color_zones: [0xAD, 0xD8, 0xFF, 0x8F] 111 | color_zones_outline: [0xAD, 0xD8, 0xFF] 112 | color_virtual_walls: [255, 0, 0] 113 | color_no_go_zones: [255, 33, 55, 127] 114 | color_no_go_zones_outline: [255, 0, 0] 115 | color_no_mop_zones: [163, 130, 211, 127] 116 | color_no_mop_zones_outline: [163, 130, 211] 117 | color_charger: [0, 255, 0] 118 | color_robo: [65, 65, 235] 119 | color_unknown: [0, 0, 0] 120 | color_scan: [0xDF, 0xDF, 0xDF] 121 | draw: 122 | - charger 123 | - path 124 | - goto_path 125 | - predicted_path 126 | - no_go_zones 127 | - no_mopping_zones 128 | - vacuum_position 129 | - virtual_walls 130 | #- zones 131 | # texts: 132 | # - text: "Room 1" 133 | # x: 25 134 | # y: 25 135 | # color: [125, 20, 213] 136 | # - text: "Room 2" 137 | # x: 25 138 | # y: 75 139 | # color: [125, 20, 213, 127] 140 | # font_size: 25 141 | # map_transformation: 142 | # #scale: 1 143 | # #rotate: 0 144 | # trim: 145 | # top: 20 146 | # bottom: 18 147 | # left: 25 148 | # right: 20 149 | sizes: 150 | charger_radius: 3.5 151 | vacuum_radius: 3.5 152 | attributes: 153 | - calibration_points 154 | - charger 155 | - goto 156 | - goto_path 157 | - goto_predicted_path 158 | - image 159 | - map_name 160 | #- no_go_areas 161 | #- no_mopping_areas 162 | - obstacles 163 | - path 164 | - room_numbers 165 | - rooms 166 | - vacuum_position 167 | - vacuum_room 168 | - walls 169 | - zones 170 | scan_interval: 171 | seconds: 10 172 | auto_update: false 173 | 174 | template: 175 | - sensor: 176 | - name: "vacuum_operation" 177 | state: 'Operation' 178 | - name: "vacuum_accessories" 179 | state: 'Working time' 180 | - name: "vacuum_status_fix" 181 | state: > 182 | {% set val = state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.status') %} 183 | {% if val == 1 %} 184 | Sleeping 185 | {% elif val == 2 %} 186 | In Standby 187 | {% elif val == 3 %} 188 | Suspend 189 | {% elif val == 4 %} 190 | Cleaning 191 | {% elif val == 5 %} 192 | Go Charging 193 | {% elif val == 6 %} 194 | Charging 195 | {% elif val == 7 %} 196 | Fault 197 | {% elif val == 8 %} 198 | Remote control 199 | {% elif val == 9 %} 200 | The battery is full 201 | {% elif val == 10 %} 202 | Shut down 203 | {% elif val == 11 %} 204 | Recharge pause 205 | {% else %} 206 | Device offline 207 | {% endif %} 208 | - name: "vacuum_fan_speed" 209 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','fan_speed') }}" 210 | - name: "vacuum_status" 211 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.status') }}" 212 | - name: "vacuum_fault" 213 | state: > 214 | {% set val = state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.fault') %} 215 | {% if (val == 0) or (val == None) %} 216 | No Faults 217 | {% elif val == 1 %} 218 | Low battery, start recharging 219 | {% elif val == 2 %} 220 | Low power, start shutting down 221 | {% elif val == 3 %} 222 | The main wheel is abnormal, please check whether the main wheel is stuck 223 | {% elif val == 4 %} 224 | Please check if the edge is jammed 225 | {% elif val == 5 %} 226 | Machine tilt, please move to level and start 227 | {% elif val == 6 %} 228 | Please check whether the top radar is blocked or jammed 229 | {% elif val == 7 %} 230 | Front collision sensor abnormal 231 | {% elif val == 8 %} 232 | Abnormal sensor on the right side along the wall 233 | {% elif val == 9 %} 234 | Please check whether the main brush is entangled or jammed 235 | {% elif val == 10 %} 236 | Please check whether the side brush is entangled or jammed 237 | {% elif val == 11 %} 238 | Abnormal fan 239 | {% elif val == 12 %} 240 | The radar cover is jammed 241 | {% elif val == 13 %} 242 | Please clean the dust box and filter screen, or check whether the dust box and filter screen are in place 243 | {% elif val == 14 %} 244 | Take out the dust box 245 | {% elif val == 15 %} 246 | Please clean the dust box and filter screen 247 | {% elif val == 16 %} 248 | The machine is trapped, please move to the new position and start 249 | {% elif val == 17 %} 250 | The machine is suspended. Please put it back on the level ground before starting 251 | {% elif val == 18 %} 252 | The water tank has been taken out. Please put it back into the water tank before starting 253 | {% elif val == 19 %} 254 | There is not enough water in the tank 255 | {% elif val == 20 %} 256 | The specified area cannot be reached 257 | {% elif val == 21 %} 258 | Please move out of the restricted area before starting 259 | {% elif val == 22 %} 260 | Please stay away from the cliff before starting 261 | {% elif val == 23 %} 262 | Pump current error 263 | {% elif val == 24 %} 264 | Recharge failed, charging point not found 265 | {% elif val == 25 %} 266 | Radar speed error 267 | {% elif val == 27 %} 268 | Please check whether the top radar is jammed 269 | {% elif val == 30 %} 270 | Radar open circuit abnormal 271 | {% elif val == 31 %} 272 | Battery abnormal 273 | {% elif val == 32 %} 274 | Middle brush abnormal 275 | {% elif val == 33 %} 276 | Main wheel abnormal 277 | {% elif val == 34 %} 278 | Side brush abnormal 279 | {% elif val == 35 %} 280 | Fan abnormal 281 | {% elif val == 37 %} 282 | Firmware upgrade failed due to insufficient conditions 283 | {% else %} 284 | Unknown error №{{state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.fault')}} 285 | {% endif %} 286 | - name: "vacuum_on" 287 | state: > 288 | {% set val = state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.on') %} 289 | {% if val == 0 %} 290 | Close 291 | {% elif val == 1 %} 292 | Open 293 | {% else %} 294 | Unknown 295 | {% endif %} 296 | - name: "vacuum_charging_state" 297 | state: > 298 | {% set val = state_attr('vacuum.vacuum_cleaner_robot_cleaner','battery.charging_state') %} 299 | {% if val == 1 %} 300 | Charging 301 | {% elif val == 2 %} 302 | No charging 303 | {% elif val == 3 %} 304 | No need 305 | {% else %} 306 | Unknown 307 | {% endif %} 308 | - name: "vacuum_sweep_mode" 309 | state: > 310 | {% set val = state_attr('vacuum.vacuum_cleaner_robot_cleaner','sweep.sweep_mode') %} 311 | {% if val == 0 %} 312 | Waiting 313 | {% elif val == 1 %} 314 | Cleaning the entire apartment 315 | {% elif val == 2 %} 316 | Cleaning the area 317 | {% elif val == 3 %} 318 | Local cleaning 319 | {% elif val == 4 %} 320 | Moving to the point 321 | {% elif val == 7 %} 322 | Smart 323 | {% elif val == 8 %} 324 | Cleaning the segment 325 | {% elif val == 9 %} 326 | DepthTotal 327 | {% elif val == 10 %} 328 | Along the wall 329 | {% else %} 330 | Unknown 331 | {% endif %} 332 | - name: "vacuum_station_type" 333 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.station_type') }}" 334 | - name: "vacuum_cleaning_time" 335 | state: > 336 | {% if (state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.clean_time') == None) %} 337 | 0 338 | {% else %} 339 | {{(state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.clean_time')/60)|round(1)}} 340 | {% endif %} 341 | - name: "vacuum_total_cleaning_time" 342 | state: > 343 | {% if (state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.total_clean_time') == None) %} 344 | 0 345 | {% else %} 346 | {{(state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.total_clean_time')/60)|round(1)}} 347 | {% endif %} 348 | - name: "vacuum_cleaned_area" 349 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.clean_area') }}" 350 | - name: "vacuum_total_cleaned_area" 351 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.total_clean_areas') }}" 352 | - name: "vacuum_cleaning_count" 353 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.clean_counts') }}" 354 | - binary_sensor: 355 | - name: "vacuum_mop" 356 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.mop') }}" 357 | 358 | input_boolean: 359 | vacuum_lidar_collision: 360 | name: 'Collision Radar' 361 | icon: 'mdi:radar' 362 | vacuum_led_switch: 363 | name: 'Button light' 364 | icon: 'mdi:alarm-light' 365 | vacuum_auto_boost: 366 | name: 'Carpet inflation mode' 367 | icon: 'mdi:rug' 368 | vacuum_double_clean: 369 | name: 'Cleaning x2' 370 | icon: 'mdi:map-marker-distance' 371 | vacuum_edge_sweep: 372 | name: 'Y-Mopping' 373 | icon: 'mdi:transit-detour' 374 | vacuum_station_key: 375 | name: 'Display status when touched' 376 | icon: 'mdi:account-arrow-right' 377 | vacuum_station_led: 378 | name: 'Display backlight' 379 | icon: 'mdi:lightbulb-on-outline' 380 | vacuum_mute: 381 | name: 'Silent mode' 382 | icon: 'mdi:volume-off' 383 | vacuum_room1: 384 | name: 'Hallway' 385 | icon: 'mdi:mirror' 386 | vacuum_room2: 387 | name: 'Hall' 388 | icon: 'mdi:sofa' 389 | vacuum_room3: 390 | name: 'Bedroom' 391 | icon: 'mdi:bed' 392 | vacuum_room4: 393 | name: 'Kitchen' 394 | icon: 'mdi:silverware-variant' 395 | vacuum_room5: 396 | name: 'Children' 397 | icon: 'mdi:desktop-classic' 398 | vacuum_room6: 399 | name: 'Corridor' 400 | icon: 'mdi:doorbell' 401 | 402 | input_number: 403 | vacuum_volume: 404 | name: 'Volume level' 405 | icon: 'mdi:volume-high' 406 | unit_of_measurement: '%' 407 | min: 0 408 | max: 100 409 | step: 1 410 | 411 | input_select: 412 | vacuum_water_level: 413 | name: 'Water use' 414 | icon: 'mdi:waves' 415 | options: 416 | - No water 417 | - Small 418 | - Middle 419 | - MAX 420 | vacuum_work_station_freq: 421 | name: 'Throwing away trash' 422 | icon: 'mdi:delete' 423 | options: 424 | - Not to throw away 425 | - Every time 426 | - Every second 427 | - Every third 428 | vacuum_mode: 429 | name: 'Cleaning power' 430 | icon: 'mdi:wind-power-outline' 431 | options: 432 | - Sweep 433 | - Silent 434 | - Basic 435 | - Strong 436 | - Full Speed 437 | vacuum_sweep_type: 438 | name: 'Cleaning function' 439 | icon: 'mdi:vacuum-outline' 440 | options: 441 | - Sweep 442 | - Mop 443 | - Mop And Sweep 444 | 445 | automation: 446 | # The vacuum cleaner started cleaning 447 | - alias: 'vacuum_start_cleaning' 448 | mode: queued 449 | trigger: 450 | - platform: state 451 | entity_id: sensor.vacuum_status 452 | from: '9' 453 | to: '4' 454 | - platform: state 455 | entity_id: sensor.vacuum_status 456 | from: '6' 457 | to: '4' 458 | action: 459 | - service: script.turn_on 460 | entity_id: script.telegram_send_message 461 | data: 462 | variables: 463 | emoji: "\U0001F9F9" 464 | message: 'The vacuum cleaner started cleaning' 465 | target: 466 | - !secret telegram_bot_chat_id_poison 467 | - !secret telegram_bot_chat_id_sasha 468 | sound: "auto" 469 | 470 | # Vacuum cleaner finished cleaning 471 | - alias: 'vacuum_end_cleaning' 472 | mode: queued 473 | trigger: 474 | - platform: state 475 | entity_id: sensor.vacuum_status 476 | from: '4' 477 | to: '5' 478 | - platform: state 479 | entity_id: sensor.vacuum_status 480 | from: '4' 481 | to: '9' 482 | action: 483 | - service: script.turn_on 484 | data: 485 | entity_id: script.vacuum_download_map 486 | - delay: '00:00:30' 487 | - service: camera.snapshot 488 | data_template: 489 | entity_id: 'camera.xiaomi_cloud_map_extractor' 490 | filename: '/config/www/xiaomi_vacuum_cleaner_map.jpg' 491 | - service: telegram_bot.send_photo 492 | data_template: 493 | file: '/config/www/xiaomi_vacuum_cleaner_map.jpg' 494 | caption: "\U00002705 Vacuum cleaner removed {{states('sensor.vacuum_cleaned_area')}} m² in {{states('sensor.vacuum_cleaning_time')}} minutes." 495 | target: 496 | - !secret telegram_bot_chat_id_poison 497 | - !secret telegram_bot_chat_id_sasha 498 | - condition: template 499 | value_template: | 500 | {% if states('sensor.vacuum_cleaner_brush_life_level')|int(100) <=5 or 501 | states('sensor.vacuum_cleaner_brush_life_level_2')|int(100) <=5 or 502 | states('sensor.vacuum_cleaner_brush_life_level_3')|int(100) <=5 or 503 | states('sensor.vacuum_cleaner_filter_life_level')|int(100) <=5 %}True{% else %}False{% endif %} 504 | - service: script.turn_on 505 | entity_id: script.telegram_send_message 506 | data: 507 | variables: 508 | emoji: "\U000026A0" 509 | message: | 510 | {%- set text = '' %} 511 | {%- if states('sensor.vacuum_cleaner_brush_life_level')|int(100) <=5 %}{% set text = 'replace the brush at the bottom, it has only left ' + states('sensor.vacuum_cleaner_brush_life_level') + '%' %}{% endif %} 512 | {%- if states('sensor.vacuum_cleaner_brush_life_level_2')|int(100) <=5 %}{% set text = 'replace the side brush, it has only left ' + states('sensor.vacuum_cleaner_brush_life_level_2') + '%' %}{% endif %} 513 | {%- if states('sensor.vacuum_cleaner_brush_life_level_3')|int(100) <=5 %}{% set text = 'wipe the sensors, it has only left ' + states('sensor.vacuum_cleaner_brush_life_level_3') + '%' %}{% endif %} 514 | {%- if states('sensor.vacuum_cleaner_filter_life_level')|int(100) <=5 %}{% set text = 'replace the HEPA filter, it has only left ' + states('sensor.vacuum_cleaner_filter_life_level') + '%' %}{% endif %} 515 | Needed: {{text}} and reset the counter 516 | target: 517 | - !secret telegram_bot_chat_id_poison 518 | - !secret telegram_bot_chat_id_sasha 519 | sound: "auto" 520 | 521 | # Mistake with the vacuum cleaner 522 | - alias: 'vacuum_show_error' 523 | mode: queued 524 | trigger: 525 | - platform: state 526 | entity_id: sensor.vacuum_fault 527 | condition: 528 | condition: template 529 | value_template: "{% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.fault',0) or is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.fault',None) %}False{% else %}True{% endif %}" 530 | action: 531 | - service: script.turn_on 532 | entity_id: script.telegram_send_message 533 | data: 534 | variables: 535 | emoji: "\U0001F9F9" 536 | message: "Mistake with the vacuum cleaner №{{state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.fault')}}. Description: {{states('sensor.vacuum_fault')}}." 537 | target: 538 | - !secret telegram_bot_chat_id_poison 539 | - !secret telegram_bot_chat_id_sasha 540 | sound: "auto" 541 | 542 | # get the values from the vacuum cleaner 543 | - alias: vacuum_get_miot_property 544 | mode: queued 545 | trigger: 546 | platform: state 547 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 548 | condition: 549 | condition: template 550 | value_template: "{% if states('vacuum.vacuum_cleaner_robot_cleaner') == 'unavailable' %}False{% else %}True{% endif %}" 551 | action: 552 | - service_template: > 553 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.led_switch', 1) %} 554 | input_boolean.turn_on 555 | {% else %} 556 | input_boolean.turn_off 557 | {% endif %} 558 | data: 559 | entity_id: input_boolean.vacuum_led_switch 560 | - service_template: > 561 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.lidar_collision', 1) %} 562 | input_boolean.turn_on 563 | {% else %} 564 | input_boolean.turn_off 565 | {% endif %} 566 | data: 567 | entity_id: input_boolean.vacuum_lidar_collision 568 | - service_template: > 569 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.auto_boost', 1) %} 570 | input_boolean.turn_on 571 | {% else %} 572 | input_boolean.turn_off 573 | {% endif %} 574 | data: 575 | entity_id: input_boolean.vacuum_auto_boost 576 | - service: input_number.set_value 577 | entity_id: input_number.vacuum_volume 578 | data_template: 579 | value: '{{ state_attr("vacuum.vacuum_cleaner_robot_cleaner","speaker.volume") }}' 580 | - service_template: > 581 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.double_clean', 1) %} 582 | input_boolean.turn_on 583 | {% else %} 584 | input_boolean.turn_off 585 | {% endif %} 586 | data: 587 | entity_id: input_boolean.vacuum_double_clean 588 | - service_template: > 589 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'map.path_type', 1) %} 590 | input_boolean.turn_on 591 | {% else %} 592 | input_boolean.turn_off 593 | {% endif %} 594 | data: 595 | entity_id: input_boolean.vacuum_edge_sweep 596 | - service: input_select.select_option 597 | entity_id: input_select.vacuum_water_level 598 | data_template: 599 | option: > 600 | {%- if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.water_level',0) -%} 601 | No water 602 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.water_level',1) -%} 603 | Small 604 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.water_level',2) -%} 605 | Middle 606 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.water_level',3) -%} 607 | MAX 608 | {%- else -%} 609 | {%- endif -%} 610 | - service_template: > 611 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.station_key', 1) %} 612 | input_boolean.turn_on 613 | {% else %} 614 | input_boolean.turn_off 615 | {% endif %} 616 | data: 617 | entity_id: input_boolean.vacuum_station_key 618 | - service_template: > 619 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.station_led', 1) %} 620 | input_boolean.turn_on 621 | {% else %} 622 | input_boolean.turn_off 623 | {% endif %} 624 | data: 625 | entity_id: input_boolean.vacuum_station_led 626 | - service_template: > 627 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'speaker.mute', 1) %} 628 | input_boolean.turn_on 629 | {% else %} 630 | input_boolean.turn_off 631 | {% endif %} 632 | data: 633 | entity_id: input_boolean.vacuum_mute 634 | - service: input_select.select_option 635 | entity_id: input_select.vacuum_work_station_freq 636 | data_template: 637 | option: > 638 | {%- if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.work_station_freq',0) -%} 639 | Not to throw away 640 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.work_station_freq',1) -%} 641 | Every time 642 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.work_station_freq',2) -%} 643 | Every second 644 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.work_station_freq',3) -%} 645 | Every third 646 | {%- else -%} 647 | {%- endif -%} 648 | - service: input_select.select_option 649 | entity_id: input_select.vacuum_mode 650 | data_template: 651 | option: > 652 | {%- if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.mode',0) -%} 653 | Sweep 654 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.mode',1) -%} 655 | Silent 656 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.mode',2) -%} 657 | Basic 658 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.mode',3) -%} 659 | Strong 660 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.mode',4) -%} 661 | Full Speed 662 | {%- else -%} 663 | {%- endif -%} 664 | - service: input_select.select_option 665 | entity_id: input_select.vacuum_sweep_type 666 | data_template: 667 | option: > 668 | {%- if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.sweep_type',0) -%} 669 | Sweep 670 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.sweep_type',1) -%} 671 | Mop 672 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.sweep_type',2) -%} 673 | Mop And Sweep 674 | {%- else -%} 675 | {%- endif -%} 676 | 677 | # set the values in the vacuum cleaner 678 | - alias: vacuum_set_miot_property 679 | mode: queued 680 | trigger: 681 | - platform: state 682 | entity_id: input_boolean.vacuum_led_switch 683 | id: 'led_switch' 684 | - platform: state 685 | entity_id: input_boolean.vacuum_lidar_collision 686 | id: 'lidar_collision' 687 | - platform: state 688 | entity_id: input_boolean.vacuum_auto_boost 689 | id: 'auto_boost' 690 | - platform: state 691 | entity_id: input_number.vacuum_volume 692 | id: 'volume' 693 | - platform: state 694 | entity_id: input_boolean.vacuum_double_clean 695 | id: 'double_clean' 696 | - platform: state 697 | entity_id: input_boolean.vacuum_edge_sweep 698 | id: 'edge_sweep' 699 | - platform: state 700 | entity_id: input_select.vacuum_water_level 701 | id: 'water_level' 702 | - platform: state 703 | entity_id: input_boolean.vacuum_station_key 704 | id: 'station_key' 705 | - platform: state 706 | entity_id: input_boolean.vacuum_station_led 707 | id: 'station_led' 708 | - platform: state 709 | entity_id: input_boolean.vacuum_mute 710 | id: 'mute' 711 | - platform: state 712 | entity_id: input_select.vacuum_work_station_freq 713 | id: 'work_station_freq' 714 | - platform: state 715 | entity_id: input_select.vacuum_mode 716 | id: 'vacuum_mode' 717 | - platform: state 718 | entity_id: input_select.vacuum_sweep_type 719 | id: 'vacuum_sweep_type' 720 | condition: 721 | - condition: template 722 | value_template: '{{ trigger.to_state.context.parent_id == none }}' 723 | action: 724 | - choose: 725 | - conditions: 726 | - condition: trigger 727 | id: "led_switch" 728 | sequence: 729 | - service: xiaomi_miot.set_miot_property 730 | data: 731 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 732 | did: !secret xiaomi_cloud_did 733 | siid: 8 734 | piid: 22 735 | value: "{{ 0 if is_state('input_boolean.vacuum_led_switch', 'off') else 1 }}" 736 | - conditions: 737 | - condition: trigger 738 | id: "lidar_collision" 739 | sequence: 740 | - service: xiaomi_miot.set_miot_property 741 | data: 742 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 743 | did: !secret xiaomi_cloud_did 744 | siid: 8 745 | piid: 23 746 | value: "{{ 0 if is_state('input_boolean.vacuum_lidar_collision', 'off') else 1 }}" 747 | - conditions: 748 | - condition: trigger 749 | id: "auto_boost" 750 | sequence: 751 | - service: xiaomi_miot.set_miot_property 752 | data: 753 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 754 | did: !secret xiaomi_cloud_did 755 | siid: 8 756 | piid: 9 757 | value: "{{ 0 if is_state('input_boolean.vacuum_auto_boost', 'off') else 1 }}" 758 | - conditions: 759 | - condition: trigger 760 | id: "volume" 761 | sequence: 762 | - service: xiaomi_miot.set_miot_property 763 | data: 764 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 765 | did: !secret xiaomi_cloud_did 766 | siid: 9 767 | piid: 1 768 | value: "{{states('input_number.vacuum_volume')|round(0)}}" 769 | - conditions: 770 | - condition: trigger 771 | id: "double_clean" 772 | sequence: 773 | - service: xiaomi_miot.set_miot_property 774 | data: 775 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 776 | did: !secret xiaomi_cloud_did 777 | siid: 8 778 | piid: 20 779 | value: "{{ 0 if is_state('input_boolean.vacuum_double_clean', 'off') else 1 }}" 780 | - conditions: 781 | - condition: trigger 782 | id: "edge_sweep" 783 | sequence: 784 | - service: xiaomi_miot.set_miot_property 785 | data: 786 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 787 | did: !secret xiaomi_cloud_did 788 | siid: 13 789 | piid: 8 790 | value: "{{ 0 if is_state('input_boolean.vacuum_edge_sweep', 'off') else 1 }}" 791 | - conditions: 792 | - condition: trigger 793 | id: "water_level" 794 | sequence: 795 | - service: xiaomi_miot.set_miot_property 796 | data: 797 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 798 | did: !secret xiaomi_cloud_did 799 | siid: 8 800 | piid: 11 801 | value: > 802 | {%- if is_state("input_select.vacuum_water_level", "No water") -%} 803 | 0 804 | {%- elif is_state("input_select.vacuum_water_level", "Small") -%} 805 | 1 806 | {%- elif is_state("input_select.vacuum_water_level", "Middle") -%} 807 | 2 808 | {%- elif is_state("input_select.vacuum_water_level", "MAX") -%} 809 | 3 810 | {% else %} 811 | {% endif %} 812 | - conditions: 813 | - condition: trigger 814 | id: "station_key" 815 | sequence: 816 | - service: xiaomi_miot.set_miot_property 817 | data: 818 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 819 | did: !secret xiaomi_cloud_did 820 | siid: 8 821 | piid: 24 822 | value: "{{ 0 if is_state('input_boolean.vacuum_station_key', 'off') else 1 }}" 823 | - conditions: 824 | - condition: trigger 825 | id: "station_led" 826 | sequence: 827 | - service: xiaomi_miot.set_miot_property 828 | data: 829 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 830 | did: !secret xiaomi_cloud_did 831 | siid: 8 832 | piid: 25 833 | value: "{{ 0 if is_state('input_boolean.vacuum_station_led', 'off') else 1 }}" 834 | - conditions: 835 | - condition: trigger 836 | id: "mute" 837 | sequence: 838 | - service: xiaomi_miot.set_miot_property 839 | data: 840 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 841 | did: !secret xiaomi_cloud_did 842 | siid: 9 843 | piid: 2 844 | value: "{{ 0 if is_state('input_boolean.vacuum_mute', 'off') else 1 }}" 845 | - conditions: 846 | - condition: trigger 847 | id: "work_station_freq" 848 | sequence: 849 | - service: xiaomi_miot.set_miot_property 850 | data: 851 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 852 | did: !secret xiaomi_cloud_did 853 | siid: 8 854 | piid: 2 855 | value: > 856 | {%- if is_state("input_select.vacuum_work_station_freq", "Not to throw away") -%} 857 | 0 858 | {%- elif is_state("input_select.vacuum_work_station_freq", "Every time") -%} 859 | 1 860 | {%- elif is_state("input_select.vacuum_work_station_freq", "Every second") -%} 861 | 2 862 | {%- elif is_state("input_select.vacuum_work_station_freq", "Every third") -%} 863 | 3 864 | {% else %} 865 | {% endif %} 866 | - conditions: 867 | - condition: trigger 868 | id: "vacuum_mode" 869 | sequence: 870 | - service: xiaomi_miot.set_miot_property 871 | data: 872 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 873 | did: !secret xiaomi_cloud_did 874 | siid: 2 875 | piid: 4 876 | value: > 877 | {%- if is_state("input_select.vacuum_mode", "Sweep") -%} 878 | 0 879 | {%- elif is_state("input_select.vacuum_mode", "Silent") -%} 880 | 1 881 | {%- elif is_state("input_select.vacuum_mode", "Basic") -%} 882 | 2 883 | {%- elif is_state("input_select.vacuum_mode", "Strong") -%} 884 | 3 885 | {%- elif is_state("input_select.vacuum_mode", "Full Speed") -%} 886 | 4 887 | {% else %} 888 | {% endif %} 889 | - conditions: 890 | - condition: trigger 891 | id: "vacuum_sweep_type" 892 | sequence: 893 | - service: xiaomi_miot.set_miot_property 894 | data: 895 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 896 | did: !secret xiaomi_cloud_did 897 | siid: 2 898 | piid: 8 899 | value: > 900 | {%- if is_state("input_select.vacuum_sweep_type", "Sweep") -%} 901 | 0 902 | {%- elif is_state("input_select.vacuum_sweep_type", "Mop") -%} 903 | 1 904 | {%- elif is_state("input_select.vacuum_sweep_type", "Mop And Sweep") -%} 905 | 2 906 | {% else %} 907 | {% endif %} 908 | 909 | # Turn on night mode 910 | - alias: 'vacuum_nigth_on' 911 | trigger: 912 | platform: time 913 | at: "22:00:00" 914 | action: 915 | - service: xiaomi_miot.set_miot_property 916 | data: 917 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 918 | did: !secret xiaomi_cloud_did 919 | siid: 9 920 | piid: 2 921 | value: "1" 922 | 923 | # Disable night mode 924 | - alias: 'vacuum_nigth_off' 925 | trigger: 926 | platform: time 927 | at: "07:00:00" 928 | action: 929 | - service: xiaomi_miot.set_miot_property 930 | data: 931 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 932 | did: !secret xiaomi_cloud_did 933 | siid: 9 934 | piid: 2 935 | value: "0" 936 | 937 | script: 938 | vacuum_download_map: 939 | alias: "Download a map from the cloud" 940 | mode: single 941 | icon: mdi:cloud-download-outline 942 | sequence: 943 | - service: homeassistant.update_entity 944 | data: 945 | entity_id: camera.xiaomi_cloud_map_extractor 946 | - delay: '00:00:02' 947 | - service: homeassistant.update_entity 948 | data: 949 | entity_id: camera.xiaomi_cloud_map_extractor 950 | - delay: '00:00:02' 951 | - service: homeassistant.update_entity 952 | data: 953 | entity_id: camera.xiaomi_cloud_map_extractor 954 | - delay: '00:00:02' 955 | - service: homeassistant.update_entity 956 | data: 957 | entity_id: camera.xiaomi_cloud_map_extractor 958 | 959 | vacuum_start_clean: 960 | alias: "Cleaning rooms according to the list" 961 | icon: mdi:delete-sweep-outline 962 | mode: single 963 | sequence: 964 | - condition: template 965 | value_template: | 966 | {% if is_state('input_boolean.vacuum_room1','on') or 967 | is_state('input_boolean.vacuum_room2','on') or 968 | is_state('input_boolean.vacuum_room3','on') or 969 | is_state('input_boolean.vacuum_room4','on') or 970 | is_state('input_boolean.vacuum_room5','on') or 971 | is_state('input_boolean.vacuum_room6','on')%}True{% else %}False{% endif %} 972 | - service: script.turn_on 973 | entity_id: script.telegram_send_message 974 | data_template: 975 | variables: 976 | emoji: "\U0001F9F9" 977 | message: | 978 | {%- set text = '' %} 979 | {%- if is_state('input_boolean.vacuum_room1','on') %}{% set text = state_attr('input_boolean.vacuum_room1','friendly_name') %}{% endif %} 980 | {%- if is_state('input_boolean.vacuum_room2','on') %} 981 | {%- if text != '' %}{% set text = text+',' %}{% endif %} 982 | {% set text = text+state_attr('input_boolean.vacuum_room2','friendly_name') %}{% endif %} 983 | {%- if is_state('input_boolean.vacuum_room3','on') %} 984 | {%- if text != '' %}{% set text = text+',' %}{% endif %} 985 | {% set text = text+state_attr('input_boolean.vacuum_room3','friendly_name') %}{% endif %} 986 | {%- if is_state('input_boolean.vacuum_room4','on') %} 987 | {%- if text != '' %}{% set text = text+',' %}{% endif %} 988 | {% set text = text+state_attr('input_boolean.vacuum_room4','friendly_name') %}{% endif %} 989 | {%- if is_state('input_boolean.vacuum_room5','on') %} 990 | {%- if text != '' %}{% set text = text+',' %}{% endif %} 991 | {% set text = text+state_attr('input_boolean.vacuum_room5','friendly_name') %}{% endif %} 992 | {%- if is_state('input_boolean.vacuum_room6','on') %} 993 | {%- if text != '' %}{% set text = text+',' %}{% endif %} 994 | {% set text = text+state_attr('input_boolean.vacuum_room6','friendly_name') %}{% endif %} 995 | Selected rooms for cleaning: {{text}} 996 | target: 997 | - !secret telegram_bot_chat_id_sasha 998 | sound: "auto" 999 | - service: script.turn_on 1000 | entity_id: script.vacuum_clean_select_room 1001 | data_template: 1002 | variables: 1003 | rooms: | 1004 | {%- set text = '' -%} 1005 | {%- if is_state('input_boolean.vacuum_room1','on') %}{%- set text = '1' %}{% endif %} 1006 | {%- if is_state('input_boolean.vacuum_room2','on') %} 1007 | {%- if text != '' %}{%- set text = text+',' %}{% endif %} 1008 | {%- set text = text+'2' %}{% endif %} 1009 | {%- if is_state('input_boolean.vacuum_room3','on') %} 1010 | {%- if text != '' %}{%- set text = text+',' %}{% endif %} 1011 | {%- set text = text+'3' %}{% endif %} 1012 | {%- if is_state('input_boolean.vacuum_room4','on') %} 1013 | {%- if text != '' %}{%- set text = text+',' %}{% endif %} 1014 | {%- set text = text+'4' %}{% endif %} 1015 | {%- if is_state('input_boolean.vacuum_room5','on') %} 1016 | {%- if text != '' %}{%- set text = text+',' %}{% endif %} 1017 | {%- set text = text+'5' %}{% endif %} 1018 | {%- if is_state('input_boolean.vacuum_room6','on') %} 1019 | {%- if text != '' %}{%- set text = text+',' %}{% endif %} 1020 | {%- set text = text+'6' %}{% endif %} 1021 | {%- set text = '[2,"{\\"mapId\\":1626189155,\\"segmentId\\":[' + text + ']}"]' %} 1022 | {{text}} 1023 | 1024 | vacuum_clean_select_room: 1025 | alias: 'Cleaning of selected rooms' 1026 | mode: single 1027 | fields: 1028 | rooms: 1029 | description: 'Command with room numbers' 1030 | example: 'Specifies the full cleaning command of the room' 1031 | sequence: 1032 | - service: xiaomi_miot.call_action 1033 | data: 1034 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1035 | did: !secret xiaomi_cloud_did 1036 | siid: 14 1037 | aiid: 1 1038 | params: "{{ rooms }}" 1039 | 1040 | vacuum_start_clean_all: 1041 | alias: "Cleaning the entire apartment" 1042 | icon: mdi:vacuum-outline 1043 | mode: single 1044 | sequence: 1045 | - service: vacuum.start 1046 | data: 1047 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1048 | 1049 | vacuum_reset_brush_life_level: 1050 | alias: "Reset readings" 1051 | icon: mdi:backup-restore 1052 | mode: single 1053 | sequence: 1054 | - service: xiaomi_miot.call_action 1055 | data: 1056 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1057 | siid: 11 1058 | aiid: 1 1059 | params: [] 1060 | throw: false 1061 | - delay: '00:20:00' 1062 | 1063 | vacuum_reset_brush_life_level_2: 1064 | alias: "Reset readings" 1065 | icon: mdi:backup-restore 1066 | mode: single 1067 | sequence: 1068 | - service: xiaomi_miot.call_action 1069 | data: 1070 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1071 | siid: 12 1072 | aiid: 1 1073 | params: [] 1074 | throw: false 1075 | - delay: '00:20:00' 1076 | 1077 | vacuum_reset_brush_life_level_3: 1078 | alias: "Reset readings" 1079 | icon: mdi:backup-restore 1080 | mode: single 1081 | sequence: 1082 | - service: xiaomi_miot.call_action 1083 | data: 1084 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1085 | siid: 15 1086 | aiid: 1 1087 | params: [] 1088 | throw: false 1089 | - delay: '00:20:00' 1090 | 1091 | vacuum_reset_filter_life_level: 1092 | alias: "Reset readings" 1093 | icon: mdi:backup-restore 1094 | mode: single 1095 | sequence: 1096 | - service: xiaomi_miot.call_action 1097 | data: 1098 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1099 | siid: 10 1100 | aiid: 1 1101 | params: [] 1102 | throw: false 1103 | - delay: '00:20:00' 1104 | -------------------------------------------------------------------------------- /rus/packages/xiaomi_vacuum.yaml: -------------------------------------------------------------------------------- 1 | xiaomi_vacuum: 2 | homeassistant: 3 | customize: 4 | vacuum.vacuum_cleaner_robot_cleaner: 5 | miot_local: true # Принудительное чтение и запись данных в локальной сети 6 | miot_cloud: false # Включить облако miot для сущности (чтение, запись, действие) 7 | #miot_cloud_write: true # (Необязательно) Включить облако miot (только запись) 8 | miot_cloud_action: true # (Необязательно) Включить облако miot (только действие) 9 | sensor.vacuum_cleaner_battery_level: 10 | friendly_name: 'Уровень заряда' 11 | icon: 'mdi:battery' 12 | sensor.vacuum_charging_state: 13 | friendly_name: 'Состояние зарядки' 14 | icon: 'mdi:state-machine' 15 | sensor.vacuum_status: 16 | friendly_name: 'Режим работы' 17 | icon: 'mdi:state-machine' 18 | sensor.vacuum_status_fix: 19 | friendly_name: 'Статус пылесоса' 20 | icon: 'mdi:autorenew' 21 | sensor.vacuum_sweep_mode: 22 | friendly_name: 'Тип уборки' 23 | icon: 'mdi:format-list-bulleted-type' 24 | sensor.vacuum_fan_speed: 25 | friendly_name: 'Скорость всасывания' 26 | icon: 'mdi:speedometer' 27 | sensor.vacuum_fault: 28 | friendly_name: 'Ошибка' 29 | icon: 'mdi:alert-circle' 30 | sensor.vacuum_on: 31 | friendly_name: 'Состояние переключателя' 32 | icon: 'mdi:nintendo-switch' 33 | binary_sensor.vacuum_mop: 34 | friendly_name: 'Контейнер с водой' 35 | icon: 'mdi:cup-water' 36 | sensor.vacuum_cleaner_filter_life_level: 37 | friendly_name: 'Осталось процентов' 38 | icon: 'mdi:percent-outline' 39 | sensor.vacuum_cleaner_filter_left_time: 40 | friendly_name: 'Осталось времени' 41 | icon: 'mdi:calendar-clock' 42 | sensor.vacuum_cleaner_brush_life_level: 43 | friendly_name: 'Осталось процентов' 44 | icon: 'mdi:percent-outline' 45 | sensor.vacuum_cleaner_brush_left_time: 46 | friendly_name: 'Осталось времени' 47 | icon: 'mdi:calendar-clock' 48 | sensor.vacuum_cleaner_brush_life_level_2: 49 | friendly_name: 'Осталось процентов' 50 | icon: 'mdi:percent-outline' 51 | sensor.vacuum_cleaner_brush_left_time_2: 52 | friendly_name: 'Осталось времени' 53 | icon: 'mdi:calendar-clock' 54 | sensor.vacuum_cleaner_brush_life_level_3: 55 | friendly_name: 'Осталось процентов' 56 | icon: 'mdi:percent-outline' 57 | sensor.vacuum_cleaner_brush_left_time_3: 58 | friendly_name: 'Осталось времени' 59 | icon: 'mdi:calendar-clock' 60 | sensor.vacuum_cleaning_time: 61 | friendly_name: 'Время последней уборки' 62 | unit_of_measurement: 'мин.' 63 | icon: 'mdi:timer-outline' 64 | sensor.vacuum_total_cleaning_time: 65 | friendly_name: 'Общее время уборки' 66 | unit_of_measurement: 'мин.' 67 | icon: 'mdi:timer-outline' 68 | sensor.vacuum_cleaned_area: 69 | friendly_name: 'Площадь последней уборки' 70 | unit_of_measurement: 'м ²' 71 | icon: 'mdi:ruler' 72 | sensor.vacuum_total_cleaned_area: 73 | friendly_name: 'Общая площадь уборки' 74 | unit_of_measurement: 'м ²' 75 | icon: 'mdi:ruler' 76 | sensor.vacuum_cleaning_count: 77 | friendly_name: 'Количество уборок' 78 | icon: 'mdi:robot-vacuum' 79 | sensor.vacuum_operation: 80 | friendly_name: 'Операция' 81 | sensor.vacuum_accessories: 82 | friendly_name: 'Время работы' 83 | 84 | # roidmi.vacuum.v60 (Roidmi EVE Plus) 85 | xiaomi_miot: 86 | username: !secret xiaomi_cloud_username 87 | password: !secret xiaomi_cloud_password 88 | # server_country: cn 89 | device_customizes: 90 | roidmi.vacuum.v60: 91 | exclude_miot_services: map 92 | camera: 93 | - platform: xiaomi_cloud_map_extractor 94 | host: !secret xiaomi_vacuum_host 95 | token: !secret xiaomi_vacuum_token 96 | username: !secret xiaomi_cloud_username 97 | password: !secret xiaomi_cloud_password 98 | #store_map: true 99 | force_api: roidmi 100 | country: "cn" 101 | colors: 102 | color_map_inside: [32, 115, 185] 103 | color_map_outside: [230, 233, 238] #цвета снаружи карты 104 | color_map_wall: [91, 96, 99] #цвет стен 105 | color_map_wall_v2: [93, 109, 126] 106 | color_grey_wall: [93, 109, 126] 107 | color_path: [255, 255, 255] 108 | color_goto_path: [0, 255, 0] 109 | color_predicted_path: [255, 255, 0, 0] 110 | color_zones: [0xAD, 0xD8, 0xFF, 0x8F] 111 | color_zones_outline: [0xAD, 0xD8, 0xFF] 112 | color_virtual_walls: [255, 0, 0] 113 | color_no_go_zones: [255, 33, 55, 127] 114 | color_no_go_zones_outline: [255, 0, 0] 115 | color_no_mop_zones: [163, 130, 211, 127] 116 | color_no_mop_zones_outline: [163, 130, 211] 117 | color_charger: [0, 255, 0] 118 | color_robo: [65, 65, 235] 119 | color_unknown: [0, 0, 0] 120 | color_scan: [0xDF, 0xDF, 0xDF] 121 | draw: 122 | - charger 123 | - path 124 | - goto_path 125 | - predicted_path 126 | - no_go_zones 127 | - no_mopping_zones 128 | - vacuum_position 129 | - virtual_walls 130 | #- zones 131 | # texts: 132 | # - text: "Room 1" 133 | # x: 25 134 | # y: 25 135 | # color: [125, 20, 213] 136 | # - text: "Room 2" 137 | # x: 25 138 | # y: 75 139 | # color: [125, 20, 213, 127] 140 | # font_size: 25 141 | # map_transformation: 142 | # #scale: 1 143 | # #rotate: 0 144 | # trim: 145 | # top: 20 146 | # bottom: 18 147 | # left: 25 148 | # right: 20 149 | sizes: 150 | charger_radius: 3.5 151 | vacuum_radius: 3.5 152 | attributes: 153 | - calibration_points 154 | - charger 155 | - goto 156 | - goto_path 157 | - goto_predicted_path 158 | - image 159 | - map_name 160 | #- no_go_areas 161 | #- no_mopping_areas 162 | - obstacles 163 | - path 164 | - room_numbers 165 | - rooms 166 | - vacuum_position 167 | - vacuum_room 168 | - walls 169 | - zones 170 | scan_interval: 171 | seconds: 10 172 | auto_update: false 173 | 174 | template: 175 | - sensor: 176 | - name: "vacuum_operation" 177 | state: 'Операция' 178 | - name: "vacuum_accessories" 179 | state: 'Время работы' 180 | - name: "vacuum_status_fix" 181 | state: > 182 | {% set val = state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.status') %} 183 | {% if val == 1 %} 184 | Сон 185 | {% elif val == 2 %} 186 | Ожидание 187 | {% elif val == 3 %} 188 | Пауза 189 | {% elif val == 4 %} 190 | Уборка 191 | {% elif val == 5 %} 192 | Возвращение к док-станции 193 | {% elif val == 6 %} 194 | Идет зарядка 195 | {% elif val == 7 %} 196 | Сбой 197 | {% elif val == 8 %} 198 | Удаленное управление 199 | {% elif val == 9 %} 200 | Батарея полностью заряжена 201 | {% elif val == 10 %} 202 | Выключен 203 | {% elif val == 11 %} 204 | Пауза поиск зарядной станции 205 | {% else %} 206 | Нет связи с пылесосом 207 | {% endif %} 208 | - name: "vacuum_fan_speed" 209 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','fan_speed') }}" 210 | - name: "vacuum_status" 211 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.status') }}" 212 | - name: "vacuum_fault" 213 | state: > 214 | {% set val = state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.fault') %} 215 | {% if (val == 0) or (val == None) %} 216 | Нет ошибки 217 | {% elif val == 1 %} 218 | Батарея разряжена, поиск зарядки 219 | {% elif val == 2 %} 220 | Батарея разряжена, отключение 221 | {% elif val == 3 %} 222 | Сбой главного колеса, убедитесь в его свободном ходе 223 | {% elif val == 4 %} 224 | Убедитесь, что край не замят 225 | {% elif val == 5 %} 226 | Устройство наклонено, установите ровно и включите 227 | {% elif val == 6 %} 228 | Убедитесь, что верхний радар двигается свободно и не закрыт 229 | {% elif val == 7 %} 230 | Сбой переднего датчика столкновений 231 | {% elif val == 8 %} 232 | Сбой датчика справа вдоль стены 233 | {% elif val == 9 %} 234 | Убедитесь, что главная щетка двигается свободно 235 | {% elif val == 10 %} 236 | Убедитесь, что боковая щетка двигается свободно 237 | {% elif val == 11 %} 238 | Сбой вентилятора 239 | {% elif val == 12 %} 240 | Помеха перед крышкой радара 241 | {% elif val == 13 %} 242 | Очистите пылесборник и фильтр или проверьте наличие установленного пылесборника и фильтра 243 | {% elif val == 14 %} 244 | Отсутствует пылесборник 245 | {% elif val == 15 %} 246 | Очистите пылесборник и фильтр 247 | {% elif val == 16 %} 248 | Устройство застряло, переместите в новое положение и запустите 249 | {% elif val == 17 %} 250 | Устройство приостановлено. Установите его на ровную поверхность перед запуском 251 | {% elif val == 18 %} 252 | Бак для воды извлечен. Установите бак на место перед запуском 253 | {% elif val == 19 %} 254 | Недостаточно воды в баке 255 | {% elif val == 20 %} 256 | Не попадает в указанную зону 257 | {% elif val == 21 %} 258 | Переместите устройство из запретной зоны перед запуском 259 | {% elif val == 22 %} 260 | Отойдите от откоса, прежде чем начинать 261 | {% elif val == 23 %} 262 | Ошибка тока насоса 263 | {% elif val == 24 %} 264 | Сбой зарядки, зарядная станция не найдена 265 | {% elif val == 25 %} 266 | Ошибка скорости по радару 267 | {% elif val == 27 %} 268 | Убедитесь, что верхний радар двигается свободно 269 | {% elif val == 30 %} 270 | Сбой в электронике радара 271 | {% elif val == 31 %} 272 | Сбой аккумулятора 273 | {% elif val == 32 %} 274 | Сбой средней щетки 275 | {% elif val == 33 %} 276 | Сбой главного колеса 277 | {% elif val == 34 %} 278 | Сбой боковой щетки 279 | {% elif val == 35 %} 280 | Сбой вентилятора 281 | {% elif val == 37 %} 282 | Сбой обновления прошивки из-за несоблюдения требований 283 | {% else %} 284 | Неизвестная ошибка №{{state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.fault')}} 285 | {% endif %} 286 | - name: "vacuum_on" 287 | state: > 288 | {% set val = state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.on') %} 289 | {% if val == 0 %} 290 | Закрыто 291 | {% elif val == 1 %} 292 | Открыто 293 | {% else %} 294 | Неизвестно 295 | {% endif %} 296 | - name: "vacuum_charging_state" 297 | state: > 298 | {% set val = state_attr('vacuum.vacuum_cleaner_robot_cleaner','battery.charging_state') %} 299 | {% if val == 1 %} 300 | Зарядка 301 | {% elif val == 2 %} 302 | Нет зарядки 303 | {% elif val == 3 %} 304 | Не требуется 305 | {% else %} 306 | Неизвестно 307 | {% endif %} 308 | - name: "vacuum_sweep_mode" 309 | state: > 310 | {% set val = state_attr('vacuum.vacuum_cleaner_robot_cleaner','sweep.sweep_mode') %} 311 | {% if val == 0 %} 312 | Ожидание 313 | {% elif val == 1 %} 314 | Уборка всей квартиры 315 | {% elif val == 2 %} 316 | Уборка зоны 317 | {% elif val == 3 %} 318 | Локальная уборка 319 | {% elif val == 4 %} 320 | Движение к точки 321 | {% elif val == 7 %} 322 | Smart 323 | {% elif val == 8 %} 324 | Уборка сегмента 325 | {% elif val == 9 %} 326 | DepthTotal 327 | {% elif val == 10 %} 328 | Вдоль стены 329 | {% else %} 330 | Неизвестно 331 | {% endif %} 332 | - name: "vacuum_station_type" 333 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.station_type') }}" 334 | - name: "vacuum_cleaning_time" 335 | state: > 336 | {% if (state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.clean_time') == None) %} 337 | 0 338 | {% else %} 339 | {{(state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.clean_time')/60)|round(1)}} 340 | {% endif %} 341 | - name: "vacuum_total_cleaning_time" 342 | state: > 343 | {% if (state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.total_clean_time') == None) %} 344 | 0 345 | {% else %} 346 | {{(state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.total_clean_time')/60)|round(1)}} 347 | {% endif %} 348 | - name: "vacuum_cleaned_area" 349 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.clean_area') }}" 350 | - name: "vacuum_total_cleaned_area" 351 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.total_clean_areas') }}" 352 | - name: "vacuum_cleaning_count" 353 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.clean_counts') }}" 354 | - binary_sensor: 355 | - name: "vacuum_mop" 356 | state: "{{ state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.mop') }}" 357 | 358 | input_boolean: 359 | vacuum_lidar_collision: 360 | name: 'Радар столкновений' 361 | icon: 'mdi:radar' 362 | vacuum_led_switch: 363 | name: 'Подсветка кнопки' 364 | icon: 'mdi:alarm-light' 365 | vacuum_auto_boost: 366 | name: 'Режим наддува ковра' 367 | icon: 'mdi:rug' 368 | vacuum_double_clean: 369 | name: 'Уборка x2' 370 | icon: 'mdi:map-marker-distance' 371 | vacuum_edge_sweep: 372 | name: 'Y-образное мытье' 373 | icon: 'mdi:transit-detour' 374 | vacuum_station_key: 375 | name: 'Статус дисплея при касании' 376 | icon: 'mdi:account-arrow-right' 377 | vacuum_station_led: 378 | name: 'Подсветка дисплея' 379 | icon: 'mdi:lightbulb-on-outline' 380 | vacuum_mute: 381 | name: 'Режим без звука' 382 | icon: 'mdi:volume-off' 383 | vacuum_room1: 384 | name: 'Прихожая' 385 | icon: 'mdi:mirror' 386 | vacuum_room2: 387 | name: 'Зал' 388 | icon: 'mdi:sofa' 389 | vacuum_room3: 390 | name: 'Спальня' 391 | icon: 'mdi:bed' 392 | vacuum_room4: 393 | name: 'Кухня' 394 | icon: 'mdi:silverware-variant' 395 | vacuum_room5: 396 | name: 'Кабинет' 397 | icon: 'mdi:desktop-classic' 398 | vacuum_room6: 399 | name: 'Коридор' 400 | icon: 'mdi:doorbell' 401 | 402 | input_number: 403 | vacuum_volume: 404 | name: 'Уровень громкости' 405 | icon: 'mdi:volume-high' 406 | unit_of_measurement: '%' 407 | min: 0 408 | max: 100 409 | step: 1 410 | 411 | input_select: 412 | vacuum_water_level: 413 | name: 'Использование воды' 414 | icon: 'mdi:waves' 415 | options: 416 | - Без воды 417 | - Минимальное кол-во воды 418 | - Среднее кол-во воды 419 | - Максимальное кол-во воды 420 | vacuum_work_station_freq: 421 | name: 'Выбрасывать мусор' 422 | icon: 'mdi:delete' 423 | options: 424 | - Не выбрасывать 425 | - Каждый раз 426 | - Каждый второй 427 | - Каждый третий 428 | vacuum_mode: 429 | name: 'Мощность уборки' 430 | icon: 'mdi:wind-power-outline' 431 | options: 432 | - Подметать 433 | - Тихая 434 | - Средняя 435 | - Сильная 436 | - Максимальная скорость 437 | vacuum_sweep_type: 438 | name: 'Тип уборки' 439 | icon: 'mdi:vacuum-outline' 440 | options: 441 | - Подметать 442 | - Мойка 443 | - Подметать и мыть 444 | 445 | automation: 446 | # Пылесос начал уборку 447 | - alias: 'vacuum_start_cleaning' 448 | mode: queued 449 | trigger: 450 | - platform: state 451 | entity_id: sensor.vacuum_status 452 | from: '9' 453 | to: '4' 454 | - platform: state 455 | entity_id: sensor.vacuum_status 456 | from: '6' 457 | to: '4' 458 | action: 459 | - service: script.turn_on 460 | entity_id: script.telegram_send_message 461 | data: 462 | variables: 463 | emoji: "\U0001F9F9" 464 | message: 'Пылесос начал уборку' 465 | target: 466 | - !secret telegram_bot_chat_id_poison 467 | - !secret telegram_bot_chat_id_sasha 468 | sound: "auto" 469 | 470 | # Пылесос закончил уборку 471 | - alias: 'vacuum_end_cleaning' 472 | mode: queued 473 | trigger: 474 | - platform: state 475 | entity_id: sensor.vacuum_status 476 | from: '4' 477 | to: '5' 478 | - platform: state 479 | entity_id: sensor.vacuum_status 480 | from: '4' 481 | to: '9' 482 | action: 483 | - service: script.turn_on 484 | data: 485 | entity_id: script.vacuum_download_map 486 | - delay: '00:00:30' 487 | - service: camera.snapshot 488 | data_template: 489 | entity_id: 'camera.xiaomi_cloud_map_extractor' 490 | filename: '/config/www/xiaomi_vacuum_cleaner_map.jpg' 491 | - service: telegram_bot.send_photo 492 | data_template: 493 | file: '/config/www/xiaomi_vacuum_cleaner_map.jpg' 494 | caption: "\U00002705 Пылесос убрал {{states('sensor.vacuum_cleaned_area')}} м² за {{states('sensor.vacuum_cleaning_time')}} минут." 495 | target: 496 | - !secret telegram_bot_chat_id_poison 497 | - !secret telegram_bot_chat_id_sasha 498 | - condition: template 499 | value_template: | 500 | {% if states('sensor.vacuum_cleaner_brush_life_level')|int(100) <=5 or 501 | states('sensor.vacuum_cleaner_brush_life_level_2')|int(100) <=5 or 502 | states('sensor.vacuum_cleaner_brush_life_level_3')|int(100) <=5 or 503 | states('sensor.vacuum_cleaner_filter_life_level')|int(100) <=5 %}True{% else %}False{% endif %} 504 | - service: script.turn_on 505 | entity_id: script.telegram_send_message 506 | data: 507 | variables: 508 | emoji: "\U000026A0" 509 | message: | 510 | {%- set text = '' %} 511 | {%- if states('sensor.vacuum_cleaner_brush_life_level')|int(100) <=5 %}{% set text = 'заменить щетку снизу, осталось ' + states('sensor.vacuum_cleaner_brush_life_level') + '%' %}{% endif %} 512 | {%- if states('sensor.vacuum_cleaner_brush_life_level_2')|int(100) <=5 %}{% set text = 'заменить боковую щетку, осталось ' + states('sensor.vacuum_cleaner_brush_life_level_2') + '%' %}{% endif %} 513 | {%- if states('sensor.vacuum_cleaner_brush_life_level_3')|int(100) <=5 %}{% set text = 'протереть датчики, осталось ' + states('sensor.vacuum_cleaner_brush_life_level_3') + '%' %}{% endif %} 514 | {%- if states('sensor.vacuum_cleaner_filter_life_level')|int(100) <=5 %}{% set text = 'заменить фильтр HEPA, осталось ' + states('sensor.vacuum_cleaner_filter_life_level') + '%' %}{% endif %} 515 | Необходимо: {{text}} и сбросить счетчик 516 | target: 517 | - !secret telegram_bot_chat_id_poison 518 | - !secret telegram_bot_chat_id_sasha 519 | sound: "auto" 520 | 521 | # Ошибка с пылесосом 522 | - alias: 'vacuum_show_error' 523 | mode: queued 524 | trigger: 525 | - platform: state 526 | entity_id: sensor.vacuum_fault 527 | condition: 528 | condition: template 529 | value_template: "{% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.fault',0) or is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.fault',None) %}False{% else %}True{% endif %}" 530 | action: 531 | - service: script.turn_on 532 | entity_id: script.telegram_send_message 533 | data: 534 | variables: 535 | emoji: "\U0001F9F9" 536 | message: "Ошибка с пылесосом №{{state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.fault')}}. Расшифровка: {{states('sensor.vacuum_fault')}}." 537 | target: 538 | - !secret telegram_bot_chat_id_poison 539 | - !secret telegram_bot_chat_id_sasha 540 | sound: "auto" 541 | 542 | # получаем значения с пылесоса 543 | - alias: vacuum_get_miot_property 544 | mode: queued 545 | trigger: 546 | platform: state 547 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 548 | condition: 549 | condition: template 550 | value_template: "{% if states('vacuum.vacuum_cleaner_robot_cleaner') == 'unavailable' %}False{% else %}True{% endif %}" 551 | action: 552 | - service_template: > 553 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.led_switch', 1) %} 554 | input_boolean.turn_on 555 | {% else %} 556 | input_boolean.turn_off 557 | {% endif %} 558 | data: 559 | entity_id: input_boolean.vacuum_led_switch 560 | - service_template: > 561 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.lidar_collision', 1) %} 562 | input_boolean.turn_on 563 | {% else %} 564 | input_boolean.turn_off 565 | {% endif %} 566 | data: 567 | entity_id: input_boolean.vacuum_lidar_collision 568 | - service_template: > 569 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.auto_boost', 1) %} 570 | input_boolean.turn_on 571 | {% else %} 572 | input_boolean.turn_off 573 | {% endif %} 574 | data: 575 | entity_id: input_boolean.vacuum_auto_boost 576 | - service: input_number.set_value 577 | entity_id: input_number.vacuum_volume 578 | data_template: 579 | value: '{{ state_attr("vacuum.vacuum_cleaner_robot_cleaner","speaker.volume") }}' 580 | - service_template: > 581 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.double_clean', 1) %} 582 | input_boolean.turn_on 583 | {% else %} 584 | input_boolean.turn_off 585 | {% endif %} 586 | data: 587 | entity_id: input_boolean.vacuum_double_clean 588 | - service_template: > 589 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'map.path_type', 1) %} 590 | input_boolean.turn_on 591 | {% else %} 592 | input_boolean.turn_off 593 | {% endif %} 594 | data: 595 | entity_id: input_boolean.vacuum_edge_sweep 596 | - service: input_select.select_option 597 | entity_id: input_select.vacuum_water_level 598 | data_template: 599 | option: > 600 | {%- if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.water_level',0) -%} 601 | Без воды 602 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.water_level',1) -%} 603 | Минимальное кол-во воды 604 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.water_level',2) -%} 605 | Среднее кол-во воды 606 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.water_level',3) -%} 607 | Максимальное кол-во воды 608 | {%- else -%} 609 | {%- endif -%} 610 | - service_template: > 611 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.station_key', 1) %} 612 | input_boolean.turn_on 613 | {% else %} 614 | input_boolean.turn_off 615 | {% endif %} 616 | data: 617 | entity_id: input_boolean.vacuum_station_key 618 | - service_template: > 619 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'custom.station_led', 1) %} 620 | input_boolean.turn_on 621 | {% else %} 622 | input_boolean.turn_off 623 | {% endif %} 624 | data: 625 | entity_id: input_boolean.vacuum_station_led 626 | - service_template: > 627 | {% if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner', 'speaker.mute', 1) %} 628 | input_boolean.turn_on 629 | {% else %} 630 | input_boolean.turn_off 631 | {% endif %} 632 | data: 633 | entity_id: input_boolean.vacuum_mute 634 | - service: input_select.select_option 635 | entity_id: input_select.vacuum_work_station_freq 636 | data_template: 637 | option: > 638 | {%- if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.work_station_freq',0) -%} 639 | Не выбрасывать 640 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.work_station_freq',1) -%} 641 | Каждый раз 642 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.work_station_freq',2) -%} 643 | Каждый второй 644 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','custom.work_station_freq',3) -%} 645 | Каждый третий 646 | {%- else -%} 647 | {%- endif -%} 648 | - service: input_select.select_option 649 | entity_id: input_select.vacuum_mode 650 | data_template: 651 | option: > 652 | {%- if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.mode',0) -%} 653 | Подметать 654 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.mode',1) -%} 655 | Тихая 656 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.mode',2) -%} 657 | Средняя 658 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.mode',3) -%} 659 | Сильная 660 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.mode',4) -%} 661 | Максимальная скорость 662 | {%- else -%} 663 | {%- endif -%} 664 | - service: input_select.select_option 665 | entity_id: input_select.vacuum_sweep_type 666 | data_template: 667 | option: > 668 | {%- if is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.sweep_type',0) -%} 669 | Подметать 670 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.sweep_type',1) -%} 671 | Мойка 672 | {%- elif is_state_attr('vacuum.vacuum_cleaner_robot_cleaner','vacuum.sweep_type',2) -%} 673 | Подметать и мыть 674 | {%- else -%} 675 | {%- endif -%} 676 | 677 | # устанавливаем значения в пылесос 678 | - alias: vacuum_set_miot_property 679 | mode: queued 680 | trigger: 681 | - platform: state 682 | entity_id: input_boolean.vacuum_led_switch 683 | id: 'led_switch' 684 | - platform: state 685 | entity_id: input_boolean.vacuum_lidar_collision 686 | id: 'lidar_collision' 687 | - platform: state 688 | entity_id: input_boolean.vacuum_auto_boost 689 | id: 'auto_boost' 690 | - platform: state 691 | entity_id: input_number.vacuum_volume 692 | id: 'volume' 693 | - platform: state 694 | entity_id: input_boolean.vacuum_double_clean 695 | id: 'double_clean' 696 | - platform: state 697 | entity_id: input_boolean.vacuum_edge_sweep 698 | id: 'edge_sweep' 699 | - platform: state 700 | entity_id: input_select.vacuum_water_level 701 | id: 'water_level' 702 | - platform: state 703 | entity_id: input_boolean.vacuum_station_key 704 | id: 'station_key' 705 | - platform: state 706 | entity_id: input_boolean.vacuum_station_led 707 | id: 'station_led' 708 | - platform: state 709 | entity_id: input_boolean.vacuum_mute 710 | id: 'mute' 711 | - platform: state 712 | entity_id: input_select.vacuum_work_station_freq 713 | id: 'work_station_freq' 714 | - platform: state 715 | entity_id: input_select.vacuum_mode 716 | id: 'vacuum_mode' 717 | - platform: state 718 | entity_id: input_select.vacuum_sweep_type 719 | id: 'vacuum_sweep_type' 720 | condition: 721 | - condition: template 722 | value_template: '{{ trigger.to_state.context.parent_id == none }}' 723 | action: 724 | - choose: 725 | - conditions: 726 | - condition: trigger 727 | id: "led_switch" 728 | sequence: 729 | - service: xiaomi_miot.set_miot_property 730 | data: 731 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 732 | did: !secret xiaomi_cloud_did 733 | siid: 8 734 | piid: 22 735 | value: "{{ 0 if is_state('input_boolean.vacuum_led_switch', 'off') else 1 }}" 736 | - conditions: 737 | - condition: trigger 738 | id: "lidar_collision" 739 | sequence: 740 | - service: xiaomi_miot.set_miot_property 741 | data: 742 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 743 | did: !secret xiaomi_cloud_did 744 | siid: 8 745 | piid: 23 746 | value: "{{ 0 if is_state('input_boolean.vacuum_lidar_collision', 'off') else 1 }}" 747 | - conditions: 748 | - condition: trigger 749 | id: "auto_boost" 750 | sequence: 751 | - service: xiaomi_miot.set_miot_property 752 | data: 753 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 754 | did: !secret xiaomi_cloud_did 755 | siid: 8 756 | piid: 9 757 | value: "{{ 0 if is_state('input_boolean.vacuum_auto_boost', 'off') else 1 }}" 758 | - conditions: 759 | - condition: trigger 760 | id: "volume" 761 | sequence: 762 | - service: xiaomi_miot.set_miot_property 763 | data: 764 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 765 | did: !secret xiaomi_cloud_did 766 | siid: 9 767 | piid: 1 768 | value: "{{states('input_number.vacuum_volume')|round(0)}}" 769 | - conditions: 770 | - condition: trigger 771 | id: "double_clean" 772 | sequence: 773 | - service: xiaomi_miot.set_miot_property 774 | data: 775 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 776 | did: !secret xiaomi_cloud_did 777 | siid: 8 778 | piid: 20 779 | value: "{{ 0 if is_state('input_boolean.vacuum_double_clean', 'off') else 1 }}" 780 | - conditions: 781 | - condition: trigger 782 | id: "edge_sweep" 783 | sequence: 784 | - service: xiaomi_miot.set_miot_property 785 | data: 786 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 787 | did: !secret xiaomi_cloud_did 788 | siid: 13 789 | piid: 8 790 | value: "{{ 0 if is_state('input_boolean.vacuum_edge_sweep', 'off') else 1 }}" 791 | - conditions: 792 | - condition: trigger 793 | id: "water_level" 794 | sequence: 795 | - service: xiaomi_miot.set_miot_property 796 | data: 797 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 798 | did: !secret xiaomi_cloud_did 799 | siid: 8 800 | piid: 11 801 | value: > 802 | {%- if is_state("input_select.vacuum_water_level", "Без воды") -%} 803 | 0 804 | {%- elif is_state("input_select.vacuum_water_level", "Минимальное кол-во воды") -%} 805 | 1 806 | {%- elif is_state("input_select.vacuum_water_level", "Среднее кол-во воды") -%} 807 | 2 808 | {%- elif is_state("input_select.vacuum_water_level", "Максимальное кол-во воды") -%} 809 | 3 810 | {% else %} 811 | {% endif %} 812 | - conditions: 813 | - condition: trigger 814 | id: "station_key" 815 | sequence: 816 | - service: xiaomi_miot.set_miot_property 817 | data: 818 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 819 | did: !secret xiaomi_cloud_did 820 | siid: 8 821 | piid: 24 822 | value: "{{ 0 if is_state('input_boolean.vacuum_station_key', 'off') else 1 }}" 823 | - conditions: 824 | - condition: trigger 825 | id: "station_led" 826 | sequence: 827 | - service: xiaomi_miot.set_miot_property 828 | data: 829 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 830 | did: !secret xiaomi_cloud_did 831 | siid: 8 832 | piid: 25 833 | value: "{{ 0 if is_state('input_boolean.vacuum_station_led', 'off') else 1 }}" 834 | - conditions: 835 | - condition: trigger 836 | id: "mute" 837 | sequence: 838 | - service: xiaomi_miot.set_miot_property 839 | data: 840 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 841 | did: !secret xiaomi_cloud_did 842 | siid: 9 843 | piid: 2 844 | value: "{{ 0 if is_state('input_boolean.vacuum_mute', 'off') else 1 }}" 845 | - conditions: 846 | - condition: trigger 847 | id: "work_station_freq" 848 | sequence: 849 | - service: xiaomi_miot.set_miot_property 850 | data: 851 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 852 | did: !secret xiaomi_cloud_did 853 | siid: 8 854 | piid: 2 855 | value: > 856 | {%- if is_state("input_select.vacuum_work_station_freq", "Не выбрасывать") -%} 857 | 0 858 | {%- elif is_state("input_select.vacuum_work_station_freq", "Каждый раз") -%} 859 | 1 860 | {%- elif is_state("input_select.vacuum_work_station_freq", "Каждый второй") -%} 861 | 2 862 | {%- elif is_state("input_select.vacuum_work_station_freq", "Каждый третий") -%} 863 | 3 864 | {% else %} 865 | {% endif %} 866 | - conditions: 867 | - condition: trigger 868 | id: "vacuum_mode" 869 | sequence: 870 | - service: xiaomi_miot.set_miot_property 871 | data: 872 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 873 | did: !secret xiaomi_cloud_did 874 | siid: 2 875 | piid: 4 876 | value: > 877 | {%- if is_state("input_select.vacuum_mode", "Подметать") -%} 878 | 0 879 | {%- elif is_state("input_select.vacuum_mode", "Тихая") -%} 880 | 1 881 | {%- elif is_state("input_select.vacuum_mode", "Средняя") -%} 882 | 2 883 | {%- elif is_state("input_select.vacuum_mode", "Сильная") -%} 884 | 3 885 | {%- elif is_state("input_select.vacuum_mode", "Максимальная скорость") -%} 886 | 4 887 | {% else %} 888 | {% endif %} 889 | - conditions: 890 | - condition: trigger 891 | id: "vacuum_sweep_type" 892 | sequence: 893 | - service: xiaomi_miot.set_miot_property 894 | data: 895 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 896 | did: !secret xiaomi_cloud_did 897 | siid: 2 898 | piid: 8 899 | value: > 900 | {%- if is_state("input_select.vacuum_sweep_type", "Подметать") -%} 901 | 0 902 | {%- elif is_state("input_select.vacuum_sweep_type", "Мойка") -%} 903 | 1 904 | {%- elif is_state("input_select.vacuum_sweep_type", "Подметать и мыть") -%} 905 | 2 906 | {% else %} 907 | {% endif %} 908 | 909 | # Включить режим ночь 910 | - alias: 'vacuum_nigth_on' 911 | trigger: 912 | platform: time 913 | at: "22:00:00" 914 | action: 915 | - service: xiaomi_miot.set_miot_property 916 | data: 917 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 918 | did: !secret xiaomi_cloud_did 919 | siid: 9 920 | piid: 2 921 | value: "1" 922 | 923 | # Отключить режим ночь 924 | - alias: 'vacuum_nigth_off' 925 | trigger: 926 | platform: time 927 | at: "07:00:00" 928 | action: 929 | - service: xiaomi_miot.set_miot_property 930 | data: 931 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 932 | did: !secret xiaomi_cloud_did 933 | siid: 9 934 | piid: 2 935 | value: "0" 936 | 937 | script: 938 | # скачать карту с облака 939 | vacuum_download_map: 940 | alias: "Скачать карту с облака" 941 | mode: single 942 | icon: mdi:cloud-download-outline 943 | sequence: 944 | - service: homeassistant.update_entity 945 | data: 946 | entity_id: camera.xiaomi_cloud_map_extractor 947 | - delay: '00:00:02' 948 | - service: homeassistant.update_entity 949 | data: 950 | entity_id: camera.xiaomi_cloud_map_extractor 951 | - delay: '00:00:02' 952 | - service: homeassistant.update_entity 953 | data: 954 | entity_id: camera.xiaomi_cloud_map_extractor 955 | - delay: '00:00:02' 956 | - service: homeassistant.update_entity 957 | data: 958 | entity_id: camera.xiaomi_cloud_map_extractor 959 | 960 | vacuum_start_clean: 961 | alias: "Уборка комнат по списку" 962 | icon: mdi:delete-sweep-outline 963 | mode: single 964 | sequence: 965 | - condition: template 966 | value_template: | 967 | {% if is_state('input_boolean.vacuum_room1','on') or 968 | is_state('input_boolean.vacuum_room2','on') or 969 | is_state('input_boolean.vacuum_room3','on') or 970 | is_state('input_boolean.vacuum_room4','on') or 971 | is_state('input_boolean.vacuum_room5','on') or 972 | is_state('input_boolean.vacuum_room6','on')%}True{% else %}False{% endif %} 973 | - service: script.turn_on 974 | entity_id: script.telegram_send_message 975 | data_template: 976 | variables: 977 | emoji: "\U0001F9F9" 978 | message: | 979 | {%- set text = '' %} 980 | {%- if is_state('input_boolean.vacuum_room1','on') %}{% set text = state_attr('input_boolean.vacuum_room1','friendly_name') %}{% endif %} 981 | {%- if is_state('input_boolean.vacuum_room2','on') %} 982 | {%- if text != '' %}{% set text = text+',' %}{% endif %} 983 | {% set text = text+state_attr('input_boolean.vacuum_room2','friendly_name') %}{% endif %} 984 | {%- if is_state('input_boolean.vacuum_room3','on') %} 985 | {%- if text != '' %}{% set text = text+',' %}{% endif %} 986 | {% set text = text+state_attr('input_boolean.vacuum_room3','friendly_name') %}{% endif %} 987 | {%- if is_state('input_boolean.vacuum_room4','on') %} 988 | {%- if text != '' %}{% set text = text+',' %}{% endif %} 989 | {% set text = text+state_attr('input_boolean.vacuum_room4','friendly_name') %}{% endif %} 990 | {%- if is_state('input_boolean.vacuum_room5','on') %} 991 | {%- if text != '' %}{% set text = text+',' %}{% endif %} 992 | {% set text = text+state_attr('input_boolean.vacuum_room5','friendly_name') %}{% endif %} 993 | {%- if is_state('input_boolean.vacuum_room6','on') %} 994 | {%- if text != '' %}{% set text = text+',' %}{% endif %} 995 | {% set text = text+state_attr('input_boolean.vacuum_room6','friendly_name') %}{% endif %} 996 | Выбранны комнаты для уборки: {{text}} 997 | target: 998 | - !secret telegram_bot_chat_id_sasha 999 | sound: "auto" 1000 | - service: script.turn_on 1001 | entity_id: script.vacuum_clean_select_room 1002 | data_template: 1003 | variables: 1004 | rooms: | 1005 | {%- set text = '' -%} 1006 | {%- if is_state('input_boolean.vacuum_room1','on') %}{%- set text = '1' %}{% endif %} 1007 | {%- if is_state('input_boolean.vacuum_room2','on') %} 1008 | {%- if text != '' %}{%- set text = text+',' %}{% endif %} 1009 | {%- set text = text+'2' %}{% endif %} 1010 | {%- if is_state('input_boolean.vacuum_room3','on') %} 1011 | {%- if text != '' %}{%- set text = text+',' %}{% endif %} 1012 | {%- set text = text+'3' %}{% endif %} 1013 | {%- if is_state('input_boolean.vacuum_room4','on') %} 1014 | {%- if text != '' %}{%- set text = text+',' %}{% endif %} 1015 | {%- set text = text+'4' %}{% endif %} 1016 | {%- if is_state('input_boolean.vacuum_room5','on') %} 1017 | {%- if text != '' %}{%- set text = text+',' %}{% endif %} 1018 | {%- set text = text+'5' %}{% endif %} 1019 | {%- if is_state('input_boolean.vacuum_room6','on') %} 1020 | {%- if text != '' %}{%- set text = text+',' %}{% endif %} 1021 | {%- set text = text+'6' %}{% endif %} 1022 | {%- set text = '[2,"{\\"mapId\\":1626189155,\\"segmentId\\":[' + text + ']}"]' %} 1023 | {{text}} 1024 | 1025 | vacuum_clean_select_room: 1026 | alias: 'Уборка выбранных комнат' 1027 | mode: single 1028 | fields: 1029 | rooms: 1030 | description: 'Команда с номерами комнат' 1031 | example: 'Указывается полностью команда уборки комнаты' 1032 | sequence: 1033 | - service: xiaomi_miot.call_action 1034 | data: 1035 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1036 | did: !secret xiaomi_cloud_did 1037 | siid: 14 1038 | aiid: 1 1039 | params: "{{ rooms }}" 1040 | 1041 | vacuum_start_clean_all: 1042 | alias: "Уборка всей квартиры" 1043 | icon: mdi:vacuum-outline 1044 | mode: single 1045 | sequence: 1046 | - service: vacuum.start 1047 | data: 1048 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1049 | 1050 | vacuum_reset_brush_life_level: 1051 | alias: "Сброс показаний" 1052 | icon: mdi:backup-restore 1053 | mode: single 1054 | sequence: 1055 | - service: xiaomi_miot.call_action 1056 | data: 1057 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1058 | siid: 11 1059 | aiid: 1 1060 | params: [] 1061 | throw: false 1062 | - delay: '00:20:00' 1063 | 1064 | vacuum_reset_brush_life_level_2: 1065 | alias: "Сброс показаний" 1066 | icon: mdi:backup-restore 1067 | mode: single 1068 | sequence: 1069 | - service: xiaomi_miot.call_action 1070 | data: 1071 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1072 | siid: 12 1073 | aiid: 1 1074 | params: [] 1075 | throw: false 1076 | - delay: '00:20:00' 1077 | 1078 | vacuum_reset_brush_life_level_3: 1079 | alias: "Сброс показаний" 1080 | icon: mdi:backup-restore 1081 | mode: single 1082 | sequence: 1083 | - service: xiaomi_miot.call_action 1084 | data: 1085 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1086 | siid: 15 1087 | aiid: 1 1088 | params: [] 1089 | throw: false 1090 | - delay: '00:20:00' 1091 | 1092 | vacuum_reset_filter_life_level: 1093 | alias: "Сброс показаний" 1094 | icon: mdi:backup-restore 1095 | mode: single 1096 | sequence: 1097 | - service: xiaomi_miot.call_action 1098 | data: 1099 | entity_id: vacuum.vacuum_cleaner_robot_cleaner 1100 | siid: 10 1101 | aiid: 1 1102 | params: [] 1103 | throw: false 1104 | - delay: '00:20:00' 1105 | --------------------------------------------------------------------------------