So I made a home assistant with the arduino mega and a raspberry pi.
I have 6 push buttons connected on 6 digital inputs. I use digital input to switch to ground.
I have already installed a 1K ohm resistor on digital input and 5V on every push button. But I see that my inputs randomly on different times switches on. This give the result that my lamps goes on and off randomly.
I have 4 push buttons on a distance of 4 meter and 2 push buttons on a distance of 18± meters. All of them goes randomly on and off. Approximately 4 times a day.
I don’t use shielded cables. I don’t have the option to replace them because they are already in the wall. But they are twisted.
What is the best solution for solving this problem?