I have connected a 10K pullup resistor between 3.3v and GPIO 17 as well as a switch to ground. If i flip the switch 10 times, the GPIO binary sensor in HA only reflect the correct state 6-8 times. I have verified with a Python-script that the GPIO pin is set to the correct value (0 or 1). So even if the circuit is grounded (Python script shows 0) the state in HA is still “on”.
Any ideas?