CommentStreams:42313ccc7ba5b683cb02e85d64d4eea5
I added sudo in front of /etc/x728pwr.sh & in /etc/rc.local and now the momentary switch seems to be working as expected. Also note that the pin descriptions under section 3 above are incorrect. Pin 1 is the NO pin of your momentary switch, Pin 2 is ground or common for the switch, pin 3 is ground for the LED in the switch and pin 4 is +V for the LED in the switch. Pin 1 is the farthest pin from the fan.
I found out that the pin to let the Pi know if AC power is good or not was not working on the female side of the header that goes directly to the pi. I get between 0.2 and 1.0 ish volts. If i measure the male side that would go to another hat i get 0v when AC power is on and 3.4v when AC power is off. Looking into how to fix that. But if I use jumper wires and use the male pin the x728pld.py script works correctly.