Xiaomi Vacuum S1/S60/T60/S61/T61 room cleaning by room name

Not as far as I know and I don’t believe it’s possible to root without disassembly.

It’s a pain as it’s the only robot in the range to have such great maps…

and mine crashed last week, my wife was using it and we have been swapping between floors using the backup maps. I think she left it looking for the docking station…which wasn’t there and it crashed in big style. I had to do a factory reset. Which meant finding the token again and re-finding all the relevant segment codes (took about 30mins). But would be great to just be able to carry out a restore function.

So alot info back and forth here,
What is the easiest way to get an s6 up and running now days? I guess that roborock app still is not supported, so going via mi home it is…?

Xiaomi app works with it, so does the roborock one, but you can’t use both at the same time.

To switch between them you have reset the WiFi, which resets the token I believe.

Personly prefer to use ours via homeasisstant. Its faster and more intuitive.

yeah i want to use it via homeassistant, but i cant get the token out of it if i have it connected to roborock now…?
i have to set it up with mi home, and then downgrade it with flolevac and get the token… or is it an easier way now?

Easiest way that I’ve found is to use the Xaomi mi home app version 5.4.49 and the token is in the txt file.

The roborock app gets the newer firmware quicker, but Mi home is more stable.

Can anyone confirm if the “room cleaning” api (app_segment_clean) works with the new firmware for the s50 model as it now supports room division like the s6 model does.

can confirm, just got it working without anything special after the upgrade.

One thing to note is that the command to get the room numbers returned nothing so i had to guess

They ended up being

1-2 (these were rooms autogenerated by the app after first run)
16-27 (these were ones i split and divided manually)

3 Likes

Room cleaning works like a charm. But can’t seem to get set_fan_speed to work… not from the built in vacuum card or by trying to make a card by myself… have you got it to work with the s6?
Fixed it. It doesn’t work writing percent value.
101-105 is the different fan settings…

I had issues with setting the fan_speed on my s5/s55 units as well after upgrading to the latest FW.
tried these values

101 standard
102 standard
103 standard
104 standard
105 gentle

all values except 105 puts the bot into standard speed :confused:

created an issue on gibhub

Hi, room cleaning is already out a while, but i see, no one started on the google assistant component? so you can say like, hey google, can you vacuum the kitchen?
This “zone” trait is already supported for Google Assistant, now we can only use start/stop
yes, i know its possible to run scrips/switches to clean zone
But using the offcial google trait is native and you can speak more natural, instead of those predefined commands…

i hardcoded this zone trait already a while ago in the google_assistant , and loaded it as a custom component, but since i am using nabu casa now, i cant override it anymore as a custom

below is what i did, i didnt code it myself though…

i hardcoded the rooms/zones it in the google assistant component, but if its going to be official, i think something need to change also in the xiaomi module itself, so we can define those zones in some other place… or maybe with the template vacuum component


from homeassistant.components.xiaomi_miio import vacuum as vacuum_xiaomi

    def sync_attributes(self):
        """Return StartStop attributes for a sync request."""
        return {'pausable':
                self.state.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
                & vacuum.SUPPORT_PAUSE != 0,
                'availableZones':['kitchen', 'living room']}

    async def execute(self, command, data, params):
        """Execute a StartStop command."""
        if command == COMMAND_STARTSTOP:
            if params['start']:
                if params.get('zone') is not None:
                    ZONES = {
                        'kitchen': [14600,17800,20450,21700],
                        'living room': [25480,17400,29530,22250],
                    }
                    await self.hass.services.async_call(
                        self.state.domain, vacuum_xiaomi.SERVICE_CLEAN_ZONE, {
                            ATTR_ENTITY_ID: self.state.entity_id,
                            'zone': [ZONES[params['zone']]],
                            'repeats': 1
                        }, blocking=True, context=data.context)
                else:
                    await self.hass.services.async_call(
                        self.state.domain, vacuum.SERVICE_START, {
                            ATTR_ENTITY_ID: self.state.entity_id
                        }, blocking=True, context=data.context)
            else:
                await self.hass.services.async_call(
                    self.state.domain, vacuum.SERVICE_STOP, {
                        ATTR_ENTITY_ID: self.state.entity_id
                    }, blocking=True, context=data.context)
        elif command == COMMAND_PAUSEUNPAUSE:
            if params['pause']:
                await self.hass.services.async_call(
                    self.state.domain, vacuum.SERVICE_PAUSE, {
                        ATTR_ENTITY_ID: self.state.entity_id
                    }, blocking=True, context=data.context)
            else:
                await self.hass.services.async_call(
                    self.state.domain, vacuum.SERVICE_START, {
                        ATTR_ENTITY_ID: self.state.entity_id
                    }, blocking=True, context=data.context)
1 Like

where do I insert this command : miio protocol call get_room_mapping

Valid room numbers can be retrieved using miio command-line tool. It will only give room numbers and not the room names. To get the room names, one can just test the app_segment_clean command and see which room it cleans.

miio protocol call <ip of the vacuum> get_room_mapping

Doesn’t work for me:

➜  ~ miio protocol call 10.0.40.35 get_room_mapping
 INFO  Attempting to call get_room_mapping on 10.0.40.35

 INFO  Device found, making call

 INFO  Got result:
[]
➜  ~ miio --version
0.15.6

Same here.
And giving miio protocol call 192.168.7.112 app_segment_clean ‘[1]’ or any number does nothing.

Same to me, I bet it’s something wrong with the new firmware on the new S50 model. Anyway, I managed to find the room IDs by trial-and-error, following what thecubical wrote:

So, if you have modified the rooms and the robot does not respond to low numbers, try numbers from 16 onwards.

Nothing even with number over 50 :sob: :sob: :sob:

Absolutely nothing??? Do you get at least an “ok” answer from the robot? If not, I would double check the syntax or the IP address… but first of all, have you set the token? As Dielee said you should set it with:

Did everything from previous posts:
Token is setted with no problem.
Just those 2 commands do nothing.

$ miio protocol call 10.10.10.8 get_room_mapping
INFO Attempting to call get_room_mapping on 10.10.10.8

INFO Device found, making call

INFO Got result:

and

$ miio protocol call 10.10.10.8 app_segment_clean ‘[50]’
INFO Attempting to call app_segment_clean on 10.10.10.8

INFO Device found, making call

for minutes. Just say nothing

mmm, I bet it’s something with the apostrophe character you are using… try to remove it, to me it works, i.e. like this:

You are a genius!!!

Is anyone here using the latest firmwere? I have an S5 and when I do “miio protocol call 10.0.1.13 get_room_mapping” I only get a return of []

However, if I do “miio protocol call 10.0.1.13 app_segment_clean ‘[4]’” it does go to a room (I just happened to guess that number, most I try are invalid, it must not do them sequentially.)

Is there a way to get the room mappings or even see what the current number is while I have chosen a room with the app?