Shutdown and wake up a Tvheadend server automatically
Copy this script to some directory like /usr/local/bin
and make it executeable.
Change URL, username, password and min_uptime if necessary.
Add a cronjob like this to get this script running:
*/5 * * * * /usr/local/bin/tvh-auto-power.py