Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

git-developer/autosuspend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

  • suspend
  • hibernate
  • hybrid-suspend and
  • poweroff

Activity means

  • Tvheadend activity:
    • Running or upcoming recordings
    • Subscriptions, e.g. live TV or EPG grabbing
    • Connected clients, e.g. Kodi or web interface
  • System activity as defined in the Ubuntu AutoSuspend script, e.g.
    • Running daemons
    • Running applications
    • Connected samba clients
    • Reachable network clients

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

  • systemd (part of Debian 8)
  • A running Tvheadend service

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:

  • Web Interface
  • Admin
  • Video Recorder

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

Links

About

AutoSuspend-Script for Tvheadend on Linux

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages