Project

General

Profile

tvheadend-mqtt - an adapter to access the Tvheadend-API via MQTT

Added by Christian . over 5 years ago

I've been looking for an integration of Tvheadend with home automation systems for some time.

My requirements:

  1. Overview of finished and upcoming recordings
  2. Overview of storage space
  3. After certain events (e.g. completion of a recording), the current Tvheadend status shall be sent automatically (no polling)
  4. Possibility to integrate with home automation systems like FHEM
  5. High isolation from the overall system and a minimum of dependencies
  6. Extensibility and configurability by the user

#1 is possible through calls to the Tvheadend HTTP API.
#2 is currently (Tvheadend 4.3-1789~g6bfeca6c0) not possible via the HTTP API, but only via HTSP or operating system tools.
#3 can be implemented via the built-in post-processors.
#4 requires standardized protocols for communication and data format.
#5 is in competition with #2, #3 and #4.

Since I did not find a suitable solution, I developed one: an adapter between the Tvheadend API and MQTT called tvheadend-mqtt.

This is how it works: interested clients subscribe to an MQTT topic and receive the current Tvheadend status in JSON format after each recording. Active queries are supported, too. The adapter runs in a Docker container, separated from Tvheadend and the home automation system. If clients wish to receive the status triggered by Tvheadend, Tvheadend and tvheadend-mqtt need access to a shared directory.

tvheadend-mqtt is located at GitHub and Docker Hub, together with its documentation and an example on how to integrate with FHEM.