Sonoff ZBMINIR2 not reporting input sensor in ZHA

Hi,

I’m trying to use Sonoff ZBMINIR2 via ZHA to check the state of the S1/S2 input. I connected a magnetic sensor there mounted on the doors to check if the doors are closed, but the in the HA the sensor is reported as “closed” all the time.

On the other hand the sensor is coupled with the switch (even if I enable the “detach” mode - apparently it doesn’t work correctly), so when I open/close that input the switch toggles its state. That could be enough for me, I could sacrifice that one switch, but unfortunately if I toggle that switch once through HA, then subsequent readings of my door sensor are negated. Even if I set trigger mode to “Normally off follow trigger”.

Any hints? Or any recommendations for buying another zigbee switch that works fine with ZHA and could be used just as a open/closed door sensor?

I tried to use Sonoff MINI-D (via WiFi) - but that one had another issue. When its input is shorted the ZHA “Action” sensor input changes to “single” for half a second and then changes back to “”. So it only signals an edge. I tried to change trigger settings through eWeLink app (as I suppose it’s the module, not HA issue), but the only change I could get was receiving these signals on both edges or just one (off->on). And I need to read current state.

I’ve read that ZBMINIL2 reports sensor input correctly (and it has about 1-second delay due to powering without neutral wire), so maybe I’ll give it a try.

P.