Enigma2 EPG

Hallo!

Da ja Weihnachten ist und ein wenig Zeit für IPS und IPSView bleibt möcht ich wieder mal ein kleines Problem angehen!
Derzeit Funktioniert ja alles sehr gut aber Ich würde sehr gerne das App Dreamepg mit IPSView bzw. IPS vereinen.

Bild 1 ist ein Screenshot vom App EPGDream wenn man auf das Logo drückt schaltet die VU auf den Kanal

Bild 2 ist ein Screenshot von OpenWebif Vu+ mit OpenATV

Wie und wo muß ich ansetzen das ich das ganze über IPS in IPSView bringe?
Denn Ich will nicht immer zwischen den App´s IPSView und EPGDream hin und her switchen

Mfg
Maxx

Hi Maxx!

Ich denke du hast 2 Möglichkeiten…

1.) Einfach das OpenWebIf als externe Seite (Steuerelemente - HTML & Web - WebView) in deiner IPSView Visu einbauen.
2.) Alles selbst in einer HTML-Seite nach deinen Wünschen „aufbauen“/nachbauen und diese dann im IPSView einbinden.

Für Variante 2 >> An die EPG-Daten der VU+ kommst du über verschiedene Scripte/Module (unter anderem mein Enigma2BY Modul).

Grüße,
Chris

PS: Ich meine mich zu erinnern, dass Fonzo da auch mal was in der Richtung gebastelt hat mit Senderlogos und Umschalten. Aber ich glaube das war für Mediola?!

Ja für Variante 2 bin ich auch, aber wie kann ich am besten anfangen?
Mit HTML habe ich keine erfahrung aber vielleicht gibt es ja andere Projekte die ich umbauen kann!
Bin für jede hilfe sehr dankbar!

Mfg
Maxx

Das hatten wir doch ansatzweise schon mal hier.
Deine Abbildungen zeigen ein Multi EPG, das habe ich mir persönlich auch noch keins gebaut, ich nutzte nach wie vor eine EPG Ausgabe in Form einer Tabelle für einen Sender. Du müsstest Dir also aus den Daten die die EPG Anfrage Dir zurückgibt eine HTML Seite bauen und diese dann in IPSView anzeigen. Oder einfacher, passt aber nicht ganz zum Gesamtlayout, das OpenWebif in eine Webview Box in IPSStudio stecken.

Morgen!

Ich werde mich mal schlau machen vielleicht bekomme ich so eine HTML Seite hin!
OpenWebif einfach 1:1 einbauen ist nicht gut denn Ich will ja auch umschalten wenn ich auf die Senderlogos drücke!

Mfg
Maxx

Wenn es Dir nur um das Umschalten oder einfaches EPG geht kannst Du auch
IPS2Enigma
anschauen bzw. nutzten. Nur ein richtiges Multi EPG hat sich bisher glaub ich keiner die Mühe gemacht zu bauen, da wärst Du wohl der erste, aber da würden sich viele freuen wenn Du so was basteln willst.

Danke das schaut mal schon sehr gut aus!
Das ist ja fast schon fertig für mich, werde mir am Abend mal das Modul geauer ansehen!
Fonzo du bist mein Held!

Mfg
Maxx

Hallo!

Ich poste mal hir den code vom Modul vielleicht kann mir ja wer von hier weiterhelfen denn mein Nachbar ist in HTML
Perfekt aber derzeit mit Arbeit eingedeckt!

<?
    // Klassendefinition
    class IPS2Enigma extends IPSModule 
    {
	// Überschreibt die interne IPS_Create($id) Funktion
        public function Create() 
        {
            	// Diese Zeile nicht löschen.
            	parent::Create();
           	$this->RegisterPropertyBoolean("Open", false);
	    	$this->RegisterPropertyString("User", "User");
	    	$this->RegisterPropertyString("Password", "Passwort");
		$this->RegisterPropertyString("IPAddress", "127.0.0.1");
		$this->RegisterPropertyInteger("DataUpdate", 15);
		$this->RegisterPropertyBoolean("HDD_Data", false);
		$this->RegisterPropertyBoolean("Movielist_Data", false);
		$this->RegisterPropertyBoolean("Enigma2_Data", false);
		$this->RegisterPropertyBoolean("Signal_Data", false);
		$this->RegisterPropertyBoolean("Network_Data", false);
		$this->RegisterPropertyBoolean("RC_Data", false);
		$this->RegisterPropertyInteger("BouquetsNumber", 0);
		$this->RegisterPropertyBoolean("EPGnow_Data", false);
		$this->RegisterPropertyBoolean("EPGnext_Data", false);
		$this->RegisterPropertyInteger("EPGUpdate", 60);
		$this->RegisterPropertyBoolean("EPGlist_Data", false);
		$this->RegisterPropertyBoolean("EPGlistSRef_Data", false);
		$this->RegisterPropertyInteger("PiconSource", 0);
		$this->RegisterPropertyInteger("ScreenshotUpdate", 30);
		$this->RegisterPropertyInteger("Screenshot", 640);
		$this->RegisterTimer("DataUpdate", 0, 'Enigma_Get_DataUpdate($_IPS["TARGET"]);');
		$this->RegisterTimer("EPGUpdate", 0, 'Enigma_Get_EPGUpdate($_IPS["TARGET"]);');
		$this->RegisterTimer("ScreenshotUpdate", 0, 'Enigma_GetScreenshot($_IPS["TARGET"]);');
		$this->RegisterTimer("StatusInfo", 0, 'Enigma_GetStatusInfo($_IPS["TARGET"]);');
	}
        
	// Überschreibt die intere IPS_ApplyChanges($id) Funktion
        public function ApplyChanges() 
        {
		// Diese Zeile nicht löschen
		parent::ApplyChanges();
		
		// Profil anlegen
		$this->RegisterProfileInteger("time.min", "Clock", "", " min", 0, 1000000, 1);
		$this->RegisterProfileInteger("snr.db", "Intensity", "", " db", 0, 1000000, 1);
		$this->RegisterProfileInteger("gigabyte.GB", "Gauge", "", " GB", 0, 1000000, 1);
		
		// Objekte und Hook anlegen
		$this->RegisterMediaObject("Screenshot_".$this->InstanceID, "Screenshot_".$this->InstanceID, 1, $this->InstanceID, 1000, true, "Screenshot.jpg");
		$this->RegisterHook("/hook/IPS2Enigma");
		$this->SetBuffer("FirstUpdate", "false");
		
		$this->RegisterVariableInteger("PiconUpdate", "Picon Update", "~UnixTimestamp", 1500);
		$this->DisableAction("PiconUpdate");
		IPS_SetHidden($this->GetIDForIdent("PiconUpdate"), true);
		
		//Status-Variablen anlegen
		If ($this->ReadPropertyBoolean("Enigma2_Data") == true) {
			$this->RegisterVariableString("e2oeversion", "E2 OE-Version", "", 10);
			$this->DisableAction("e2oeversion");
			$this->RegisterVariableString("e2enigmaversion", "E2 Version", "", 20);
			$this->DisableAction("e2enigmaversion");
			$this->RegisterVariableString("e2distroversion", "E2 Distro-Version", "", 30);
			$this->DisableAction("e2distroversion");
			$this->RegisterVariableString("e2imageversion", "E2 Image-Version", "", 40);
			$this->DisableAction("e2imageversion");
			$this->RegisterVariableString("e2webifversion", "E2 WebIf-Version", "", 50);
			$this->DisableAction("e2webifversion");
		}
		$this->RegisterVariableString("e2devicename", "Model", "", 60);
		$this->DisableAction("e2devicename");
		$this->RegisterVariableString("e2tunerinfo", "Tuner Information", "~HTMLBox", 65);
		$this->DisableAction("e2tunerinfo");
		
		If ($this->ReadPropertyBoolean("Network_Data") == true) {
			$this->RegisterVariableString("e2lanmac", "MAC", "", 70);
			$this->DisableAction("e2lanmac");
			$this->RegisterVariableBoolean("e2landhcp", "DHCP", "", 71);
			$this->DisableAction("e2landhcp");
			$this->RegisterVariableString("e2lanip", "IP", "", 72);
			$this->DisableAction("e2lanip");
			$this->RegisterVariableString("e2lanmask", "Mask", "", 73);
			$this->DisableAction("e2lanmask");
			$this->RegisterVariableString("e2langw", "Gateway", "", 74);
			$this->DisableAction("e2langw");
		}
		If ($this->ReadPropertyBoolean("HDD_Data") == true) {
			$this->RegisterVariableString("e2hddinfo_model", "HDD Model", "", 80);
			$this->DisableAction("e2hddinfo_model");
			$this->RegisterVariableInteger("e2hddinfo_capacity", "HDD Capacity", "gigabyte.GB", 90);
			$this->DisableAction("e2hddinfo_capacity");
			$this->RegisterVariableInteger("e2hddinfo_free", "HDD Free", "gigabyte.GB", 95);
			$this->DisableAction("e2hddinfo_free");
		}
		
		// Daten aus der Status-Funktion
		$this->RegisterVariableBoolean("powerstate", "Powerstate", "~Switch", 100);
		$this->EnableAction("powerstate");
		$this->RegisterVariableBoolean("isRecording", "Aufnahme", "~Switch", 104);
		$this->DisableAction("isRecording");
		$this->RegisterVariableInteger("volume", "Volume", "~Intensity.100", 106);
		$this->EnableAction("volume");
		$this->RegisterVariableString("currservice_serviceref", "Service-Referenz", "", 108);
		$this->DisableAction("currservice_serviceref");
		
		$this->RegisterVariableString("e2servicename", "Service Name", "", 110);
		$this->DisableAction("e2servicename");
		
		If ($this->ReadPropertyBoolean("EPGnow_Data") == true) {
			$this->RegisterVariableString("e2eventtitle", "Event Title", "", 120);
			$this->DisableAction("e2eventtitle");
			$this->RegisterVariableString("e2eventdescription", "Event Description", "", 125);
			$this->DisableAction("e2eventdescription");
			$this->RegisterVariableString("e2eventdescriptionextended", "Event Description Extended", "", 130);
			$this->DisableAction("e2eventdescriptionextended");
			$this->RegisterVariableInteger("e2eventstart", "Event Start", "~UnixTimestampTime", 140);
			$this->DisableAction("e2eventstart");
			$this->RegisterVariableInteger("e2eventend", "Event End", "~UnixTimestampTime", 150);
			$this->DisableAction("e2eventend");
			$this->RegisterVariableInteger("e2eventduration", "Event Duration", "time.min", 160);		
			$this->DisableAction("e2eventduration");
			$this->RegisterVariableInteger("e2eventpast", "Event Past", "time.min", 170);
			$this->DisableAction("e2eventpast");
			$this->RegisterVariableInteger("e2eventleft", "Event Left", "time.min", 180);
			$this->DisableAction("e2eventleft");
			$this->RegisterVariableInteger("e2eventprogress", "Event Progress", "~Intensity.100", 190);
			$this->DisableAction("e2eventprogress");
		}
		
		If ($this->ReadPropertyBoolean("EPGnext_Data") == true) {
			$this->RegisterVariableString("e2nexteventtitle", "Next Event Title", "", 200);
			$this->DisableAction("e2nexteventtitle");
			$this->RegisterVariableString("e2nexteventdescription", "Next Event Description", "", 210);
			$this->DisableAction("e2nexteventdescription");
			$this->RegisterVariableString("e2nexteventdescriptionextended", "Next Event Description Extended", "", 220);
			$this->DisableAction("e2nexteventdescriptionextended");
			$this->RegisterVariableInteger("e2nexteventstart", "Next Event Start", "~UnixTimestampTime", 230);
			$this->DisableAction("e2nexteventstart");
			$this->RegisterVariableInteger("e2nexteventend", "Next Event End", "~UnixTimestampTime", 240);
			$this->DisableAction("e2nexteventend");
			$this->RegisterVariableInteger("e2nexteventduration", "Next Event Duration", "time.min", 250);
			$this->DisableAction("e2nexteventduration");		
		}
		
		If (($this->ReadPropertyBoolean("EPGnow_Data") == true) OR ($this->ReadPropertyBoolean("EPGnext_Data") == true)) {
			$this->RegisterVariableString("e2epgHTML", "EPG", "~HTMLBox", 257);
			$this->DisableAction("e2epgHTML");
		}
		
		If ($this->ReadPropertyBoolean("Movielist_Data") == true) {
			$this->RegisterVariableString("e2movielist", "Aufzeichnungen", "~HTMLBox", 260);
			$this->DisableAction("e2movielist");
		}
		
		If ($this->ReadPropertyBoolean("Signal_Data") == true) {
			$this->RegisterVariableInteger("e2snrdb", "Signal-to-Noise Ratio (dB)", "snr.db", 300);
			$this->DisableAction("e2snrdb");
			$this->RegisterVariableInteger("e2snr", "Signal-to-Noise Ratio", "~Intensity.100", 310);
			$this->DisableAction("e2snr");
			$this->RegisterVariableInteger("e2ber", "Bit error rate", "", 320);
			$this->DisableAction("e2ber");
			$this->RegisterVariableInteger("e2agc", "Automatic Gain Control", "~Intensity.100", 330);
			$this->DisableAction("e2agc");
		}
		
		//$this->RegisterVariableString("e2stream", "Stream-Video", "~HTMLBox", 900);
		//$this->DisableAction("e2stream");
		
		If ($this->ReadPropertyBoolean("RC_Data") == true) {
			$this->RegisterVariableBoolean("rc_power", "Power", "~Switch", 500);
			$this->EnableAction("rc_power");
			$this->RegisterVariableBoolean("rc_mute", "Mute", "~Switch", 505);
			$this->EnableAction("rc_mute");
			$this->RegisterVariableBoolean("rc_vol_up", "Volume up", "~Switch", 510);
			$this->EnableAction("rc_vol_up");
			$this->RegisterVariableBoolean("rc_vol_down", "Volume down", "~Switch", 520);
			$this->EnableAction("rc_vol_down");
			$this->RegisterVariableBoolean("rc_1", "1", "~Switch", 530);
			$this->EnableAction("rc_1");
			$this->RegisterVariableBoolean("rc_2", "2", "~Switch", 540);
			$this->EnableAction("rc_2");
			$this->RegisterVariableBoolean("rc_3", "3", "~Switch", 550);
			$this->EnableAction("rc_3");
			$this->RegisterVariableBoolean("rc_4", "4", "~Switch", 560);
			$this->EnableAction("rc_4");
			$this->RegisterVariableBoolean("rc_5", "5", "~Switch", 570);
			$this->EnableAction("rc_5");
			$this->RegisterVariableBoolean("rc_6", "6", "~Switch", 580);
			$this->EnableAction("rc_6");
			$this->RegisterVariableBoolean("rc_7", "7", "~Switch", 590);
			$this->EnableAction("rc_7");
			$this->RegisterVariableBoolean("rc_8", "8", "~Switch", 600);
			$this->EnableAction("rc_8");
			$this->RegisterVariableBoolean("rc_9", "9", "~Switch", 610);
			$this->EnableAction("rc_9");
			$this->RegisterVariableBoolean("rc_0", "0", "~Switch", 620);
			$this->EnableAction("rc_0");
			$this->RegisterVariableBoolean("rc_previous", "Previous", "~Switch", 640);
			$this->EnableAction("rc_previous");
			$this->RegisterVariableBoolean("rc_next", "Next", "~Switch", 650);
			$this->EnableAction("rc_next");
			$this->RegisterVariableBoolean("rc_bouquet_up", "Bouquet up", "~Switch", 660);
			$this->EnableAction("rc_bouquet_up");
			$this->RegisterVariableBoolean("rc_bouquet_down", "Bouquet down", "~Switch", 670);
			$this->EnableAction("rc_bouquet_down");
			$this->RegisterVariableBoolean("rc_red", "Red", "~Switch", 680);
			$this->EnableAction("rc_red");
			$this->RegisterVariableBoolean("rc_green", "Green", "~Switch", 690);
			$this->EnableAction("rc_green");
			$this->RegisterVariableBoolean("rc_yellow", "Yellow", "~Switch", 700);
			$this->EnableAction("rc_yellow");
			$this->RegisterVariableBoolean("rc_blue", "Blue", "~Switch", 710);
			$this->EnableAction("rc_blue");
			$this->RegisterVariableBoolean("rc_up", "Up", "~Switch", 720);
			$this->EnableAction("rc_up");
			$this->RegisterVariableBoolean("rc_down", "Down", "~Switch", 730);
			$this->EnableAction("rc_down");
			$this->RegisterVariableBoolean("rc_left", "Left", "~Switch", 740);
			$this->EnableAction("rc_left");
			$this->RegisterVariableBoolean("rc_right", "Right", "~Switch", 750);
			$this->EnableAction("rc_right");
			$this->RegisterVariableBoolean("rc_audio", "Audio", "~Switch", 760);
			$this->EnableAction("rc_audio");
			$this->RegisterVariableBoolean("rc_video", "Video", "~Switch", 770);
			$this->EnableAction("rc_video");
			$this->RegisterVariableBoolean("rc_lame", "Lame", "~Switch", 780);
			$this->EnableAction("rc_lame");
			$this->RegisterVariableBoolean("rc_info", "Info", "~Switch", 790);
			$this->EnableAction("rc_info");
			$this->RegisterVariableBoolean("rc_menu", "Menu", "~Switch", 800);
			$this->EnableAction("rc_menu");
			$this->RegisterVariableBoolean("rc_ok", "OK", "~Switch", 810);
			$this->EnableAction("rc_ok");
			$this->RegisterVariableBoolean("rc_menu", "Menu", "~Switch", 800);
			$this->EnableAction("rc_menu");
			$this->RegisterVariableBoolean("rc_ok", "OK", "~Switch", 810);
			$this->EnableAction("rc_ok");
			$this->RegisterVariableBoolean("rc_tv", "TV", "~Switch", 820);
			$this->EnableAction("rc_tv");
			$this->RegisterVariableBoolean("rc_radio", "Radio", "~Switch", 830);
			$this->EnableAction("rc_radio");
			$this->RegisterVariableBoolean("rc_help", "Help", "~Switch", 840);
			$this->EnableAction("rc_help");
			$this->RegisterVariableBoolean("rc_text", "Text", "~Switch", 850);
			$this->EnableAction("rc_text");
			$this->RegisterVariableBoolean("rc_exit", "Exit", "~Switch", 860);
			$this->EnableAction("rc_exit");
			$this->RegisterVariableBoolean("rc_rewind", "Rewind", "~Switch", 870);
			$this->EnableAction("rc_rewind");
			$this->RegisterVariableBoolean("rc_play", "Play", "~Switch", 880);
			$this->EnableAction("rc_play");
			$this->RegisterVariableBoolean("rc_pause", "Pause", "~Switch", 890);
			$this->EnableAction("rc_pause");
			$this->RegisterVariableBoolean("rc_forward", "Forward", "~Switch", 900);
			$this->EnableAction("rc_forward");
			$this->RegisterVariableBoolean("rc_stop", "Stop", "~Switch", 910);
			$this->EnableAction("rc_stop");
			$this->RegisterVariableBoolean("rc_record", "Record", "~Switch", 920);
			$this->EnableAction("rc_record");
		}
		
		If ($this->ReadPropertyBoolean("EPGlist_Data") == true) {
			$this->RegisterVariableString("e2epglistHTML", "EPG Liste", "~HTMLBox", 950);
			$this->DisableAction("e2epglistHTML");
		}
		
		If ($this->ReadPropertyBoolean("EPGlistSRef_Data") == true) {
			$this->RegisterVariableString("e2epglistSRefHTML", "EPG Liste Sender", "~HTMLBox", 950);
			$this->DisableAction("e2epglistSRefHTML");
		}
		
		If ($this->ReadPropertyInteger("PiconSource") == 0) {
			$this->Get_Picons();
		}
		elseif ($this->ReadPropertyInteger("PiconSource") == 1) {
			$this->Get_Picons_Enigma();
		}
		
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$this->Get_BasicData();
			$this->Get_HTML();
			$this->SetTimerInterval("DataUpdate", ($this->ReadPropertyInteger("DataUpdate") * 1000));
			$this->SetTimerInterval("EPGUpdate", ($this->ReadPropertyInteger("EPGUpdate") * 1000));
			$this->SetTimerInterval("ScreenshotUpdate", ($this->ReadPropertyInteger("ScreenshotUpdate") * 1000));
			$this->SetTimerInterval("StatusInfo", 2 * 1000);
			$this->Get_Powerstate();
			$this->GetScreenshot();
			$this->Get_EPGUpdate();
			$this->GetStatusInfo();
			If ($this->ReadPropertyBoolean("Movielist_Data") == true) {
				$this->GetMovieListUpdate();
			}
			$this->SetStatus(102);
		}
		else {
			$this->SetStatus(104);
		}
        }
	
	public function RequestAction($Ident, $Value) 
	{
  		switch($Ident) {
			case "rc_mute":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 113 Key "mute"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=113"));
				}
				break;
			case "muted":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 113 Key "mute"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=113"));
				}
				break;
			case "rc_vol_up":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 115 Key "volume up"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=115"));
				}
				break;
			case "rc_vol_down":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 114 Key "volume down"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=114"));
				}
				break;
			case "volume":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// Funktion fehlt noch
					
				}
				break;
			case "rc_power":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
					// 116 Key "Power""
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=116"));
					$this->Get_EPGUpdate();
				}
				break;
			case "powerstate":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
					// 116 Key "Power""
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=116"));
					$this->Get_EPGUpdate();
				}
				break;
			case "rc_1":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 2   Key "1"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=2"));
				}
				break;
			case "rc_2":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 3   Key "2"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=3"));
				}
				break;
			case "rc_3":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 4   Key "3"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=4"));
				}
				break;
			case "rc_4":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 5   Key "4"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=5"));
				}
				break;
			case "rc_5":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 6   Key "5"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=6"));
				}
				break;
			case "rc_6":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 7   Key "6"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=7"));
				}
				break;
			case "rc_7":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 8   Key "7"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=8"));
				}
				break;
			case "rc_8":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 9   Key "8"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=9"));
				}
				break;
			case "rc_9":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 10  Key "9"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=10"));
				}
				break;
			case "rc_0":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 11  Key "0"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=11"));
				}
				break;
			case "rc_previous":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 412 Key "previous"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=412"));
				}
				break;
			case "rc_next":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 407 Key "next"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=407"));
				}
				break;
			case "rc_bouquet_up":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 402 Key "bouquet up"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=402"));
				}
				break;
			case "rc_bouquet_down":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 403 Key "bouquet down"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=403"));
				}
				break;
			case "rc_red":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 398 Key "red"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=398"));
				}
				break;
			case "rc_green":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 399 Key "green"	
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=399"));
				}
				break;
			case "rc_yellow":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 400 Key "yellow"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=400"));
				}
				break;
			case "rc_blue":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 401 Key "blue"	
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=401"));
				}
				break;
			case "rc_up":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 103 Key "up"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=103"));
				}
				break;
			case "rc_down":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 108 Key "down"	
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=108"));
				}
				break;
			case "rc_left":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 105 Key "left"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=105"));
				}
				break;
			case "rc_right":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 106 Key "right"	
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=106"));
				}
				break;
			case "rc_audio":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 392 Key "audio"
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=392"));
				}
				break;
			case "rc_video":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 393 Key "video"		
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=393"));
				}
				break;
			case "rc_lame":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 174 Key "lame"		
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=174"));
				}
				break;
			case "rc_info":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 358 Key "info"		
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=358"));
				}
				break;
			case "rc_menu":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 139 Key "menu"			
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=139"));
				}
				break;
			case "rc_ok":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 352 Key "OK"			
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=352"));
				}
				break;
			case "rc_tv":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 377 Key "tv"			
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=377"));
				}
				break;
			case "rc_radio":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 385 Key "radio"			
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=385"));
				}
				break;
			case "rc_text":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 388 Key "text"			
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=388"));
				}
				break;
			case "rc_help":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 138 Key "help"			
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=138"));
				}
				break;
			case "rc_exit":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 1 Key "exit"			
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=1"));
				}
				break;
			case "rc_rewind":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 168 Key "rewind"		
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=168"));
				}
				break;
			case "rc_play":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 207 Key "play"		
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=207"));
				}
				break;
			case "rc_pause":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 119 Key "pause"		
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=119"));
				}
				break;
			case "rc_forward":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 208 Key "forward"		
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=208"));
				}
				break;
			case "rc_stop":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 128 Key "stop" 		
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=128"));
				}
				break;
			case "rc_record":
			    	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// 167 Key "record"		
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=167"));
				}
				break;
			default:
			    throw new Exception("Invalid Ident");
	    	}
	}
	
	// Beginn der Funktionen
	public function Get_DataUpdate()
	{
		If (($this->ReadPropertyBoolean("Open") == true) AND (GetValueBoolean($this->GetIDForIdent("powerstate")) == true)) {
			$this->SetBuffer("FirstUpdate", "false");
			//IPS_LogMessage("IPS2Enigma","TV-Daten ermitteln");
			// das aktuelle Programm
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/subservices"));
       			If ($xmlResult == false) {
				$this->SendDebug("Get_DataUpdate", "Fehler beim Lesen der Daten!", 0);
				return;
			}
			
			//SetValueString($this->GetIDForIdent("e2servicename"), (string)$xmlResult->e2service->e2servicename);
			$e2servicereference = (string)$xmlResult->e2service->e2servicereference;
			$e2servicename = (string)$xmlResult->e2service->e2servicename;	
						
			If ($this->ReadPropertyBoolean("Movielist_Data") == true) {
				$this->GetMovieListUpdate();
			}
			
			If ($this->ReadPropertyBoolean("HDD_Data") == true) {
				// Festplattendaten
				$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/about"));
				If (substr($xmlResult->e2about->e2hddinfo->capacity, -2) == "GB") {
					SetValueInteger($this->GetIDForIdent("e2hddinfo_capacity"), (int)$xmlResult->e2about->e2hddinfo->capacity);
				}
				else {
					SetValueInteger($this->GetIDForIdent("e2hddinfo_capacity"), (int)$xmlResult->e2about->e2hddinfo->capacity * 1000);
				}
				If (substr($xmlResult->e2about->e2hddinfo->free, -2) == "GB") {	
					SetValueInteger($this->GetIDForIdent("e2hddinfo_free"), (int)$xmlResult->e2about->e2hddinfo->free);
				}
				else {
					SetValueInteger($this->GetIDForIdent("e2hddinfo_free"), (int)$xmlResult->e2about->e2hddinfo->free * 1000);
				}
			}
			
			//SetValueString($this->GetIDForIdent("e2stream"), "<video width="320" height="240" controls> <source src="http://".$this->ReadPropertyString("IPAddress")."/web/stream.m3u?ref=".$e2servicereference." type="video/mp4"> </video>");
			//"http://".$this->ReadPropertyString("IPAddress")."/web/stream.m3u?ref=".$e2servicereference
		}
		else {
			if ($this->GetBuffer("FirstUpdate") == "false") {
				If ($this->ReadPropertyBoolean("EPGnow_Data") == true) {
					SetValueString($this->GetIDForIdent("e2eventtitle"), "N/A");
					SetValueString($this->GetIDForIdent("e2eventdescription"), "N/A");
					SetValueString($this->GetIDForIdent("e2eventdescriptionextended"), "N/A");
					SetValueInteger($this->GetIDForIdent("e2eventstart"), 0);
					SetValueInteger($this->GetIDForIdent("e2eventend"), 0);
					SetValueInteger($this->GetIDForIdent("e2eventduration"), 0);
					SetValueInteger($this->GetIDForIdent("e2eventpast"), 0);
					SetValueInteger($this->GetIDForIdent("e2eventleft"), 0);
					SetValueInteger($this->GetIDForIdent("e2eventprogress"), 0);
					SetValueString($this->GetIDForIdent("e2epgHTML"), ""); 		
				}
				If ($this->ReadPropertyBoolean("EPGnext_Data") == true) {
					SetValueString($this->GetIDForIdent("e2nexteventtitle"), "N/A");
					SetValueString($this->GetIDForIdent("e2nexteventdescription"), "N/A");
					SetValueString($this->GetIDForIdent("e2nexteventdescriptionextended"), "N/A");
					SetValueInteger($this->GetIDForIdent("e2nexteventstart"), 0);
					SetValueInteger($this->GetIDForIdent("e2nexteventend"), 0);
					SetValueInteger($this->GetIDForIdent("e2nexteventduration"), 0);
					SetValueString($this->GetIDForIdent("e2epgHTML"), "");
				}
				$this->SetBuffer("FirstUpdate", "true");
			}
		}
	}
	
	public function Get_EPGUpdate()
	{
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$FilePathStream = "user".DIRECTORY_SEPARATOR."Enigma_HTML".DIRECTORY_SEPARATOR."Button-Media-Player_32.png";
			$FilePathPlay = "user".DIRECTORY_SEPARATOR."Enigma_HTML".DIRECTORY_SEPARATOR."Button-Play_32.png";
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/getservices"));
			If ($xmlResult == false) {
				$this->SendDebug("Get_EPGUpdate", "Fehler beim Lesen der EPG-Daten!", 0);
				return;
			}
			$bouquet = (string)$xmlResult->e2service[$this->ReadPropertyInteger("BouquetsNumber")]->e2servicereference;
			
			If ($this->ReadPropertyBoolean("EPGlist_Data") == true) {
				$this->GetEPGNowNextData();
			}
			
			If (GetValueBoolean($this->GetIDForIdent("powerstate")) == true) {
				$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/subservices"));
				$e2servicereference = (string)$xmlResult->e2service->e2servicereference;
				$e2servicename = (string)$xmlResult->e2service->e2servicename;
				
				If (($this->ReadPropertyBoolean("EPGlistSRef_Data") == true) ) {
					
					//$sender = urlencode($sender);
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/epgservice?sRef=".$e2servicereference));
					$ValueCount = count($xmlResult) - 2;
					$table = '<style type="text/css">';
					$table .= '<link rel="stylesheet" href="./.../webfront.css">';
					$table .= "</style>";
					$table .= '<table class="tg">';
					$table .= "<tr>";
					$table .= '<th class="tg-kv4b">Sender</th>';
					$table .= '<th class="tg-kv4b">Beginn<br></th>';
					$table .= '<th class="tg-kv4b">Titel</th>';
					$table .= '<th class="tg-kv4b">Kurzbeschreibung<br></th>';
					$table .= '<th class="tg-kv4b">Dauer<br></th>';
					$table .= '<colgroup>'; 
					$table .= '<col width="120">'; 
					$table .= '<col width="100">'; 
					$table .= '</colgroup>';
					$table .= '</tr>';
					$table .= '<tr>';
					$table .= '<td class="tg-611x"><img src='.$this->Get_Filename((string)$xmlResult->e2event[0]->e2eventservicereference).' alt='.(string)$xmlResult->e2event[0]->e2eventservicename.'></td>';
					$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult->e2event[0]->e2eventstart).' Uhr'.'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event[0]->e2eventtitle).'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event[0]->e2eventdescription).'</td>';			
					$table .= '<td class="tg-611x">'.round((int)$xmlResult->e2event[0]->e2eventduration / 60).' min'.'</td>';
					$table .= '</tr>';
					for ($i = 1; $i <= Min(count($xmlResult) - 1, 15); $i++) {
						$table .= '<tr>';
						$table .= '<td class="tg-611x"></td>';
						//$table .= '<td rowspan='.$ValueCount.' class="tg-611x"><img src='.$this->Get_Filename((string)$xmlResult->e2event[$i]->e2eventservicereference).' alt='.(string)$xmlResult->e2event[$i]->e2eventservicename.'></td>';
						$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult->e2event[$i]->e2eventstart).' Uhr'.'</td>';
						$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event[$i]->e2eventtitle).'</td>';
						$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event[$i]->e2eventdescription).'</td>';			
						$table .= '<td class="tg-611x">'.round((int)$xmlResult->e2event[$i]->e2eventduration / 60).' min'.'</td>';
						$table .= '</tr>';				
					}
					$table .= '</table>';
					SetValueString($this->GetIDForIdent("e2epglistSRefHTML"), $table);
				}
			
				If (($this->ReadPropertyBoolean("EPGnow_Data") == true) AND ($this->ReadPropertyBoolean("EPGnext_Data") == false) AND (substr($e2servicereference, 0, 20) <> "1:0:0:0:0:0:0:0:0:0:")) {
					// das aktuelle Ereignis
					$xmlResult =  new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/epgservicenow?sRef=".$e2servicereference));
					SetValueString($this->GetIDForIdent("e2eventtitle"), (string)utf8_decode($xmlResult->e2event->e2eventtitle));
					SetValueString($this->GetIDForIdent("e2eventdescription"), (string)utf8_decode($xmlResult->e2event->e2eventdescription));
					SetValueString($this->GetIDForIdent("e2eventdescriptionextended"), (string)utf8_decode($xmlResult->e2event->e2eventdescriptionextended));
					SetValueInteger($this->GetIDForIdent("e2eventstart"), (int)$xmlResult->e2event->e2eventstart);
					SetValueInteger($this->GetIDForIdent("e2eventend"), (int)$xmlResult->e2event->e2eventstart + (int)$xmlResult->e2event->e2eventduration);
					SetValueInteger($this->GetIDForIdent("e2eventduration"), round((int)$xmlResult->e2event->e2eventduration / 60) );
					SetValueInteger($this->GetIDForIdent("e2eventpast"), round( (int)time() - (int)$xmlResult->e2event->e2eventstart) / 60 );
					SetValueInteger($this->GetIDForIdent("e2eventleft"), round(((int)$xmlResult->e2event->e2eventstart + (int)$xmlResult->e2event->e2eventduration - (int)time()) / 60 ));
					SetValueInteger($this->GetIDForIdent("e2eventprogress"), GetValueInteger($this->GetIDForIdent("e2eventpast")) / GetValueInteger($this->GetIDForIdent("e2eventduration")) * 100);
					$table = '<style type="text/css">';
					$table .= '<link rel="stylesheet" href="./.../webfront.css">';
					$table .= "</style>";
					$table .= '<table class="tg">';
					$table .= "<tr>";
					$table .= '<th class="tg-kv4b">Sender</th>';
					$table .= '<th class="tg-kv4b">Titel</th>';
					$table .= '<th class="tg-kv4b">Kurzbeschreibung<br></th>';
					$table .= '<th class="tg-kv4b">Langbeschreibung<br></th>';
					$table .= '<th class="tg-kv4b">Beginn<br></th>';
					$table .= '<th class="tg-kv4b">Ende<br></th>';
					$table .= '<th class="tg-kv4b">Dauer<br></th>';
					$table .= '</tr>';
					$table .= '<tr>';
					$table .= '<td class="tg-611x"><img src='.$this->Get_Filename($e2servicereference).' alt='.$e2servicename.'></td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event->e2eventtitle).'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event->e2eventdescription).'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event->e2eventdescriptionextended).'</td>';
					$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult->e2event->e2eventstart).' Uhr'.'</td>';
					$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult->e2event->e2eventstart + (int)$xmlResult->e2event->e2eventduration).' Uhr'.'</td>';
					$table .= '<td class="tg-611x">'.round((int)$xmlResult->e2event->e2eventduration / 60).' min'.'</td>';
					$table .= '</tr>';
					$table .= '</table>';
					SetValueString($this->GetIDForIdent("e2epgHTML"), $table);
				}
				If (($this->ReadPropertyBoolean("EPGnow_Data") == false) AND ($this->ReadPropertyBoolean("EPGnext_Data") == true) AND (substr($e2servicereference, 0, 20) <> "1:0:0:0:0:0:0:0:0:0:")) {
					// das folgende Ereignis
					$xmlResult =  new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/epgservicenext?sRef=".$e2servicereference));
					SetValueString($this->GetIDForIdent("e2nexteventtitle"), (string)utf8_decode($xmlResult->e2event->e2eventtitle));
					SetValueString($this->GetIDForIdent("e2nexteventdescription"), (string)utf8_decode($xmlResult->e2event->e2eventdescription));
					SetValueString($this->GetIDForIdent("e2nexteventdescriptionextended"), (string)utf8_decode($xmlResult->e2event->e2eventdescriptionextended));
					SetValueInteger($this->GetIDForIdent("e2nexteventstart"), (int)$xmlResult->e2event->e2eventstart);
					SetValueInteger($this->GetIDForIdent("e2nexteventend"), (int)$xmlResult->e2event->e2eventstart + (int)$xmlResult->e2event->e2eventduration);
					SetValueInteger($this->GetIDForIdent("e2nexteventduration"), round((int)$xmlResult->e2event->e2eventduration / 60) );
					$table = '<style type="text/css">';
					$table .= '<link rel="stylesheet" href="./.../webfront.css">';
					$table .= "</style>";
					$table .= '<table class="tg">';
					$table .= "<tr>";
					$table .= '<th class="tg-kv4b">Sender</th>';
					$table .= '<th class="tg-kv4b">Titel</th>';
					$table .= '<th class="tg-kv4b">Kurzbeschreibung<br></th>';
					$table .= '<th class="tg-kv4b">Langbeschreibung<br></th>';
					$table .= '<th class="tg-kv4b">Beginn<br></th>';
					$table .= '<th class="tg-kv4b">Ende<br></th>';
					$table .= '<th class="tg-kv4b">Dauer<br></th>';
					$table .= '</tr>';
					$table .= '<tr>';
					$table .= '<td class="tg-611x"><img src='.$this->Get_Filename($e2servicereference).' alt='.$e2servicename.'></td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event->e2eventtitle).'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event->e2eventdescription).'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event->e2eventdescriptionextended).'</td>';
					$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult->e2event->e2eventstart).' Uhr'.'</td>';
					$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult->e2event->e2eventstart + (int)$xmlResult->e2event->e2eventduration).' Uhr'.'</td>';
					$table .= '<td class="tg-611x">'.round((int)$xmlResult->e2event->e2eventduration / 60).' min'.'</td>';
					$table .= '</tr>';
					$table .= '</table>';
					SetValueString($this->GetIDForIdent("e2epgHTML"), $table);
				}
				If (($this->ReadPropertyBoolean("EPGnow_Data") == true) AND ($this->ReadPropertyBoolean("EPGnext_Data") == true) AND (substr($e2servicereference, 0, 20) <> "1:0:0:0:0:0:0:0:0:0:")) {
					// das aktuelle Ereignis
					$xmlResult =  new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/epgservicenow?sRef=".$e2servicereference));
					SetValueString($this->GetIDForIdent("e2eventtitle"), (string)utf8_decode($xmlResult->e2event->e2eventtitle));
					SetValueString($this->GetIDForIdent("e2eventdescription"), (string)utf8_decode($xmlResult->e2event->e2eventdescription));
					SetValueString($this->GetIDForIdent("e2eventdescriptionextended"), (string)utf8_decode($xmlResult->e2event->e2eventdescriptionextended));
					SetValueInteger($this->GetIDForIdent("e2eventstart"), (int)$xmlResult->e2event->e2eventstart);
					SetValueInteger($this->GetIDForIdent("e2eventend"), (int)$xmlResult->e2event->e2eventstart + (int)$xmlResult->e2event->e2eventduration);
					SetValueInteger($this->GetIDForIdent("e2eventduration"), round((int)$xmlResult->e2event->e2eventduration / 60) );
					SetValueInteger($this->GetIDForIdent("e2eventpast"), round( (int)time() - (int)$xmlResult->e2event->e2eventstart) / 60 );
					SetValueInteger($this->GetIDForIdent("e2eventleft"), round(((int)$xmlResult->e2event->e2eventstart + (int)$xmlResult->e2event->e2eventduration - (int)time()) / 60 ));
					SetValueInteger($this->GetIDForIdent("e2eventprogress"), GetValueInteger($this->GetIDForIdent("e2eventpast")) / GetValueInteger($this->GetIDForIdent("e2eventduration")) * 100);
					// das folgende Ereignis
					$xmlResult_2 =  new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/epgservicenext?sRef=".$e2servicereference));
					SetValueString($this->GetIDForIdent("e2nexteventtitle"), (string)utf8_decode($xmlResult_2->e2event->e2eventtitle));
					SetValueString($this->GetIDForIdent("e2nexteventdescription"), (string)utf8_decode($xmlResult_2->e2event->e2eventdescription));
					SetValueString($this->GetIDForIdent("e2nexteventdescriptionextended"), (string)utf8_decode($xmlResult_2->e2event->e2eventdescriptionextended));
					SetValueInteger($this->GetIDForIdent("e2nexteventstart"), (int)$xmlResult_2->e2event->e2eventstart);
					SetValueInteger($this->GetIDForIdent("e2nexteventend"), (int)$xmlResult_2->e2event->e2eventstart + (int)$xmlResult_2->e2event->e2eventduration);
					SetValueInteger($this->GetIDForIdent("e2nexteventduration"), round((int)$xmlResult_2->e2event->e2eventduration / 60) );
					$table = '<style type="text/css">';
					$table .= '<link rel="stylesheet" href="./.../webfront.css">';
					$table .= "</style>";
					$table .= '<table class="tg">';
					$table .= "<tr>";
					$table .= '<th class="tg-kv4b">Sender</th>';
					$table .= '<th class="tg-kv4b">Beginn<br></th>';
					$table .= '<th class="tg-kv4b">Titel</th>';
					$table .= '<th class="tg-kv4b">Kurzbeschreibung<br></th>';
					$table .= '<th class="tg-kv4b">Langbeschreibung<br></th>';
					//$table .= '<th class="tg-kv4b">Ende<br></th>';
					$table .= '<th class="tg-kv4b">Dauer<br></th>';
					$table .= '<colgroup>'; 
					$table .= '<col width="120">'; 
					$table .= '<col width="100">'; 
					$table .= '</colgroup>';
					$table .= '</tr>';
					$table .= '<tr>';
					$table .= '<td class="tg-611x"><img src='.$this->Get_Filename($e2servicereference).' alt='.$e2servicename.'></td>';
					$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult->e2event->e2eventstart).' Uhr'.'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event->e2eventtitle).'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event->e2eventdescription).'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event->e2eventdescriptionextended).'</td>';
					//$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult->e2event->e2eventstart + (int)$xmlResult->e2event->e2eventduration).' Uhr'.'</td>';
					$table .= '<td class="tg-611x">'.round((int)$xmlResult->e2event->e2eventduration / 60).' min'.'</td>';
					$table .= '</tr>';
					$table .= '<tr>';
					$table .= '<td class="tg-611x"></td>';
					$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult_2->e2event->e2eventstart).' Uhr'.'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult_2->e2event->e2eventtitle).'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult_2->e2event->e2eventdescription).'</td>';
					$table .= '<td class="tg-611x">'.utf8_decode($xmlResult_2->e2event->e2eventdescriptionextended).'</td>';
					//$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult_2->e2event->e2eventstart + (int)$xmlResult_2->e2event->e2eventduration).' Uhr'.'</td>';
					$table .= '<td class="tg-611x">'.round((int)$xmlResult_2->e2event->e2eventduration / 60).' min'.'</td>';
					$table .= '</tr>';
					$table .= '</table>';
					SetValueString($this->GetIDForIdent("e2epgHTML"), $table);
				}
			}
			else {
				If (($this->ReadPropertyBoolean("EPGnow_Data") == true) OR ($this->ReadPropertyBoolean("EPGnext_Data") == true)) {
					SetValueString($this->GetIDForIdent("e2epgHTML"), "nicht verfügbar");
				}
				If (($this->ReadPropertyBoolean("EPGlistSRef_Data") == true) ) {
					SetValueString($this->GetIDForIdent("e2epglistSRefHTML"), "nicht verfügbar");
				}
			}
		}
	}
	
	// Ermittlung der Basisdaten
	private function Get_BasicData()
	{
		$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/deviceinfo"));
		If ($xmlResult == false) {
			$this->SendDebug("Get_BasicData", "Fehler beim Lesen der Basisdaten!", 0);
			return;
		}
		If ($this->ReadPropertyBoolean("Enigma2_Data") == true) {
			SetValueString($this->GetIDForIdent("e2oeversion"), (string)$xmlResult->e2oeversion);
			SetValueString($this->GetIDForIdent("e2enigmaversion"), (string)$xmlResult->e2enigmaversion);
			SetValueString($this->GetIDForIdent("e2distroversion"), (string)$xmlResult->e2distroversion);
			SetValueString($this->GetIDForIdent("e2imageversion"), (string)$xmlResult->e2imageversion);
			SetValueString($this->GetIDForIdent("e2webifversion"), (string)$xmlResult->e2webifversion);
		}
		SetValueString($this->GetIDForIdent("e2devicename"), (string)$xmlResult->e2devicename);
		$table = '<style type="text/css">';
		$table .= '<link rel="stylesheet" href="./.../webfront.css">';
		$table .= "</style>";
		$table .= '<table class="tg">';
		$table .= "<tr>";
		$table .= '<th class="tg-kv4b">Name</th>';
		$table .= '<th class="tg-kv4b">Typ<br></th>';
		$table .= '</tr>';
		for ($i = 0; $i <= count($xmlResult->e2frontends->e2frontend) - 1; $i++) {
			$table .= '<tr>';
			$table .= '<td class="tg-611x">'.$xmlResult->e2frontends->e2frontend[$i]->e2name.'</td>';
			$table .= '<td class="tg-611x">'.$xmlResult->e2frontends->e2frontend[$i]->e2model.'</td>';
			$table .= '</tr>';
		}
		$table .= '</table>';
		SetValueString($this->GetIDForIdent("e2tunerinfo"), $table);
		
		If ($this->ReadPropertyBoolean("Network_Data") == true) {
			SetValueString($this->GetIDForIdent("e2lanmac"), (string)$xmlResult->e2network->e2lanmac);
			SetValueBoolean($this->GetIDForIdent("e2landhcp"), (bool)$xmlResult->e2network->e2landhcp);
			SetValueString($this->GetIDForIdent("e2lanip"), (string)$xmlResult->e2network->e2lanip);
			SetValueString($this->GetIDForIdent("e2lanmask"), (string)$xmlResult->e2network->e2lanmask);
			SetValueString($this->GetIDForIdent("e2langw"), (string)$xmlResult->e2network->e2langw);
		}
		
		If ($this->ReadPropertyBoolean("HDD_Data") == true) {
			SetValueString($this->GetIDForIdent("e2hddinfo_model"), (string)$xmlResult->e2hdds->e2hdd->e2model);
		}
	}
	
	public function GetStatusInfo()
	{
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$JSONString = file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/api/statusinfo?");
			If ($JSONString == false) {
				$this->SendDebug("GetStatusInfo", "Fehler beim Lesen der Statusinformationen!", 0);
				return;
			}
			$data = json_decode($JSONString);
			// Prüfen ob die Box ein- oder ausgeschaltet ist
			If (!filter_var($data->inStandby, FILTER_VALIDATE_BOOLEAN) <> GetValueBoolean($this->GetIDForIdent("powerstate")) ) {
				SetValueBoolean($this->GetIDForIdent("powerstate"), !filter_var($data->inStandby, FILTER_VALIDATE_BOOLEAN));
			}
			// Prüfen ob eine Aufnahme läuft
			If (filter_var($data->isRecording, FILTER_VALIDATE_BOOLEAN) <> GetValueBoolean($this->GetIDForIdent("isRecording")) ) {
				SetValueBoolean($this->GetIDForIdent("isRecording"), filter_var($data->isRecording, FILTER_VALIDATE_BOOLEAN));
				If ($this->ReadPropertyBoolean("Movielist_Data") == true) {
					$this->GetMovieListUpdate();
				}
			}
			// Lautstärke
			If (intval($data->volume) <> GetValueInteger($this->GetIDForIdent("volume")) ) {
				SetValueInteger($this->GetIDForIdent("volume"), intval($data->volume));
			}
			
			If (!filter_var($data->inStandby, FILTER_VALIDATE_BOOLEAN) == true) {
				// Der aktuelle Programm-Name
				If (strval($data->currservice_station) <> GetValueString($this->GetIDForIdent("e2servicename")) ) {
					SetValueString($this->GetIDForIdent("e2servicename"), strval($data->currservice_station));
					
				}
				// Der aktuelle Service-Referenz
				If (strval($data->currservice_serviceref) <> GetValueString($this->GetIDForIdent("currservice_serviceref")) ) {
					SetValueString($this->GetIDForIdent("currservice_serviceref"), strval($data->currservice_serviceref));
					If ($this->ReadPropertyBoolean("EPGlist_Data") == true) {
						$this->GetEPGNowNextData();
					}
				}
				// Signalstärke
				If ($this->ReadPropertyBoolean("Signal_Data") == true) {
					// Empfangsstärke ermitteln
					$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/signal?"));
					SetValueInteger($this->GetIDForIdent("e2snrdb"), (int)$xmlResult->e2snrdb);
					SetValueInteger($this->GetIDForIdent("e2snr"), (int)$xmlResult->e2snr);
					SetValueInteger($this->GetIDForIdent("e2ber"), (int)$xmlResult->e2ber);
					SetValueInteger($this->GetIDForIdent("e2agc"), (int)$xmlResult->e2acg);
				}
			}
			else {
				// Signalstärke
				If ($this->ReadPropertyBoolean("Signal_Data") == true) {
					If (GetValueInteger($this->GetIDForIdent("e2snrdb")) <> 0 ) {
						SetValueInteger($this->GetIDForIdent("e2snrdb"), 0);
						SetValueInteger($this->GetIDForIdent("e2snr"), 0);
						SetValueInteger($this->GetIDForIdent("e2ber"), 0);
						SetValueInteger($this->GetIDForIdent("e2agc"), 0);
					}
				}
				If (GetValueString($this->GetIDForIdent("e2servicename")) <> "N/A" ) {
					SetValueString($this->GetIDForIdent("e2servicename"), "N/A");
				}
				If (GetValueString($this->GetIDForIdent("currservice_serviceref")) <> "N/A" ) {
					SetValueString($this->GetIDForIdent("currservice_serviceref"), "N/A");
				}
			}
			
		}
	}
	
	private function GetMovieListUpdate()
	{
		$FilePathPlay = "user".DIRECTORY_SEPARATOR."Enigma_HTML".DIRECTORY_SEPARATOR."Button-Play_32.png";
		$FilePathStream = "user".DIRECTORY_SEPARATOR."Enigma_HTML".DIRECTORY_SEPARATOR."Button-Media-Player_32.png";
		$FilePathDelete = "user".DIRECTORY_SEPARATOR."Enigma_HTML".DIRECTORY_SEPARATOR."Button-Delete_32.png";
		$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/movielist"));
		If ($xmlResult == false) {
			$this->SendDebug("GetMovieListUpdate", "Fehler beim Lesen der Daten!", 0);
			return;
		}
		
		$table = '<style type="text/css">';
		$table .= '<link rel="stylesheet" href="./.../webfront.css">';
		$table .= "</style>";
		$table .= '<table class="tg">';
		$table .= "<tr>";
		$table .= '<th class="tg-kv4b">Titel</th>';
		$table .= '<th class="tg-kv4b">Kurzbeschreibung<br></th>';
		$table .= '<th class="tg-kv4b">Langbeschreibung<br></th>';
		$table .= '<th class="tg-kv4b">Quelle</th>';
		$table .= '<th class="tg-kv4b">Länge</th>';
		$table .= '<th class="tg-kv4b"></th>';
		$table .= '<th class="tg-kv4b"></th>';
		$table .= '</tr>';
		for ($i = 0; $i <= count($xmlResult) - 1; $i++) {
			$Servicereference = (string)$xmlResult->e2movie[$i]->e2servicereference;
			$table .= '<tr>';
			$table .= '<td class="tg-611x">'.$xmlResult->e2movie[$i]->e2title.'</td>';
			$table .= '<td class="tg-611x">'.$xmlResult->e2movie[$i]->e2description.'</td>';
			$table .= '<td class="tg-611x">'.$xmlResult->e2movie[$i]->e2descriptionextended.'</td>';
			$table .= '<td class="tg-611x">'.$xmlResult->e2movie[$i]->e2servicename.'</td>';
			$table .= '<td class="tg-611x">'.$xmlResult->e2movie[$i]->e2length.'</td>';
			// Aufzeichnung im TV abspielen
			$table .= '<td class="tg-611x"><img src='.$FilePathPlay.' alt="Abspielen" 
				onclick="window.xhrGet=function xhrGet(o) {var HTTP = new XMLHttpRequest();HTTP.open(\'GET\',o.url,true);HTTP.send();};window.xhrGet({ url: \'hook/IPS2Enigma?Index='.$i.'&Source=Movielist_Play&SRef='.$Servicereference.'\' })"></td>';
			// Aufzeichnung aus dem Webfront streamen
			$MovieFilename = str_replace(" ", "%20", (string)$xmlResult->e2movie[$i]->e2filename);
			$Targetlink = "http://".$this->ReadPropertyString("IPAddress")."/web/ts.m3u?file=".$MovieFilename; 
			$table .= '<td class="tg-611x"><a href='.$Targetlink.' target="_blank"><img src='.$FilePathStream.' alt="Stream starten"></td>';
			$table .= '</tr>';
		}
		$table .= '</table>';
		SetValueString($this->GetIDForIdent("e2movielist") , $table);
	}
	    
	private function GetEPGNowNextData()
	{
		$FilePathStream = "user".DIRECTORY_SEPARATOR."Enigma_HTML".DIRECTORY_SEPARATOR."Button-Media-Player_32.png";
		$FilePathPlay = "user".DIRECTORY_SEPARATOR."Enigma_HTML".DIRECTORY_SEPARATOR."Button-Play_32.png";
		$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/getservices"));
		If ($xmlResult == false) {
			$this->SendDebug("GetEPGNowNextData", "Fehler beim Lesen der Daten!", 0);
			return;
		}
		$bouquet = (string)$xmlResult->e2service[$this->ReadPropertyInteger("BouquetsNumber")]->e2servicereference;
		$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/epgnownext?bRef=".urlencode($bouquet)));
		$table = '<style type="text/css">';
		$table .= '<link rel="stylesheet" href="./.../webfront.css">';
		$table .= "</style>";
		$table .= '<table class="tg">';
		$table .= "<tr>";
		$table .= '<th class="tg-kv4b">Sender</th>';
		$table .= '<th class="tg-kv4b">Beginn<br></th>';
		$table .= '<th class="tg-kv4b">Titel</th>';
		$table .= '<th class="tg-kv4b">Kurzbeschreibung<br></th>';
		$table .= '<th class="tg-kv4b">Dauer<br></th>';
		$table .= '<th class="tg-kv4b"></th>';
		$table .= '<th class="tg-kv4b"></th>';
		$table .= '<colgroup>'; 
		$table .= '<col width="120">'; 
		$table .= '<col width="100">'; 
		$table .= '</colgroup>';
		$table .= '</tr>';
		for ($i = 0; $i <= count($xmlResult) - 1; $i=$i+2) {
			$Servicereference = (string)$xmlResult->e2event[$i]->e2eventservicereference;
			$table .= '<tr>';
			$table .= '<td rowspan="2" class="tg-611x"><img src='.$this->Get_Filename($Servicereference).' alt='.(string)$xmlResult->e2event[$i]->e2eventservicename.' 
				onclick="window.xhrGet=function xhrGet(o) {var HTTP = new XMLHttpRequest();HTTP.open(\'GET\',o.url,true);HTTP.send();};window.xhrGet({ url: \'hook/IPS2Enigma?Index='.($i/2).'&Source=EPGlist_Data_A&SRef='.$Servicereference.'\' })"></td>';
			$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult->e2event[$i]->e2eventstart).' Uhr'.'</td>';
			$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event[$i]->e2eventtitle).'</td>';
			$table .= '<td class="tg-611x" onclick="window.xhrGet=function xhrGet(o) {var HTTP = new XMLHttpRequest();HTTP.open(\'GET\',o.url,true);HTTP.send();};window.xhrGet({ url: \'hook/IPS2Enigma?Index='.($i/2).'&Source=EPGlist_Data_D\' })">'.utf8_decode($xmlResult->e2event[$i]->e2eventdescription).'</td>';			
			$table .= '<td class="tg-611x">'.round((int)$xmlResult->e2event[$i]->e2eventduration / 60).' min'.'</td>';
			$table .= '</tr>';
			$table .= '<tr>';
			$table .= '<td class="tg-611x">'.date("H:i", (int)$xmlResult->e2event[$i+1]->e2eventstart).' Uhr'.'</td>';
			$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event[$i+1]->e2eventtitle).'</td>';
			$table .= '<td class="tg-611x">'.utf8_decode($xmlResult->e2event[$i+1]->e2eventdescription).'</td>';
			$table .= '<td class="tg-611x">'.round((int)$xmlResult->e2event[$i+1]->e2eventduration / 60).' min'.'</td>';
			$table .= '<td class="tg-611x"><img src='.$FilePathPlay.' alt="Umschalten" 
				onclick="window.xhrGet=function xhrGet(o) {var HTTP = new XMLHttpRequest();HTTP.open(\'GET\',o.url,true);HTTP.send();};window.xhrGet({ url: \'hook/IPS2Enigma?Index='.($i/2).'&Source=EPGlist_Data_A&SRef='.$Servicereference.'\' })"></td>';
			$Targetlink = "http://".$this->ReadPropertyString("IPAddress")."/web/stream.m3u?ref=".urlencode((string)$xmlResult->e2event[$i]->e2eventservicereference)."&name=".urlencode((string)$xmlResult->e2event[$i]->e2eventservicename);
			$table .= '<td class="tg-611x"><a href='.$Targetlink.' target="_blank"><img src='.$FilePathStream.' alt="Stream starten"></td>';
			$table .= '</tr>';
		}
		$table .= '</table>';
		SetValueString($this->GetIDForIdent("e2epglistHTML"), $table);
	}
	
	    
	private function Get_Powerstate()
	{
		
		$result = GetValueBoolean($this->GetIDForIdent("powerstate"));
		/*
		//$xmlResult = simplexml_load_file("http://".$this->ReadPropertyString("IPAddress")."/web/powerstate");
		$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/powerstate"));
		//$wert = $xml->e2instandby;
		If(strpos((string)$xmlResult->e2instandby, "false")!== false) {
			// Bei "false" ist die Box eingeschaltet
			SetValueBoolean($this->GetIDForIdent("powerstate"), true);
			$result = true;
		}
		else {
			SetValueBoolean($this->GetIDForIdent("powerstate"), false);
			$result = false;
		}
		*/
	return $result;
	}
	public function ToggleStandby()
	{
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/powerstate?newstate=0"));
			If ($xmlResult == false) {
				$this->SendDebug("ToggleStandby", "Fehler beim Setzen der Daten!", 0);
				return;
			}
		}
	}
	/*
	0 = Toogle Standby
	1 = Deepstandby
	2 = Reboot
	3 = Restart Enigma2
	4 = Wakeup from Standby
	5 = Standby
    	*/
	public function DeepStandby()
	{
	      If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/powerstate?newstate=1"));
		      	If ($xmlResult == false) {
				$this->SendDebug("DeepStandby", "Fehler beim Setzen der Daten!", 0);
				return;
			}
	      }
	}
	
	public function Standby()
	{
	       If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$xmlResult = new SimpleXMLElement(file_get_contents("http:///".$this->ReadPropertyString("IPAddress")."/web/powerstate?newstate=5"));
		       	If ($xmlResult == false) {
				$this->SendDebug("Standby", "Fehler beim Setzen der Daten!", 0);
				return;
			}
	       }
	}			       
	
	public function WakeUpStandby()
	{
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/powerstate?newstate=4"));
		}
	}
				       
	public function Reboot()
	{
	   	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) { 
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/powerstate?newstate=2"));
		}
	}
	
	public function RestartEnigma()
	{
	      	If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/powerstate?newstate=3"));
		}
	}		       
	public function GetCurrentServiceName()
	{
		$result = "";
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
		       $xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/subservices"));
		       $result = (string)$xmlResult->e2service[0]->e2servicename;
		}
	return $result;
	}
	public function GetCurrentServiceReference()
	{
		$result = "";
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
	      		$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/subservices"));
	      		$result =  (string)$xmlResult->e2service[0]->e2servicereference;
		}
	return $result;
	}
    	
	public function WriteMessage(string $message, int $time)
	{
	   	$result = false;
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
		       $message = urlencode($message);
		       $xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/message?text=".$message."&type=2&timeout=".$time));
		       if ($xmlResult->e2state == "True") {
		       		$result = true;
			}
		}
	return $result;
	}   
	
	public function WriteInfoMessage(string $message,int $time)
	{
	   	$result = false;
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
		       $message = urlencode($message);
		       $xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/message?text=$message&type=1&timeout=$time"));
		       if ($xmlResult->e2state == "True") {
		       		$result = true;
			}
		}
	return $result;
	}  
	
	public function WriteAttentionMessage(string $message,int $time)
	{
	   	$result = false;
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
		       $message = urlencode($message);
		       $xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/message?text=$message&type=3&timeout=$time"));
		       if ($xmlResult->e2state == "True") {
		       		$result = true;
			}
		}
	return $result;
	}
	
	public function Zap(string $servicereference)
	{
	   	$result = false;
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/zap?sRef=".$servicereference));
		}
	}    
	    
	public function MoviePlay(string $servicereference)
	{
	   	$result = false;
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$servicereference = urlencode($servicereference);
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/zap?sRef=".$servicereference));
		}
	}    
	
	public function ToggleMute()
	{
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			// 113 Key "mute"
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=113"));
		}
	}    
	
	public function VolUp()
	{
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			// 115 Key "volume up"
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=115"));
		}
	}        
	
	public function VolDown()
	{
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			// 114 Key "volume down"
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/remotecontrol?command=114"));
		}
	}          
	    
	public function GetScreenshot()
	{
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$Content = file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/grab?format=jpg&r=".$this->ReadPropertyInteger("Screenshot"));
			IPS_SetMediaContent($this->GetIDForIdent("Screenshot_".$this->InstanceID), base64_encode($Content));  //Bild Base64 codieren und ablegen
			IPS_SendMediaEvent($this->GetIDForIdent("Screenshot_".$this->InstanceID)); //aktualisieren
		}
	} 
	
	private function RegisterMediaObject($Name, $Ident, $Typ, $Parent, $Position, $Cached, $Filename)
	{
		$MediaID = @$this->GetIDForIdent($Ident);
		if($MediaID === false) {
		    	$MediaID = 0;
		}
		
		if ($MediaID == 0) {
			 // Image im MedienPool anlegen
			$MediaID = IPS_CreateMedia($Typ); 
			// Medienobjekt einsortieren unter Kategorie $catid
			IPS_SetParent($MediaID, $Parent);
			IPS_SetIdent($MediaID, $Ident);
			IPS_SetName($MediaID, $Name);
			IPS_SetPosition($MediaID, $Position);
                    	IPS_SetMediaCached($MediaID, $Cached);
			$ImageFile = IPS_GetKernelDir()."media".DIRECTORY_SEPARATOR.$Filename;  // Image-Datei
			IPS_SetMediaFile($MediaID, $ImageFile, false);    // Image im MedienPool mit Image-Datei verbinden
		}  
	}     
	    
	private function ConnectionTest()
	{
	      $result = false;
	      If (Sys_Ping($this->ReadPropertyString("IPAddress"), 2000)) {
			//IPS_LogMessage("IPS2Enigma Netzanbindung","Angegebene IP ".$this->ReadPropertyString("IPAddress")." reagiert");
			$status = @fsockopen($this->ReadPropertyString("IPAddress"), 80, $errno, $errstr, 10);
				if (!$status) {
					IPS_LogMessage("IPS2Enigma Netzanbindung","Port ist geschlossen!");				
	   			}
	   			else {
	   				fclose($status);
					//IPS_LogMessage("IPS2Enigma Netzanbindung","Port ist geöffnet");
					$result = true;
					$this->SetStatus(102);
	   			}
		}
		else {
			IPS_LogMessage("IPS2Enigma","IP ".$this->ReadPropertyString("IPAddress")." reagiert nicht!");
			$this->SetStatus(104);
		}
	return $result;
	}
	    
	private function RegisterProfileInteger($Name, $Icon, $Prefix, $Suffix, $MinValue, $MaxValue, $StepSize)
	{
	        if (!IPS_VariableProfileExists($Name))
	        {
	            IPS_CreateVariableProfile($Name, 1);
	        }
	        else
	        {
	            $profile = IPS_GetVariableProfile($Name);
	            if ($profile['ProfileType'] != 1)
	                throw new Exception("Variable profile type does not match for profile " . $Name);
	        }
	        IPS_SetVariableProfileIcon($Name, $Icon);
	        IPS_SetVariableProfileText($Name, $Prefix, $Suffix);
	        IPS_SetVariableProfileValues($Name, $MinValue, $MaxValue, $StepSize);
	}
	
	public function GetServiceInformation()
	{
		If (($this->ReadPropertyBoolean("Open") == true) AND ($this->ConnectionTest() == true)) {
			$xmlResult = new SimpleXMLElement(file_get_contents("http://".$this->ReadPropertyString("IPAddress")."/web/getservices"));
			If (count($xmlResult->e2service) == 0) {
				$Result = "Es wurde nur kein Bouquet gefunden, bitte auf dem Receiver mindestens eines einrichten";
			}
			elseif (count($xmlResult->e2service) == 1) {
				$Result = "Es wurde nur ein Bouquet gefunden, die Einstellung muss daher 0 sein. (Aktuell: ".$this->ReadPropertyInteger("BouquetsNumber").")"; 
			}
			elseif (count($xmlResult->e2service) > 1) {
				$Result = "Es wurde folgende Bouquets gefunden:".chr(13);
				for ($i = 1; $i <= count($xmlResult->e2service) - 1; $i++) {
					$Result .= "Auswahl: ".$i." Bouquet: ".$xmlResult->e2service[$i]->e2servicename.chr(13);
				}
				$Result .= "Bitte die  Auswahl in das Feld Bouquet-Nummer eintragen. (Aktuell: ".$this->ReadPropertyInteger("BouquetsNumber").")";
			}
		}
	return $Result;
	}
	    
	private function RegisterHook($WebHook) 
	{ 
		$ids = IPS_GetInstanceListByModuleID("{015A6EB8-D6E5-4B93-B496-0D3F77AE9FE1}"); 
		if(sizeof($ids) > 0) { 
			$hooks = json_decode(IPS_GetProperty($ids[0], "Hooks"), true); 
			$found = false; 
			foreach($hooks as $index => $hook) { 
				if($hook['Hook'] == $WebHook) { 
					if($hook['TargetID'] == $this->InstanceID) 
						return; 
					$hooks[$index]['TargetID'] = $this->InstanceID; 
					$found = true; 
				} 
			} 
			if(!$found) { 
				$hooks[] = Array("Hook" => $WebHook, "TargetID" => $this->InstanceID); 
			} 
			IPS_SetProperty($ids[0], "Hooks", json_encode($hooks)); 
			IPS_ApplyChanges($ids[0]); 
		} 
	} 
	
	protected function ProcessHookData() 
	{		
		if ((isset($_GET["Source"]) ) AND (isset($_GET["Index"])) ){
			
			$Source = $_GET["Source"];
			$Index = $_GET["Index"];
			$SRef = $_GET["SRef"];
			switch($Source) {
			case "EPGlist_Data_A":
			    	//IPS_LogMessage("IPS2Enigma","WebHookData - Source: ".$Source." Index: ".$Index);
				If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					// Spalte A					
					$this->Zap($SRef);
					$this->Get_EPGUpdate();
				}
				break;
			case "EPGlist_Data_D":
			    	IPS_LogMessage("IPS2Enigma","WebHookData - Source: ".$Source." Index: ".$Index);
				break;
			case "Movielist_Play":
				If (($this->ReadPropertyBoolean("Open") == true) AND ($this->Get_Powerstate() == true)) {
					$this->MoviePlay($SRef);
				}
				break;
			}
			
		}
	}
	    
	private function Get_Filename(string $sRef)
	{
		// aus der Service Referenz den Dateinamen des Picons generieren
		// Doppelpunkte durch Unterstriche ersetzen
		$Filename = str_replace(":", "_", $sRef);
		// das letzte Zeichen entfernen
		$Filename = substr($Filename, 0, -1);
		// .png anhängen
 		If ($this->ReadPropertyInteger("PiconSource") == 0) {
			$Filename = "user".DIRECTORY_SEPARATOR."Picons".DIRECTORY_SEPARATOR.$Filename.".png";
		}
		elseif ($this->ReadPropertyInteger("PiconSource") == 1) {
			$Filename = "user".DIRECTORY_SEPARATOR."Picons_Enigma".DIRECTORY_SEPARATOR.$Filename.".png";
		}
	return $Filename;
	}
	    
	private function SSH_Connect(String $Command)
	{
	        If (($this->ReadPropertyBoolean("Open") == true) ) {
			set_include_path(__DIR__.'/libs');
			require_once (__DIR__ . '/libs/Net/SSH2.php');
			
			$ssh = new Net_SSH2($this->ReadPropertyString("IPAddress"));
			$login = @$ssh->login($this->ReadPropertyString("User"), $this->ReadPropertyString("Password"));
			if ($login == false)
			{
			    IPS_LogMessage("IPS2Enigma","SSH-Connect: Angegebene IP ".$this->ReadPropertyString("IPAddress")." reagiert nicht!");
			    return false;
			}
			$Result = ""; //$ssh->exec($Command);
			$ssh->disconnect();
		}
		else {
			$result = "";
		}
	
        return $Result;
	}
	
	private function Get_HTML()
	{
		$WebfrontPath = IPS_GetKernelDir()."webfront".DIRECTORY_SEPARATOR."user".DIRECTORY_SEPARATOR."Enigma_HTML";
		$SourcePath = IPS_GetKernelDir()."modules".DIRECTORY_SEPARATOR."IPS2Enigma".DIRECTORY_SEPARATOR."IPS2Enigma".DIRECTORY_SEPARATOR."imgs".DIRECTORY_SEPARATOR."HTML";
		if (file_exists($WebfrontPath)) {
			// Das Verzeichnis existiert bereits
		} 
		else {
			//Das Verzeichnis existiert nicht
			$result = mkdir($WebfrontPath);
			If (!$result) {
				IPS_LogMessage("IPS2Enigma","Fehler bei der Verzeichniserstellung!");
			}
		}
		$Path = opendir($SourcePath);
		while (false !== ($file = readdir($Path)))
		{
			if ($file != "." && $file != "..") {
				copy($SourcePath.DIRECTORY_SEPARATOR.$file, $WebfrontPath.DIRECTORY_SEPARATOR.$file); // Datei kopieren
			}
		}
		closedir($Path);	
	}
	    
	public function Get_Picons_Enigma()
	{
	        If (($this->ReadPropertyBoolean("Open") == true) ) {
			// Prüfen, ob das Verzeichnis schon existiert
			$WebfrontPath = IPS_GetKernelDir()."webfront".DIRECTORY_SEPARATOR."user".DIRECTORY_SEPARATOR."Picons_Enigma";
			$SourcePath = "/usr/share/enigma2/picon";
			if (file_exists($WebfrontPath)) {
			    	// Das Verzeichnis existiert bereits
			} else {
			    	//Das Verzeichnis existiert nicht
				$result = mkdir($WebfrontPath);
				If (!$result) {
					IPS_LogMessage("IPS2Enigma","Fehler bei der Verzeichniserstellung!");
				}
			}
			
			$ftp_server = $this->ReadPropertyString("IPAddress");
			$ftp_user_name = $this->ReadPropertyString("User");
			$ftp_user_pass = $this->ReadPropertyString("Password");
			// set up basic connection
			$conn_id = ftp_connect($ftp_server);
			// login with username and password
			$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
			If ($login_result == true) {
				ftp_chdir($conn_id, $SourcePath);
				// die Dateien in diesem Verzeichnis ermitteln
				$contents = ftp_nlist($conn_id, ".");
				for ($i = 0; $i <= count($contents) - 1; $i++) {
					$result = ftp_get ($conn_id, $WebfrontPath.DIRECTORY_SEPARATOR.$contents[$i], $SourcePath.DIRECTORY_SEPARATOR.$contents[$i], FTP_BINARY);
					If (!$result) {
						IPS_LogMessage("IPS2Enigma","Fehler beim Kopieren der Datei ".$contents[$i]."!");
					}
						
				}
				$result = true;
			}
			else {
				IPS_LogMessage("IPS2Enigma","Fehler bei der Verbindung!");
				$result = false;
			}
			// close the connection
			ftp_close($conn_id); 
		}
		else {
			$result = false;
		}
	
        return $result;
	}   
	    
	private function Get_Picons()
	{
		// Quelldatei
		$FileName = IPS_GetKernelDir()."modules".DIRECTORY_SEPARATOR."IPS2Enigma".DIRECTORY_SEPARATOR."IPS2Enigma".DIRECTORY_SEPARATOR."imgs".DIRECTORY_SEPARATOR."Picons.zip";
		// Zielpfad
		$WebfrontPath = IPS_GetKernelDir()."webfront".DIRECTORY_SEPARATOR."user".DIRECTORY_SEPARATOR;  
		if (file_exists($FileName)) {
			// Prüfen, ob die Datei neuer ist, als die bisher installierte
			If (filemtime($FileName) > GetValueInteger($this->GetIDForIdent("PiconUpdate"))) {
				$zip = new ZipArchive;
				if ($zip->open($FileName) === TRUE) {
				$zip->extractTo($WebfrontPath);
				$zip->close();
					// Neues Erstellungsdatum der Datei sichern
					SetValueInteger($this->GetIDForIdent("PiconUpdate"), filemtime($FileName));
					IPS_LogMessage("IPS2Enigma","Picon Update erfolgreich");
				} 
				else {
					IPS_LogMessage("IPS2Enigma","Picon Update nicht erfolgreich!");
				}
			}
		}		
	}
				       
/*	    
//*************************************************************************************************************
// Schreibt eine Message auf den Bildschirm die man mit ja oder nein beantworten muss
// man sollte die Frage immer so stellen, das nein als aktive Antwort ausgewertet wird,
// da in allen anderen Fällen 0 oder -1  gemeldet wird
// return
// -1  wenn keine erfolgreiche Verbindung
// 0 wenn mit ja oder garnicht geantwortet wurde
// 1 wenn mit nein geantwortet
function ENIGMA2_GetAnswerFromMessage($ipadr,$message = "",$time=5)
{
    $type = 0;
    $result = -1;
   if (ENIGMA2_GetAvailable( $ipadr ))
    {
       $message = urlencode($message);
       $xmlResult = new SimpleXMLElement(file_get_contents("http://$ipadr/web/message?text=$message&type=$type&timeout=$time"));
      if ($xmlResult->e2state == "True")
      {
         sleep($time);
         $result = -1;
         $xmlResult =  new SimpleXMLElement(file_get_contents("http://$ipadr/web/messageanswer?getanswer=now"));
            if ($xmlResult->e2statetext == "Answer is NO!")
          {
              $result = 1;
          }
          else
          {
             $result = 0;
          }
        }    }
   else
    {
       $result = -1;
    }
return $result;
}
//*************************************************************************************************************
// Prüft ob die Box gerade aufnimmt
function ENIGMA2_RecordStatus($ipadr)
{
   $result = false;
echo "test";
	if (ENIGMA2_GetAvailable( $ipadr ))
    	{
		$xml = simplexml_load_file("http://$ipadr/web/recordnow?.xml");
echo $xml;
		$wert = $xml->e2state;
		echo $wert;
		if(strpos($wert,"false")!== false)
			{
			$result = true; // Bei "false" ist die Box eingeschaltet
			}
		else
			{
			$result = false;
			}
		}
		else
		   {
		   Echo "Box nicht erreichbar";
		   }
return $result;
}
*/
}
?>

Ergebnis vom modul

Wunsch design

Also was ich brauche ist auf der Linken seite die Icons das ist ja so schon OK man kann auch schon umschalten wenn man auf das Icon drückt!

Beginn Titel Kurzbeschreibung Dauer kann alles weg, und dafür den Zeitstrahl hineinbringen

Vielleicht kann mir ja wer einen Tip geben wie ich an mein Ziel komme!
Mfg
Maxx

Nun die Funktion die die Daten liefert ist eine ganz andere siehe oben. Aber wenn Du Die Daten hast musst Du diese Daten dann eben als HTML Seite setzten. Dazu gibt es vielfältige Möglichkeiten, musst Du Dein Nachbar fragen, aber Du wirst um das sauber darstellen zu können auf alle Fälle Javascript nutzten müssen.

Hier findest Du z.B. ein Beispiel wie Du so was machen kannst. Ansonsten ist das hier sehr nett aber das 1:1 nachzubauen nicht trivial, da kann sich Dein Nachbar austoben.

Hallo zusammen,

ich würde auch gerne bei einigen Sendern die aktuelle Sendung in Mediola Neo anzeigen lassen.
Am liebsten als einzelne Text Variable (in Neo).

Leider habe ich diese Funktion weder bei IPS2Enigma noch bei Enigma2BY gefunden
Mit IPS2Enigma kann ich genau das was ich gerne möchte nur leider mit dem aktuellen Programm.

Kennt jemand eine einfache Möglichkeit das zu realisieren?

Danke
Tom

Was willst Du denn genau anzeigen nur die laufende Sendung zur Uhrzeit auf allen Sendern oder die nächste zwei Sendungen pro Sender oder was genau?

Als Textvariable macht das wenig Sinn bzw. das verbraucht Dir so viele Varibalen das das kein Sinn macht. Außerdem kannst Du da Du die Schriftart nicht anpassen kannst das mit einem Textfeld in NEO nicht gescheit setzten. Daher bleibt eigentlich nur die Möglichkeit eine HTML Seite (HTMLBox) zu nehmen und diese dann in NEO einzubinden.

Schau mal hier, ansonsten musst Du sagen was Du genau suchst bzw. wie das aussehen soll dann kann man Dir vielleicht helfen.

Ansonsten probier das mal so grob:


<?
  
// Holt EPG Info Was läuft jetzt Dreambox gibt zu vielen Sendern keine Informationen
include(IPS_GetScriptFile(44202 /*[Geräte\Heimkino\Video\Dreambox\Funktionen\f_Enigma_2]*/)); //f_Enigma_2
$DreamboxObjektID = 20229 /*[Geräte\Heimkino\Video\Dreambox\Dreambox 8000 Wohnzimmer]*/;
$senderID = IPS_GetObjectIDByIdent("AktSendernameVAR", $DreamboxObjektID);
$sender = GetValue($senderID);
var_dump($sender);
if ($sender == "unbekannt" || $sender == "")
	{
	$HTMLData = HTMLHead();
	$HTMLData .= "";
	$HTMLData .= HTMLBottom();
	SetValueString(22326 /*[Geräte\Heimkino\Video\Dreambox\Dreambox Weitere Anzeige\Kanalliste funktioniert nicht externe Seite notwendig]*/  , $HTMLData);
	}

else
	{
	$bouquet = "1:7:1:0:0:0:0:0:0:0:FROM%20BOUQUET%20%22userbouquet.favourites.tv%22%20ORDER%20BY%20bouquet";
	$epgnow = Enigma2_getChannelList($ipadr,$bouquet);
	//var_dump($epgnow);
	$HTMLData = HTMLHead();
	$i = 0;
	foreach($epgnow as $now)
		{
				$i = $i+1;
				if ($i % 2 != 0)
				 	{	
						$HTMLData .= "<table class=\"row_0\"><tr><td rowspan=\"2\" width=\"120\" valign=\"top\" align=\"left\"><figure class=\"picon\"><div onclick=window.xhrRPC('/api/','SetValue',[11848 /*[Geräte\Heimkino\Video\Dreambox\Zap\Dreambox 8000 Wohnzimmer Zap\Sender auf SREF umschalten]*/,'".$now['sref']."']);><img src=\"user/neo/images/picon/".$now['pref'].".png\" alt=\"logo\"></div><figcaption>".$now['name']."</figcaption></figure></td>".PHP_EOL;
						$HTMLData .= "<td class=\"titel\">".$now['title']."</td></tr>".PHP_EOL;
						$HTMLData .= "<tr><td align=\"left\" valign=\"top\" class=\"description\">".$now['desc']."</td></tr></table>".PHP_EOL;
					}
				else
				 	{
						$HTMLData .= "<table class=\"row_1\"><tr><td rowspan=\"2\" width=\"120\" valign=\"top\" align=\"left\"><figure class=\"picon\"><div onclick=window.xhrRPC('/api/','SetValue',[11848 /*[Geräte\Heimkino\Video\Dreambox\Zap\Dreambox 8000 Wohnzimmer Zap\Sender auf SREF umschalten]*/,'".$now['sref']."']);><img src=\"user/neo/images/picon/".$now['pref'].".png\" alt=\"logo\"></div><figcaption>".$now['name']."</figcaption></figure></td>".PHP_EOL;
						$HTMLData .= "<td class=\"titel\">".$now['title']."</td></tr>".PHP_EOL;
						$HTMLData .= "<tr><td align=\"left\" valign=\"top\" class=\"description\">".$now['desc']."</td></tr></table>".PHP_EOL;
					}
		}
	$HTMLData .= HTMLBottom();
	var_dump($HTMLData);
	SetValueString(22326 /*[Geräte\Heimkino\Video\Dreambox\Dreambox Weitere Anzeige\Kanalliste funktioniert nicht externe Seite notwendig]*/  , $HTMLData);
	}
	
	function HTMLHead()
	{
		$HTMLData = '<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Kanalliste</title>
<script type="text/javascript" src="user/neo/js/jquery.js"></script>
<script type="text/javascript" src="user/neo/js/jquery.mobile-1.4.5.min.js"></script>
<!--The following script tag downloads a font from the Adobe Edge Web Fonts server for use within the web page. We recommend that you do not modify it.-->
<script>var __adobewebfontsappname__="dreamweaver"</script>
<script src="http://use.edgefonts.net/source-sans-pro:n6:default;bilbo:n4:default;acme:n4:default.js" type="text/javascript"></script>

<link href="user/neo/css/jquery.mobile-1.4.5.iframe.css" rel="stylesheet" type="text/css">
<link href="user/neo/css/dreambox.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="wrapper">';
		return $HTMLData;
	}
	
	function HTMLBottom()
	{
		$HTMLData = '</div>
</body>
</html>';

		return $HTMLData;
	}

?>

f_Enigma_2


<?
$dm8000ip = IPS_GetProperty(20229 /*[Geräte\Heimkino\Video\Dreambox\Dreambox 8000 Wohnzimmer]*/, "Enigma2IP"); // IP Adresse der Dreambox
$webport = IPS_GetProperty(20229 /*[Geräte\Heimkino\Video\Dreambox\Dreambox 8000 Wohnzimmer]*/, "Enigma2WebPort");

$ipadr = $dm8000ip.":".$webport; // IP Adresse mit Webport 192.168.X.X:XXXX

/*
* Holt IPAdresse aus Variable 'IP' eines DummyModules obj
*/
function GetIpFromObj($obj)
{

    $ip_obj = @IPS_GetObjectIDByName("IP", $obj); // Hole das Object aus Variable IP
    $ip_adr = @GetValue($ip_obj);

return $ip_adr;
}

/**
*  Prüft über Ping ob Gerät erreichbar
*  Return
*  true  -  wenn erreichbar
*  false -  nicht erreichbar
**/

function ENIGMA2_GetAvailable($ipadr)
{
   $result = false;
   global $dm8000ip;
   if ($dm8000ip > "" )
    {
       $result = (Boolean) Sys_Ping($dm8000ip, 1000);   // Ping max. 1 Sek. warten
   }
return $result;
}

// Prüft ob Box an oder aus ist
function ENIGMA2_Power ($ipadr)
{
$xml = simplexml_load_file('http://'.$ipadr.'/web/powerstate?.xml');
$wert = $xml->e2instandby;

if(strpos($wert,"false")!==false)
{
echo "Die Box ist eingeschaltet";
SetValueBoolean(53181, true); /* Status an */
}
else
{
echo "Die Box ist im Standby";
SetValueBoolean(53181, false); /* Status aus */
}
}


/**
* Schaltet Powerstate der Dreambox
* 0 = Toogle Standby
* 1 = Deepstandby
* 2 = Reboot
* 3 = Restart Enigma2
* 4 = Wakeup from Standby
* 5 = Standby
**/
function ENIGMA2_Powerstate($powerstate, $ipadr)
{
 $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/powerstate?newstate=".$powerstate));
 if ($xmlResult->e2instandby == 'true')
        {
         	SetValueBoolean(53181, false);
        }
        else
        {
         	SetValueBoolean(53181, true);
        }
}
/**
* Setzt Dreambox in Standby/nicht StandBy
*  -1    -  bei Fehler
*  1  -  wenn in StandBy
*  0 -  wenn nicht in Standby
**/
function ENIGMA2_ToggleStandby($ipadr)
{
    $powerstate = 0;
    $result = -1;

   if (ENIGMA2_GetAvailable( $ipadr ))
    {
       $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/powerstate?newstate=".$powerstate));
        print_r ($xmlResult);
        if ($xmlResult->e2instandby == 'true')
        {
           $result = 1;
           SetValueBoolean(53181, false);
        }
        else
        {
            $result = 0;
            SetValueBoolean(53181, true);
        }
   }

return $result;
}

/**
* liefert den Namen des aktuellen Sendernamens
*/
function ENIGMA2_GetCurrentServiceName($ipadr)
{
  if (ENIGMA2_GetAvailable($ipadr))
   {
        $xmlResult =  new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/subservices"));
        $result = utf8_decode($xmlResult->e2service->e2servicename);
        return $result;
   }
   else
   {
	return 'Box nicht erreichbar!';
	}
}
/**
* liefert die Servicereferenz, Picture Referenz und den Sendernamen des aktuellen Senders
*/
function ENIGMA2_GetCurrentServiceReference($ipadr)
{


   if (ENIGMA2_GetAvailable( $ipadr ))
    {
       $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/subservices"));
		 $sref = utf8_decode($xmlResult->e2service[0]->e2servicereference);
       $name = utf8_decode($xmlResult->e2service->e2servicename);
		 $pref = str_replace(':','_',$sref);
		 $pref = substr($pref, 0, -1);
   }

return array($sref, $pref, $name);
}


/**
* liefert ein Array mit den Namen der Bouquets wenn $bouquet = ""
* liefert ein Array mit den Namen der Sender eines Bouquet  wenn $bouquet ungleich ""
* keys e2servicereference
* keys e2servicename
*/
function ENIGMA2_GetServiceBouquetsOrServices($ipadr,$bouquet = "")
{
   if (ENIGMA2_GetAvailable( $ipadr ))
    {
       if ($bouquet == "" )
       {
           $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/getservices"));
       }
       else {
          $bouquet = urlencode($bouquet);
           $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/getservices?sRef=".$bouquet));
       }
   }
   else
    {
      $xmlResult[] = "";
    }
return $xmlResult;
}

//*************************************************************************************************************
// Ermittelt die EPG-Daten eines definierten Senders
function ENIGMA2_EPG($ipadr, $sref)
{
   $xmlResult[] = "";
   $sender = urlencode($sref);
   $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgservice?sRef=".$sref));
return $xmlResult;
}

/*
* Bouquet Liste
*/
function Enigma2_getBouquetList($ipadr, $bouquet)
{


	$xml = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/getservices?sRef=".$bouquet));
	$number = ($xml->e2service->count());
	if ($number < 1)
	{
		$error = "Bitte führen Sie die Bouquet Auswahl aus.";
		return array("error" => $error);
	}

	$primary = array();

  $bouquetlist = $xml->e2service;
  foreach ($bouquetlist as $bouquet)
  {
      $name = utf8_decode($bouquet->e2servicename);
		$sref = utf8_decode($bouquet->e2servicereference);
      $pref = str_replace(':','_',$sref);
		$pref = substr($pref, 0, -1);

		$primary[] = array(
			"name" => $name,
			"sref" => $sref,
			"pref" => $pref
		);
  }


	return $primary;
}

/*
* Kanal Liste EPG Now
*/
function Enigma2_getChannelList ($ipadr, $bouquet)
{

	$xml = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgnow?bRef=".$bouquet));
	$number = ($xml->e2event->count());

	if ($number < 1)
	{
		$error = "Diesem Bouquet sind keine Sender zugeordnet.";
		return array("error" => $error);
	}

	$service = array();
  $channellist = $xml->e2event;
    foreach ($channellist as $channelxml)
		{
      $name = utf8_decode($channelxml->e2eventservicename);
      $title = utf8_decode($channelxml->e2eventtitle);
		$desc = utf8_decode($channelxml->e2eventdescriptionextended);
      $desc =  str_replace('?','<br>',$desc);
		$sref = utf8_decode($channelxml->e2eventservicereference);
      $pref = str_replace(':','_',$sref);
		$pref = substr($pref, 0, -1);

			$service[] = array(
				"name" => $name,
				"title" => $title,
				"desc" => $desc,
				"sref" => $sref,
				"pref" => $pref
			);
		}
	return $service;
}



/*
* Schreibt eine Infomessage auf den Bildschirm
* return
* true wenn erfolgreich
* false wenn nicht erfolgreich
**/
function ENIGMA2_WriteInfoMessage($ipadr,$message = "",$time=5)
{
    $type = 1;
    $result = false;
   if (ENIGMA2_GetAvailable( $ipadr ))
    {
       $message = urlencode($message);
       $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/message?text=".$message."&type=".$type."&timeout=".$time));
      if ($xmlResult->e2state == "True")
      {
         $result = true;
        }
    }
   else
    {
       $result = false;
    }
return $result;
}
/*
* Schreibt eine Errormessage auf den Bildschirm
* return
* true wenn erfolgreich
* false wenn nicht erfolgreich
**/
function ENIGMA2_WriteErrorMessage($ipadr,$message = "",$time=5)
{
    $type = 3;
    $result = false;
   if (ENIGMA2_GetAvailable( $ipadr ))
    {
       $message = urlencode($message);
       $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/message?text=".$message."&type=".$type."&timeout=".$time));
      if ($xmlResult->e2state == "True")
      {
         $result = true;
        }
    }
   else
    {
       $result = false;
    }
return $result;
}
/*
* Schreibt eine Message auf den Bildschirm
* return
* true wenn erfolgreich
* false wenn nicht erfolgreich
**/
function ENIGMA2_WriteMessage($ipadr,$message = "",$time=5)
{
    $type = 2;
    $result = false;
   if (ENIGMA2_GetAvailable( $ipadr ))
    {
       $message = urlencode($message);
       $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/message?text=".$message."&type=".$type."&timeout=".$time));
      if ($xmlResult->e2state == "True")
      {
         $result = true;
        }
    }
   else
    {
       $result = false;
    }
return $result;
}

/******************************************************************************************************************************
* Schreibt eine Message auf den Bildschirm die man mit ja oder nein beantworten kann
* 0 = Initialisierung
* 1 = Dreambox Ausgeschaltet
* 2 = Nachricht nicht gesendet
* 3 = Wenn mit Ja geantwortet wurde
* 4 = Wenn mit Nein geantwortet wurde
* 5 = Wenn Zeit abgelaufen ohne antworten
*/
function ENIGMA2_GetAnswerFromMessage($ipadr,$message,$time)
{
    $result = 0;
    $timeout = 25;
    if ($time > $timeout)
       $time = $timeout;
    if (ENIGMA2_GetAvailable($ipadr))
    {
       $xmlResult =  new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/messageanswer?getanswer=now"));
       if ($time == 0)
        {
           $time = $timeout;
          $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/message?text=".$message."&type=0"));
       }
       else
          $xmlResult = new SimpleXMLElement(file_get_contents('http://'.$ipadr.'/web/message?text='.$message.'&type=0&timeout='.$time));
        if ($xmlResult->e2state == "True")
       {
          $start = time();
           do
            {
                $xmlResult =  new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/messageanswer?getanswer=now"));
                $diff = time() - $start;
                if ($xmlResult->e2state == "True")
                {
                 if ($xmlResult->e2statetext == "Answer is YES!")
                 {
                    if (($diff + 1) >= $time)
                       $result = 5;
                    else
                        $result = 3;
                  }
                  elseif ($xmlResult->e2statetext == "Answer is NO!")
                     $result = 4;
                }
                sleep(0.5);
            }
            while (($result == 0) and ($diff <= $time));
            if ($result == 0)
               $result = 5;
       }
       else
             $result = 2;
    }
    else
        $result = 1;
    return $result;
}

/**
liest Aktuelle Sendung und Laufzeit aus
**/
function ENIGMA2_GetCurrentFilm($ipadr)
{
	 if (ENIGMA2_GetAvailable($ipadr))
   {
        $xmlResult =  new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/subservices"));
        $sref = utf8_decode($xmlResult->e2service[0]->e2servicereference);
		  $pref = str_replace(':','_',$sref);
		  $pref = substr($pref, 0, -1);
		  $name = utf8_decode($xmlResult->e2service->e2servicename);
        $xmlResult =  new SimpleXMLElement(file_get_contents("http://$ipadr/web/epgservice?sRef=$sref"));
        $title = utf8_decode($xmlResult->e2event->e2eventtitle);
        $description = utf8_decode($xmlResult->e2event->e2eventdescriptionextended);
        $description =  str_replace('?','<br>',$description);
        $startsec = $xmlResult->e2event->e2eventstart;
        $duration = $xmlResult->e2event->e2eventduration;
        $currenttime = $xmlResult->e2event->e2eventcurrenttime;
		  if ((int)$startsec >= time() - 36000)
            $start = date("H:i",(int)$startsec) .' Uhr';
        else
           $start = "N/A";
        if (((int)$duration > 0) and ((int)$startsec >= time() - 36000))
            $ende = date("H:i",(int)$startsec + (int)$duration) .' Uhr';
        else
           $ende = "N/A";
        if (((int)$duration > 0) and ((int)$startsec >= time() - 36000))
            $endeint = date("H:i",(int)$startsec + (int)$duration) .' Uhr';
        else
           $endeint = "N/A";
         if (round((int)$duration / 60) > 0)
               {
                $fortschritt = (int)(round(((int)$currenttime - (int)$startsec) / 60 ) / round((int)$duration / 60) * 100) ;
                }
            else
               {
               $fortschritt = 0;
               }
        if ((int)$duration > 0)
            $dauer = round((int)$duration / 60).' Minuten';
        else
           $dauer = "N/A";
        if (((int)$currenttime > time() - 1800) and ((int)$currenttime < time() + 1800) and ((int)$startsec >= time() - 36000))
            $vorbei = round(((int)$currenttime - (int)$startsec) / 60 ).' Minuten';
        else
           $vorbei = "N/A";
        if (((int)$currenttime > time() - 1800) and ((int)$currenttime < time() + 1800) and ((int)$startsec >= time() - 36000) and ((int)$duration > 0))
            $verbl = round(((int)$startsec + (int)$duration - (int)$currenttime) / 60 ).' Minuten';
        else
           $verbl = "N/A";
         $description =  str_replace('?','<br>',$description);
		  return array($name, $title, $start, $ende, $dauer, $vorbei, $verbl, $description , $fortschritt, $endeint, $sref, $pref);
		  // return "Kanal      :$name
Titel      :$title
Start      :$start
Ende       :$ende
Dauer      :$dauer
Vergangen  :$vorbei
Verbleiben :$verbl
Details    :$description";
    }
    else
       return 'Box nicht erreichbar!';
}


/**
Holt EPG und an ein WFC popup schicken
**/

function GetDreamEpg($ipadr, $channel) {
    $epgentry = "";
    $chanlist = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/getservices?sRef=1:7:1:0:0:0:0:0:0:0:FROM%20BOUQUET%20%22userbouquet.favourites.tv%22%20ORDER%20BY%20bouquet"));
    $bouquetlist = $chanlist->e2service;
    $zapname = IPS_GetObject($channel);
    $zapname2 = $zapname['ObjectName'];
    foreach ($bouquetlist as $entry) {
    $sendername = utf8_decode($entry->e2servicename);
  $sref = ("$entry->e2servicereference 
");
  $pos1 = strpos($sref,'"');
  $pos2 = strpos($sref,'"',$pos1+1);
  $sref = substr($sref,$pos1,$pos2-$pos1-1);
  if($sendername == $zapname2) {
     $ergebnis = $sref;
         $epgservice = new SimpleXMLElement(file_get_contents("http://$ipadr/web/epgservice?sRef=".$ergebnis.""));
   $epglist = $epgservice->e2event;
   foreach ($epglist as $entry2) {
      $heute = time();
      $heute = date("dmy", $heute);
      $eventstartraw = trim($entry2->e2eventstart);
      $eventdate = date("dmy", $eventstartraw);
      //if ($eventdate  == $heute) {
         $newtitel = utf8_decode($entry2->e2eventtitle);
         $newsref = $entry2->e2eventservicereference;
         $newtime = date("H:i",$eventstartraw);
         $newdesc = utf8_decode($entry2->e2eventdescriptionextended);
         $neweventid = trim($entry2->e2eventid);
         $newlenght = $entry2->e2eventduration /60;
         $epgentry .= "<div class=\"standardContainer\">" ."Zeit: " .$newtime ."</div>";
         $epgentry .= "<div class=\"standardContainer\">" ."Länge: " .$newlenght ." Minuten"."</div>";
       $epgentry .= "<div class=\"standardContainer\">" ."Titel: " .$newtitel ."</div>";
       $epgentry .= "<div class=\"standardContainer\">" ."Inhalt: " .$newdesc ."</div>";
       $epgentry .= '<td style="line-height: 25px;">'.'</td><td align="right"><div onclick="dojo.xhrGet({ url: \'http://192.168.0.5/web/timeraddbyeventid?sRef='.$newsref .'&eventid=' .$neweventid .'\'});" style="border:1px solid #3B3B4D; margin:0px; padding:3px; text-align:center; width: 100px;">Aufnehmen</div></td>';
       $epgentry .= "<br>";
      //}
   }
    }
    }
    return $epgentry;
}

/**
Timer
**/

// prüft ob ein Timer aktiv ist und liefert true wenn aktiv, sonst false
function ENIGMA2_IsTimerActive($ipadr)
{
   if (ENIGMA2_GetAvailable($ipadr))
    {
        $site = file_get_contents("http://".$ipadr."/web/timerlist");

        $xmlResult = new SimpleXMLElement($site);
        // e2state = 0 -> geplanter Timer
        // e2state = 2 -> Timer läuft
        // e2state = 3 -> Timer beendet

        // Lese alle Timerevents aus
        foreach ($xmlResult as $child)
        {
                if($child->e2state == "2")          // Aufnahme läuft
                   return true;
                else
                   return false;
        }
    }
    else
       return false;
}

// Lese alle Timerevents aus
// Array mit den Daten = String
function ENIGMA2_GetTimerList($ipadr)
{

  global $config;

  $string = file_get_contents("http://".$ipadr."/web/timerlist");
	$xml = new SimpleXMLElement($string);
	$number = ($xml->e2timer->count());

	if ($number < 1)
	{
		$error = "Es wurden keine aktiven Timer gefunden!";
		return array("error" => $error);
	}

	$service = array();
  $timerlist = $xml->e2timer;
    foreach ($timerlist as $timerxml)
		{
		$sref = (string)str_replace(':','%3A',"$timerxml->e2servicereference");
		$pref = str_replace(':','_',"$timerxml->e2servicereference");
		$name = utf8_decode("$timerxml->e2servicename");
		$id = utf8_decode("$timerxml->e2eit");
		$titel = utf8_decode("$timerxml->e2name");
		$desc = utf8_decode("$timerxml->e2description");
		$xdesc = utf8_decode("$timerxml->e2descriptionextended");
		$tbeg = utf8_decode("$timerxml->e2timebegin");
		$tend = utf8_decode("$timerxml->e2timeend");
		$estart = getdate("$timerxml->e2timebegin");
      $estart = utf8_decode("$estart[hours]:$estart[minutes]");
		$eend = getdate("$timerxml->e2timeend");
      $eend = utf8_decode("$eend[hours]:$eend[minutes]");
		$duration = utf8_decode("$timerxml->e2duration");
		$disabled = utf8_decode("$timerxml->e2disabled");
		$justplay = utf8_decode("$timerxml->e2justplay");

			$timer[] = array(
				"sref" => $sref,
				"pref" => $pref,
				"name" => $name,
				"id" => $id,
				"titel" => $titel,
				"desc" => $desc,
				"xdesc" => $xdesc,
				"tbeg" => $tbeg,
				"tend" => $tend,
				"estart" => $estart,
				"eend" => $eend,
				"duration" => $duration,
				"disabled" => $disabled,
				"justplay" => $justplay
			);
		}
	return $timer;
}


// löscht bereits abgearbeitete Timer aus der Liste
function ENIGMA2_CleanupTimer($ipadr)
{
    if (ENIGMA2_GetAvailable( $ipadr ))
    {
        $xmlResult = new SimpleXMLElement(file_get_contents("http://$ipadr/web/timercleanup?cleanup="));
   }

}

/*
* löscht einen Timer
*/

function ENIGMA2_deleteTimer($ipadr, $sref, $tbeg, $tend)
{
    if (GetAvailable($ipadr))
    {
    	$string = file_get_contents("http://".$ipadr."/web/timerdelete?sRef=".$sref."&begin=".$tbeg."&end=".$tend);
    	$result = new SimpleXMLElement($string);
      $result = $result->e2statetext;

    //WFC_SendNotification(43692, 'Dreambox - Timer gelöscht', "$result 
", 'Speaker', 4);
   }
	return $result;

}

/**
----------------------------------
URL String für Aufnahme:
----------------------------------

http://dm800/web/timerchange?sRef=1%3A0%3A19%3A283D%3A3FB%3A1%3AC00000%3A0%3A0%3A0%3A&begin=1438731100&end=1438731400&name=Tagesschau&eventID=0&description=&dirname=%2Fhdd%2Fmovie%2F&tags=&afterevent=3&eit=0&disabled=0&justplay=0&repeated=0&deleteOldOnSave=0



uebergebene Variablen:

sRef=1%3A0%3A19%3A283D%3A3FB%3A1%3AC00000%3A0%3A0%3A0%3A -> Sender -> 1:0:19:283D:3FB:1:C00000:0:0:0: -> Das Erste HD
&begin=1438731100 -> Beginn wäre -> 5.8.2015 1:31
&end=1438731400 -> Ende wäre -> 5.8.2015 1:36 (1438731400 - 1438731100 =300 Sekunden = 5 Minuten)
&name=Tagesschau
&eventID=0
&description=
&dirname=%2Fhdd%2Fmovie%2F -> Location -> /hdd/movie/
&tags=
&afterevent=3 -> 0=nothing;3=Auto
&eit=0
&disabled=0
&justplay=0 -> Action RECORDING=0 oder ZAP=1
&repeated=0 -> 1=Mo (0x0000001);31=Mo-Fr (0x0011111);64=So (0x1000000);127=Mo-So (0x1111111)


---------------------------------------
URL String um Timer wieder zu löschen:
---------------------------------------

h ttp://dm800/web/timerdelete?sRef=1%3A0%3A19%3A283D%3A3FB%3A1%3AC00000%3A0%3A0%3A0%3A&begin=1438731100&end=1438731400

**/
/*
* Erstellt einen Timer mit Event ID
* http://IP_of_your_box/web/timeraddbyeventid?sRef=1:0:1:7926:A:70:1680000:0:0:0:&eventid=53779&dirname=/hdd/movie/
*/
function ENIGMA2_addTimer($ipadr, $sref, $id)
	{
	$xmlResult =  new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/timeraddbyeventid?sRef=".$sref."&eventid=".$id."&dirname=/hdd/movie/"));
	return $xmlResult;
	}


// liest Infos zur Dreambox aus
// Rückgabewert = Array ($e2enigmaversion, $e2imageversion, $e2webif, $model, $hdd, $capacity, $hddfree, $description)
function ENIGMA2_GetBoxInfo($ipadr)
{
  	if (ENIGMA2_GetAvailable($ipadr))
    {
        $xmlResult =  new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/about"));
         $e2enigmaversion = utf8_decode($xmlResult->e2about->e2enigmaversion);
			$e2imageversion = utf8_decode($xmlResult->e2about->e2imageversion);
         $e2webif = utf8_decode($xmlResult->e2about->e2webifversion);
         $model = utf8_decode($xmlResult->e2about->e2model);
         $hdd = utf8_decode($xmlResult->e2about->e2hddinfo->model);
         $capacity = utf8_decode($xmlResult->e2about->e2hddinfo->capacity);
        $hddfree = utf8_decode($xmlResult->e2about->e2hddinfo->free);
    }
    
    		$boxinfo[] = array(
				"enigmaversion" => $e2enigmaversion,
				"imageversion" => $e2imageversion,
				"webif" => $e2webif,
				"model" => $model,
				"hdd" => $hdd,
				"capacity" => $capacity,
				"hddfree" => $hddfree
				);
	
		return $boxinfo;
    
}

/*****************************************************************************************************
* Sendet einen RemoteControl code. Infos unter
* "http://dream.reichholf.net/wiki/Enigma2:WebInterface#RemoteControl"
116 Key "Power"
2   Key "1"
3   Key "2"
4   Key "3"
5   Key "4"
6   Key "5"
7   Key "6"
8   Key "7"
9   Key "8"
10  Key "1"
11  Key "0"
412 Key "previous"
407 Key "next
115 Key "volume up"
113 Key "mute"
402 Key "bouquet up"
114 Key "volume down"
174 Key "lame"
403 Key "bouquet down"
358 Key "info"
103 Key "up"
139 Key "menu"
105 Key "left"
352 Key "OK"
106 Key "right"
392 Key "audio"
108 Key "down"
393 Key "video"
398 Key "red"
399 Key "green"
400 Key "yellow"
401 Key "blue"
377 Key "tv"
385 Key "radio"
388 Key "text"
138 Key "help"
*/
function ENIGMA2_RemoteControl($ipadr,$command)
{
   global $dm8000ip;
	if (ENIGMA2_GetAvailable($dm8000ip))
   {
      $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/remotecontrol?command=".$command));
      if ($xmlResult->e2result == "True")
         $result = ($xmlResult->e2resulttext);
        else
           $result = "error";
   }
   else
      $result = "not available";
    return $result;
}

/*****************************************************************************************************
* Sendet einen RemoteControl code an CGI. Infos unter
* "http://dream.reichholf.net/wiki/Webinterface_Befehle#Wiedergabe_und_Aufnahme"
play
pause
forward
rewind
stop
record
*/
function ENIGMA2_RemoteControlCGI($ipadr,$command)
{
   global $dm8000ip;
	if (ENIGMA2_GetAvailable($dm8000ip))
   {
      $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/cgi-bin/videocontrol?command=".$command));
      if ($xmlResult->e2result == "True")
         $result = ($xmlResult->e2resulttext);
        else
           $result = "error";
   }
   else
      $result = "not available";
    return $result;
}



/**
Umschalten
**/
function ENIGMA2_Zap($ipadr, $sref)
{
$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/zap?sRef=".$sref));
$e2state = $xmlResult->e2state;

    if ($e2state == "True")
    {
  
    $e2statetext = $xmlResult->e2statetext;
    //IPS_LogMessage( "Umschalten:" , $e2statetext ); Wrong parameter type !
    }
	else
	{
	$e2statetext = "cannot zap while device is in standby";
	}
	return $e2statetext;
}



/**
Aktuelles Programm, Aktueller Status
**/
function ENIGMA2_Getcurrent($ipadr)
{
   if (ENIGMA2_GetAvailable($ipadr))
   {
      $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/getcurrent"));
      if ($xmlResult->e2result == "True")
         $result = ($xmlResult->e2resulttext);
        else
           $result = "error";
   }
   else
      $result = "not available";
    return $result;
}



//Aktuelle Programminfo vom laufenden Sender
function ENIGMA2_GetcurrentChannel($ipadr)
{
   if (ENIGMA2_GetAvailable($ipadr))
   {
      $xmlResult = new SimpleXMLElement(file_get_contents("http://$ipadr/web/getcurrent"));
      if ($xmlResult->e2volume->e2result == "True")
         {
	      $result = array();
  			$channellist = $xmlResult->e2eventlist->e2event;
         foreach ($channellist as $channelxml)
				{
				$name = utf8_decode($channelxml->e2eventservicename);
				$id = utf8_decode($channelxml->e2eventid);
				$provider = utf8_decode($channelxml->e2eventprovidername);
				$sendername = utf8_decode($channelxml->e2eventservicename);
            $title = utf8_decode($channelxml->e2eventtitle);
		      $desc = utf8_decode($channelxml->e2eventdescription);
		      $desc =  str_replace('?','<br>',$desc);
				$descext = utf8_decode($channelxml->e2eventdescriptionextended);
		      $descext =  str_replace('?','<br>',$descext);
				$sref = utf8_decode($channelxml->e2eventservicereference);
		      $pref = str_replace(':','_',$sref);
				$pref = substr($pref, 0, -1);
				$startsec = utf8_decode($channelxml->e2eventstart);
				$duration = utf8_decode($channelxml->e2eventduration);
				$remaining = utf8_decode($channelxml->e2eventremaining);
				$currenttime = utf8_decode($channelxml->e2eventcurrenttime);
				$start = date("H:i",(int)$startsec) .' Uhr';
				if (((int)$duration > 0) and ((int)$startsec >= time() - 36000))
		            $ende = date("H:i",(int)$startsec + (int)$duration) .' Uhr';
		      else
		           $ende = "N/A";
				$vorbei = round(((int)$currenttime - (int)$startsec) / 60 ).' Minuten';
				if ($vorbei <0)
					{
					$vorbei=0;
					}
				$verbleibend = round(((int)$startsec + (int)$duration - (int)$currenttime) / 60 ).' Minuten';
				$fortschritt = (int)(round(((int)$currenttime - (int)$startsec) / 60 ) / round((int)$duration / 60) * 100) ;
		      if ($fortschritt < 0)
		               {
		                $fortschritt = 0;
		                }
		        if ((int)$duration > 0)
		            $dauer = round((int)$duration / 60).' Minuten';
		        else
		           $dauer = "N/A";

					$result[] = array(
						"name" => $name,
						"id" => $id,
						"provider" => $provider,
						"sendername" => $sendername,
						"title" => $title,
						"descext" => $descext,
						"desc" => $desc,
						"start" => $start,
						"ende" => $ende,
						"dauer" => $dauer,
						"vorbei" => $vorbei,
						"verbleibend" => $verbleibend,
						"fortschritt" => $fortschritt,
						"sref" => $sref,
						"pref" => $pref
						);
				}
   		return $result;
			}
		  else
			{
			  $result = "error";
			  return $result;
			}
	}
   else
		{
		$result = "not available";
    	return $result;
		}
}


// Prüft die Signalstärke des Senders
function ENIGMA2_SignalStatus($ipadr)
{
    if (ENIGMA2_GetAvailable( $ipadr ))
        {
        $xml = simplexml_load_file("http://$ipadr/web/signal?.xml");
        $snrdb = (int)$xml->e2snrdb;
        $snr = (int)$xml->e2snr;
        $ber = (int)$xml->e2ber;
        $acg = (int)$xml->e2acg;
        }
    else
        {
        $snrdb = 0;
        $snr = 0;
        $ber = 0;
        $acg = 0;
        }

return array($snrdb, $snr, $ber, $acg);
}

/*
* Movie List, zeigt Liste alle Aufnahmen
*/
function ENIGMA2_getMovieList($ipadr)
{

   $string = file_get_contents("http://".$ipadr."/web/movielist?dirname=/hdd/movie/&tag=");
	$xml = new SimpleXMLElement($string);
	$number = ($xml->e2movie->count());

	if ($number < 1)
	{
		$error = "Es wurden keine Aufnahmen gefunden!";
		return array("error" => $error);
	}

	$service = array();
  $movielist = $xml->e2movie;
    foreach ($movielist as $moviexml)
		{
		$name = utf8_decode("$moviexml->e2servicename"); //Sendername
		$titel = utf8_decode("$moviexml->e2title"); // Titel der Aufnahme
		$desc = utf8_decode("$moviexml->e2description");
      $desc =  str_replace('?','<br>',$desc);
		$xdesc = utf8_decode("$moviexml->e2descriptionextended");
      $xdesc =  str_replace('?','<br>',$xdesc);
		//$name = ("$moviexml->e2servicename");
		//$titel = ("$moviexml->e2title");
      //$xdesc = ("$moviexml->e2descriptionextended");
		//$desc = ("$moviexml->e2description");
		$filename = ("$moviexml->e2filename");
		$filesize = ("$moviexml->e2filesize");
		$filesize = round((int)$filesize/1048576);
		$length = ("$moviexml->e2length");
		$time = getdate("$moviexml->e2time");
		$tbeg = utf8_decode("$moviexml->e2time");
		$pos = strpos($length, ":");
			if ($pos == 2)
				{
				$min = substr($length, 0, 2);
				$sek = substr($length, 3, 2);
				$unixlength = ((int)$min*60)+(int)$sek;
				}
			elseif ($pos == 1)
				{
				$min = substr($length, 0, 1);
				$sek = substr($length, 2, 2);
				$unixlength = ((int)$min*60)+(int)$sek;
				}
			elseif ($pos == 3)
				{
				$min = substr($length, 0, 3);
				$sek = substr($length, 4, 2);
				$unixlength = ((int)$min*60)+(int)$sek;
				}
  		
		$tend = (int)$tbeg+(int)$unixlength;
		$tag = $time['mday'];
		$monat = $time['mon'];
		$jahr = $time['year'];
		$date = $time['mday'].".".$time['mon'].".".$time['year'];
    	$time = ("$time[hours]:$time[minutes]");
    	$sref = ("$moviexml->e2servicereference");
      $sref = str_replace(':','%3A', $sref);
      $sref = str_replace(' ','%20', $sref);
		$sreftimer = substr($sref, 0, 20);
    	$sreftimer = str_replace(':','%3A', $sreftimer);
		$pref = str_replace(':','_',"$moviexml->e2servicereference");

			$movie[] = array(
				"name" => $name,
				"titel" => $titel,
				"desc" => $desc,
				"filename" => $filename,
				"filesize" => $filesize,
				"length" => $length,
				"time" => $time,
				"tbeg" => $tbeg,
				"tend" => $tend,
				"tag" => $tag,
				"monat" => $monat,
				"jahr" => $jahr,
				"date" => $date,
				"xdesc" => $xdesc,
				"sref" => $sref,
				"sreftimer" => $sreftimer,
				"pref" => $pref,
				"anzahl" => $number
			);
		}
	return $movie;
}

//Funktion noch testen und prüfen ob schon vorhanden
/*

stream
http://dreambox/web/stream.m3u?ref={servicereference}
*/
// EPG durchsuchen mit einem Suchstring
function ENIGMA2_EPGSearch($ipadr, $search)
{
   $xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgsearch?search=".$search));
}

// Zeigt die verfügbaren Audiotracks an
function ENIGMA_GETAudio($ipadr)
{
$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/getaudiotracks"));
$number = ($xmlResult->e2audiotrack->count());

	if ($number < 1)
	{
		$error = "Es wurden keine Audiotracks gefunden!";
		return array("error" => $error);
	}
$audiotracklist = $xmlResult->e2audiotrack;
    foreach ($audiotracklist as $audiotrack)
		{
		$description = utf8_decode("$audiotrack->e2audiotrackdescription");
		$trackid = utf8_decode("$audiotrack->e2audiotrackid");
		$pid = utf8_decode("$audiotrack->e2audiotrackpid");
		$active = ("$audiotrack->e2audiotrackactive");
		

			$audio[] = array(
				"Beschreibung" => $description,
				"TrackID" => $trackid,
				"PID" => $pid,
				"Status" => $active
			);
		}
 	return $audio;
}


// Wählt einen verfügbaren Audiotrack aus
function ENIGMA_SELECTAudio($ipadr, $id)
{
$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/selectaudiotrack?id=".$id));

}

// HTML Ausgabe in Tabelle Head
function ENIGMA_GetTableHeader ()
{
	// Kopf der Tabelle erzeugen
	$html  = '<table border="0" cellpadding="0" cellspacing="0" class="tableLine">'.PHP_EOL;
	$html .= '<tbody style="">'.PHP_EOL;
	return $html;
}

//HTML Ausgabe in Tabelle Footer
function ENIGMA_GetTableFooter()
{
	$html = '</tbody>'.PHP_EOL;
	$html .= '</table>'.PHP_EOL;
	return $html;
}

// Wertet die Anzahl der Listeneinträge die $listings entsprechen für die nächsten Sendungsinfos aus
// Zeigt Startzeit - Endzeit und Titel der Sendung an
// erhält die $programmliste = ENIGMA2_EPG($ipadr, $reference);
function ENIGMA_GetListfromProgram($programmliste, $listings)
{
   $HTMLData = "";
	for ($i = 0; $i <= $listings-1; $i++)
			{
			$sendungsinfo = utf8_decode($programmliste->e2event[$i]->e2eventtitle); // Sendungsname
			$startsec = $programmliste->e2event[$i]->e2eventstart;
			$startzeit = date("H:i",(int)$startsec) .' Uhr'; // Startzeit
			$duration = $programmliste->e2event[$i]->e2eventduration;
			$endzeit = date("H:i",(int)$startsec + (int)$duration) .' Uhr'; // Endzeit
			$HTMLData .= '<tr><td>'.$startzeit.' - '.$endzeit.': </td><td>'.$sendungsinfo.'</td></tr>'.PHP_EOL; // Uhrzeit Titel
         }
return $HTMLData;
}


// Wertet die Anzahl der Listeneinträge die $listings entsprechen für die nächsten Sendungsinfos aus
// Zeigt Startzeit - Endzeit und Titel der Sendung an
// mit Beschreibung der Sendung
// erhält die $programmliste = ENIGMA2_EPG($ipadr, $reference);
function ENIGMA_GetListfromProgramFull($programmliste, $listings)
{
   $HTMLData = "";
	for ($i = 0; $i <= $listings-1; $i++)
			{
			$sendungsinfo = utf8_decode($programmliste->e2event[$i]->e2eventtitle); // Sendungsname
			$startsec = $programmliste->e2event[$i]->e2eventstart;
			$startzeit = date("H:i",(int)$startsec); // Startzeit
			$duration = $programmliste->e2event[$i]->e2eventduration;
			$endzeit = date("H:i",(int)$startsec + (int)$duration); // Endzeit
			$id = $programmliste->e2event[$i]->e2eventid;
			$desc = utf8_decode($programmliste->e2event[$i]->e2eventdescription);
         $desc =  str_replace('?','<br>',$desc);
			$descext = utf8_decode($programmliste->e2event[$i]->e2eventdescriptionextended);
         $descext =  str_replace('?','<br>',$descext);
         $HTMLData .= '<tr><td>'.$sendungsinfo.'</td><td></td></tr>'.PHP_EOL; // Titel
         $HTMLData .= '<tr><td>'.$desc.'</td><td></td></tr>'.PHP_EOL; // Kurzbeschreibung
			$HTMLData .= '<tr><td>'.$startzeit.' - '.$endzeit.' Uhr</td><td></td></tr>'.PHP_EOL; // Uhrzeit
			$HTMLData .= '<tr><td colspawn="2">'.$descext.'</td></tr>'.PHP_EOL; // Lange Beschreibung
			$HTMLData .= '<tr><td></td><td></td></tr>'.PHP_EOL; // Leerzeile
         }
return $HTMLData;
}

// Erzeugt einen Array mit Sendername, sref und perf vom Bouquet
// die Liste kommt von $liste = ENIGMA2_GetServiceBouquetsOrServices($ipadr,$bouquet); // Liste aller Sender des Bouquets mit sref und Namen
// muss noch ergänzt werden erzeugen Ausgabe mit Selektionsmöglichkeit der Sender
function ENIGMA_Channel($liste)
	{
	$z = 0;
	$list = array();
	foreach ($liste as $channel)
		{
		$list[$z][0] = $channel->e2servicename; // Sendername
    	$list[$z][1] = $channel->e2servicereference; // Senderreferenznummer
      $list[$z][2] = substr(str_replace(':','_',$list[$z][1]), 0, -1); // pref

    	//$HTMLData .= '<tr><td colspan="2"><a href="http://'.$ipadr.'/web/zap?sRef='.$list[$z][1].'">'.$list[$z][0].'</td></tr>'.PHP_EOL; // Name des Senders
      $z = $z+1;
		}
	return $list;
	}


// Funktion die nicht im Modul vorhanden sind


// Fragt Multi EPG Daten ab
// time und endtime müssen übergeben werden (Beispiel $time=1438190560 $endTime=180
// http://192.168.55.37/web/epgmulti?bRef=1%3A7%3A1%3A0%3A0%3A0%3A0%3A0%3A0%3A0%3AFROM%20BOUQUET%20%22userbouquet.favourites.tv%22%20ORDER%20BY%20bouquet&time=1438190560&endTime=180
$bRef = "1%3A7%3A1%3A0%3A0%3A0%3A0%3A0%3A0%3A0%3AFROM%20BOUQUET%20%22userbouquet.favourites.tv%22%20ORDER%20BY%20bouquet";

function ENIGMA2_MultiEPG($ipadr, $time, $endtime, $bRef)
{
$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgmulti?bRef=".$bRef."&time=".$time."&endTime=".$endtime));
$number = ($xmlResult->e2event->count());
$multiepglist = $xmlResult->e2event;
    foreach ($multiepglist as $event)
		{
      $sendername = utf8_decode("$event->e2eventservicename");
		$description = utf8_decode("$event->e2eventdesription");
		$description =  str_replace('?','<br>',$description);
		$duration = ("$event->e2eventduration");
		$startunix = utf8_decode("$event->e2eventstart");
		$start = date("H:i",(int)$startunix).' Uhr'; // Endzeit
		$endunix = (int)$startunix + (int)$duration;
      $end = date("H:i", $endunix) .' Uhr'; // Endzeit
		$sref = utf8_decode("$event->e2eventservicereference");
      $pref = str_replace(':','_',$sref);
		$pref = substr($pref, 0, -1);
      $id = utf8_decode("$event->e2eventid");
      $currenttime = utf8_decode("$event->e2eventcurrenttime");
      $title = utf8_decode("$event->e2eventtitle");
      $descext = utf8_decode("$event->e2eventdescriptionextended");
		$descext =  str_replace('?','<br>',$descext);

			$multiepg[] = array(
				"sendername" => $sendername,
				"description" => $description,
				"start" => $start,
				"end" => $end,
				"startunix" => $startunix,
				"endunix" => $endunix,
				"sref" => $sref,
				"pref" => $pref,
				"id" => $id,
				"currenttime" => $currenttime,
				"title" => $title,
				"descext" => $descext,
				"duration" => $duration
				);
		}

		return $multiepg;
}

/*
* Löscht eine Aufnahme auf der Festplatte
*/
function ENIGMA2_MovieDelete($ipadr, $sref)
{
   //$Result = file_get_contents('http://'.$ipadr.'/web/moviedelete?sRef='.$sref);
   //$xmlResult = new SimpleXMLElement(fopen("http://".$ipadr."/web/moviedelete?sRef=".$sref, "r" ));
   
   //$xmlResult = new SimpleXMLElement(SYS_GetURLContent("http://'.$ipadr.'/web/moviedelete?sRef='.$sref"));
	//$xmlResult = new SimpleXMLElement(file_get_contents('http://'.$ipadr.'/web/moviedelete?sRef='.$sref));
	$xmlResult = file_get_contents("http://$ipadr/web/moviedelete?sRef=$sref");
	if($xmlResult == false)
	{
	echo "Es wird false ausgegeben";
	}
   return $xmlResult;
}

function ENIGMA2_EPGNext($ipadr, $bRef)
{
	$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgnext?bRef=".$bRef));
	if($xmlResult == false)
	{
		$epgnext = false;
	}
	$number = ($xmlResult->e2event->count());
	$epgnextlist = $xmlResult->e2event;
    foreach ($epgnextlist as $event)
		{
		$id = utf8_decode("$event->e2eventid");
		$startunix = utf8_decode("$event->e2eventstart");
		$duration = ("$event->e2eventduration");
		$start = date("H:i",(int)$startunix).' Uhr'; // Endzeit
		$endunix = (int)$startunix + (int)$duration;
      	$end = date("H:i", $endunix) .' Uhr'; // Endzeit
		$currenttime = ("$event->e2eventcurrenttime");
		$currenttime = utf8_decode("$event->e2eventcurrenttime");
      	$title = utf8_decode("$event->e2eventtitle");
		$description = utf8_decode("$event->e2eventdesription");
		$description =  str_replace('?','<br>',$description);
      	$descext = utf8_decode("$event->e2eventdescriptionextended");
		$descext =  str_replace('?','<br>',$descext);
		$sref = utf8_decode("$event->e2eventservicereference");
      	$pref = str_replace(':','_',$sref);
		$pref = substr($pref, 0, -1);
		$sendername = utf8_decode("$event->e2eventservicename");
		
			$epgnext[] = array(
				"id" => $id,
				"start" => $start,
				"end" => $end,
				"startunix" => $startunix,
				"endunix" => $endunix,
				"duration" => $duration,
				"currenttime" => $currenttime,
				"title" => $title,
				"description" => $description,
				"descext" => $descext,
				"sref" => $sref,
				"pref" => $pref,
				"sendername" => $sendername
				);
		}

	return $epgnext;
}

function ENIGMA2_EPGBouquet($ipadr, $bRef, $time)
{
	$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgbouquet?bRef=".$bRef."&time=".$time));
	if($xmlResult == false)
	{
		$epgbouquet = false;
	}
	$number = ($xmlResult->e2event->count());
	$epgbouquetlist = $xmlResult->e2event;
    foreach ($epgbouquetlist as $event)
		{
		$id = utf8_decode("$event->e2eventid");
		$startunix = utf8_decode("$event->e2eventstart");
		$duration = ("$event->e2eventduration");
		$start = date("H:i",(int)$startunix).' Uhr'; // Endzeit
		$endunix = (int)$startunix + (int)$duration;
      	$end = date("H:i", $endunix) .' Uhr'; // Endzeit
		$currenttime = ("$event->e2eventcurrenttime");
		$currenttime = utf8_decode("$event->e2eventcurrenttime");
      	$title = utf8_decode("$event->e2eventtitle");
		//$description = utf8_decode("$event->e2eventdesription");
		//$description =  str_replace('?','<br>',$description);
      	//$descext = utf8_decode("$event->e2eventdescriptionextended");
		//$descext =  str_replace('?','<br>',$descext);
		$description = $event->e2eventdesription;
		//$description =  str_replace('?','<br>',$description);
      	$descext = $event->e2eventdescriptionextended;
		//$descext =  str_replace('?','<br>',$descext);
		$sref = utf8_decode("$event->e2eventservicereference");
      	$pref = str_replace(':','_',$sref);
		$pref = substr($pref, 0, -1);
		$sendername = utf8_decode("$event->e2eventservicename");
		
			$epgbouquet[] = array(
				"id" => $id,
				"start" => $start,
				"end" => $end,
				"startunix" => $startunix,
				"endunix" => $endunix,
				"duration" => $duration,
				"currenttime" => $currenttime,
				"title" => $title,
				"description" => $description,
				"descext" => $descext,
				"sref" => $sref,
				"pref" => $pref,
				"sendername" => $sendername
				);
		}

	return $epgbouquet;			
}

function ENIGMA2_EPGNow($ipadr, $bRef)
{
	$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgnow?bRef=".$bRef));
	if($xmlResult == false)
	{
		$epgnow = false;
	}
	$number = ($xmlResult->e2event->count());
	$epgnowlist = $xmlResult->e2event;
    foreach ($epgnowlist as $event)
		{
		$id = utf8_decode("$event->e2eventid");
		$startunix = utf8_decode("$event->e2eventstart");
		$duration = ("$event->e2eventduration");
		$start = date("H:i",(int)$startunix).' Uhr'; // Endzeit
		$endunix = (int)$startunix + (int)$duration;
      	$end = date("H:i", $endunix) .' Uhr'; // Endzeit
		$currenttime = ("$event->e2eventcurrenttime");
		$currenttime = utf8_decode("$event->e2eventcurrenttime");
      	$title = utf8_decode("$event->e2eventtitle");
		$description = utf8_decode("$event->e2eventdesription");
		$description =  str_replace('?','<br>',$description);
      	$descext = utf8_decode("$event->e2eventdescriptionextended");
		$descext =  str_replace('?','<br>',$descext);
		$sref = utf8_decode("$event->e2eventservicereference");
      	$pref = str_replace(':','_',$sref);
		$pref = substr($pref, 0, -1);
		$sendername = utf8_decode("$event->e2eventservicename");
		
			$epgnow[] = array(
				"id" => $id,
				"start" => $start,
				"end" => $end,
				"startunix" => $startunix,
				"endunix" => $endunix,
				"duration" => $duration,
				"currenttime" => $currenttime,
				"title" => $title,
				"description" => $description,
				"descext" => $descext,
				"sref" => $sref,
				"pref" => $pref,
				"sendername" => $sendername
				);
		}

	return $epgnow;		
}

function ENIGMA2_EPGNowNext($ipadr, $bRef)
{
	$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgnownext?bRef=".$bRef));
	if($xmlResult == false)
	{
		$epgnownext = false;
	}
	$number = ($xmlResult->e2event->count());
	$epgnownextlist = $xmlResult->e2event;
    foreach ($epgnownextlist as $event)
		{
		$id = utf8_decode("$event->e2eventid");
		$startunix = utf8_decode("$event->e2eventstart");
		$duration = ("$event->e2eventduration");
		$start = date("H:i",(int)$startunix).' Uhr'; // Endzeit
		$endunix = (int)$startunix + (int)$duration;
      	$end = date("H:i", $endunix) .' Uhr'; // Endzeit
		$currenttime = ("$event->e2eventcurrenttime");
		$currenttime = utf8_decode("$event->e2eventcurrenttime");
      	$title = utf8_decode("$event->e2eventtitle");
		$description = utf8_decode("$event->e2eventdesription");
		$description =  str_replace('?','<br>',$description);
      	$descext = utf8_decode("$event->e2eventdescriptionextended");
		$descext =  str_replace('?','<br>',$descext);
		$sref = utf8_decode("$event->e2eventservicereference");
      	$pref = str_replace(':','_',$sref);
		$pref = substr($pref, 0, -1);
		$sendername = utf8_decode("$event->e2eventservicename");
		
			$epgnownext[] = array(
				"id" => $id,
				"start" => $start,
				"end" => $end,
				"startunix" => $startunix,
				"endunix" => $endunix,
				"duration" => $duration,
				"currenttime" => $currenttime,
				"title" => $title,
				"description" => $description,
				"descext" => $descext,
				"sref" => $sref,
				"pref" => $pref,
				"sendername" => $sendername
				);
		}

	return $epgnownext;			
}

function ENIGMA2_EPGService($ipadr, $sRef, $time, $endtime)
{
	$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgservice?sRef=".$sRef."$time=".$time."&endtime".$endtime));
	if($xmlResult == false)
	{
		echo "Es wird false ausgegeben";
	}
	return $xmlResult;			
}


function ENIGMA2_EPGServiceNext($ipadr, $sRef)
{
	$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgservicenext?sRef=".$sRef));
	if($xmlResult == false)
	{
		echo "Es wird false ausgegeben";
	}
	return $xmlResult;			
}

function ENIGMA2_EPGServiceNow($ipadr, $sRef)
{
	$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgservicenow?sRef=".$sRef));
	if($xmlResult == false)
	{
		echo "Es wird false ausgegeben";
	}
	return $xmlResult;			
}

function ENIGMA2_EPGSimilar($ipadr, $sRef, $eventid)
{
	$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/epgsimilar?sRef=".$sRef."$eventid=".$eventid));
	if($xmlResult == false)
	{
		echo "Es wird false ausgegeben";
	}
	return $xmlResult;			
}

function ENIGMA2_RecordNow($ipadr, $sRef)
{
	$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/recordnow?recordnow=".$sRef));
	if($xmlResult == false)
	{
		echo "Es wird false ausgegeben";
	}
	return $xmlResult;			
}

function ENIGMA2_MediaPlayerCmd($ipadr, $command)
{
	$xmlResult = new SimpleXMLElement(file_get_contents("http://".$ipadr."/web/mediaplayercmd?command=".$command));
	if($xmlResult == false)
	{
		echo "Es wird false ausgegeben";
	}
	return $xmlResult;			
}

// EPG
/**
/web/epgsearch.rss?search=
/web/movielist.html?dirname=&tag=
/web/movielist.m3u?dirname=&tag=
/web/movielist.rss?dirname=&tag=
/web/movielist?dirname=&tag=

//Live Update
http://ip/web/updates.html?AGC=

**/
?>

Mir würde eigentlich die aktuell laufende Sendung all meiner Favoriten ausreichen.
Somit kann ich dann sehen was gerade auf welchem Sender läuft und dann per Druck auf das Symbol vom jeweiligen Sender gleich umschalten…

Schönen Gruß
Tom

Das zeigt der Code oben an, Du must das nur entsprechend modifizieren an Deine Umgebung.

Das müsstest Du ebenfalls noch ergänzen, mit Javaskript das man umschalten kann.

Du kannst aber auch hier schauen, da war so eine Ansicht glaube ich schon drinnen


https://github.com/Joey-1970/IPS2Enigma

Hallo Fonzo,
hätte eine Frage zu dem zweiten Skript in dem Beitrag oben.

Nehme/Kann ich dort als Instanz ID die ID des Enigma2 Moduls von Bayaro? Deine ID ist 20229.

In Zeile 5 ergänze ich das Skript mit der IP:Port.

Bei Enigma2 Power State ist im Modul eine Integer anstatt eine Boolean

Wenn Du das Modul von Bayaro nutzt, dann einfach die Objekt ID ändern. Ansonsten sind das die Grundfunktionen die auch so im Forum stehen. Wenn Du also kein Modul benutzt, hast Du da auch die meisten Funktionen drinnen, nur dann musst Du halt in der ersten und zweiten Zeile die Daten der Dreambox eintragen wenn diese nicht in einem Modul hinterlegt sind.

Eigentlich musst Du ab Zeile 3 nichts mehr ändern die IP und der Port wird ja in Zeile 2 und 3 angegeben.

Ja da ich aber einfach ein/aus schalten will habe ich bei mir halt noch eine weitere Boolean Varibale angelegt.


Darunter dann Skripte damit ich diese einfach z.B. aus NEO aufrufen kann.

Ok, Danke dir Fonzo.

Mal eine Frage, hat jemand das Modul GitHub - Joey-1970/IPS2Enigma: Anbindung einer Enigma-Receiver-Box an IP-Symcon unter IPS 5 am laufen ?

Ich habe das Modul mal installiert, bekomme aber leider eine Fehlermeldung.

20.08.2018 20:15:34 | TimerPool | IPS2Enigma (StatusInfo): <br />
<b>Warning</b>: file_get_contents(http://192.168.178.33/api/statusinfo?): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
in <b>C:\IP-Symcon\modules\IPS2Enigma\IPS2Enigma\module.php</b> on line <b>906</b><br />

20.08.2018 20:15:37 | PHP Error | Type: E_WARNING
Message: file_get_contents(http://192.168.178.33/api/statusinfo?): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found

File: C:\IP-Symcon\modules\IPS2Enigma\IPS2Enigma\module.php
Line: 906

Habe eine Dreambox 920 die vom Modul auch erkannt wird.

Ich habe das Modul erfolgreich am laufen, habe aber eine VU+ Box.

Danke Dir für die Info, da werde ich mal schauen was da schief läuft.