I believe you may have wrong info from Claude regarding the wiring, but I don’t fully understand your intentions yet, so please check the Sonoff product info listed later in this post before you wire anything.
Firstly though, could you clarify your aims here? Are you
A) trying to replace both the switches with the smart relay (so it’s all done in HA automations?)
B) have the light operated either via the smart relay and/or either of the wall switches? (Allowing automation and/or manual switching from both switches?)
C) something else I’ve not considered?
Also, have you bought the Sonoff relay yet? If not, have you considered the ZBMINIR2 version instead? As there is neutral in the back box, it could be used and has the following advantages over the ZBMINIL2…
It’s cheaper
It’s a zigbee repeater
Supports smartbulbs in detached relay mode
It can switch inductive loads like fans - allowing it to be used elsewhere in the future if you ditch this switch
It has more flexibility via HA for choosing things like switch trigger modes and inching
It is about 1mm shallower (for cramped backboxes), and the same width.
For what it’s worth, I did install a ZBMINIL2 a few days ago in our kitchen on a 3-way circuit. Here’s what I did to keep all three manual switches operational.
Please keep in mind, this is just how I approached my installation.
Safely isolated and proved the circuit dead.
Determined which of the three switches had the switched live going to the light. Once sure which wire carried the switched live (Ls) to the lamp, I noted which terminal of the switch it came out of - and called that terminal T.
Removed the Ls wire from T and connected it to Lout of the relay. The relay now has final say over energising this live to the lamp.
Inserted a wire between T and S2 of the relay. The wire should be brown, or sleeved brown if any other colour, as it can be live (Any sparky, please correct this if the colour/sleeving suggestion is incorrect). Any of the switches could then apply the switched live to the S2 input of the relay instead of the light.
Wired up the relay’s Lin from the common live block. Wago 221s are good and you can get them in 5 way if needed. I used a 3 way wago.
If I were using the ZBMINIR2 model relay, I would also wire up the relay’s N from the common neutral block in the backbox.
Ensured no loose wires, re-energised the circuit & joined the relay to the Zigbee mesh.
Reinstall the switch faceplate
Assuming a correctly identified switched live (Ls) to the lamp, this should give you manual switching on all the existing switches, and you should also be able to control the lamp from home assistant.
One last thought, I also added a stand-off collar between the switch faceplate and the back box as mine wasn’t particularly deep, and the last thing I wanted was a wire pushing on the relay’s reset button when the faceplate was pushed back into place.
I want to operate the light from either switch at any time.
In addition to that I want to set up some simple automations. Basically just turn off the light if no motion or if after 8pm.
But in case its turned off by Sonoff i want to be able to manually turn it on from any of the 2-way switches.
I bought ZBMINIL2 (Sonoff relay) but in case is the wrong one i can order ZBMIN IR2 if i cant make it work.
I had no idea that ZBMINIR2 exists and yes, it is smaller. My back box is 25mm so probably everything will be really cramped there if i add a WAGO too for the 3 wires.
PS: everytime I ask for help someone points me that I forgot to mention important data. My cross to carry I guess.
Either the ZBMINIR2 or ZBMINIL2 can be used if there is neutral in the back box. For switches where there is only live in, and switched live out, the ZBMINIL2 is appropriate. I only posted the info about the ZBMINIR2 in case you hadn’t purchased yet. Something to keep in mind for any future house upgrades.
Option B is also what I wanted. If you read through what I did for our kitchen in my second reply above, and look at the 2-way wiring diagram with switches between live and S2, you should be able to work out how to wire it up, just correctly identify the switched live to the light, and the terminal it comes from first.
As always, isolate and verify before changing anything.
If your backbox is 25mm deep I think you will either need a deeper backbox (not always possible to easily retrofit) or use a collar/extender between the backbox and the switch faceplate or things just won’t fit. I ended up ordering one of these but you’ll need to determine a suitable one for your case if things are too tight.