Integrating XMLTV with openHAB for TV Guide Automation

Hey everyone, I’ve been working on a fun project to integrate XMLTV with openHAB to display TV guide information. It’s been a bit of a learning curve, but I’m excited to share my setup and see if others are interested in doing something similar!

What I Achieved:
I managed to pull EPG data for several channels and display the current and next shows, along with their timings. This is super handy for keeping track of what’s on without switching on the TV. I also set up a basic UI in Lovelace to show this information neatly.

Installation Steps:

  1. Install XMLTV: I used the tv_grab_eu_egon grabber for European channels. It was straightforward with sudo apt-get install xmltv.
  2. Configure XMLTV: I edited the config file to select the channels I wanted. This involved some trial and error, but I found the documentation helpful.
  3. Set Up openHAB Items: I created items to store the channel name, current show, next show, and their timings. This involved a bit of scripting to parse the XML data.
  4. Automation Rules: I wrote rules to update the EPG data every hour and extract the necessary information. It was a bit tricky to get the timing right, but it’s working smoothly now.

Challenges and Solutions:

  • Parsing XML Data: Initially, I struggled with extracting the right data from the XML files. Using Python scripts helped a lot here.
  • Time Zone Issues: Making sure the timings matched my local time was a bit of a pain, but adjusting the XMLTV config sorted it out.

Final Thoughts:
This project has been a great way to get more out of my openHAB setup. It’s not just about controlling devices; it’s also about integrating everyday information into my smart home ecosystem. I’m curious to see if others have similar setups or if there are improvements I can make!

If anyone is interested in the scripts or more detailed instructions, feel free to ask. I’d love to help others set this up too! :slight_smile: