-
-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Support of Xiaomi Miot vacuum platform #251
Comments
@fewdji can you provide a more detailed description for these services? (including stuff passed in params) |
siid and aiid are ids of actions. {"areas":[[-1300,-2150,-20,-390,3,1,1]]} {"selects":[[4,1,3,3,1]]} |
I'm not sure if I understand everything correctly, can describe lines with vacuum_carpet:
sequence:
- service: xiaomi_miot.call_action
data:
entity_id: vacuum.dreame_d9
siid: 4 # vacuum-extend
aiid: 1 # start-clean
params:
- piid: 1 # ??? (is it work-mode? if so, in documentation it is marked as readonly)
value: 19 # ???
- piid: 10 # clean-extend-data
value: '{"areas":[[-1300,-2150,-20,-390,3,1,1]]}'
force_params: true vacuum_room:
sequence:
- service: xiaomi_miot.call_action
data:
entity_id: vacuum.dreame_d9
siid: 4 # vacuum-extend
aiid: 1 # start-clean
params:
- piid: 1 # ??? (is it work-mode? if so, in documentation it is marked as readonly)
value: 18 # ???
- piid: 10 # clean-extend-data
value: '{"selects":[[4,1,3,3,1]]}'
force_params: true It seems that every device has its own specific values for siid/aiid/piid + own formats for values, am I right? |
params:
- piid: 1 # work mode
value: 19 # cleaning by room params:
- piid: 1 # work mode
value: 18 # cleaning by zones You're right every model has own values for siid/aiid/piid. service: xiaomi_miot.call_action
data:
entity_id: vacuum.dreame_d9
siid: 4
aiid: 1
params:
- piid: 1
value: 19
- piid: 10
value: '{"areas":[[%coordinates%,%repeats%,1,1]]}' # just like example
force_params: true |
Ok, I don't really want to add a separate platform for each vacuum from this integration. Custom platform already exists: you don't provide The problem is that currently it is not possible to substitute a part of a value, just whole value, so it can't be used to describe |
Agree with the first sentence. |
Template processor has been improved in v2.0.9. Now it is possible to use
|
Hello. Can't get the roidmi eve vacuum cleaner to work properly. It doesn't have siid vacuum-extend. https://home.miot-spec.com/spec/roidmi.vacuum.v60 I have already tried the commands, but I cannot start cleaning the zone. |
How did you find out about the exact values needed for Edit: I checked again - if i provide both
i get
i get |
I used modificated version of MiHome (by vevs). It allows to log all command which sends to the vacuum. |
Thanks! |
Found the issue. If someone has the same problem: in this scenario (checked for rooms) @fewdji's example works 100% for the W10, the devices are really similar. My problem was that I had |
And what can we do in case of multiselected rooms or areas? |
This comment was marked as outdated.
This comment was marked as outdated.
Great! Thanks a lot! |
@inviz-ize please confirm if it works |
Jinja templates are resolved later by HA core, not by the card. You can paste this output to dev tools template tester to check out if everything is correct. |
Checked it with dev tools.
Seems that all should be ok. I'm receiving success message from the card, but still my vacuum doing nothing. Will try to debug deeper |
Ok, can you try to use following data in manual service call from dev tools? service: xiaomi_miot.call_action
data: {
"entity_id": "vacuum.ksiushka",
"siid": 18,
"aiid": 1,
"params": [
{
"piid": 1,
"value": 18
},
{
"piid": 21,
"value": '{"selects":[[6,1,3,3,1],[3,1,3,3,1]]}'
}
],
"force_params": true
} |
Checked this. Works fine. |
Hmmm, is there anything in logs? Maybe resolving templates doesn't work for all services... |
:( it worked here Can you try following one? It should create a notification instead - template: vacuum_clean_segment
max_selections: 5
repeats_type: EXTERNAL
max_repeats: 5
service_call_schema:
service: persistent_notification.create
service_data:
title: 'Command to [[entity_id]]'
message: '{"selects":[{% for s in [[selection]] %}[{{s}},[[repeats]],1,3,3]{% if not loop.last %},{% endif %}{% endfor %}]}'
predefined_selections:
... |
Although I found viomi v5 pro command and ids but I am not familiar with coding to match the other models cods. would appreciate to give me an example. it is how I added: type: custom:xiaomi-vacuum-map-card
entity: vacuum.v38_cloud_146784
map_source:
camera: camera.xiaomi_cloud_map_extractor
calibration_source:
camera: true
map_modes:
- template: vacuum_goto
- template: vacuum_clean_zone
max_selections: 1
repeats_type: EXTERNAL
max_repeats: 5
service_call_schema:
service: xiaomi_miot_raw.call_action
service_data:
entity_id: vacuum.v38_cloud_146784
siid: 18 # vacuum-extend
aiid: 1 # start-clean
params:
- piid: 1 # work mode
value: 19
- piid: 21 # clean-info
value: '{"areas":[[[[selection_unwrapped]],[[repeats]],1,1]]}'
force_params: true
- template: vacuum_clean_segment
predefined_selections:
- id: 1
label:
text: Room 1 |
Here you have yaml with fixed indentaion: type: custom:xiaomi-vacuum-map-card
entity: vacuum.v38_cloud_146784
map_source:
camera: camera.xiaomi_cloud_map_extractor
calibration_source:
camera: true
map_modes:
- template: vacuum_goto
- template: vacuum_clean_zone
max_selections: 1
repeats_type: EXTERNAL
max_repeats: 5
service_call_schema:
service: xiaomi_miot_raw.call_action
service_data:
entity_id: vacuum.v38_cloud_146784
siid: 18 # vacuum-extend
aiid: 1 # start-clean
params:
- piid: 1 # work mode
value: 19
- piid: 21 # clean-info
value: '{"areas":[[[[selection_unwrapped]],[[repeats]],1,1]]}'
force_params: true
- template: vacuum_clean_segment
predefined_selections:
- id: 1
label:
text: Room 1 |
I have a problem with the configuration of the Xiaomi Mijia 1C (dreame.vacuum.mc1808). Camera Map Extractor downloaded the map. I can see the vacuum cleaner on the tab, but when turned on, it does not draw a path in live view. The vacuum cleaner disappears. Only after entering the Xaiomi Home application on the smartphone does it refresh the map, but this is not always the case. The status of the camera.xiaomi_cloud_map_extractor entity is still idle even when I turn on the vacuum cleaner. camera:
- platform: xiaomi_cloud_map_extractor
host: !secret vacuum_ip
token: !secret vacuum_token
username: !secret xiaomi_user
password: !secret xiaomi_pass
country: de
colors:
color_map_inside: [32, 115, 185]
color_map_outside: [19, 87, 148]
color_map_wall: [255, 255, 255]
color_map_wall_v2: [93, 109, 126]
color_grey_wall: [93, 109, 126]
color_ignored_obstacle: [0, 0, 0, 127]
color_ignored_obstacle_with_photo: [0, 0, 0, 127]
color_obstacle: [0, 0, 0, 127]
color_obstacle_with_photo: [0, 0, 0, 127]
color_path: [0, 0, 0]
color_goto_path: [0, 0, 0]
color_predicted_path: [255, 255, 0, 0]
color_cleaned_area: [127, 127, 127, 127]
color_zones: [0xAD, 0xD8, 0xFF, 0x8F]
color_zones_outline: [0xAD, 0xD8, 0xFF]
color_virtual_walls: [255, 0, 0]
color_new_discovered_area: [64, 64, 64]
color_no_go_zones: [255, 33, 55, 127]
color_no_go_zones_outline: [255, 0, 0]
color_no_mop_zones: [163, 130, 211, 127]
color_no_mop_zones_outline: [163, 130, 211]
color_charger: [0x66, 0xfe, 0xda, 0x7f]
color_robo: [211, 238, 106]
color_room_names: [255, 255, 255]
color_unknown: [0, 0, 0]
color_scan: [0xDF, 0xDF, 0xDF]
room_colors:
1: [240, 178, 122]
2: [88, 214, 141]
3: [217, 136, 128]
4: [52, 152, 219]
draw: ["all"]
# - charger
# - cleaned_area
# - goto_path
# - ignored_obstacles
# - ignored_obstacles_with_photo
# - no_go_zones
# - no_mopping_zones
# - obstacles
# - obstacles_with_photo
# - path
# - predicted_path
# - room_names
# - vacuum_position
# - virtual_walls
# - zones
attributes:
- calibration_points
- charger
# - cleaned_rooms
- country
# - goto
# - goto_path
# - goto_predicted_path
- image
- is_empty
- map_name
- no_go_areas
- no_mopping_areas
- obstacles
# - ignored_obstacles
- obstacles_with_photo
# - ignored_obstacles_with_photo
- path
- room_numbers
- rooms
- vacuum_position
# - vacuum_room
# - vacuum_room_name
# - walls
# - zones
scan_interval:
seconds: 10
auto_update: true
store_map_raw: false
store_map_image: true
store_map_path: "/tmp"
force_api: dreame
lovelace-xiaomi-vacuum-map-card: type: custom:xiaomi-vacuum-map-card
map_source:
camera: camera.xiaomi_cloud_map_extractor
calibration_source:
camera: true
entity: vacuum.dreame_mc1808_659b_robot_cleaner
vacuum_platform: send_command
map_locked: true
tiles: null
map_modes:
- template: vacuum_clean_zone
max_selections: 1
repeats_type: EXTERNAL
max_repeats: 5
service_call_schema:
service: xiaomi_miot.call_action
service_data:
entity_id: vacuum.dreame_mc1808_659b_robot_cleaner
siid: 18
aiid: 1
params:
- piid: 1
value: 19
- piid: 21
value: '{"areas":[[[[selection_unwrapped]],[[repeats]],1,1]]}'
force_params: true
- template: vacuum_goto
- template: vacuum_clean_segment
max_selections: 4
repeats_type: EXTERNAL
max_repeats: 3
service_call_schema:
service: xiaomi_miot.call_action
service_data:
entity_id: vacuum.dreame_mc1808_659b_robot_cleaner
siid: 18
aiid: 1
params:
- piid: 1
value: 18
- piid: 6
value: 0
- piid: 21
value: '{"selects":[[[[selection_unwrapped]],[[repeats]],3,3,1]]}'
force_params: true
predefined_selections:
- id: 1
outline:
- - -1917
- 3637
- - -1917
- 5464
- - -706
- 5464
- - -706
- 3637
label:
text: Łazienka
x: -1350
'y': 4634
offset_y: 35
icon:
name: mdi:shower
x: -1350
'y': 4634
- id: 2
outline:
- - 323
- 2953
- - 323
- 5834
- - 2823
- 5834
- - 2823
- 2953
label:
text: Pokój
x: 1500
'y': 4334
offset_y: 35
icon:
name: mdi:chair-rolling
x: 1500
'y': 4334
- id: 3
outline:
- - -4035
- 3614
- - -4035
- 5344
- - -2915
- 5344
- - -2915
- 3614
- - 452
- 3794
- - 452
- -1465
- - -3897
- -1465
- - -3897
- 3794
label:
text: Salon
x: -1650
'y': 200
offset_y: 35
icon:
name: mdi:sofa
x: -1650
'y': 200
- id: 4
outline:
- - 412
- -770
- - 412
- 2680
- - 3103
- 2680
- - 3103
- -770
label:
text: Sypialnia
x: 1400
'y': 2050
offset_y: 35
icon:
name: mdi:bed-king-outline
x: 1400
'y': 2050 |
@Xander124 it's a kown issue, see PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor#299 |
are jinja templates already supported? @PiotrMachowski |
Hi |
@lokaelmo #318 |
I did exactly that, path isn't supported in my vacuum so I switched to default but still the path doesn't show in the card |
use custom: xiaomi-vacuum-map-card. When selecting vacuum_clean_zone, hold
down the orange start button for 2-5 seconds and release it, you should see
a message like in the attachment.
|
thanks for replying, I can't see the attachment, where can I find the orange start button |
@lokaelmo colors depend on selected theme. It is a "play" with a small icon of currently selected mode. Instructions provided by @Xander124 do not match your question. You have to draw a path, not zone. If you have troubles achieving it in current version of the card you can wait a few days, there's a big release coming, it will make everything easier. |
ok, thanks a lot |
Does someone here have a template for the z10 pro? |
I saw jinja rendering is out since #447 but I'm still getting the following error log on HA:
This is what my configuration looks like: - template: vacuum_clean_segment
max_selections: 8
repeats_type: EXTERNAL
max_repeats: 3
service_call_schema:
service: xiaomi_miot.call_action
service_data:
entity_id: '[[entity_id]]'
siid: 18
aiid: 1
params:
- piid: 1
value: 18
- piid: 21
value: {"selects":[{% for s in [[selection]] %}[{{s}},1,1,3,1]{% if not loop.last %},{% endif %}{% endfor %}]}
force_params: true Could anybody make it work with the jinja template? |
- template: vacuum_clean_segment
max_selections: 8
repeats_type: EXTERNAL
max_repeats: 3
service_call_schema:
evaluate_data_as_template: true
service: xiaomi_miot.call_action
service_data:
entity_id: '[[entity_id]]'
siid: 18
aiid: 1
params:
- piid: 1
value: 18
- piid: 21
value: {"selects":[{% for s in ('[[selection]]'|from_json) %}[{{s}},1,1,3,1]{% if not loop.last %},{% endif %}{% endfor %}]}
force_params: true |
Thank you very much @PiotrMachowski. It worked! 🎉 |
Hey. Is it possible to use the GoTo action with xiaomi miot? |
I think I found a solution to change the scan interval when the device is docked/not docked. If you set the default scan interval to 14400 seconds ( 4 hours ) in the configuration.yaml file and ten use the following 2 automations. alias: update xiaomi map extractor
description: ""
trigger:
- platform: time_pattern
seconds: "15"
condition: []
action:
- service: homeassistant.update_entity
data: {}
target:
entity_id: camera.xiaomi_cloud_map_extractor
initial_state: "off"
mode: restart
alias: start/stop xiaomi fast scan interval
description: ""
trigger:
- platform: state
entity_id:
- vacuum.roborock_s6
condition: []
action:
- if:
- condition: state
entity_id: vacuum.roborock_s6
state: docked
then:
- service: automation.turn_off
data: {}
target:
entity_id: automation.update_xiaomi_map_extractor
else:
- service: automation.turn_on
data: {}
target:
entity_id: automation.update_xiaomi_map_extractor
mode: single EDIT: Had to do a small change in the second automations. I tested the automations and ot works for me. |
Was anyne able to integrate Xiaomi S12? |
I have the room cleaning and zone cleaning not found issue in roborock s5
any revised code please? |
@FilipeOS do not use Miot integration with Roborock S5, use built-in Xiaomi Miio integration |
Yes I tried that after I post here and I finally got everything working thank you. |
I just don't understand why I keep getting invalid calibration map when I open the vaccums... In configuration file I just have calibration points enabled since was all working and setup |
Calibration error is displayed when map is missing |
How can I prevent this from happening since on Xiaomi map is always there? |
Description
Please add support of al-one/hass-xiaomi-miot platform.
Solution
Example of calling service for zone cleaning:
...and room:
Alternatives
No response
Context
No response
The text was updated successfully, but these errors were encountered: