Plex launched its DVR feature in 2016. Using Plex’s TV DVR feature, it’s possible to watch live TV as well as schedule recordings remotely and stream them to your devices either within your home or over the internet. It’s the most polished DVR server I have seen so far.
Unfortunately, it only supports either DVR tuners connected to the server directly or HDHomeRun devices. This is quite a limit, as this means CAM modules can’t be used, IPTV channels can’t be added and neither can satellite dishes.
I already had set up TVHeadend with Multicast IPTV and , so I was looking into a way of feeding my TVHeadend channels into Plex.
tvhProxy
tvhProxy is a small tool which helps bridging these two services. A small flask app to proxy requests between Plex Media Server and TVHeadend. The [original version of tvhProxy ( ) has been archived on GitHub by its maintainer and is out of date and does not work with recent versions of Plex Media Server.
I have decided to revive the project and add a few critical improvements compared to the archived upstream version:
-
SSDP Discovery. Fixes the issue of Plex randomly dropping the device - - by simulating the SSDP announcements a real HDHomerun is sending. Otherwise you the tuner is dropped and “Device not found. Ensure your device is powered on and connected to your network.” is shown in the settings
DEBUG - DVR:Device: Device device://tv.plex.grabbers.hdhomerun/12345678 died DEBUG - DVR:Grabber: Plexserver discovered 0 compatible devices.` -
XMLTV EPG EPG export, including adding dummy programme entries for channels without EPG so you can still use these channels in Plex (see below for Plex configuration URL).
-
Configuration of variables via dotenv file for easier testing
-
Adding a dockerfile for easier deployment.
Plex configuration
Enter the IP of the host running tvhProxy, including port 5004, e.g., 192.168.1.50:5004. Use http://192.168.1.50:5004/epg.xml for the EPG (see Using XMLTV for guide data for full instructions).
Should the proxy keep disappearing or you can’t add it, it’s worth trying to delete the existing configuration from the database:
- See https://support.plex.tv/articles/201100678-repair-a-corrupt-database/ on how to access the plex config database and
- run
delete from media_provider_resources;to remove any leftover config.
Docker Setup
I’m using docker-compose with the following docker-compose.yml file:
version: "2.1"
services:
tvhproxy:
build: https://github.com/chkuendig/tvhProxy.git
container_name: tvhproxy
environment:
- TVH_PROXY_HOST=192.168.178.24
- TVH_URL=http://parklife:9981
- DEVICE_ID=2020-02-Q5YH-U5PIK8 #this is random but needs to stay fixed
volumes:
- "/etc/localtime:/etc/localtime:ro" # we need to have the same timezone as the host tvheadend to build the EPG correctly
network_mode: "host"
Since this isn’t a pre-built container, you run docker-compose build tvhproxy instead of docker-compose pull tvhproxy and that’s it.
Discussion
Let me know what you think at https://forums.plex.tv/t/tvhproxy-update/544037.
