Sonoff Mini R2 - switch state?

Hi,

With a Sonoff Mini R2 being used in LAN mode, I can switch my light using a sonoff_100123abc entity. This works fine. And the switch “input” pins let my old physical switch operate the light, and the switch state changes in HA fine.

But what I wonder is does anyone know if there’s a sensor I can expose that tells me if the physical switch state is on or off? I’d like the option to set the switch entity to the state in the physical switch.

Currently I track the status of the physical switch…when it’s switched off, the entity is “off”, but if I know no automation has been run on the entity, then I assume the change in state is because of the physical switch. So I save a variable that the “sonoff-switched-off”. (or on as needed) (I could also add the motion detector which I use to automate the light’s state as a variable - i.e. when there’s motion and the state changes, the automation sets a variable to “sonoff-motion-on”, so if the state of the sonoff changes with no motion, that could be a manual change.

But it would be good if I could just “read” the switch input pins’ state!

Regards,

Ambi