I use this method:
Switch:
https://www.digikey.be/nl/products/detail/e-switch/ULV7FWGSS341/9996196
You need a switch that clicks when pushed, stays in that position, not a momentary switch.
Other alternatives are available, with or without wire loom and connector.
Relay:
Power button requires the installation of two plugins:
- GPIO Buttons
- Enable Shutdown On
- GPIO Pin 16
- GPIO Control
- System Startup Event On
- GPIO Pin 13
- GPIO State On
When you push the switch, power is applied to the power supply and RPI. Once Volumio is started, 5 V is applied to GPIO pin 13 that closes the relay because GPIO pin 16 is connected to ground.
When you push the button again, GPIO 16 is decoupled from ground, RPI, Volumio plug-in detects it and does a proper shutdown. This opens the relay and switches off all power.
What puzzled me for a while where the pin numbers. The drawing shows the GPIO pins for Roon Audio, not for Volumio. You need to use GPIO pins 13 & 16.
Physical layout for the pins:
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html
Keep in mind that the GPIO numbers are not the same as the physical pin numbers.
GPIO 13 is 33 and GPIO 16 is 36.
I like it because when switched off, all power is switched off. Good for the environment. I don’t mind walking to my Volumio streamer to switch it on and off. A remote is not possible.
Hope this helps.