SonoffLAN icon indicating copy to clipboard operation
SonoffLAN copied to clipboard

Add percentage-based position control for Sonoff MINI-ZBRBS shutter relay

Open Patxinho opened this issue 2 months ago • 4 comments

Hello, I am using the Sonoff MINI-ZBRBS Zigbee shutter relay with the SonoffLAN integration. Currently, the device is recognized and I can control it to fully open or fully close the blinds. However, there is no option to set a specific position percentage (e.g., set the blinds to 50%). The only available controls are for complete opening and closing.

Failed to upload "sonoff-04898d7589afe1d2874d902656dbba6a-Persiana cocina-e550d13604ef21a078886c989d1a35de.json"

Patxinho avatar Oct 16 '25 10:10 Patxinho

Show device diagnostics.

AlexxIT avatar Oct 16 '25 12:10 AlexxIT

{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2025.10.1",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.13.7",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Madrid",
    "os_name": "Linux",
    "os_version": "6.6.x",
    "container_arch": "amd64",
    "run_as_root": true
  },
  "custom_components": {
    "vesync": {
      "documentation": "https://www.home-assistant.io/integrations/vesync",
      "version": "1.3.2",
      "requirements": [
        "tv4you2016-pyvesync==0.0.5"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/use/",
      "version": "2.0.5",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "ideenergy": {
      "documentation": "https://github.com/ldotlopez/ha-ideenergy",
      "version": "2025.2.0",
      "requirements": [
        "ideenergy>=2.0.0rc1",
        "homeassistant-historical-sensor==2.0.0"
      ]
    },
    "ariston": {
      "documentation": "https://github.com/fustom/ariston-remotethermo-home-assistant-v3",
      "version": "0.19.8",
      "requirements": [
        "ariston==0.19.9"
      ]
    },
    "config_editor": {
      "documentation": "https://github.com/junkfix/config-editor-card",
      "version": "5.0.0",
      "requirements": []
    },
    "openplantbook": {
      "documentation": "https://github.com/Olen/home-assistant-openplantbook/",
      "version": "1.3.1",
      "requirements": [
        "json-timeseries==0.1.7",
        "openplantbook-sdk==0.4.7"
      ]
    },
    "localtuya": {
      "documentation": "https://github.com/rospogrigio/localtuya/",
      "version": "5.2.3",
      "requirements": []
    },
    "meross_lan": {
      "documentation": "https://github.com/krahabb/meross_lan",
      "version": "5.6.0",
      "requirements": []
    },
    "monitor_docker": {
      "documentation": "https://github.com/ualex73/monitor_docker",
      "version": "1.18",
      "requirements": [
        "aiodocker==0.22.0",
        "python-dateutil==2.9.0"
      ]
    },
    "portainer": {
      "documentation": "https://github.com/tomaae/homeassistant-portainer",
      "version": "0.0.0",
      "requirements": []
    },
    "xiaomi_cloud_map_extractor": {
      "documentation": "https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor",
      "version": "v2.2.5",
      "requirements": [
        "pillow",
        "pybase64",
        "python-miio",
        "requests",
        "pycryptodome"
      ]
    },
    "plant": {
      "documentation": "https://github.com/Olen/homeassistant-plant/",
      "version": "2025.8.0",
      "requirements": [
        "async-timeout>=4.0.2"
      ]
    },
    "dreame_vacuum": {
      "documentation": "https://github.com/Tasshack/dreame-vacuum",
      "version": "v1.0.6",
      "requirements": [
        "pillow",
        "numpy",
        "pybase64",
        "requests",
        "pycryptodome",
        "python-miio",
        "mini-racer",
        "paho-mqtt"
      ]
    },
    "sonoff": {
      "documentation": "https://github.com/AlexxIT/SonoffLAN",
      "version": "3.9.3",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "ble_monitor": {
      "documentation": "https://github.com/custom-components/ble_monitor",
      "version": "13.10.1",
      "requirements": [
        "pycryptodomex>=3.23.0",
        "janus>=2.0.0",
        "aioblescan>=0.2.14",
        "btsocket>=0.3.0",
        "pyric>=0.1.6.3"
      ]
    },
    "google_keep_sync": {
      "documentation": "https://github.com/watkins-matt/home-assistant-google-keep-sync",
      "version": "1.0.0",
      "requirements": [
        "gpsoauth @ git+https://github.com/watkins-matt/gpsoauth.git@master",
        "gkeepapi==0.16.0"
      ]
    },
    "alexa_media": {
      "documentation": "https://github.com/alandtse/alexa_media_player/wiki",
      "version": "5.7.8",
      "requirements": [
        "alexapy==1.29.8",
        "packaging>=20.3",
        "wrapt>=1.14.0"
      ]
    },
    "bermuda": {
      "documentation": "https://github.com/agittins/bermuda",
      "version": "0.8.5",
      "requirements": []
    },
    "edata": {
      "documentation": "https://github.com/uvejota/homeassistant-edata/",
      "version": "2025.03.1",
      "requirements": [
        "e-data==1.2.22",
        "python-dateutil>=2.8.2"
      ]
    },
    "alarmo": {
      "documentation": "https://github.com/nielsfaber/alarmo",
      "version": "1.10.12",
      "requirements": []
    },
    "daikin_onecta": {
      "documentation": "https://github.com/jwillemsen/daikin_onecta",
      "version": "4.2.9",
      "requirements": []
    },
    "xiaomi_miot": {
      "documentation": "https://github.com/al-one/hass-xiaomi-miot",
      "version": "1.1.0",
      "requirements": [
        "construct>=2.10.68",
        "python-miio>=0.5.12",
        "micloud>=0.5"
      ]
    },
    "browser_mod": {
      "documentation": "https://github.com/thomasloven/hass-browser_mod/blob/master/README.md",
      "version": "2.6.2",
      "requirements": []
    },
    "miwifi": {
      "documentation": "https://github.com/JuanManuelRomeroGarcia/hass-miwifi/wiki",
      "version": "3.4.1",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "sonoff",
    "name": "Sonoff",
    "codeowners": [
      "AlexxIT"
    ],
    "config_flow": true,
    "dependencies": [
      "http",
      "zeroconf"
    ],
    "documentation": "https://github.com/AlexxIT/SonoffLAN",
    "iot_class": "local_push",
    "issue_tracker": "/api/sonoff/c13680f6-c33f-4109-951c-1f9523ca0fe0",
    "requirements": [
      "pycryptodome>=3.6.6"
    ],
    "version": "3.9.3",
    "is_built_in": false,
    "overwrites_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 0.00024390500038862228
    },
    "04898d7589afe1d2874d902656dbba6a": {
      "wait_import_platforms": -0.00018580601317808032,
      "wait_base_component": -0.00852459401357919,
      "config_entry_setup": 1.9440982840023935
    }
  },
  "data": {
    "version": "7c75c46",
    "cloud_auth": true,
    "config": null,
    "options": {
      "debug": true,
      "homes": 1,
      "mode": "auto"
    },
    "errors": [
      {
        "name": "custom_components.sonoff.core.ewelink.cloud",
        "message": [
          "Cloud WS Connection error: ClientConnectorCertificateError(ConnectionKey(host='eu-dispa.coolkit.cc', port=443, is_ssl=True, ssl=True, proxy=None, proxy_auth=None, proxy_headers_hash=None), SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: EE certificate key too weak (_ssl.c:1032)'))"
        ],
        "level": "WARNING",
        "source": [
          "custom_components/sonoff/core/ewelink/cloud.py",
          584
        ],
        "timestamp": 1760581317.7211845,
        "exception": "",
        "count": 21,
        "first_occurred": 1760569421.6079109
      },
      {
        "name": "custom_components.sonoff.core.ewelink.cloud",
        "message": [
          "Cloud ERROR: {'error': 411, 'deviceid': 'a480081615', 'apikey': '3fb1d4ab-4696-4e36-9d60-8bfba80e00d6', 'sequence': '1760593225945', 'uid': '3fb1d4ab-4696-4e36-9d60-8bfba80e00d6'}"
        ],
        "level": "WARNING",
        "source": [
          "custom_components/sonoff/core/ewelink/cloud.py",
          604
        ],
        "timestamp": 1760593229.0000618,
        "exception": "",
        "count": 1,
        "first_occurred": 1760593229.0000618
      }
    ],
    "device": {
      "uiid": 7034,
      "params": {
        "bindInfos": "***",
        "subDevId": "ff9bcafeffb6c67c7034",
        "parentid": "100202103a",
        "fwVersion": "1.0.5",
        "subDevRssi": -63,
        "subDeviceManufacturer": "SONOFF",
        "setclose": 50,
        "motorDir": "reverse",
        "motorClb": "normal",
        "swMode": 2,
        "switch": "pause",
        "calibState": 0,
        "calibration": 0,
        "tzInfo": {
          "tzName": "Europe/Madrid",
          "utcOffset": 60,
          "dstOffset": 60,
          "dstStartRule": "0 0 2 ? 1L 3 *",
          "dstEndRule": "0 0 3 ? 1L 10 *"
        }
      },
      "model": "MINI-ZBRBS",
      "online": true,
      "local": null,
      "localtype": null,
      "host": null,
      "deviceid": "a4800f9847"
    }
  },
  "issues": []
}

Patxinho avatar Oct 16 '25 12:10 Patxinho

Hi Alexx,

I’m using the SONOFF MINI-ZBRBS (Zigbee shutter relay) integrated through SonoffLAN.
The device connects correctly via eWeLink and is recognized in Home Assistant, but it is not exposed as a cover entity — instead, it’s detected as a generic device or switch, which prevents percentage control and full shutter functionality.

After some testing, I found that the device has uiid: 7034 and behaves identically to other shutter-type devices.
By inspecting the custom_components/sonoff/core/devices.py file, I confirmed that uiid 7034 is not mapped as a shutter.

✅ Working solution

Adding the following line to the DEVICES dictionary in devices.py solved the issue:

7034: [XCover, LED, RSSI],

After restarting Home Assistant, the device appears correctly as:

cover.sonoff_mini_zbrbs

and supports full open/close/stop/position control.

💡 Suggestion

Please include this mapping in the official devices.py list so that uiid 7034 is recognized as a shutter device by default.
Optionally, this could be improved to detect the device automatically based on its model ("MINI-ZBRBS") for future-proofing.

Thanks for your great work maintaining SonoffLAN!
This change makes the MINI-ZBRBS fully functional as a cover entity.

Patxinho avatar Oct 16 '25 18:10 Patxinho

It's great that you found the solution yourself. I assumed this converter might work, but I don't have the device to test it myself.

AlexxIT avatar Oct 17 '25 08:10 AlexxIT