How to combine Sonoff ZBMINI with Zigbee smart bulb

Tags: #<Tag:0x00007fc40969a300> #<Tag:0x00007fc40969a1e8> #<Tag:0x00007fc40969a0d0> #<Tag:0x00007fc409699fe0> #<Tag:0x00007fc409699e28>

I just bought a couple of Sonoff ZBMINI Zigbee switches. They work well for me with regular “dumb” lightbulbs. I use a Raspberry Pi 4 with Conbee II Zigbee gateway, which runs deCONZ and Home Assistant software.

Currently, I assume the ZBMINI works as follows:

  • SWITCH: connected to a light switch button, measures the position of the switch: open or closed
  • RELAY: turns the power to the lightbulb on or off
  • The SWITCH position is linked directly to the RELAY: when I change the SWITCH position, the RELAY state is toggled between on (provide current to the lightbulb) and off (do not provide current to the lightbulb)
  • After pairing the ZBMINI with my Smart Home setup (Raspberry Pi 4 with Conbee II Zigbee gateway, running Home Assistant and deCONZ), I am able to control the relay from Home Assistant.
  • I cannot seem to be able to read the SWITCH position from Home Assistant

This setup works well for regular (dumb) lightbulbs.

However, when using smart Zigbee lightbulbs (e.g. Philips Hue, IKEA TradFri), this behaviour is not desirable: when the RELAY turns off the power, the smart lightbulbs stop their function as a Zigbee router and are no longer reachable by the Smart Home platform.

In this case, I would like to use the existing physical switch as a software switch, that toggles the smart bulb in HA and does not touch the current flow.

The Shelly 1 smart switch solves this by allowing a user to configure the button as a “detached switch”, which unlinks the SWITCH and the RELAY:

  • The SWITCH acts as a detached sensor: when changing the SWITCH position, the Shelly 1 sends an MQTT message which can trigger an action in the Home Automation software (e.g. toggling the smart lightbulb). The RELAY state does not change.
  • The RELAY acts as a detached relay: its state can be changed through the Home Automation software.
  • This allows a user to use the SWITCH to toggle the smart lightbulb, or initiate other action with any connected device really.
  • The smart Zigbee lightbulb can continuously stay connected to power, allowing it to act as a Zigbee router.

Does this type of functionality exist for the Sonoff ZBMINI? If not, does anyone have any other recommendations on how to use a ZBMINI together with a smart bulb which acts as a Zigbee router?

1 Like

Hi,

Move the “L Out” to the same connector as the “L In”. This would effectively bridge the live and have permanent power to the bulb. The Sonoff relay would still “click” when you pushed the light switch but not do anything. You would then need an automation to trigger the bulb on when the relay turns on.

Something similar to this automation that I have (used an Xiaomi Button to trigger the light)

- id: brandonlight003
  alias: Brandon's Light
  trigger:
  - platform: state
    entity_id: sensor.brandon_xiaomi_switch
    to: single
  action:
  - service: light.toggle
    entity_id: light.hue_spare_brandon

You may have to have an “on” automation and an “off” automation. Mine is just a push button so it just toggles on/off.

Simon

1 Like

That would be one possible solution, with the disadvantage that I cannot turn off the power to the smart bulb anymore, and that I cannot turn off the light anymore when the network / HA is not available unless I screw open the light switch box.

Ideally, the switch would

  • turn the smart bulb on/off “soft” via HA when HA is available, and
  • turn the smart bulb on/off “hard” via actually providing/cutting the power with the relay when HA is not available. In other words, gracefully fall back to dumb switching when the network / central brain is not available.

When flashing a Shelly with ESPHome, this is possible. See e.g. this article:

Goal 2: Provide a fail-over mechanism that allows the switch to operate even when Home Assistant is unavailable.

Hello I cannot answer your question but this sonoff zbmini works out of the box with deconz?:heart_eyes:
@kasper1 i just paired one and it appears as light which is ok but the state will indeed not be updated :frowning: I will flash the sonoff bridge and use tasmota for this :slight_smile:

Pairing with deCONZ worked without issues for me. At the moment, I’m not using deCONZ anymore though. I recently transitioned to using ZHA instead of deCONZ. I like the simplified pairing and closer integration with Home Assistant of ZHA. Also it is one container less to maintain and keep up to date.

By default, ZHA recognises the ZBMINI as a light instead of a switch. This can be overridden as described here:

Hello,

Thank’s for your topic, very interristing.
I have the same needed. I bought wifi spots, they need permanent power to work.
I had same idea, use my ZBMINI like virtual switch,
HA convert the signal On/Off to order to the wifi spot.

However I don’t imagined to conserve control if my HA fall.

But, impossible for me to appair ZBMINI on HA.
I have Raspberry Pi4 B (2GB) + Raspbee II + HA core 2021.2.3
I beegin to play this week (1st experience with all )

I tried 2 ways:
1/ container deCONZ on Add-ON section: my Raspbee II is correctly detect, but impossible to appair my switch ZBMINI.

2/ ZHA: I use patch “/dev/ttyAMA0” but I have wrong popup “Impossible to connect device ZHA”

Some ideas ?

4h later…I connected my device !!
Stupid error, the patch was /dev/ttyS0
I found answer on Raspberry documentation: https://www.raspberrypi.org/documentation/configuration/uart.md

Now I have to connect my wifi spots…other adventure

I am in the same boat - has there been any progress on this? meaning is it possible to flash ESP home to the ZBMINI? Other I might consider going for the MINI instead for smart bulbs…

No progress on this. I recommend a wifi relay which is flashable with Esphome (Sonoff Mini or Shelly 1) instead of the ZBMINI for steering smart bulbs.