I was browsing the forum but could not find anything relevant to solve my problem. So here is what I want to achieve:
To have smart light bulbs (preferably Zigbee based) that I can switch from a wall switch and also control through the Home Assistant dashboard or via Assist. But seamlessly. So, for example turn it on using a manual switch and off using Assist.
Keep the administrative effort to add a new light minimal to avoid mistakes and unnecessary work.
It is important to me that the basic usability of my house does not degrade when my Home Assistant PC breaks down, for example. That means the manual light switch should still work as someone would expect from it, at any time.
One solution I thought might work would be to use the SONOFF ZBMINIR2 smart switch behind a traditional light switch. But not wire it up in a way that actually cuts power to my lamp via the relay, but rather have it use a direct bind to the smart light bulb. So that the ZBMINIR2 directly controls the on and off of the light bulb. This however did not work when I tried it.
I have set up something similar using the IKEA RODRET and direct binding on another light bulb in the living room, which works very well.
I have also tried using the ZBMINIR2’s relay mode. But that turns off the smart bulb, so by default Assist can’t control it.
Other possible solutions that require the Home Assistant in between at all times which I have found so far:
Have it run entirely through HA. Therefore, I believe I would need to create a template light in configuration.yaml that combines the relay and dimming commands of the SONOFF ZBMINIR2 and then assign that lamp to my dashboard buttons and expose it to Assist.
The annoyance I see with this solution is the rather large administrative effort required. But I feel this is a rather neat solution to integrate non-smart lamps to the system using the SONOFF ZBMINIR2.
Use automations or scripts that I map to the Assist commands. I see this to have an even greater administrative effort and not work too reliably…
I could compromise to using something other than Zigbee if that allows me to achieve what I want.
Any tips to achieve exactly what I described above are greatly appreciated.
May not be a good idea to have smart bulbs and a smart switch. In several rooms I have dumb bulbs with a mains-powered Zigbee switch - controllable from HA or with the switch, which still works if HA is down.
You can’t dim the lights or change colour, though. If you want to do that you need smart bulbs with a battery-powered remote (not a switch that will cut power). If you bind the remote directly to the bulbs it will continue working without HA.
OP is not trying to use a smart bulb with a smart switch. OP is trying to wire the bulb to be always on and then create his own switch to not pass a load but just use logic to control the bulb. In this case the switch OP creates could do anything within ha.
Okay, glad to hear that they should work for what I want to achieve.
So your light bulb is always connected to the mains. And your SONOFF ZBMINI as well. But its relay output is not connected anywhere, right?
I tried that configuration, but it seems for me something with the direct binding in Z2M did not work. The only options I have there are “Identity” and “OnOff”. Seems like it should work with them.
I now found out that the SONOFF ZBMINIR2 has a “decoupled” mode. So while you press the button the device sends a state update to HA, but does not physically switch the power. (You can still switch the relay from HA if you would want to.) The plan is then to have direct binding between the ZBMINIR2 and the light set up. Once that’s possible it should allow for a pretty robust system that should still work if any part of the home automation system fails.
Thanks for your input! And I see you are using an automation for this.
I want to use Zigbee direct binding between the ZBMINI and my light bulb. And I found out now that while its possible to bind them, the ZBMINI does not actually send anything to the light. But many people said that SONOFF told them they currently work on implementing this as described for example here.
Thanks a lot! That was a great hint and helped me find a great deal of information, mainly from this thread, about what I want to achieve.
Turns out I still need to wait for a firmware update from SONOFF to get it fully working as desired, at least with that particular device.
Hang on. If you’re using Z2M like the links you posted imply, then this should already be possible:
Detach relay mode (binary)
Enable/Disable detach relay mode.
Value can be found in the published state on the detach_relay_mode property.
To read (/get) the value publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get with payload {"detach_relay_mode": ""}.
To write (/set) a value publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set with payload {"detach_relay_mode": NEW_VALUE}.
If value equals true detach relay mode is ON, if false OFF
Edit: nevermind, I misread. You were referring to binding, not decoupled mode.
Just wire the relay like a normal switch and enable Detach relay for now. Hopefully you won’t actually need binding until Sonoff release the update.