git-developer / autosuspend

AutoSuspend-Script for Tvheadend on Linux
GNU General Public License v3.0
7 stars 9 forks source link
autosuspend linux tvheadend

tvheadend-autosuspend

An extension to Tvheadend that will suspend your system when it is inactive and wake it right before the next scheduled recording.

Suspend can be configured to be one of

Activity means

This script is based on systemd and does not make use of pm-utils. It has been tested on Debian 8 (Jessie) with Tvheadend build 4.0.8~jessie. It should work on systems that meet the dependencies listed below.

Prerequisites

Installation

  1. Copy the files from this git repository to your system.
  2. Install the dependencies
    • rtcwake (package util-linux, part of Debian 8)
    • netstat (package net-tools, part of Debian 8)
    • curl
    • xmlstarlet
    • jq

On Debian based systems, dependencies may be installed using the command

$ sudo apt-get install util-linux net-tools curl xmlstarlet jq

Configuration

Edit /etc/autosuspend according to your needs. Credentials for tvheadend are required, e.g.

# User for access to the Tvheadend REST API
TVHEADEND_USER=hts

# Password for access to the Tvheadend REST API
TVHEADEND_PASSWORD=hts

All other values are optional.

It is possible to work with an existing Tvheadend user, but I recommend to create a separate account to keep things clear. The following rights are required:

Details on the configuration of system activity can be found in the Ubuntu users wiki (german).

Links