Momentary Switch

Hello community,

I will be installing two gate motors soon and apart from their RF remote (rolling code), they have a manual push button type switch to wire to the house. Anytime the button is pressed, it closes the circuit and the motor figures out to open/close/half-open etc.

Now I thought about wiring this to GPIO0 in a sonoff Basic but this would not fit my purpose completely.

I want to retain a physical switch on the wall but also to get the status in home assistant. I could flash esphome on an esp but I can’t wrap my mind on how to get a physical switch in the picture.

Any ideas please? Thanks

I would “remove” the wall switch then add a switch to the ESP and use this as the new “wall switch”.

The new switch only triggers an automation that closes the circuit where the old switch was using a relay or optocoupler depending on what would be needed.

To get the current state, not sure how that would be possible.
Using your remotes will get it out of sync

Just to clarify…

the status of what? the switch or the gate?

history of the status of the switch and from HA that i can press the switch for the gate to open and press it again to close.

I am trying to use reed switches for the gate opening status separately.