Switch on amplifier?

Being new to all things Pi I am pleased to have acheived playing my NAS stored MP3 collection through Musicbox to my HiFi.

However a real bonus would be to actually turn on the amplifier form the UI, even a simple power relay controlled by the Pi would do the job.

Surely this is not impossible…Has anyone any thoughts or achieved this?

I just did this last night. Here is the small script that does the work: https://github.com/greglarious/stereo_power_manager

The basic idea is to turn on the external equipment whenever there is recent activity within the mopidy log file and turn off the power when there has been no log activity and no active sound output for a long-ish while.

FYI, the stereo_power.sh script (which is not included) operates a cheap Tonbux 4 outlet WiFi Smart Power Strip. If you are interested, that script gets the job done using the TUYA cli: https://github.com/TuyaAPI/cli

Thanks @greg_frank, this idea is perfect for what I had in mind. Thanks for the info.