TV Guide Support (XMLTV)

As of version 0.1.183 of Domotiga we have a integrated TV Guide in DomotiGa, thanks to Kris Wauters.
To view it, go select System in the right menu:

Install

Before using the TV Guide you have to enable and configure the module, Domotiga needs to know how to retrieve the program guide information. DomotiGa's TV Guide can use any XMLTV compatible source, just enter your grabber command line and XML file location into the TV guide settings:
  1. Open Modules -> TV Guide -> Settings
  2. For the XML Grab Command String enter the command to retrieve program guide information in XMLTV format, for more information see Grabbing TV listings below.
  3. Manually execute the XML Grab Command once on the command, because you need to select your TV provider. This can only be done manually, but is only 1 time needed
  4. For the XML File enter the name of the output file of the command above
  5. Do not forget to check Module Enabled and optionally the Debug checkbox

After you have configured the grabbing, you can download and parse the XML tv guide by clicking on the Import Guide button. A window will pop up telling:

Follow the result by watching your debug log:

2010/02/21 13:49:47 [TVGuide] Started grabbing XML with '/home/ron/domotiga/tvguide/mc2xml -c nl -g 3318 -f -D /home/ron/domotiga/tvguide/mc2xml.dat -o /home/ron/domotiga/tvguide/tvguide.xml'.
2010/02/21 13:49:56 [TVGuide] EPG - Valid from:  2010-02-21T00:00:00 UTC
2010/02/21 13:49:56 [TVGuide] EPG - Valid until:  2010-03-07T23:55:00 UTC
2010/02/21 13:49:56 [TVGuide] Identifier:  UPC - digitaal
2010/02/21 13:49:56 [TVGuide] Parsing XML file ...
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 10
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 20
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 30
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 40
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 50
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 60
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 70
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 80
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 90
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 100
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 110
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 120
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 130
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Channels so far: 140
2010/02/21 13:49:56 [TVGuide] Processing XML file ... Programs so far: 1
2010/02/21 13:49:57 [TVGuide] Processing XML file ... Programs so far: 1000
2010/02/21 13:49:57 [TVGuide] Processing XML file ... Programs so far: 2000
2010/02/21 13:49:58 [TVGuide] Processing XML file ... Programs so far: 3000
2010/02/21 13:49:59 [TVGuide] Processing XML file ... Programs so far: 4000
2010/02/21 13:50:00 [TVGuide] Processing XML file ... Programs so far: 5000
2010/02/21 13:50:01 [TVGuide] Processing XML file ... Programs so far: 6000
2010/02/21 13:50:02 [TVGuide] Processing XML file ... Programs so far: 7000
2010/02/21 13:50:02 [TVGuide] Processing XML file ... Programs so far: 8000
2010/02/21 13:50:03 [TVGuide] Processing XML file ... Programs so far: 9000
2010/02/21 13:50:04 [TVGuide] Processing XML file ... Programs so far: 10000
2010/02/21 13:50:05 [TVGuide] Processing XML file ... Programs so far: 11000
2010/02/21 13:50:05 [TVGuide] Processing XML file ... Programs so far: 12000
2010/02/21 13:50:06 [TVGuide] Processing XML file ... Programs so far: 13000
2010/02/21 13:50:07 [TVGuide] Processing XML file ... Programs so far: 14000
2010/02/21 13:50:07 [TVGuide] Processing XML file ... Programs so far: 15000
2010/02/21 13:50:08 [TVGuide] Processing XML file ... Programs so far: 16000
2010/02/21 13:50:09 [TVGuide] Processing XML file ... Programs so far: 17000
2010/02/21 13:50:10 [TVGuide] Processing XML file ... Programs so far: 18000
2010/02/21 13:50:10 [TVGuide] Processing XML file ... Programs so far: 19000
2010/02/21 13:50:11 [TVGuide] Processing XML file ... Programs so far: 20000
2010/02/21 13:50:11 [TVGuide] Processing Categories ...
2010/02/21 13:50:11 [TVGuide] Summary: Finished. 140 Channels, 44 Main Categories and 20479 Programs processed !

NOTE: this is currently integrated into DomotiGa but will be split up into a separated script soon, so it will not interfere with the rest and you can run it from a cronjob at night.

After a successful import you can start to enable the channels you want from the TV Guide Channels menu, you can also assign channel logo's and color categories.
If you have missing ones please mail them to me, they need to have the same image size at the current ones. They are located in domotiga/icons/tvlogos, if not copy them from your DomotiGa install directory.


Grabbing TV listings

There are multiple application to grab Electronic Program Guide (EPG) information and convert it to the XMLTV format.

An good overview of available options per country can be found via the XMLTVProject. For Netherlands, this points to the grabbers page for MythTV

Note that in a client-server setup the tv_grab will be executed on the client, not on the server.

Below you can find more detailed information specific for Domotiga on:

mc2xml

Microsoft Media Center can display program information and mc2xml is a guide grabber using Microsoft's database.
It's license prohibits shipping it with any other software, but you can download and install it yourself with the notes below.

Download the mc2xml linux executable from here and place it into the ~/domotiga/tvguide directory.

$ cd ~domotiga/tvguide
$ cp ~/Downloads/mc2xml .
$ chmod 700 (or chmod 755 if error rights)
$ ./mc2xml -c <country> -g <postalcode>

For my location this is:

$ ./mc2xml -c nl -g 3318
Loading ..... : mc2xml (c) <mc2xml@gmail.com> (v1.0)
Reminder .... : Unauthorized redistribution prohibited.
Reminder .... : If this software is useful, please donate!
Connecting .. : microsoft.com

Select lineup: 

  0: Analoge antenne nog niet in kaart gebracht (TER)
  1: Analoge kabeltelevisie nog niet in kaart gebracht (CAB)
  2: Analoge satelliet nog niet in kaart gebracht (SAT)
  3: Canal Digitaal (SAT)
  4: Digitale TV van KPN (TER)
  5: Digitale kabeltelevisie nog niet in kaart gebracht (CAB)
  6: Digitale satelliet nog niet in kaart gebracht (SAT)
  7: Digitale terrestri´┐Żle nog niet in kaart gebracht (TER)
  8: Digitenne (TER)
  9: UPC - digitaal (CAB)
 10: UPC analoog - Dordrecht (CAB)
 11: Ziggo Digitaal (CAB)

[mc2xml] (0-11): 9

Downloading . : microsoft.com
Downloaded .. : 566720 bytes in 3s
Source ...... : BDS
Headend ..... : 6500009
Version ..... : 2735576898
Start time .. : 2010-02-21T00:00:00 UTC
End time .... : 2010-03-07T23:55:00 UTC
Parsing ..... : UPC - digitaal
Writing ..... : xmltv.xml
Writing ..... : mc2xml.dat
Completed ... : 10901397 bytes in 39s, 140 channels, 20479 programs scheduled.

Now setup tv guide in DomotiGa's settings.
Enabled the module.
XML Grab Command String:

/home/ron/domotiga/tvguide/mc2xml -c nl -g 3318 -D /home/ron/domotiga/tvguide/mc2xml.dat -o /home/ron/domotiga/tvguide/tvguide.xml

XML File:
/home/ron/domotiga/tvguide/tvguide.xml

Click save.

For testing and first time usage from within DomotiGa you need to add -f to the XML Grab Command String, to force downloading and parsing.
You can remove it after your guide is setup and working.

For testing and further configuration, see Install above.

tv_grab_nl_py

See Installatie for a Dutch installation guide.
I was able to install it using following steps:

$ cd ~/install/
l$ git clone https://code.google.com/p/tvgrabnlpy/
Cloning into 'tvgrabnlpy'...
remote: Counting objects: 610, done.
Receiving objects: 100% (610/610), 173.76 KiB, done.
Resolving deltas: 100% (376/376), done.
$ cp tvgrabnlp/tv_grab_nl.py ~/domotiga/tvguide
$ cd ~/domotiga/tvguide
$ mkdir ~/.xmltv   # Otherwise the script will error out
$ ./tv_grab_nl.py --config=tv_grab_nl_py.conf --configure
Creating config file: tv_grab_nl_py.conf

Now edit the ~/domotiga/tvguide/tv_grab_nl_py.conf file, remove the lines with the channels you do not want to grab or comment them out using a '#'. Better start with a limited number and extend later as retrieving the information can take long.

Next create a ~/domotiga/tvguide/grab.sh file with as content:

#!/bin/bash

# Keep everything in this directory
cd "$( dirname "${BASH_SOURCE[0]}" )" 
./tv_grab_nl.py --config-file=tv_grab_nl_py.conf --cache=tv_grab_nl_py.cache

# Above command does output on stdout as Domotiga is expecting. To have it go to file:
# ./tv_grab_nl.py --config-file=tv_grab_nl_py.conf --cache=tv_grab_nl_py.cache --output=tvguide.xml

# Make TVGuide.module start parsing
echo "Completed ... : tvguide.xml" 

This can take a long time the first time based on the number of channels you specified.

Once this is done, update:
  • the XML Grab Command String to /home/<user>/domotiga/tvguide/grab.sh
  • the XML File to /home/<user>/domotiga/tvguide/tvguide.xml

For testing and further configuration, see Install above.

tv_grab_nl

This is not needed if you use mc2xml.

$ mkdir -p ~/install/xmltv
$ cd ~/install/xmltv
$ wget http://home.tiscali.nl/~lteunissen/tv_grab_nl_C/tv_grab_nl_C-0.02.17.tar.gz
$ tar xzvf tv_grab_nl_C-0.02.17.tar.gz
$ cd tv_grab_nl_C-0.02.17
$ make
$ cp tv_grab_nl_C ~/domotiga/tvguide/

You need to configure it for your provider and channels, see the website or command help on how to do this.
Place the resulting config file in ~/domotiga/tvguide/
Now you can fetch the channels and/or tvguide by clicking the import guide button in the xmltv settings window.

Related Resources

    Updated by: Alexie, Updated almost 2 years ago
    Access count: 70387 since 2011-08-25

    Attached Files

    domotiga-tvguide.png (143 KB) rdnzl, 08/24/2011 09:09 AM

    TV_Guide.png (2.22 KB) danfos, 07/12/2014 01:04 PM

    TV_Guide_Setup.png (18 KB) danfos, 07/12/2014 01:16 PM

    TV_Guide_Setup_Import_Guide.png (11.8 KB) danfos, 07/12/2014 06:17 PM

    Also available in: PDF HTML TXT