Skip to content

Conversation

@javicalle
Copy link
Collaborator

Proposed change

Adds the Sonoff MINI ZBRBS cover quirk.

Additional information

All the functionality can be accessed from the device's button, but I think it's more practical to expose it using this quirk.

Fixes #4422

The implemented functionalities are:

  • External trigger mode (short press button x3)
  • Automatic limits configuration (hold button > 10s)
  • Cover calibration status sensor

The remaining cluster attributes can be read from the "Manage Zigbee device" option. There are 2 unknown attributes:

  • 0x0010 (factory value 515)
  • 0x0012 (factory value 10)

I think it would be interesting to implement a workflow to allow manual (in addition to automatic) limit configuration. I believe I've seen something similar implemented somewhere (launching a workflow from the device settings), but I haven't been able to locate it (and I'm not sure if it would be possible to implement it from a quirk). For now, we only have the option of automatic configuration.

The cover_status entity has been added but disabled. Although it doesn't provide relevant information, it can be useful when creating automations.

Device diagnostics

zha-01KCD5D01VQYCT0HG3EAYSAFVF-SONOFF MINI-ZBRBS-d4136b73cf379046720b391adee464be.json

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works
  • Device diagnostics data has been attached

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.30%. Comparing base (35d1fc1) to head (ce31e82).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4586      +/-   ##
==========================================
+ Coverage   92.28%   92.30%   +0.01%     
==========================================
  Files         371      372       +1     
  Lines       12158    12185      +27     
==========================================
+ Hits        11220    11247      +27     
  Misses        938      938              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@javicalle
Copy link
Collaborator Author

I've tried to search for an already existing translation_key for the new entities but I've not be able to get a good ones.

Just to make use of existing translations
Extend the rename to attribute and classes
@javicalle
Copy link
Collaborator Author

I changed the translation_key to use an already existing one (motor_state).

@javicalle
Copy link
Collaborator Author

Also I am thinking about change the cover_calibrated from enum to binary_sensor with a PROBLEM' device_class.

`cover_calibrated` as a `binary_sensor` entity
    .binary_sensor(
        SonoffCluster.AttributeDefs.cover_calibrated.name,
        SonoffCluster.cluster_id,
        entity_type=EntityType.DIAGNOSTIC,
        device_class=BinarySensorDeviceClass.PROBLEM,
        attribute_converter=lambda value: not value,
        translation_key="calibrated",
        fallback_name="Calibrated",
    )

It may not be a very orthodox solution, but I think it will be quite eye-catching for the user.

The current implementation will generate the entity like this (ignore the literals):
image

The binary_sensor approach would be like that:

image image

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.

[Device Support Request] SONOFF MINI-ZBRBS Smart Roller Shutter Switch

1 participant