Skip to content

Let schedules choose vacuum, mop and suction options - #30

Closed
virtitnerd wants to merge 3 commits into
DonSidro:masterfrom
virtitnerd:feat/schedule-settings
Closed

virtitnerd wants to merge 3 commits into
DonSidro:masterfrom
virtitnerd:feat/schedule-settings

Conversation

@virtitnerd

Copy link
Copy Markdown
Contributor

Problem

A schedule only had a time and weekdays, so it always ran with whatever settings the robot happened to have. The official app lets each schedule choose vacuum only, vacuum and mop, or mop only, each with its own suction, water level, mop route and pass count.

Changes

  • Wire format: the options ride in the action object of set_timer and come back in get_timer: ["start_clean", {"fan_power": 102, "water_box_mode": 200, ...}]. With nothing chosen the object is the {} this app always sent, so a robot or server that ignores the extra keys behaves as before.
  • Model: TimerSettings (fan power, water, mop route, repeat) and a TimerKind (Current / Vacuum / Vac and mop / Mop) in CleanTimer.kt. Mopping without a water level falls back to medium, vacuum only drops water and route, mop only drops suction.
  • Editing: tapping a schedule opens it for editing. An option that is dropped is sent as null so it is cleared instead of kept.
  • UI: a cleaning-type selector and the matching suction, water, route and pass pickers on the schedule screen.

Out of scope

  • Per-room schedule settings.
  • Whether a given firmware keeps these keys is up to the robot. Firmware that drops them runs the schedule with its current settings, as before.

Tested

  • Unit tests: TimerSettingsTest covers kind detection, settings per kind and the action-object payload, including the null clearing case. ./gradlew :composeApp:testDebugUnitTest: 200 tests, 0 failures.
  • Device: built the Android app, installed it on a phone and exercised schedules against a Qrevo Pro.

A schedule only had a time and weekdays, so it always ran with whatever
settings the robot happened to have. The official app lets each schedule
vacuum only, vacuum and mop, or mop only, with its own suction, water
level, mop route and pass count.

Those options now ride in the action object of set_timer and come back
in get_timer: ["start_clean", {"fan_power": 102, "water_box_mode": 200,
...}]. With none chosen the object is the {} this always sent, so a
robot or server that ignores the extra keys behaves as before. Tapping a
schedule opens it for editing; a dropped option is sent as null so it is
cleared instead of kept.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@DonSidro
DonSidro self-requested a review October 17, 2026 20:39

@DonSidro DonSidro left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, it's a nice addition and the code is easy to follow. Tests pass on my end too.
Before I merge I want to make sure the robot actually uses these settings and doesn't just quietly ignore them. Could you try this on your Qrevo Pro:

  1. Make a schedule with something you'd notice, like Mop only or Max suction, then leave the Schedule screen and come back. Is it still there, with the same settings?
  2. If you can, send get_timer from HA or check your server log, and paste the entry. That shows whether the robot kept the keys.
  3. Let one run, or set one for a couple of minutes from now, and check that it really cleaned with those settings.

Also, a few changes I'd like:

  • For editing, does set_timer with the same id replace the old schedule on your robot? If it does, I'd rather leave a removed option out instead of sending null, because some firmwares get picky about null values. If you're not sure, deleting the old schedule and adding it again is the safe way.
  • Can createTimer and updateTimer check the robot's answer (requireOk) and show an error when it's refused? Right now a refused save looks like it worked. Someone hit exactly that in #28.
    Once those are sorted I'm happy to merge it.

virtitnerd and others added 2 commits October 17, 2026 17:03
createTimer and updateTimer ignored the robot's reply, so a refused save
looked like it worked. They now require an ok answer and the schedule
screen shows the robot's error, then reads the list back so it matches
what the robot holds.

Editing no longer sends null for a dropped option, since some firmwares
are picky about null values. It deletes the old schedule and adds it
again with the same id and on/off state, and puts the old one back if the
new one is refused. An option that is not chosen is simply left out.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Each option row scrolled sideways, so in the edit dialog the chosen
cleaning type (Mop) sat off-screen and the schedule looked unselected.
The chips now wrap onto more lines.

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

Copy link
Copy Markdown
Contributor Author

Thanks for the review, and sorry for the churn. I'm closing this one and replacing it with #37 (the scheduling work) and #38 (the time picker, which stands on its own), because what I found while checking your three points changed what this PR needs to be.

Your two requested changes were right and are the first commits of #37: a refused save is now shown as an error (requireOk), and an edit deletes the old schedule and adds it again instead of sending null.

On your three checks, with one caveat: my setup answers set_timer from local_roborock_server's schedule store, so this tells you what the app sends and reads back more than what the robot's own firmware keeps.

  1. I made a Mop only schedule, left the screen and came back, and it was still there. Editing it for more water kept the change.
  2. get_timer returns the keys: ["1792291838","on",["00 11 * * 1,3,5",["start_clean",{"repeat":1,"fan_power":102,"water_box_mode":202,"mop_mode":300,"segments":"0","clean_mop":1}]]]
  3. A schedule set a minute ahead fired and started a clean. Separately, I confirmed the robot applies these options: a start carrying suction 102 and water 203 made it report exactly those, where it had been on 104 and 202.

What changed the scope:

#37 addresses #28.

@virtitnerd virtitnerd closed this Oct 18, 2026
@virtitnerd
virtitnerd deleted the feat/schedule-settings branch October 18, 2026 18:52
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.

2 participants