Skip to content

Implement Roborock dock cleaning fluid status#161098

Merged
joostlek merged 8 commits intohome-assistant:devfrom
pauloruberto:dev
Jan 27, 2026
Merged

Implement Roborock dock cleaning fluid status#161098
joostlek merged 8 commits intohome-assistant:devfrom
pauloruberto:dev

Conversation

@pauloruberto
Copy link
Copy Markdown
Contributor

@pauloruberto pauloruberto commented Jan 17, 2026

Proposed change

This PR adds a new binary sensor for detecting when the cleaning fluid is empty or not installed on Roborock docks. The automatic cleaning fluid dispenser is a feature on newer docks such as for the Saros Z70.

Testing

  • Ran tests and verified they passed: ./script/run-in-env.sh pytest tests/components/roborock/test_binary_sensor.py -v --snapshot-update
collected 2 items

 tests/components/roborock/test_binary_sensor.py::test_binary_sensors ✓                     50% █████
 tests/components/roborock/test_binary_sensor.py::test_clean_fluid_empty_with_feature_supported ✓100% ██████████
---------------------------------------- snapshot report summary -----------------------------------------
20 snapshots passed.

Results (0.84s):
       2 passed

Overwrote integration locally, verified that the cleaning fluid status showed up for my Saros Z70s, and did not show up for my QX Revo Ultra:
Screenshot 2026-01-16 at 11 28 53 PM

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

Copy link
Copy Markdown

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @pauloruberto

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link
Copy Markdown

Hey there @Lash-L, @allenporter, mind taking a look at this pull request as it has been labeled with an integration (roborock) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of roborock can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign roborock Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@allenporter
Copy link
Copy Markdown
Contributor

We're in the middle of adding a way to better check if certain status modes are supported, so that we only add entities when the device says they are supported without requiring status fetches on startup. I wonder if the is_clean_fluid_delivery_supported feature is what controls this?

Copy link
Copy Markdown

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @pauloruberto

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@pauloruberto
Copy link
Copy Markdown
Contributor Author

I wonder if the is_clean_fluid_delivery_supported feature is what controls this?

@allenporter Hmm yeah it seems like it should be, I'll give that a shot and see if it works as expected

@Lash-L
Copy link
Copy Markdown
Contributor

Lash-L commented Jan 17, 2026

I wonder if the is_clean_fluid_delivery_supported feature is what controls this?

@allenporter Hmm yeah it seems like it should be, I'll give that a shot and see if it works as expected

From what i can see that does seem to be a good indicator. I think we need to fully implement some of the more complex dock support to get a slightly better indicator, but that one is a great first pass.

Comment thread tests/components/roborock/snapshots/test_binary_sensor.ambr
@pauloruberto pauloruberto marked this pull request as ready for review January 20, 2026 01:36
Copilot AI review requested due to automatic review settings January 20, 2026 01:36
@pauloruberto pauloruberto requested a review from Lash-L January 20, 2026 01:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for detecting when cleaning fluid is empty or not installed on Roborock docks with automatic cleaning fluid dispensers (e.g., Saros Z70). The implementation adds a new binary sensor that only appears when the device supports the cleaning fluid delivery feature.

Changes:

  • Adds conditional binary sensor for cleaning fluid status based on device feature support
  • Implements feature detection mechanism using feature_supported callable in entity descriptions
  • Extends test coverage to verify entity creation when feature is supported
  • Adds appropriate translations and icons for the new sensor

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
homeassistant/components/roborock/binary_sensor.py Adds new clean_fluid_empty sensor with feature detection support and filtering logic
homeassistant/components/roborock/strings.json Adds translation key for the cleaning fluid sensor name
homeassistant/components/roborock/icons.json Adds spray-bottle icon for the cleaning fluid sensor
tests/components/roborock/test_binary_sensor.py Adds test to verify entity creation when cleaning fluid feature is supported
tests/components/roborock/mock_data.py Adds clean_fluid_status field to mock device data
tests/components/roborock/conftest.py Adds device_features trait mock with is_clean_fluid_delivery_supported flag

"name": "Water shortage"
},
"clean_fluid_empty": {
"name": "Cleaning fluid"
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The entity name "Cleaning fluid" is ambiguous for a binary sensor with device class PROBLEM. When the sensor is "on", it indicates a problem (empty/not installed), but the name doesn't clearly convey this. Consider renaming to "Cleaning fluid empty" to match the pattern used by the similar "Water shortage" sensor and make the problem state clear to users.

Suggested change
"name": "Cleaning fluid"
"name": "Cleaning fluid empty"

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is a good change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure if we wanted to keep it more generic since this sensor can mean either cleaning fluid empty, or cleaning fluid container not installed 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good point! You have convinced me! Can you include this in a docs pr as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What does not installed mean? If the device doesn't have this, why do we provide this entity at all?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not installed as in physically. You can physically remove it and it will give this error or if it's empty it will give this error

Comment thread homeassistant/components/roborock/binary_sensor.py Outdated
@pauloruberto pauloruberto requested a review from Lash-L January 25, 2026 14:20
Copy link
Copy Markdown
Contributor

@Lash-L Lash-L left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thank you!

Copy link
Copy Markdown
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

The prek checks are failing, can you take a look?

@home-assistant home-assistant bot marked this pull request as draft January 26, 2026 14:26
@home-assistant
Copy link
Copy Markdown

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@pauloruberto
Copy link
Copy Markdown
Contributor Author

The prek checks are failing, can you take a look?

Seems like it was just due to json ordering, updated it and verified that the prettier passes locally

@pauloruberto pauloruberto marked this pull request as ready for review January 26, 2026 14:35
@home-assistant home-assistant bot requested a review from joostlek January 26, 2026 14:35
@home-assistant home-assistant bot dismissed stale reviews from themself January 26, 2026 14:35

Stale

@joostlek joostlek merged commit 0e08a6a into home-assistant:dev Jan 27, 2026
34 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants