Hein is spot on. Here is a bit more info having just got it working using Sutton's Stable PPA 3.2~precise:
google for and download tv_grab_nz-py script
Open it with gedit and/or nano and satisfy yourself it's not malicious. Or not.
put tv_grab_nz-py into /home/hts/.xmltv
Do this because your user has rights to do stuff there, and so does tvheadend.
The tv_grab_file is already configured to look for the xmltv file there as well. Why edit things and fight it?
Tell tv_grab_nz-py what channels you want epg info about. Note this is NOT done as root:
$ ./tv_grab_nz-py --configure
Follow the prompts and say yes to all the channels you want EPG for and no to those you don't.
As at this writing, The Shopping Channel epg isn't yet integrated. Great cultural loss, I know!
Now that it is configured, ask it to write the output to a file instead of the terminal:
$ ./tv_grab_nz-py --output tv_grab_file.xmltv
Make sure you use this output file name, as the tv_grab_file script is already configured to grab a file with that name directly from the /home/hts/.xmltv folder.
Open the file with gedit/nano and familiarise yourself with the output.
google for and download tv_grab_file
I downloaded it to the same .xmltv folder for convenience.
Open it with gedit and/or nano and satisfy yourself it's not malicious. Or not.
sudo it into /usr/bin:
$ sudo cp /home/hts/.xmltv/tv_grab_file /usr/bin/tv_grab_file
Make it executable:
$ sudo chmod +x /usr/bin/tv_grab_file
Once it's in there, you need to restart tvheadened so that it sees it:
$ sudo service tvheadend restart
Use the browser to go back into tvheadend through the normal interface and configure:
Configuration>EPG Grabber>General Config> tick all three
Configuration>EPG Grabber>Internal Grabber>Module> find XMLTV: tv_grab_file is a simple grabber.....etc
Configuration>EPG Grabber>Grab interval>Set as you like, I left the default: 12 Hours
Configuration>EPG Grabber>Over the air grabbers> disable all
Configuration>EPG Grabber>External Interfaces> disable all
I also unticked the EPG boxes next to all the channels in my Configuration>TV adapters>Services tab, although I have no idea if this is really necessary.
Despite another tvheadend restart, the EIT had already built up an incomplete, crappy EPG database which prevented the shiny new xmltv file from getting loaded.
I used the suggestion from this tvheadend wiki thread:
https://www.lonelycoder.com/redmine/boards/5/topics/5937?r=5971#message-5971
..and killed off the existing EPG database and restarted tvheadend, and all was well.
"So, I stopped tvheadend, deleted /home/hts/.hts/tvheadend/epgdb.v2 (the EPG database file), and re-started the daemon again..."
Finally, I finished off with Hein's second suggestion, setting up a cron job in my own user's crontab:
$ crontab -e
I added these two lines (see man crontab for their meaning and adjust timing to suit)
50 15 /home/hts/.xmltv/tv_grab_nz-py --output /home/hts/.xmltv/tv_grab_file.xmltv
50 03 /home/hts/.xmltv/tv_grab_nz-py --output /home/hts/.xmltv/tv_grab_file.xmltv
I added the VERY necessary extra line to the crontab and saved it. (see man crontab for why an extra line is VITAL)
These times were chosen so I could see the cron job work and the output file get replaced.
It's all good and I hope spelling this out is useful to the next kiwi building their own PVR...;)
This config does NOT have the 'U' channel import error that Spencer logged here:
https://www.lonelycoder.com/redmine/boards/12/topics/4120