miio.integrations.roborock.vacuum.vacuum module

class miio.integrations.roborock.vacuum.vacuum.RoborockVacuum(ip: str, token: str | None = None, start_id: int = 0, debug: int = 0, lazy_discover: bool = True, timeout: int | None = None, *, model=None)[source]

Bases: Device

Main class for roborock vacuums (roborock.vacuum.*).

actions() DescriptorCollection[ActionDescriptor]

Return device actions.

add_timer(cron: str, command: str, parameters: str, timer_id: str)[source]

Add a timer.

Parameters:
  • cron – schedule in cron format

  • command – ignored by the vacuum.

  • parameters – ignored by the vacuum.

call_action(name: str, params=None)

Call action by name.

carpet_cleaning_mode() CarpetCleaningMode | None[source]

Get carpet cleaning mode/avoidance setting.

carpet_mode() CarpetModeStatus[source]

Get carpet mode settings.

change_setting(name: str, params=None)

Change setting value.

child_lock() bool[source]

Get child lock setting.

clean_details(id_: int) CleaningDetails | None[source]

Return details about specific cleaning.

clean_history() CleaningSummary[source]

Return generic cleaning history.

configure_wifi(ssid, password, uid=0, timezone=None)[source]

Configure the wifi settings.

consumable_reset(consumable: Consumable)[source]

Reset consumable information.

consumable_status() ConsumableStatus[source]

Return information about consumables.

create_nogo_zone(x1, y1, x2, y2, x3, y3, x4, y4)[source]

Create a rectangular no-go zone (gen2 only?).

NOTE: Multiple nogo zones and barriers could be added by passing a list of them to save_map.

Requires new fw version. 3.3.9_001633+?

create_software_barrier(x1, y1, x2, y2)[source]

Create software barrier (gen2 only?).

NOTE: Multiple nogo zones and barriers could be added by passing a list of them to save_map.

Requires new fw version. 3.3.9_001633+?

delete_timer(timer_id: str)[source]

Delete a timer with given ID.

Parameters:

timer_id (str) – Timer ID

descriptors() DescriptorCollection[Descriptor]

Return a collection containing all descriptors for the device.

disable_dnd()[source]

Disable do-not-disturb.

dnd_status() DNDStatus[source]

Returns do-not-disturb status.

dust_collection_mode() DustCollectionMode | None[source]

Get the dust collection mode setting.

edit_map(start)[source]

Start map editing?

enable_lab_mode(enable)[source]

Enable persistent maps and software barriers.

This is required to use create_nogo_zone and create_software_barrier commands.

enable_log_upload()[source]
fan_speed()[source]

Return fan speed.

fan_speed_presets() Dict[str, int][source]

Return available fan speed presets.

find()[source]

Find the robot.

firmware_features() List[int][source]

Return a list of available firmware features.

Information: https://github.com/marcelrv/XiaomiRobotVacuumProtocol/blob/master/fw_features.md Feel free to contribute information from your vacuum if it is not yet listed.

fresh_map(version)[source]

Return fresh map?

get_backup_maps()[source]

Get backup maps.

classmethod get_device_group()[source]
get_maps() MapList[source]

Return list of maps.

get_properties(properties, *, property_getter='get_prop', max_properties=None)

Request properties in slices based on given max_properties.

This is necessary as some devices have limitation on how many properties can be queried at once.

If max_properties is None, all properties are requested at once.

Parameters:
  • properties (list) – List of properties to query from the device.

  • max_properties (int) – Number of properties that can be requested at once.

Returns:

List of property values.

get_room_mapping()[source]

Retrieves a list of segments.

get_segment_status()[source]

Get the status of a segment.

goto(x_coord: int, y_coord: int)[source]

Go to specific target.

Parameters:
  • x_coord (int) – x coordinate

  • y_coord (int) – y coordinate

home()[source]

Stop cleaning and return home.

info(*, skip_cache=False) DeviceInfo

Get (and cache) miIO protocol information from the device.

This includes information about connected wlan network, and hardware and software versions.

Parameters:

bool (skip_cache) – Skip the cache

install_sound(url: str, md5sum: str, sound_id: int)[source]

Install sound from the given url.

last_clean_details() CleaningDetails | None[source]

Return details from the last cleaning.

Returns None if there has been no cleanups.

load_map(map_enum: Enum | None = None, map_id: int | None = None)[source]

Change the current map used.

locale()[source]

Return locale information.

log_upload_status()[source]
manual_control(rotation: int, velocity: float, duration: int = 1500)[source]

Give a command over manual control interface.

manual_control_once(rotation: int, velocity: float, duration: int = 1500)[source]

Starts the remote control mode and executes the action once before deactivating the mode.

manual_start()[source]

Start manual control mode.

manual_stop()[source]

Stop manual control mode.

map()[source]

Return map token.

merge_segment()[source]
mop_dryer_settings() MopDryerSettings[source]

Get mop dryer settings.

mop_intensity() MopIntensity[source]

Get mop scrub intensity setting.

mop_mode() MopMode | None[source]

Get mop mode setting.

name_segment()[source]
pause()[source]

Pause cleaning.

persist_map(version)[source]

Return fresh map?

raw_command(command, parameters)

Send a raw command to the device. This is mostly useful when trying out commands which are not implemented by a given device instance.

Parameters:
  • command (str) – Command to send

  • parameters (dict) – Parameters to send

resume_or_start()[source]

A shortcut for resuming or starting cleaning.

resume_segment_clean()[source]

Resuming cleaning a segment.

resume_zoned_clean()[source]

Resume zone cleaning after being paused.

segment_clean(segments: List, repeat: int = 1)[source]

Clean segments.

Parameters:
  • segments (List) – List of segments to clean: [16,17,18]

  • repeat (int) – Count of iterations

send(command: str, parameters: Any | None = None, retry_count: int | None = None, *, extra_parameters=None) Any[source]

Send command to the device.

This is overridden to raise an exception on unknown methods.

send_handshake()

Send initial handshake to the device.

sensors() DescriptorCollection[PropertyDescriptor]

Return read-only properties.

serial_number()[source]

Get serial number.

set_carpet_cleaning_mode(mode: CarpetCleaningMode)[source]

Set carpet cleaning mode/avoidance setting.

set_carpet_mode(enabled: bool, stall_time: int = 10, low: int = 400, high: int = 500, integral: int = 450)[source]

Set the carpet mode.

set_child_lock(lock: bool) bool[source]

Set child lock setting.

set_dnd(start_hr: int, start_min: int, end_hr: int, end_min: int)[source]

Set do-not-disturb.

Parameters:
  • start_hr (int) – Start hour

  • start_min (int) – Start minute

  • end_hr (int) – End hour

  • end_min (int) – End minute

set_dust_collection(enabled: bool) bool[source]

Turn automatic dust collection on or off.

set_dust_collection_mode(mode: DustCollectionMode) bool[source]

Set dust collection mode setting.

set_fan_speed(speed: int)[source]

Set fan speed.

Parameters:

speed (int) – Fan speed to set

set_fan_speed_preset(speed_preset: int) None[source]

Set fan speed preset speed.

set_mop_dryer_dry_time(dry_time_seconds: int) bool[source]

Set mop dryer add-on dry time.

set_mop_dryer_enabled(enabled: bool) bool[source]

Set mop dryer add-on enabled.

set_mop_intensity(mop_intensity: MopIntensity)[source]

Set mop scrub intensity setting.

set_mop_mode(mop_mode: MopMode)[source]

Set mop mode setting.

set_sound_volume(vol: int)[source]

Set sound volume [0-100].

set_timezone(new_zone)[source]

Set the timezone.

set_waterflow(waterflow: WaterFlow)[source]

Set water flow setting.

settings() DescriptorCollection[PropertyDescriptor]

Return settable properties.

sound_info()[source]

Get voice settings.

sound_install_progress()[source]

Get sound installation progress.

sound_volume() int[source]

Get sound volume.

split_segment()[source]
spot()[source]

Start spot cleaning.

start()[source]

Start cleaning.

start_dust_collection()[source]

Activate automatic dust collection.

start_mop_drying() bool[source]

Start mop drying.

start_mop_washing() bool[source]

Start mop washing.

status() DeviceStatus[source]

Return status of the vacuum.

stop()[source]

Stop cleaning.

Note, prefer ‘pause’ instead of this for wider support. Some newer vacuum models do not support this command.

stop_dust_collection()[source]

Abort in progress dust collection.

stop_mop_drying() bool[source]

Stop mop drying.

stop_mop_washing() bool[source]

Start mop washing.

stop_segment_clean()[source]

Stop cleaning a segment.

stop_zoned_clean()[source]

Stop cleaning a zone.

supports_miot() bool

Return True if the device supports miot commands.

This requests a single property (siid=1, piid=1) and returns True on success.

test_sound_volume()[source]

Test current sound volume.

timer() List[Timer][source]

Return a list of timers.

timezone()[source]

Get the timezone.

update(url: str, md5: str)

Start an OTA update.

update_progress() int

Return current update progress [0-100].

update_state()

Return current update state.

update_timer(timer_id: str, mode: TimerState)[source]

Update a timer with given ID.

Parameters:
  • timer_id (str) – Timer ID

  • mode (TimerState) – either On or Off

use_backup_map(id: int)[source]

Set backup map.

vacuum_status() VacuumStatus[source]

Return only status of the vacuum.

waterflow() WaterFlow[source]

Get water flow setting.

zoned_clean(zones: List)[source]

Clean zones.

Parameters:

zones (List) – List of zones to clean: [[x1,y1,x2,y2, iterations],[x1,y1,x2,y2, iterations]]

MANUAL_DURATION_DEFAULT = 1500
MANUAL_ROTATION_MAX = 180
MANUAL_ROTATION_MIN = -180
MANUAL_VELOCITY_MAX = 0.3
MANUAL_VELOCITY_MIN = -0.3
property device_id: int

Return the device id (did).

property model: str

Return device model.

property raw_id: int

Return the last used protocol sequence id.

retry_count = 3
supported_models = ['rockrobo.vacuum.v1', 'roborock.vacuum.s4', 'roborock.vacuum.a19', 'roborock.vacuum.a01', 'roborock.vacuum.s5', 'roborock.vacuum.s5e', 'roborock.vacuum.s6', 'roborock.vacuum.t6', 'roborock.vacuum.a08', 'roborock.vacuum.a11', 'roborock.vacuum.a14', 'roborock.vacuum.a23', 'roborock.vacuum.a15', 'roborock.vacuum.a27', 'roborock.vacuum.a62', 'roborock.vacuum.a70', 'roborock.vacuum.a34', 'roborock.vacuum.a38', 'roborock.vacuum.a40', 'roborock.vacuum.a75', 'roborock.vacuum.a29', 'roborock.vacuum.a46', 'roborock.vacuum.a10', 'roborock.vacuum.e2', 'roborock.vacuum.m1s', 'roborock.vacuum.c1', 'roborock.vacuum.*']
timeout = 5
token: str | None