I've just nuked my out of date Ubuntu server, and I'm part way through setting up a new Debian install.
My old server was set up so long ago, I can barely remember how I did it, but I managed to successfully set up a script to shut down the system when idle, and wake up for recording. I'm sure it was from the following page:
https://tvheadend.org/projects/tvheadend/wiki/Wakeup
Which seems no longer to exist.
Is there an up to date version? Or is this something which might be incorporated into future versions?