ZHA: Advanced features of Sonoff ZBMINIR2

The turbo mode improves the signal strength. You should only use it if you’ve got any problems with the range, so you don’t add up additional noise to your environment.

So happy to find this thread! I have one normal light bulb and the ZBMINIR works perfectly in relais mode and I love the fallback functionality in case it doesn’t have connection, but couldn’t get it working with the smart bulb. Maximum two or three times and it switched back to relais mode, most likely due to the triggering via ZHA. Good to know it’s not a config error.

I just installed two of these and have it working with detached mode and controlling smart bulbs. Most important thing is getting your sensor ID for the action. The automation is looking for any state change from the action sensor which is the toggling of your physical switch on the wall. Here is a yaml example of an automation and the MQTT settings used:

alias: Lighting - Turn On/Off Primary Bathroom Shower
description: ""
triggers:
  - entity_id:
      - sensor.sonoff_relay_switch_2_primary_shower_action
    trigger: state
    to: null
    from: null
conditions: []
actions:
  - choose:
      - conditions:
          - condition: device
            type: is_off
            device_id: 8c4358a1b165a06eed9838b37936dc7e
            entity_id: d5f3a65d41488e0aed0cc34140f6cc47
            domain: light
        sequence:
          - type: turn_on
            device_id: 8c4358a1b165a06eed9838b37936dc7e
            entity_id: d5f3a65d41488e0aed0cc34140f6cc47
            domain: light
        alias: Turn On
      - conditions:
          - condition: device
            type: is_on
            device_id: 8c4358a1b165a06eed9838b37936dc7e
            entity_id: d5f3a65d41488e0aed0cc34140f6cc47
            domain: light
        sequence:
          - type: turn_off
            device_id: 8c4358a1b165a06eed9838b37936dc7e
            entity_id: d5f3a65d41488e0aed0cc34140f6cc47
            domain: light
        alias: Turn Off
    enabled: true
mode: single
![Screenshot 2024-12-07 at 3.33.09 PM|405x500](upload://zcz43fCJ7pfpjRYCUbYgtllP1Td.png)


Did you manage to do this in ZHA?
As far as I understand the advanced features only work as expected with Z2M, not with ZHA (also your screenshot is showing more options than in my ZHA instance with Core 2024.12.1)

E.g.: With ZHA The detached relay mode is not working (behaviour as described by others in this thread.

If you made this work in ZHA, please tell us how

Ahh i missed that bit, this is Z2M, apologies!

I did have to modify my triggers to only be triggered if an action is “toggle” not just any state. When it was “any state” they would randomly turn on.

There is a matching bug, it seems like the problem is already identified.

2 Likes

Hi,
I bought the ZBMINI L2 just for the “DETACH” mode.
I cannot use the Z2M because my Raspberry PI3B+ is no longer sufficient to run Z2M.
It just keeps looping.

I am therefore obliged to stay on ZHA.

When do you think this can be resolved?

THANKS

pardon,

I meant ZBMINIR2

Totally aligned with you Eric, disappointed for the moment although the module is great

1 Like

I hope this will be sorted out for us.

I’m gonna keep an eye on this thread. Was planning to buy a few ZBMINIR2s to use them in detached mode. Glad I didn’t yet.

(Don’t want to switch from ZHA to MQTT just yet…) Hopefully this gets fixed soon!

I’m also interested in the detached mode, but I have an additionell question. Can I use one device to contact two different switches to two different lamps or is it designed to switch one lamp with two switches?

I am not exactly sure what you mean.

In an electrical sense, it is a relais. A single switch in an electrical circuit.
This circuit can still be built to turn on/off multiple lamps.
This is common if you have multiple ceiling lights in a room: You can still wire them to one dumb wall switch and it will switch all of them on or off - the other option would be a (dumb) double wall switch to control them independently. This is up to personal choice.

But essentially, the zbminir2 - at least the relais in it - does the same as a common (single) wall switch.

Of course, your Home Assistant will take notice of every wall switch toggle. So you can create an automation that does anything you like when you toggle the switch, if the zbminir2 is installed. Turn on music, close the blinds, switch a socket to rotate your disco ball, …

The only thing that changes with detached mode is if the relais closes / opens the electrical circuit or not.

fyi, with the new z2m 2.0.0, the action sensor for triggering automations is now depreciated. Cannot figure out how to get it to sense a state change anymore while in detached mode.

Where would be a good place to post the lost of this sensor for developers? fixing it is unfortunately outside of my wheel house.

I want to control with one zbmninir2 to different switches on two different zigbee lamps, so I need the detached mode.
So I have L1 & L2 as in and also as out.So I think I need two.

I got it working in z2m yesterday, version 2.0.0-2. There is a “settings (specific)” tab where I had to enable the action first. After that, it worked.

HI all,

So I’ve got my first ZBMINIR2, which I connected to my Sonoff Zigbee Dongle replacing my Conbee 2. I see all these options in vanilla ZHA (ha-core 2025.1):

Looks perfect. Now what I want to do this the following: NO detached switch. The switch (rocker type) needs to turn the light on and off. This works.

What I would also like to do is turn on/off the light from HA. Is this possible? I only can turn off the “switch”, but the “switch” state doesn’t reflect the state of the power that is sent to the light. It’s like the relay itself.

image

I though this would be like the first thing that comes up when installing these switches: keep the regular switch, and enable smart functionality. Or am I not getting it?

Update** to give an idea that this is not what it should be: let’s say I turn off the switch in HA. Then I can still turn on the light by flipping the physical switch. After that the “switch” in HA is still disabled?

Cheers
Vincent

I fixed it, as the solution was reported here https://www.reddit.com/r/sonoff/comments/1gdxhpb/zbminir2_doesnt_update_its_state_if_activated_by/ worked for me as well.

So the problem? Physical rocker switch does not toggle “Switch” of ZBMINIR2 in HA, using ZHA.

Fix: click “Reconfigure” when you are looking at the ZBMINIR2 device in ZHA, 5 seconds later, it works!

1 Like

Hello, no news of the initiial bug of detached relay not working with ZHA?

I feel like everyone doesn’t care.

1 Like