Skip to content

fix(routines): send scene motor settings with set_clean_motor_mode - #247

Open
Aurel004 wants to merge 1 commit into
Python-roborock:mainfrom
Aurel004:fix/routine-clean-motor-mode
Open

Aurel004 wants to merge 1 commit into
Python-roborock:mainfrom
Aurel004:fix/routine-clean-motor-mode

Conversation

@Aurel004

Copy link
Copy Markdown

Problem

On newer firmware (seen on a QRevo Master, fw 02.28.26), routines started from the app or Home Assistant never move the robot while it is in SmartPlan mode.

The routine runner sends the scene settings one by one (set_custom_mode, set_water_box_custom_mode, set_mop_mode). In SmartPlan mode the firmware rejects each of them with -10005 "param error", so the routine aborts before app_segment_clean / app_start:

Routine step=1 method=do_scenes_segments command=set_custom_mode params=[102]
Routine task failed for device=...: {'code': -10005, 'message': 'param error!'}

The Roborock app changes these settings with a single set_clean_motor_mode call, which the firmware accepts in every mode (including switching into and out of SmartPlan: {"fan_power":110,"mop_mode":306,"water_box_mode":209}).

Fix

When a scene step carries fan_power, mop_mode and water_box_mode, _settings_commands now sends them together:

set_clean_motor_mode [{"fan_power": 102, "mop_mode": 300, "water_box_mode": 200}]
set_mop_template_id [300]        # unchanged, still optional
app_segment_clean [{"segments": [21], "repeat": 1}]

Steps that only carry some of these settings keep the previous per-setting commands, so older models are unaffected.

Testing

  • Added tests for segment and app-start steps with all three settings, and for a fan-power-only step (keeps set_custom_mode).
  • Full suite: uv run --extra dev pytest -q tests/ → 461 passed.
  • On the real robot in SmartPlan mode: the routine now runs (set_clean_motor_mode error=None, app_segment_clean error=None, robot enters segment cleaning). Tested it myself

Thanks

Newer firmware (seen on a QRevo, fw 02.28.26) rejects the individual
set_custom_mode / set_mop_mode / set_water_box_custom_mode commands with
-10005 "param error" while the robot is in SmartPlan mode. The routine
runner sent set_custom_mode first, so every routine aborted before the
cleaning command and the robot never moved.

When a scene step carries fan_power, mop_mode and water_box_mode, send
them together with set_clean_motor_mode, which is what the Roborock app
does and which the firmware accepts in every mode. Steps that only carry
some of these settings keep the previous per-setting commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant