Thanks Alex. I think if I started over, that’s the route I’d go.
It turns out the problem isn’t with the pull-up resistors, anyway. Even hard-wiring an external resistor didn’t help. The problem is, simply, HA can’t read GPIO input reliably. It seems nobody with the skill set to fix it is spending any time on it. That’s just the way volunteer, open-source development works.
But I do think I may have found a workaround. It turns out real-time GPIO status information is recorded in the file system. So a command line sensor can read the status at a set interval. With this project, we don’t need to know the exact moment the GPIO status changes, like you would with a doorbell. Every few seconds is enough; it’ll average out in the end.
I plan to write all this up at some point, but meanwhile, here’s what I put in my configuration.yaml today which so far (just a few heat on/off cycles) seems to be working great:
binary_sensor:
- platform: command_line
name: zone_1st
command: "cat /sys/class/gpio/gpio17/value"
payload_off: "1"
payload_on: "0"
scan_interval: 30