EPG for HabPanel

Hi

I’m trying to display some EPG data on My HabPanel.

I tried several different ways, but non is working like i want it.
My first try was with WebGrab + to get an XML File with the EPG information an transforming it with xslt to get the Item.
But the XML was not readable by OpenHab.

Does anybody have a better idea to get the EPG working?

Kind regards
Steven

You should be able to make it work with the HTTP binding and XPATH or XSLT.

“not readable by openHAB” is not informative. What was the error?

OK i managed to read the xml and get the data i need. I can do a seperate item for each xml node i want with xslt. But how can i get the item for the current show?

My XML looks like this:

<programme channel="SRF 1"
              start="20170827004500 +0200"
              stop="20170827021500 +0200">
          <title>Jack Taylor</title>
          <sub-title>Gefallene Mädchen(S1 E2)</sub-title>
          <desc>(2011) Jack Taylor wird von der Tochter einer früheren Insassin der dubiosen Magdalenen-Wäschereien beauftragt, die Identität einer ehemaligen Nonne herauszufinden. Jeder nannte sie damals nur «Lucifer». Jack erhält das Tagebuch der verstorbenen Mutter seiner Auftraggeberin und beginnt, sich auf die Suche nach der ebenso geheimnisvollen wie grausamen Lucifer zu machen. Sie soll die böseste Nonne von allen gewesen sein und quälte die Mädchen auf sadistische Weise. Im Tagebuch liest Jack über brutale Missstände und Erniedrigungen. Kaum hat Jack mit den Ermittlungen begonnen, wird er von Bill Cassell , dem Unterweltboss Galways, unmissverständlich gewarnt: Er soll den Fall niederlegen, das Tagebuch aushändigen - oder er stirbt. Cassell meint es ernst und spielt russisches Roulette mit Jack. Dieser entgeht dabei nur knapp dem Tod. Cody schleicht sich währenddessen heimlich ins Kirchenarchiv und findet heraus, dass alle Unterlagen, die auf Lucifers Identität hinweisen könnten, verschwunden sind. Alles sieht nach einer bewussten Verschleierung aus, an der Father Malachy , der engste Vertraute von Jacks Mutter, wesentlich beteiligt ist. Und dann macht Jack in dem alten Tagebuch eine Entdeckung, die ihn mehr als alles andere beunruhigt. Offenbar zählte auch seine eigene Mutter, zu der er seit jeher ein eher gespanntes Verhältnis unterhält, damals als Heiminsassin zu den «gefallenen Mädchen». Jacks Recherche wird so ungewollt zu einer Reise in die Vergangenheit der eigenen Familie. Und was als scheinbar simple Personenrecherche begonnen hat, entwickelt sich, ohne dass sich zunächst ein Zusammenhang dazu herstellen lässt, zu einer blutigen Mordserie. Die Handlung der «Jack Taylor»-Folge «Gefallene Mädchen» hat einen Bezug zur Realität: Magdalenen-Wäschereien waren in Irland - bis weit in die zweite Hälfte des 20. Jahrhunderts hinein - Heime für «gefallene Mädchen». Die jungen Frauen waren stigmatisiert als Sünderinnen, mussten unter strenger Führung katholischer Nonnen Busse tun und ohne Lohn in der Wäscherei arbeiten. Die Magdalenen-Heime waren aber auch Schauplätze schlimmster Misshandlungen und Demütigungen durch die Nonnen. SRF 1 zeigt «Jack Taylor - Gefallene Mädchen» exklusiv in Zweikanalton deutsch/englisch(n)

 ¤ Actors: Iain Glen
 ¤ Director: Stuart Orme</desc>
			   <category lang="de">Krimi</category>
		    <episode-num system="onscreen">S1 E2</episode-num>
	  </programme>

Thanks for help

http://docs.openhab.org/configuration/sitemaps.html

Or

http://docs.openhab.org/addons/uis/habpanel/readme.html

So i have to make an separate item for each time and show?
Is there a way to search via xslt by time variable?

Kind regards

I don’t know. You have provided so little detail about what you are trying to do with this information on what you are tyring to do with this information I couldn’t guess.

Not the way it is formatted in the example XML. What you will need to do is create a rule to parse out the start and stop times (in particular stripping off the +0200 part), then parse the number into a Joda DateTime and then you can compare it with Joda DateTimes populated with the start and end time you want to search for.

OK I’ll give it a try with Joda DateTimes.

My goal is to add an EPG like the one on the picture to my HABPanel, and if i click on a show the TV shoud switch to the cannel.

This is very ambitious and I will caution you that OH is not well suited for this sort of application because of the one Item per show problem. Good luck!

Hi

I came a step further, I have a dreambox DM800 (E2) wich have an epg functionality.

My item looks loke this:

Stringpro7 "Epg Pro  7 [%s]" {http="<['http://192.168.1.93/web/epgservicenow?sRef=1:0:19:235C:5B:1:FFFF0212:0:0:0:':5000:XSLT(test.xsl)]]"}

witch gave mi an output like this:

<e2eventlist>
<e2event>
<e2eventid>4634</e2eventid>
<e2eventstart>1505628300</e2eventstart>
<e2eventduration>10800</e2eventduration>
<e2eventcurrenttime>1505629539</e2eventcurrenttime>
<e2eventtitle>Teleshopping</e2eventtitle>
<e2eventdescription/>
<e2eventdescriptionextended>Teleshopping.</e2eventdescriptionextended>
<e2eventservicereference>1:0:19:235B:5B:1:FFFF0212:0:0:0:</e2eventservicereference>
<e2eventservicename>SAT.1 HD</e2eventservicename>
</e2event>
</e2eventlist>

And my transformation file looks like this:

<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
   <xsl:output method='text' indent='no'/>
   <xsl:template match='/'>
      <reRoot><reNode><xsl:value-of select='/e2eventlist/e2event/e2eventtitle' /></reNode></reRoot>
   </xsl:template>
</xsl:stylesheet>

But my item is alway NULL, there is no error in log.

Can somebufy help me?

It might be a typo but you need a space between String and pro7 in your Item definition.

Try removing the transformation and add a rule to log out the item when it receives an update. This will tell you if the problem is the item/binding or the transformation.

I came a step further, the failure was the url witch contains “.” signs
When i take a http cached it reads the xml correctly.

But I still have a failure in my configuration.
i get the following error

javax.xml.transform.TransformerConfigurationException: /etc/openhab2/transform/test.xsl) (No such file or directory)

but the path is correct and the file exists.
I tried to reinstall the xslt binding, but still not working.

Is the file owned by the openhab user and/or readable by the openhab user?

Hey @Steven_Rey,

whats the current status of your epg project?

It´s hard to get the right syntax for the transformations in OH. I gave up on trying it via XSLT or XPATH.
I get it managed to extract the show-data into openhab via regex - with some limitations (like messed up character formatting and error susceptibility due to changes on the source file). In your case, it would be something like (only works reliable, if theres only one <a2eventtitle> per channel-xml):

.*<e2eventtitle>(.*?)<.*

which results in something like this (in BasicUI):

But I agree with @rlkoshak that OH isn´t ideal to handle all this information as an seperate item. Another approach could be to let OH only control the actions like “play channel xy on device”, “record show xy”, “mark show xy as favourite”, so you only need a few items per channel to interact with the epg in OH.
Informations like the show-title, start-end-time could be shown in a webview, like this (very early creation stage, so some parts/infos are missing. :wink: ):

1 Like

HI Simson

Sorry for my late reply, i gave up with this and made it easy for my self.
I did it with frame widget on Hubpanel.

Awsome!! is this also possible with home assistant os?