Looking for an alternative for GPIO button

I have a normal push button in my wall and i connect the wires to my GPIO input on my raspi.
it does not work stably.
my question is: what’s a good alternative for this problem like hardware wise i want to keep using the same button because it’s in the hole house the same and i want it to keep it that way.

Let me guess. It triggers on ok but often fails to go off?

Do you have power available at the button?

If so, a couple of solutions:

Wemos D1 mini reporting to home assistant via esphome.

Raspi running flyte’s gpio to mqtt bridge: https://github.com/flyte/pi-mqtt-gpio

Neither require programming. Configuration is with YAML files.