Xiaomi Mijia 1C Sweeping Vacuum Cleaner (white) (STYTJ01ZHM)

As soon as possible I will do some test. Although I am not sure how to get the coordinates, but I will look for information.
Thank you very much!!.

Hi @concentric.

It works perfectly! You rock!

I don’t know why but HA is not showing me the same information as you.

image

Anyway, this is not a problem…

Great work!

1 Like

It works perfectly, also managed to get estimated cordinates of a room by looking in the mi home app and sending service data

Service: xiaomi_vacuum.vacuum_clean_zone

Service data:
entity_id: vacuum.robin
zone: '3019,2063,7424,6105'
repeats: 1

Thank you for helping us all.

1 Like

would you mind telling more about how you get the estimated coordinates from mi home app?

I have started it with
819,-263,4424,2105
and ended with
3019,2063,7424,6105

kept changing all the values one by one and in mi home go back to home page and click on the robot right after sending the command and we can see the rectangle

I’ve got it using the modified Mi Home app from:

It will create in the root folder of your phone a folder called “/vevs/logs/miio”. Search in the last modifed file when you use a zone cleaning and you will see something like this:

{“id”:9556,“method”:“action”,“params”:{“did”:“292175500”,“siid”:18,“aiid”:1,“in”:[{“piid”:1,“value”:19},{“piid”:21,“value”:“2213,4329,9706,5834”}]}}

i previously used “vacuum.xxx” to call for service. it is now “xiaomi_vacuum.xx”??
i cant find it in my service list

That’s because it’s not part of the general vacuum implementation of home assistant, but specific to the component itself.

Thanks, i have got cordinates
i could not find “logs/miio” inside “vevs” so have created it and restarted the app

Is there a possible to send multiple cordinates as my room is not square?

Get the coordinates and it works very well.
Thank you very much again @concentric!!!

I hope I can return the help in the future !!!

1 Like

How can I use the new service “xiaomi_vacuum.clean_zone”? Does’nt appear in Services for me

“I’m starting the zoned cleanup”. It works! Thanks @concentric! It’s only 8am here (in Melbourne) but you’ve made my day!

1 Like

you need to copy the folder in new branch of the repo, here

image

i managed to get it to work using call service from developer tools… but when i put it in script, it gives an error. what am i doing it wrong?

edit: nvm, i missed “data” after the entity_id

Now I’m trying to get it set up to clean zones using a drop down list with data_template. But I’m not having any luck “extra keys not allowed @ data[‘data_template’]” . Code below using the Dev Call service function (missing indents when posted here)

Backup plan is to use a script instead.

entity_id: vacuum.xoomba
data_template:
zone: >
{% if is_state('input_select.vacuum_areas', 'Entrance') %}
'-1183,1457,865,3624'
{%-elif is_state('input_select.vacuum_area', 'Kitchen') %}
'-3518,11265,-689,12830'
{% else %}
none
{% endif %}
repeats: 1’

I also tried the below but nothing happens:

entity_id: vacuum.xoomba
zone: >
{% if is_state('input_select.vacuum_areas', 'Entrance') %}
'-1183,1457,865,3624'
{%-elif is_state('input_select.vacuum_area', 'Kitchen') %}
'-3518,11265,-689,12830'
{% else %}
none
{% endif %}
repeats: 1

Does zone clean require multiple coordinates?
Currently you can only add 1

If I use this code by itself it works. I’m just trying to clean zones using a drop down selection & automation trigger.

entity_id: vacuum.xoomba
zone: '-1183,1457,865,3624'
repeats: 1

your code looks good…but can you check, i saw there is minus sign before your elif…probably that s why it doesnt work?

u wrote {%-elif instead of {% elif

The - isn’t it. I used the same format in another automation which works.

I don’t quite understand why it doesn’t work, but I’ve started using the script method anyway.

Inspired by this thread.

After all the feedback, i have merged the branch so those using hacs should automatically get the zone-cleaning now.

1 Like