Sonoff ZBMINI-L2 (Zigbee version) with Smart Bulb (Zigbee)

I managed to solve it by creating a blueprint.

How it works:

  • Wall Switch Toggled: When you flip the wall switch, the relay momentarily cuts power to the bulb.
  • Automation Reacts:
    • Immediately turns the relay back on to restore power to the bulb.
    • Waits until the bulb reconnects to Home Assistant (usually a few seconds).
    • Toggles the bulb’s state (turns it on if it was off, or off if it was on).
  • Result: You can use the wall switch to toggle the smart bulb on and off, and still control the bulb via the Home Assistant app, without manual wiring changes or special switch hardware.

Here is the blueprint, you can create an automation for each room now by simply selecting the wall switch and smart bulb that are connected.

blueprint:
  name: Smart Bulb Control with Non-Decoupled Switch
  description: Control a smart bulb with a wall switch that can't be decoupled
  domain: automation
  input:
    wall_switch_relay:
      name: Wall Switch Relay
      selector:
        entity:
          domain: switch
    smart_bulb:
      name: Smart Bulb
      selector:
        entity:
          domain: light
variables:
  wall_switch_relay: !input wall_switch_relay
  smart_bulb: !input smart_bulb
trigger:
  - platform: state
    entity_id: !input wall_switch_relay
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: !input wall_switch_relay
            state: "off"
        sequence:
          - service: switch.turn_on
            target:
              entity_id: !input wall_switch_relay
          - delay: "00:00:01"
          - service: light.toggle
            target:
              entity_id: !input smart_bulb

I’m trying your blueprint with a sonoff_zbminil2 on light switch (on/off) and a hue blub. I’m getting an error "Message malformed: extra keys not allowed @ data[‘blueprint’] when saving automation.

Did you find a solution for this?
I ground down the Port as mentioned by Tronix.

It works fine if youre quick, though when my smart bulb is off it seems the SONOFF isnt getting enough juice to operate?
When i turn my smart bulb back on, SONOFF reboots and is available again.

Did you experience something similar?

edit: or maybe i messed up something, but the behavior is strange nonetheless…

@Tronix117
you are a god!
just redid my whole whose with your hack.
now all the smart bulbs are always under power even when turned off and working perfectly as repeter.

@Drakann1234 Does this still work for you? You didn’t have any problems down the road? I bought smart lights, but they are ZigBee, just like the ZBMINIL2, so if I try to do the software hack (immediately after turning the relay off turn it back on, then switch the light), the relay tends to be connected through the light bulb, since it is a repeater closest to it, so it goes offline and the automation doesn’t continue until it is back online (which lasts 5+ seconds).

Just came here to say that it worked and that this post is fucking impressive!

It seems I have bricked my ZbminiL2 trying to cut the Set pin. I don’t know what tool is sharp enough to do so - I accidentally also scratched lightly into the Reset pin.

Well light still works - and once I had the lights working for like 30 seconds or so until home assistant started and I think switched one off - and then never able to turn it on again…

For now I just conncted the wires permanently rendering the wall switch useless and glued an Ewe Link button on top of it…

Edit: somehow some of the solder wire had connected Set and Reset - after dissolving it it behaves as before - with the exception that it does not do anything when pessing the manual switch anymore. So it’s no better than bricked right now. I don’t understand why it’s not working with the manual light switch anymore - didn’t scratch anywhere close to it. And yeah I don’t get how you can cut it - the soldered stuff goes all the way to the bottom - I don’t manage to really cut it through at all it just presses anywhere. Maybe they changed something on revisisions.

Edit 2: cut even deper and now it stays on. However I still cannot use the wall switch as it shows zero reaction in Home Assistant to what is going on there. I cannot cut power with the button anymore so it’s really detached…

Edit 3: Well it somehow registers what is going on - on the switch. However it races between on and off state switching back and force every second when the switch is on. And it then goes to off when the switch is off. Something has gone wrong and I’m not sure what. Relay is not clicking anymore and power on all the time. But yeah it kinda got dumb now.

Oh and it doesn’t matter at all if you mix up or not L1 and L - behaviour is the same.



I have this one. They have the same principle. Any idea if I can do this the same?

1 Like

Another option is flashing with custom firmware that should enable detach relay, binding and other features

1 Like

Good afternoon, I bought the ZBmini L2 and the hardware hack kind of works. When I turn the light on via Home Assistant, the ZBmini works. I can then use an automation to control the smart bulb. However, after some time when the light is off, the ZBmini goes offline. No matter how many times I press the switch, it won’t come back online. When I turn the light back on through Home Assistant, the ZBmini comes online again and works for a while.

What could be causing this?

Hi
When you said that you can’t directly control the light, with this hack we can’t bind ZBMini-L2 to bulb directly anymore ?

You are awesome ! I desoldered the blob on the reset pin instead of cutting and now the ZBMINIL2 works in “Detached Relay” mode :wink:

Hello,
Just try it with success on a spare zbminil2 thanks for the tips!!
Do you think the same process will be possible on the new MINI-ZB2GS-L ?
Cédric

It seems that many people are reporting that their device goes offline once the smart bulb is off for some time. This is normal. When a smart bulb is not lit, it will turn off. It requires a NON smart bulb to not turn off.

I am having the same issues but with another module. To solve it, I had a Shelly Bypass for dimmers that I tested and it worked greatly. Why did it work? Because the shelly bypass (for dimmers) has not only a capacitor, but also a resistor that will allow some power to go through it. I think it allows around 1.5W, which should allow the Sonoff module to work when the smart bulb is off. If you do not want to buy a Shelly Bypass for dimmers, you could also achieve the same effect with a DYI board. What you need is:

WARNING - THIS IS FOR 220V

  • 4x 4.7kΩ resistors
  • 1x non-polarized X2 0.67 uF 275V capacitor
  • 1x varistor 275V

This circuit should be able to provide ~ 2.8W so the Sonoff or whatever module should stay alive EVEN if you do not have a bulb screwed in.