Any way to see the physical state of S2 contact (closed/open) for Sonoff ZBMINI-L2?

Hey everyone,
I decided to try out Zigbee for my smart home (was all wifi/bluetooth before). Obviously it’s good for sensors, but I also wanted to try out the switches (since they don’t require neutrals and let me smartify some previosly inaccessible locations).
I ordered one of Sonoff’s small ZBMINI-L2 switches. Seems to be working fine, but the problem I have is that in relay mode it doesn’t respect the open/closed state on S2 (ON or OFF for rocker switch, which is what I’m using). It just toggles on each state change. Now, this may be fine for some people, but I’m used to treating this differently (and most importantly, so is my wife). Most of the lights I’ve automated so far at my current place are table lamps connected via smart plugs that are plugged in dumb outlets controlled by wall switches. Setting the plug to always-on after power-on, you know for sure that if the rocker switch is down, you need to switch it up to get lights. If it’s up and there’s no light, you can toggle it down and back up. This way, any state mismatches only last through one physical interaction with the switch (and they are easy to rationalize as a malfunctioning switch). With the way ZBMINI works though, you are stuck with the mismatch until another programmatic toggle.

So, the question is - can we change that behaviour (including through flashing any custom firmware, if it’s a thing for these switches; I’ve done some ESPhome conversions back in the day, including disassembly and soldering UART to ESP pins for devices that didn’t expose them, so if it’s at all possible, I’m willing to try) and make ZBMINI-L2 respect the physical switch position?
If not, are there any Zigbee switches you can recommend that allow to do this (no neutral wire, preferably available in the US - although I’m not averse to ordering on Aliexpress)?

Alternatively, is it possible to get the physical state of the S2 contact on any coordinator/firmware combo? I’m on ZHA and it’s not available, will probably try Zigbee2MQQT soon (though there are no such entities listed on the website for ZBMINI-L2, i’m not sure if it’s being kept 100% up-to-date).
I thought about setting up a logical ‘mismatch’ flag which would be toggled each time the switch state is changed logically, and then for each physical toggle see if mismatch is true - if so, cancel the state change and clear mismatch, forcing the user to flip again (mimicking the ‘malfunctioning switch’ behaviour that is by now standard for our family). However, this would be ‘going blind’ and vulnerable to break down if switch is physically toggled while HA is out. Much better to actually see if the S2 contact is closed or not.

Looks like those modules have 2 modes - rocker (which is what you need) and toggle (which is the behaviour you’re seeing).

By default they should be in rocker mode, but you might have yours set to toggle mode or switched to it without knowing (see below).

According to this, all you have to do is flip the switch 3 times in quick succession to flip from one mode to the other. The ZBMINI-L2 manual also mentions this, so try giving it a shot
image

Thanks for chiming in! I wish it were that simple.
For the benefit of others that might be looking into this, I’ll describe the switch behaviour in a bit more detail.
So, what happens if you flip the physical rocker switch (ie close or open the contact between S2 and 110v, either from the mains or from S1) depending on the mode:

  1. in toggle mode - you have to flip the switch to on and off every time to toggle a state (emulating the press of a button switch, which closes the S2 contact briefly and reopens them again), no matter what the current state of the relay is. This is different from what I want since it requires the back-forth flip even if you are flipping to the ‘correct’ state (ie flip to ON while the relay is off).
  2. in rocker mode - the relay state toggles with each open/close action on S2, but it doesn’t respect the state of S2. So, if relay is off and S2 contact is open, you must close it to turn ON the relay. If the relay is off and S2 contact is closed, you must open it. This is different from what I want since it never accepts ‘back-forth’ flips, it toggles on every change of S2 state.
    Now, the behaviour I want is
  3. on the open/close action of S2 contact (flipping the physical rocker switch ON/OFF), change the relay state correspondingly (turn on for closed S2, turn off for open S2). If the relay is already in the required state (eg the relay is turned on, and you are changing the S2 contact from open to closed), do nothing.

Then I’m stumped. Might be it behaves that way because it’s a parasitic device due to the no-neutral, but I’m honestly not sure.

Maybe (and I’m really clutching at straws here) try wiring using the other option described, in case it has an impact

Honestly, I know it pisses you off, but 2 way (3 way in the US) switches are in the “wrong” state half of the time. I guess I’ve gotten used enough to those that it wouldn’t bother me.

1 Like

Thanks! I’ll try swapping S1 for mains and see if it changes anything. I know it might seem like a petty gripe, but it bothers me. If this can’t be fixed, and no alternative devices can do this, I’ll probably try and replace the rocker with a momentary (button-type) switch and use the toggle mode, so that it at least seems more logical. However, the dumb momentary wall switches I’ve seen are exorbitantly priced (seems to be a niche thing), and the smart ones all require neutral.

Hang on. You’ve connected mains to S1? Try connecting it to S2 like the diagram.
There’s a chance only s2 is listening to the state, strange as it might sound.

Re momentary switch, I guess something like this hack would still show an incorrect state, right?

Last resort options if neither of the above works for you, get a module with Neutral and wire it up at the ceiling rose where you’ll have the same wires as the switch + neutral. Alternatively, just bite the bullet and pull a neutral - it shouldn’t be too hard if you know what you’re doing