IPSCam

Hallo,

ich habe Kameras von Yudor und konnte den MJPEG Stream wie folgt einbinden:

http://[Benutzer]:[Passwort]@[IP-Adresse]/GetData.cgi?CH=[channel]&Codec=jpeg&Size=[Breite]x[Höhe]

Der Link zum aktuellen Bild soll folgender sein (funktioniert bei mir aber nicht):

http://[Benutzer]:[Passwort]@[IP-Adresse]/current[channel].jpg

Vielleicht hilft das noch jemandem…

Beste Grüße
BSW

Hallo,

habt ihr die Technaxx-Kameras (speziell die TX67) in IPSCam eingebunden bekommen ???

Gruß Proxima

Hallo zusammen,

ich habe nochmal eine Frage zur Technaxx TX-67. Ich habe diese jetzt erfolgreich im Betrieb.

Bis auf eine Sache funktioniert alles sehr gut mit unten eingefügtem Skript.

Was bei mir leider nicht geht ist der Live Stream in der IPSymcon App für Android. Im Webfront klappt es einwandfrei. In der App wird mir aber nur ein leerer Kasten angezeigt, darunter die Buttons für die einzelnen Positionen.
Wenn ich auf die Buttons klicke, geht die Kamera auch auf die richtige Position, dass kann ich im Webfront sehen. Aber Bild bekomme ich in der App keines angezeigt. Was kann ich da machen?

Hat vielleicht jemand ne Idee?? Wäre wirklich super. Danke schon mal!!!

Grüße

Stephan

<?
    /*
     * This file is part of the IPSLibrary.
     *
     * The IPSLibrary is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published
     * by the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * The IPSLibrary is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with the IPSLibrary. If not, see http://www.gnu.org/licenses/gpl.txt.
     */

     /**@addtogroup ipscomponent
     * @{
     *
     * @file          IPSComponentCam_Foscam89x.class.php
     * @author        Andreas Brauneis
     *
     */

    /**
    * @class IPSComponentCam_Foscam89x
    *
    * Definiert ein IPSComponentCam Object, das die Funktionen einer Cam Componente für eine
    * Foscam89x Kamera implementiert
    *
    * @author Andreas Brauneis
    * @version
    *   Version 2.50.1, 10.08.2013<br/>
    */

    IPSUtils_Include ('IPSComponentCam.class.php', 'IPSLibrary::app::core::IPSComponent::IPSComponentCam');

    class IPSComponentCam_Technaxx67 extends IPSComponentCam {

        private $ipAddress;
        private $username;
        private $password;

        /**
         * @public
         *
         * Initialisierung eines IPSComponentCam_Foscam89x Objektes
         *
         * @param string $ipAddress IP Adresse der Kamera
         * @param string $username Username für Kamera Zugriff
         * @param string $password Passwort für Kamera Zugriff
         */
        public function __construct($ipAddress, $username, $password) {
            $this->ipAddress  = $ipAddress;
            $this->username   = $username;
            $this->password   = $password;
        }

            /**
         * @public
         *
         * Funktion liefert String IPSComponent Constructor String.
         * String kann dazu benützt werden, das Object mit der IPSComponent::CreateObjectByParams
         * wieder neu zu erzeugen.
         *
         * @return string Parameter String des IPSComponent Object
         */
        public function GetComponentParams() {
            return get_class($this).','.$this->instanceId;
        }

        /**
         * @public
         *
         * Function um Events zu behandeln, diese Funktion wird vom IPSMessageHandler aufgerufen, um ein aufgetretenes Event
         * an das entsprechende Module zu leiten.
         *
         * @param integer $variable ID der auslösenden Variable
         * @param string $value Wert der Variable
         * @param IPSModuleCam $module Module Object an das das aufgetretene Event weitergeleitet werden soll
         */
        public function HandleEvent($variable, $value, IPSModuleCam $module) {
            $name = IPS_GetName($variable);
            throw new IPSComponentException('Event Handling NOT supported for Variable '.$variable.'('.$name.')');
        }

        /**
         * @public
         *
         * Liefert URL des Kamera Live Streams
         *
         * @param integer $size Größe des Streams, mögliche Werte:
         *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE
         * @return string URL des Streams
         */
        public function Get_URLLiveStream($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {
            $url = 'http://'.$this->username.':'.$this->password.'@'.$this->ipAddress.'/cgi-bin/mjpg/video.cgi?channel=0&subtype=1';

            switch ($size) {
                case  IPSCOMPONENTCAM_SIZE_SMALL:
                    $url .= '&resolution=8&rate=0';
                    break;
                case  IPSCOMPONENTCAM_SIZE_MIDDLE:
                    $url .= '&resolution=8&rate=0';
                    break;
                case  IPSCOMPONENTCAM_SIZE_LARGE:
                    $url .= '&resolution=32&rate=0';
                    break;

                default:
                    trigger_error('Unknown Size '.$size);
            }
            return $url;
        }

        /**
         * @public
         *
         * Liefert URL des Kamera Bildes
         *
         * @param integer $size Größe des Bildes, mögliche Werte:
         *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE
         * @return string URL des Bildes
         */
        public function Get_URLPicture($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {

            $url = 'http://'.$this->username.':'.$this->password.'@'.$this->ipAddress.'/cgi-bin/snapshot.cgi?';

            switch ($size) {
                case  IPSCOMPONENTCAM_SIZE_SMALL:
                    $url .= '&resolution=8&rate=0';
                    break;
                case  IPSCOMPONENTCAM_SIZE_MIDDLE:
                    $url .= '&resolution=8&rate=0';
                    break;
                case  IPSCOMPONENTCAM_SIZE_LARGE:
                    $url .= '&resolution=32&rate=0';
                    break;

                default:
                    trigger_error('Unknown Size '.$size);
            }
            return $url;
        }

        /**
         * @public
         *
         * Bewegen der Kamera
         *
         * @param integer $urlType Type der URL die geliefert werden soll.
         *                         mögliche Werte: IPSCOMPONENTCAM_URL_MOVEHOME
                                                   IPSCOMPONENTCAM_URL_MOVELEFT
                                                   IPSCOMPONENTCAM_URL_MOVERIGHT
                                                   IPSCOMPONENTCAM_URL_MOVEUP
                                                   IPSCOMPONENTCAM_URL_MOVEDOWN
                                                   IPSCOMPONENTCAM_URL_PREDEFPOS1
                                                   IPSCOMPONENTCAM_URL_PREDEFPOS2
                                                   IPSCOMPONENTCAM_URL_PREDEFPOS3
                                                   IPSCOMPONENTCAM_URL_PREDEFPOS4
                                                   IPSCOMPONENTCAM_URL_PREDEFPOS5
         */
        public function Get_URL($urlType) {
            $url = 'http://'.$this->ipAddress.'/cgi-bin/ptz.cgi?action=start&channel=0&code='.$this->username.'&pwd='.$this->password;
            $url = 'http://'.$this->username.':'.$this->password.'@'.$this->ipAddress.'/cgi-bin/ptz.cgi?action=start&channel=0&code=';

            switch ($urlType) {
                    case IPSCOMPONENTCAM_URL_MOVELEFT:
                        $url = $url.'=Left&arg1=0&arg2=1&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_MOVERIGHT: 
                        $url = $url.'=Right&arg1=0&arg2=1&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_MOVEUP:
                        $url = $url.'=Up&arg1=0&arg2=1&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_MOVEDOWN: 
                        $url = $url.'=Down&arg1=0&arg2=1&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_MOVEHOME:
                        $url = $url.'command=1';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS1:
                        $url = $url.'GotoPreset&arg1=0&arg2=1&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS2:
                        $url = $url.'GotoPreset&arg1=0&arg2=2&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS3:
                        $url = $url.'GotoPreset&arg1=0&arg2=3&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS4:
                        $url = $url.'GotoPreset&arg1=0&arg2=4&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS5:
                        $url = $url.'command=37';
                        break;
                default:
                    trigger_error('Diese Funktion ist für eine Foxcam Kamera noch NICHT implementiert !!!');
            }

            return $url;

    }

        /**
         * @public
         *
         * Liefert Breite des Kamera Bildes
         *
         * @param integer $size Größe des Bildes, mögliche Werte:
         *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE
         * @return integer Breite des Bildes in Pixel
         */
        public function Get_Width($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {
            switch ($size) {
                case  IPSCOMPONENTCAM_SIZE_SMALL:
                    $return = 320;
                    break;
                case  IPSCOMPONENTCAM_SIZE_MIDDLE:
                    $return = 320;
                    break;
                case  IPSCOMPONENTCAM_SIZE_LARGE:
                    $return = 640;
                    break;

                default:
                    trigger_error('Unknown Size '.$size);
            }
            return $return;
        }

        /**
         * @public
         *
         * Liefert Höhe des Kamera Bildes
         *
         * @param integer $size Größe des Bildes, mögliche Werte:
         *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE
         * @return integer Höhe des Bildes in Pixel
         */
        public function Get_Height($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {
            switch ($size) {
                case  IPSCOMPONENTCAM_SIZE_SMALL:
                    $return = 240;
                    break;
                case  IPSCOMPONENTCAM_SIZE_MIDDLE:
                    $return = 240;
                    break;
                case  IPSCOMPONENTCAM_SIZE_LARGE:
                    $return = 480;
                    break;
                default:
                    trigger_error('Unknown Size '.$size);
            }
            return $return;
        }
    }

    /** @}*/
?>

Hallo,

  • Hat jemand eine Foscam FI9828P V2 hier in IPSCam eingebunden ???
  • Funktioniert die Kamera mit einer bestehenden Component ???

Vielen Dank !!!

Gruß Proxima

Kann mir niemand mit dem Problem in der Android IP Symcon App helfen? Woran kann das liegen das ich hier kein Live Bild abgezeigt bekomme?

Die Positionsbuttons funktionieren aber Bild wird keines angezeigt. Bin ich der Einzige mit dem Problem?

Im webfront klappt es.

Danke für eure hilfe, Grüße

Stephan

Hallo, meine Kameras bieten leider keinen Livestream als MJPEG Videostrom. Ich nutze daher XEOMA http://felenasoft.com/xeoma/en/ als Kamera Server. Dieser kann dann über das Modul Web-Server den Videostrom auch als MJPEG zu Verfügung stellen. Leider wird XEOMA unter IPSComponentCam noch nicht unterstüzt. Ich habe dazu mal einige Screenshots vom Server Modul des XEOMA gemacht und mit begefügt. Vielleicht kann jemand von euch XEOMA als Kamera mit in die IPSComponentCam aufnehmen und ein ensprechdes Script bauen.

Ich würde es dann gern auch testen.

Danke und Grüße
Ringo

Hallo, ich habe mich jetzt daran gewagt eine neues Skript in IPSComponentCam für die Xeoma Video Surveillance Software zu erstellen. Jetzt habe ich es fertig, weiß aber nicht wie ich dieses nun in die IPSLibrary als neuen Cam Typ integriere. Im Moment habe ich eine andere vorhanden IPSComponentCam verändert würde aber gern eine neue Cam anlegen mit dem Namen IPSComponentCam_XeomaVideoSurveillanceSoftware. Wenn ich das im Objektbaum mache funktioniert das aber nicht.

hier mal mein Skript für die IPSComponentCam_XeomaVideoSurveillanceSoftware

<?
	/*
	 * This file is part of the IPSLibrary.
	 *
	 * The IPSLibrary is free software: you can redistribute it and/or modify
	 * it under the terms of the GNU General Public License as published
	 * by the Free Software Foundation, either version 3 of the License, or
	 * (at your option) any later version.
	 *
	 * The IPSLibrary is distributed in the hope that it will be useful,
	 * but WITHOUT ANY WARRANTY; without even the implied warranty of
	 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	 * GNU General Public License for more details.
	 *
	 * You should have received a copy of the GNU General Public License
	 * along with the IPSLibrary. If not, see http://www.gnu.org/licenses/gpl.txt.
	 */    

     /**@addtogroup ipscomponent
     * @{   
     *
     * @file          IPSComponentCam_XeomaVideoSurveillanceSoftware.class.php
     * @author        cerberus
     * @comment       Diese Class funktioniert bei der Xeoma Video Surveillance Software mit konfiguriertem Web-Server Modul
	 *
	 */

     /**
     * @class IPSComponentCam_XeomaVideoSurveillanceSoftware
     *
     * Definiert ein IPSComponentCam Object, das die Funktionen einer Cam Componente für eine
     * Kamera aus der Xeoma Video Surveillance Software implementiert
     *
     * @author cerberus
     * @version
     * Version 1.00, 15.12.2017<br/>
     */

	IPSUtils_Include ('IPSComponentCam.class.php', 'IPSLibrary::app::core::IPSComponent::IPSComponentCam');

	class IPSComponentCam_XeomaVideoSurveillanceSoftware extends IPSComponentCam {

	private $ipAddress;
        private $port;
        private $username;
        private $password;
        private $imagename;
        private $videoname;

         /**
         * @public
         *
         * Initialisierung eines IPSComponentCam_XeomaVideoSurveillanceSoftware Objektes
         *
         * @param string $ipAddress IP Adresse des Xeoma Video Surveillance Server
         * @param string $Port des Xeoma Video Surveillance Server
         * @param string $username Username für Kamera Zugriff
         * @param string $password Passwort für Kamera Zugriff
         * @param string $imagename spezifischer Dateiname des Images im Xeoma Video Surveillance Web-Server Moduls der Surveillance Station für das entsprechende Kamera Image
	 * @param string $videoname spezifischer Dateiname des Live Streams im Xeoma Video Surveillance Web-Server Moduls der Surveillance Station für das entsprechende Kamera Videos
         */
        public function __construct($ipAddress, $port, $username, $password, $imagename, $videoname) {
            $this->ipAddress  = $ipAddress;
            $this->port       = $port;
            $this->username   = $username;
            $this->password   = $password;
            $this->imagename  = $imagename;
	    $this->videoname  = $videoname;
        }

			/**
		 * @public
		 *
		 * Funktion liefert String IPSComponent Constructor String.
		 * String kann dazu benützt werden, das Object mit der IPSComponent::CreateObjectByParams
		 * wieder neu zu erzeugen.
		 *
		 * @return string Parameter String des IPSComponent Object
		 */
		public function GetComponentParams() {
			return get_class($this).','.$this->instanceId;
		}
		
		/**
		 * @public
		 *
		 * Function um Events zu behandeln, diese Funktion wird vom IPSMessageHandler aufgerufen, um ein aufgetretenes Event 
		 * an das entsprechende Module zu leiten.
		 *
		 * @param integer $variable ID der auslösenden Variable
		 * @param string $value Wert der Variable
		 * @param IPSModuleCam $module Module Object an das das aufgetretene Event weitergeleitet werden soll
		 */
		public function HandleEvent($variable, $value, IPSModuleCam $module) {
			$name = IPS_GetName($variable);
			throw new IPSComponentException('Event Handling NOT supported for Variable '.$variable.'('.$name.')');
		}

		/**
		 * @public
		 *
		 * Liefert URL des Kamera Live Streams 
		 *
		 * @param integer $size Größe des Streams, mögliche Werte:
		 *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE
		 * @return string URL des Streams
		 */
		public function Get_URLLiveStream($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {
			$url = 'http://'.$this->ipAddress.':'.$this->port.'/'.$this->videoname.'?resolution=&fps=&login='.$this->username.'&password='.$this->password;
			switch ($size) {
				case  IPSCOMPONENTCAM_SIZE_SMALL:
					$url .= '';
					break;
				case  IPSCOMPONENTCAM_SIZE_MIDDLE:
					$url .= '';
					break;
				case  IPSCOMPONENTCAM_SIZE_LARGE:
					$url .= '';
					break;
				default:
					trigger_error('Unknown Size '.$size);
			}
			return $url;
		}

		/**
		 * @public
		 *
		 * Liefert URL des Kamera Bildes 
		 *
		 * @param integer $size Größe des Bildes, mögliche Werte:
		 *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE 
		 * @return string URL des Bildes
		 */
		public function Get_URLPicture($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {
			$url = 'http://'.$this->ipAddress.':'.$this->port.'/'.$this->imagename.'?resolution=&login='.$this->username.'&password='.$this->password;
			switch ($size) {
				case  IPSCOMPONENTCAM_SIZE_SMALL:
					$url .= '';
					break;
				case  IPSCOMPONENTCAM_SIZE_MIDDLE:
					$url .= '';
					break;
				case  IPSCOMPONENTCAM_SIZE_LARGE:
					$url .= '';
					break;
				default:
					trigger_error('Unknown Size '.$size);
			}
			return $url;
		}

		/**
		 * @public
		 *
		 * Bewegen der Kamera
		 *
		 * @param integer $urlType Type der URL die geliefert werden soll.
		 *                         mögliche Werte: IPSCOMPONENTCAM_URL_MOVEHOME
		                                           IPSCOMPONENTCAM_URL_MOVELEFT
		                                           IPSCOMPONENTCAM_URL_MOVERIGHT
		                                           IPSCOMPONENTCAM_URL_MOVEUP
		                                           IPSCOMPONENTCAM_URL_MOVEDOWN
		                                           IPSCOMPONENTCAM_URL_PREDEFPOS1
		                                           IPSCOMPONENTCAM_URL_PREDEFPOS2
		                                           IPSCOMPONENTCAM_URL_PREDEFPOS3
		                                           IPSCOMPONENTCAM_URL_PREDEFPOS4
		                                           IPSCOMPONENTCAM_URL_PREDEFPOS5
		 */
		public function Get_URL($urlType) {
			trigger_error('Diese Funktion ist für Xeoma Video Surveillance Software noch NICHT implementiert !!!');
		}

		/**
		 * @public
		 *
		 * Liefert Breite des Kamera Bildes 
		 *
		 * @param integer $size Größe des Bildes, mögliche Werte:
		 *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE 
		 * @return integer Breite des Bildes in Pixel
		 */
		public function Get_Width($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {
			switch ($size) {
				case  IPSCOMPONENTCAM_SIZE_SMALL:
					$return = 320;
					break;
				case  IPSCOMPONENTCAM_SIZE_MIDDLE:
					$return = 640;
					break;
				case  IPSCOMPONENTCAM_SIZE_LARGE:
					$return = 1024;
					break;
				default:
					trigger_error('Unknown Size '.$size);
			}
			return $return;
		}

		/**
		 * @public
		 *
		 * Liefert Höhe des Kamera Bildes 
		 *
		 * @param integer $size Größe des Bildes, mögliche Werte:
		 *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE 
		 * @return integer Höhe des Bildes in Pixel
		 */
		public function Get_Height($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {
			switch ($size) {
				case  IPSCOMPONENTCAM_SIZE_SMALL:
					$return = 240;
					break;
				case  IPSCOMPONENTCAM_SIZE_MIDDLE:
					$return = 480;
					break;
				case  IPSCOMPONENTCAM_SIZE_LARGE:
					$return = 768;
					break;
				default:
					trigger_error('Unknown Size '.$size);
			}
			return $return;
		}
	}

	/** @}*/
?>

so muss dann z.B. die IPSCam_Configuration aussehen

	function IPSCam_GetConfiguration() {
		return array(
		    0    => array(IPSCAM_PROPERTY_NAME        => 'Hauseingang',
			              IPSCAM_PROPERTY_TYPE        => IPSCAM_TYPE_FIXEDCAM,
			              IPSCAM_PROPERTY_COMPONENT   => 'IPSComponentCam_XeomaVideoSurveillanceSoftware,192.168.178.57,10090,test,123,image1.jpg,video1.mjpg',
			              ),
			1    => array(IPSCAM_PROPERTY_NAME        => 'Carport',
			              IPSCAM_PROPERTY_TYPE        => IPSCAM_TYPE_FIXEDCAM,
			              IPSCAM_PROPERTY_COMPONENT   => 'IPSComponentCam_XeomaVideoSurveillanceSoftware,192.168.178.57,10090,test,123,image2.jpg,video2.mjpg',
			              ),
		);
	}

Grüße Ringo

Einfach eine neue Datei mit dem Namen „IPSComponentCam_XeomaVideoSurveillanceSoftware.php“ im Verzeichnis …/IPSComponent/IPSComponentCam anlegen und dann wie gewohnt einbinden.

Überall aber auf die korrekte Schreibweise aufpassen (Name von Klasse und Name von File muss ident sein).

Hi,

ich suche nach einer Möglichkeit, die Kamera von Linksys [LEFT]WVC54GC in IPS einzubinden. Zugriff auf den Livestream bekomme ich. Die Frage ist nur, was ich bei IPSCAM_PROPERTY_COMPONENT eintragen soll …?[/LEFT]

http://admin:xxxxx@192.168.10.94/img/video.asf

Grüße

Liebe Forumsgemeinde,

habe jetzt mal 3 Kameras über IPSCam in mein IP-Symcon am RPi eingebunden.
Zwei davon sind IP-Kameras von Instar und funktionieren soweit wunderbar.
Die dritte Kamera ist eine am RPi welche als mjpg-streamer Kamera läuft und mittels PSComponentCam_Mjpgstreamer eingebunden ist.

Problem ist jetzt, dass sobald ich auf die diese Kamera im WebFront wechsle oder eine der Buttons an der Seite betätige (wie Live, Bild, …) ein „Error“ erscheint. Leider finde ich nicht wirklich was dazu in den Logs. Jetzt würd mich halt interessieren was das bedeutet. Bild von der Kamera erscheint ganz normal …

Desweiteren erscheint bei Klick auf „Aktualisieren“ oder „Speichern“ ein großes Fenster ohne jegliche Info.

Siehe dazu auch die Screenshots im Anhang.

Danke schon mal und Grüße,
Daniel.



Hab das Problem selbst gefunden:

Es waren die Leerzeichen vor und nach dem „<?“ und „?>“ im Script IPSComponentCam_Mjpgstreamer.class.php.

Siehe dazu auch: https://www.symcon.de/forum/threads/24292-Ausgabe-von-Fehler-im-Webfront-ohne-ersichtlichen-Grund-%28seit-Version-3-1%29

@Brownson: Sollte bei Gelegenheit mal im Git-Repro behoben werden.

Danke,
Daniel.

Danke, Fix ist online :slight_smile:

Vielen Dank!

@Brownson: Sorry, aber noch etwas gefunden:

function IPSCam_IPSCam_GetCamIdxByName($name) in IPSCam.inc.php

sollte wohl

function IPSCam_GetCamIdxByName($name)

sein, oder?

Danke, Update ist online …

Hallo,

ich versuche IPSCam zu installieren. Bei mir bleibt er im Installationsprozess irgendwie hängen.

Im Log steht „Set Version IPSCam=2.50.16 (Installing)“. Das war es.

Wie kann ich dem Fehler weiter nachgehen?

Danke im Voraus.

Hallo Zusammen,

ich habe die Lösung hier im Forum gefunden! Folgender Thread lieferte die Lösung:

IPSCam … Modul Status bleibt auf Installing

Mit dem Ansatz von sunny2002 habe ich es geschafft.

  • Modul deinstallieren (falls es schon geladen/installiert ist)
  • Modul laden
  • im Skript „IPSCam_Configuration“ Änderungen eingetragen (IP-Adresse, etc) und abgespeichert
  • Anschließend Modul installiert

Vielen Dank.

Hallo,

ich habe seit neuesten ein Problem, zumindest ist es mir bisher nicht aufgefallen.

Ich habe eine Technaxx TX-67 im Einsatz und habe für diese Kamera sechs Positionen gespeichert. Fünf Stück funktionieren bestens und ich war auch der festen Meinung das die sechste auch funktioniert hat, jetzt ist mir aber aufgefallen das sich bei der sechsten Position nichts tut und stattdessen diese Fehlermeldung kommt:

18.08.2018 16:54:26 | C:\IP-Symcon\webfront\user\IPSCam\IPSCam_CameraReceiver.php | Debug: Process IPSCam Command=camButtonPreDef6 for Camera=0

18.08.2018 16:54:26 | PHP | Error: Warning: Use of undefined constant IPSCOMPONENTCAM_URL_PREDEFPOS6 - assumed 'IPSCOMPONENTCAM_URL_PREDEFPOS6' (this will throw an Error in a future version of PHP)
   Error in Script C:\IP-Symcon\scripts\IPSLibrary\app\modules\IPSCam\IPSCam_Manager.class.php on Line 823
  134 in scripts\IPSLibrary\app\core\IPSLogger\IPSLogger.inc.php (call IPSLogger_Out)
   37 in scripts\IPSLibrary\app\core\IPSLogger\IPSLogger_PhpErrorHandler.inc.php (call IPSLogger_Err)
  823 in scripts\IPSLibrary\app\modules\IPSCam\IPSCam_Manager.class.php (call IPSLogger_PhpErrorHandler)
  881 in scripts\IPSLibrary\app\modules\IPSCam\IPSCam_Manager.class.php (call GetURL)
   77 in webfront\user\IPSCam\IPSCam_CameraReceiver.php (call Move)

Hat vielleicht jemand eine Ahnung wie es dazu kommen kann???

Was wird benötigt um mir zu helfen?

IPSCAM_Manager Skript

<?
    /*
     * This file is part of the IPSLibrary.
     *
     * The IPSLibrary is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published
     * by the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * The IPSLibrary is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with the IPSLibrary. If not, see http://www.gnu.org/licenses/gpl.txt.
     */

    /**@addtogroup ipscam
     * @{
     *
     * @file          IPSCam_Manager.class.php
     * @author        Andreas Brauneis
     * @version
     *  Version 2.50.1, 09.08.2012<br/>
     *
     * IPSCam Kamera Management
     */

    /**
     * @class IPSCam_Manager
     *
     * Definiert ein IPSCam_Manager Objekt
     *
     * @author Andreas Brauneis
     * @version
     *   Version 2.50.1, 26.07.2012<br/>
     */
    class IPSCam_Manager {

        /**
         * @private
         * ID Kategorie für Kamera Daten
         */
        private $categoryIdCams;

        /**
         * @private
         * ID Kategorie für allgemeine Steuerungs Daten
         */
        private $categoryIdCommon;

        /**
         * @private
         * ID Kategorie WebFront Navigations Panel
         */
        private $categoryIdNavPanel;

        /**
         * @private
         * ID Kategorie WebFront Camera Panel
         */
        private $categoryIdCamPanel;

        /**
         * @private
         * Konfigurations Daten Array
         */
        private $config;

        /**
         * @public
         *
         * Initialisierung des IPSCam_Manager Objektes
         *
         */
        public function __construct() {
            $baseId = IPSUtil_ObjectIDByPath('Program.IPSLibrary.data.modules.IPSCam');
            $displayCategoryId        = IPS_GetObjectIDByIdent('Display', $baseId);
            $this->categoryIdNavPanel = IPS_GetObjectIDByIdent('NavigationPanel', $displayCategoryId);
            $this->categoryIdCamPanel = IPS_GetObjectIDByIdent('CameraPanel', $displayCategoryId);
            $this->categoryIdCams     = IPS_GetObjectIDByIdent('Cams', $baseId);
            $this->categoryIdCommon   = IPS_GetObjectIDByIdent('Common', $baseId);
            $this->config             = IPSCam_GetConfiguration();
        }

        /**
         * @public
         *
         * Modifiziert einen Variablen Wert der Kamera Steuerung
         *
         * @param integer $variableId ID der Variable die geändert werden soll
         * @param variant $value Neuer Wert der Variable
         */
        // ----------------------------------------------------------------------------------------------------------------------------
        public function ChangeSetting($variableId, $value) {
            $variableIdent = IPS_GetIdent($variableId);
            switch ($variableIdent) {
                case IPSCAM_VAR_CAMSELECT:
                    $this->SetCamera($value);
                    break;
                case IPSCAM_VAR_CAMPOWER:
                    $cameraIdx = (int)IPS_GetName(IPS_GetParent($variableId));
                    $this->SetCamera($cameraIdx);
                    break;
                case IPSCAM_VAR_MODE:
                    $this->SetMode($value);
                    break;
                case IPSCAM_VAR_PICTSIZE:
                    SetValue($variableId, $value);
                    $mode = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_MODE, $this->categoryIdCommon));
                    $cameraIdx = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon));
                    if ($mode==IPSCAM_MODE_PICTURE) {
                        $this->PictureRefresh($cameraIdx);
                    }
                    $this->RefreshWebFront($cameraIdx);
                    break;
                case IPSCAM_VAR_MODELIVE:
                case IPSCAM_VAR_MODEPICT:
                case IPSCAM_VAR_MODEHIST:
                case IPSCAM_VAR_MODESETT:
                    if (!$value) {
                        $this->SetMode(IPSCAM_MODE_PICTURE);
                    } elseif ($variableIdent==IPSCAM_VAR_MODELIVE) {
                        $this->SetMode(IPSCAM_MODE_LIVE);
                    } elseif ($variableIdent==IPSCAM_VAR_MODEPICT) {
                        $this->SetMode(IPSCAM_MODE_PICTURE);
                    } elseif ($variableIdent==IPSCAM_VAR_MODEHIST) {
                        $this->SetMode(IPSCAM_MODE_HISTORY);
                    } elseif ($variableIdent==IPSCAM_VAR_MODESETT) {
                        $this->SetMode(IPSCAM_MODE_SETTINGS);
                    } else {
                        trigger_error('Unknown Variable');
                    }
                    break;
                case IPSCAM_VAR_NAVPICT:
                    SetValue($variableId, $value);
                    $this->NavigatePictures($value, 1);
                    IPS_Sleep(200);
                    SetValue($variableId, -1);
                    break;
                case IPSCAM_VAR_NAVDAYS:
                    SetValue($variableId, $value);
                    $this->NavigateDays($value, 1);
                    IPS_Sleep(200);
                    SetValue($variableId, -1);
                    break;
                case IPSCAM_VAR_MOTMODE:
                case IPSCAM_VAR_MOTTIME:
                    SetValue($variableId, $value);
                    $categoryId = IPS_GetParent($variableId);
                    $cameraIdx  = (int)IPS_GetName($categoryId);
                    $this->SetTimer ($cameraIdx, 'PictureMotion', 
                                     GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_MOTMODE, $categoryId)), 
                                     GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_MOTTIME, $categoryId)));
                    break;
                case IPSCAM_VAR_MOTHIST:
                case IPSCAM_VAR_MOTSIZE:
                    SetValue($variableId, $value);
                    break;
                case IPSCAM_VAR_PICTREF:
                    SetValue($variableId, $value);
                    $cameraIdx = (int)IPS_GetName(IPS_GetParent($variableId));
                    $this->SetTimer ($cameraIdx, 'PictureRefresh', $value);
                    break;
                case IPSCAM_VAR_PICTSTORE:
                    SetValue($variableId, $value);
                    $cameraIdx = (int)IPS_GetName(IPS_GetParent($variableId));
                    $this->SetTimer ($cameraIdx, 'PictureStore', $value);
                    break;
                case IPSCAM_VAR_PICTRESET:
                    SetValue($variableId, $value);
                    $cameraIdx = (int)IPS_GetName(IPS_GetParent($variableId));
                    $this->SetTimer ($cameraIdx, 'PictureReset', $value);
                    break;
                case IPSCAM_VAR_PICTHIST:
                    SetValue($variableId, $value);
                    break;
                default:
                    trigger_error('Unknown VariableID'.$variableId);
            }
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        public function ActivateCamera($cameraIdx, $mode) {
            $this->SetCamera($cameraIdx);
            $this->SetMode($mode);
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        private function SetCamera ($cameraIdx) {
            $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
            if (GetValue($variableIdCamSelect)<>$cameraIdx) {
                SetValue($variableIdCamSelect, $cameraIdx);
                foreach ($this->config as $idx=>$data) {
                    $categoryIdCam      = IPS_GetObjectIDByIdent($idx, $this->categoryIdCams);
                    $variableIdCamPower = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMPOWER, $categoryIdCam);
                    $valueCamPower      = ($idx==$cameraIdx);
                    SetValue($variableIdCamPower, $valueCamPower);
                }
                $mode = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_MODE, $this->categoryIdCommon));
                $this->RefreshWebFrontByMode($mode);
                if ($mode==IPSCAM_MODE_HISTORY) {
                    $this->NavigatePictures(IPSCAM_DAY_FORWARD, 1);
                } elseif ($mode==IPSCAM_MODE_PICTURE) {
                    $this->PictureRefresh($cameraIdx);
                } else {
                }
                $this->RefreshWebFront($cameraIdx);
            }
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        private function SetMode ($mode) {
            $variableIdMode = IPS_GetObjectIDByIdent(IPSCAM_VAR_MODE, $this->categoryIdCommon);
            if (GetValue($variableIdMode)<>$mode) {
                SetValue($variableIdMode, $mode);
                $variableIdMode = IPS_GetObjectIDByIdent(IPSCAM_VAR_MODELIVE, $this->categoryIdCommon);
                SetValue($variableIdMode, ($mode==IPSCAM_MODE_LIVE));
                $variableIdMode = IPS_GetObjectIDByIdent(IPSCAM_VAR_MODEPICT, $this->categoryIdCommon);
                SetValue($variableIdMode, ($mode==IPSCAM_MODE_PICTURE));
                $variableIdMode = IPS_GetObjectIDByIdent(IPSCAM_VAR_MODEHIST, $this->categoryIdCommon);
                SetValue($variableIdMode, ($mode==IPSCAM_MODE_HISTORY));
                $variableIdMode = IPS_GetObjectIDByIdent(IPSCAM_VAR_MODESETT, $this->categoryIdCommon);
                SetValue($variableIdMode, ($mode==IPSCAM_MODE_SETTINGS));

                //Reset Timers
                $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
                $cameraIdx           = GetValue($variableIdCamSelect);
                $categoryIdCam       = IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams);
                $this->SetTimer ($cameraIdx, 'PictureReset', IPSCAM_VAL_DISABLED);
                $this->SetTimer ($cameraIdx, 'PictureReset', GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTRESET, $categoryIdCam)), 'Once');

                // Refresh 
                $this->RefreshWebFrontByMode($mode);
                if ($mode==IPSCAM_MODE_HISTORY) {
                    $this->NavigatePictures(IPSCAM_DAY_FORWARD, 1);
                } elseif ($mode==IPSCAM_MODE_PICTURE) {
                    $this->PictureRefresh($cameraIdx);
                } else {
                }
                $this->RefreshWebFront($cameraIdx);
            }
        }
    
        // ----------------------------------------------------------------------------------------------------------------------------
        private function RefreshWebFront($cameraIdx) {
            // Check if Camera is currently selected in WebFront, otherwise nothing has to be refreshed
            if (GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon)) <> $cameraIdx) {
                return;
            }
            $mode            = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_MODE, $this->categoryIdCommon));
            $variableIdHtml  = IPS_GetObjectIDByIdent(IPSCAM_VAR_HTML, $this->categoryIdCommon);
            $variableIdHtml2 = IPS_GetObjectIDByIdent(IPSCAM_VAR_IHTML, $this->categoryIdCommon);

            $urlStream  = $this->GetURL($cameraIdx, IPSCAM_URL_LIVE);
            $urlImage   = $this->GetURL($cameraIdx, IPSCAM_URL_PICTURE);
            
            
            $styleImage     = 'text-align:center; border:3px solid rgba(255,255,255,0.5);';
            $styleContainer = 'text-align:center; width:100%; display:block; cursor:default;';
            $styleImage2     = 'text-align:center; width:95%; border:3px solid rgba(255,255,255,0.5);';
            $styleContainer2 = 'text-align:center; display:block; cursor:default;';

            switch ($mode) {
                case IPSCAM_MODE_LIVE:
                    $variableIdCam = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMHTML, $this->categoryIdCommon);
                    SetValue($variableIdCam,  '<iframe frameborder="0" width="100%" height="'.$this->GetStreamHeight($cameraIdx).'px"  src="../user/IPSCam/IPSCam_Camera.php"</iframe>');
                    SetValue($variableIdHtml, '<div style="'.$styleContainer.'"><img style="'.$styleImage.'" src="'.$urlStream.'"></div>');
                    SetValue($variableIdHtml2,'<div style="'.$styleContainer2.'"><img style="'.$styleImage2.'" src="'.$urlStream.'"></div>');
                    break;
                case IPSCAM_MODE_PICTURE:
                    SetValue($variableIdHtml, '<div style="'.$styleContainer.'"><img style="'.$styleImage.'" src="/user/IPSCam/ImageCurrent.jpg" timestamp="'.date('His').'"></div>');
                    SetValue($variableIdHtml2,'<div style="'.$styleContainer2.'"><img style="'.$styleImage2.'" src="/user/IPSCam/ImageCurrent.jpg" timestamp="'.date('His').'"></div>');
                    break;
                case IPSCAM_MODE_HISTORY:
                    SetValue($variableIdHtml, '<div style="'.$styleContainer.'"><img style="'.$styleImage.'" src="/user/IPSCam/ImageHistory.jpg" timestamp="'.date('His').'"></div>');
                    SetValue($variableIdHtml2,'<div style="'.$styleContainer2.'"><img style="'.$styleImage2.'" src="/user/IPSCam/ImageHistory.jpg" timestamp="'.date('His').'"></div>');
                    break;
                case IPSCAM_MODE_SETTINGS:
                    break;
                default:
                    trigger_error('Unknown Mode '.$mode);
            }

        }

        // ----------------------------------------------------------------------------------------------------------------------------
        private function RefreshWebFrontByMode($mode) {
            $mode      = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_MODE, $this->categoryIdCommon));
            $cameraIdx = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon));

            $instanceIdMode       = IPS_GetObjectIDByIdent('Modus', $this->categoryIdNavPanel);
            $instanceIdNavigation = IPS_GetObjectIDByIdent('Navigation', $this->categoryIdNavPanel);
            $instanceIdCamSettings= IPS_GetObjectIDByIdent('KameraEinstellungen', $this->categoryIdNavPanel);
            $instanceIdPicture    = IPS_GetObjectIDByIdent('Bild', $this->categoryIdNavPanel);
            $instanceIdPower      = IPS_GetObjectIDByIdent('Power', $this->categoryIdNavPanel);

            $instanceIdCameraHtml = IPS_GetObjectIDByName('Kamera', $this->categoryIdCamPanel);
            $instanceIdCameraPict = IPS_GetObjectIDByName('Bild', $this->categoryIdCamPanel);
            $instanceIdCameraHist = IPS_GetObjectIDByName('History', $this->categoryIdCamPanel);
            $instanceIdSettings   = IPS_GetObjectIDByIdent('Einstellungen', $this->categoryIdCamPanel);

            $linkIdPower     = IPS_GetObjectIDByName('Power', $instanceIdPower);
            $variableIdPower = '';
            if (array_key_exists(IPSCAM_PROPERTY_SWITCHPOWER, $this->config[$cameraIdx])) { 
                $variableIdPower = $this->config[$cameraIdx][IPSCAM_PROPERTY_SWITCHPOWER];
                IPS_SetHidden($linkIdPower, ($variableIdPower==''));
                if ($variableIdPower<>'') {
                    $variableIdPower = IPSUtil_ObjectIDByPath($variableIdPower);
                    IPS_SetLinkTargetID($linkIdPower, $variableIdPower);
                }
            }
            $linkIdWLAN = IPS_GetObjectIDByName('WLAN', $instanceIdPower);
            $variableIdWLAN = '';
            if (array_key_exists(IPSCAM_PROPERTY_SWITCHWLAN, $this->config[$cameraIdx])) { 
                $variableIdWLAN = $this->config[$cameraIdx][IPSCAM_PROPERTY_SWITCHWLAN];
                IPS_SetHidden($linkIdWLAN, ($variableIdWLAN==''));
                if ($variableIdWLAN<>'') {
                    $variableIdWLAN = IPSUtil_ObjectIDByPath($variableIdWLAN);
                    IPS_SetLinkTargetID($linkIdWLAN, $variableIdWLAN);
                }
            }

            switch ($mode) {
                case IPSCAM_MODE_LIVE:
                    IPS_SetHidden($instanceIdNavigation, true);
                    IPS_SetHidden($instanceIdPicture,    false);
                    IPS_SetHidden($instanceIdPower,      ($variableIdWLAN=='' and $variableIdPower==''));
                    IPS_SetHidden($instanceIdCamSettings,false);
                    IPS_SetHidden($instanceIdCameraHtml, false);
                    IPS_SetHidden($instanceIdCameraPict, true);
                    IPS_SetHidden($instanceIdCameraHist, true);
                    IPS_SetHidden($instanceIdSettings,   true);
                    break;
                case IPSCAM_MODE_PICTURE:
                    IPS_SetHidden($instanceIdNavigation, true);
                    IPS_SetHidden($instanceIdPicture,    false);
                    IPS_SetHidden($instanceIdPower,      ($variableIdWLAN=='' and $variableIdPower==''));
                    IPS_SetHidden($instanceIdCamSettings,false);
                    IPS_SetHidden($instanceIdCameraHtml, true);
                    IPS_SetHidden($instanceIdCameraPict, false);
                    IPS_SetHidden($instanceIdCameraHist, true);
                    IPS_SetHidden($instanceIdSettings,   true);
                    break;
                case IPSCAM_MODE_HISTORY:
                    IPS_SetHidden($instanceIdNavigation, false);
                    IPS_SetHidden($instanceIdPicture,    false);
                    IPS_SetHidden($instanceIdPower,      true);
                    IPS_SetHidden($instanceIdCamSettings,true);
                    IPS_SetHidden($instanceIdCameraHtml, true);
                    IPS_SetHidden($instanceIdCameraPict, true);
                    IPS_SetHidden($instanceIdCameraHist, false);
                    IPS_SetHidden($instanceIdSettings,   true);
                    break;
                case IPSCAM_MODE_SETTINGS:
                    IPS_SetHidden($instanceIdNavigation, true);
                    IPS_SetHidden($instanceIdPicture,    true);
                    IPS_SetHidden($instanceIdPower,      true);
                    IPS_SetHidden($instanceIdCamSettings,true);
                    IPS_SetHidden($instanceIdCameraHtml, true);
                    IPS_SetHidden($instanceIdCameraPict, true);
                    IPS_SetHidden($instanceIdCameraHist, true);
                    IPS_SetHidden($instanceIdSettings,   false);
                    break;
                default:
                    trigger_error('Unknown Mode '.$mode);
            }
            
            IPSUtils_Include ('IPSInstaller.inc.php', 'IPSLibrary::install::IPSInstaller');
            $categoryIdCam      = IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams);

            CreateLink('Bildgröße',               IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTSIZE,  $categoryIdCam), $instanceIdCamSettings, 10);

            CreateLink('Uhrzeit',                IPS_GetObjectIDByIdent(IPSCAM_VAR_NAVTIME,   $categoryIdCam), $instanceIdNavigation, 30);

            CreateLink('Bild Aktualisierung',    IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTREF,   $categoryIdCam), $instanceIdSettings, 10);
            CreateLink('Autom. Bild Speicherung',IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTSTORE, $categoryIdCam), $instanceIdSettings, 20);
            CreateLink('Aktivierung Bild Modus', IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTRESET, $categoryIdCam), $instanceIdSettings, 30);
            CreateLink('Bild Historisierung',    IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTHIST,  $categoryIdCam), $instanceIdSettings, 40);
            CreateLink('Bildgröße',              IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTSIZE,  $categoryIdCam), $instanceIdSettings, 50);
            CreateLink('Zeitraffer Modus',       IPS_GetObjectIDByIdent(IPSCAM_VAR_MOTMODE,   $categoryIdCam), $instanceIdSettings, 60);
            CreateLink('Zeitraffer Abstand',     IPS_GetObjectIDByIdent(IPSCAM_VAR_MOTTIME,   $categoryIdCam), $instanceIdSettings, 70);
            CreateLink('Zeitraffer Zeitraum',    IPS_GetObjectIDByIdent(IPSCAM_VAR_MOTHIST,   $categoryIdCam), $instanceIdSettings, 80);
            CreateLink('Zeitraffer Bildgröße',   IPS_GetObjectIDByIdent(IPSCAM_VAR_MOTSIZE,   $categoryIdCam), $instanceIdSettings, 90);
        }


        // ----------------------------------------------------------------------------------------------------------------------------
        private function SetTimer ($cameraIdx, $timerPrefix, $timerValue, $startTime=null) {
            $timerName  = $timerPrefix.'_'.$cameraIdx;
            $scriptId   = IPSUtil_ObjectIDByPath('Program.IPSLibrary.app.modules.IPSCam.IPSCam_ActionScript');
            $timerId    = @IPS_GetObjectIDByIdent($timerName, $scriptId);
            if ($timerValue==IPSCAM_VAL_DISABLED) {
                if ($timerId!==false) {
                    IPS_DeleteEvent($timerId);
                }
            } else {
                if ($timerId === false) {
                    $timerId = IPS_CreateEvent(1 /*Cyclic Event*/);
                    IPS_SetParent($timerId, $scriptId);
                    IPS_SetName($timerId, $timerName);
                    IPS_SetIdent($timerId, $timerName);
                }
                $hours = (int)($timerValue / (60*60));
                $mins  = (int)($timerValue / 60);
                $secs  = $timerValue;
                if ($startTime=='Once') {
                    $nextTime = strtotime('+'.$timerValue.' sec');
                    IPS_SetEventCyclic($timerId, 2 /**Daily*/, 1 /*Unused*/,0 /*Unused*/,0 /*Unused*/,0 /*Einmalig*/,0 /*Unused*/);
                    IPS_SetEventCyclicTimeFrom($timerId, date('H',$nextTime),  date('i',$nextTime), date('s',$nextTime));
                } elseif ($hours==24) {
                    $startTime = explode(':', $startTime);
                    IPS_SetEventCyclic($timerId, 2 /**Daily*/, 1 /*Unused*/,0 /*Unused*/,0 /*Unused*/,0 /*Einmalig*/,0 /*Unused*/);
                    IPS_SetEventCyclicTimeFrom($timerId, $startTime[0], $startTime[1], 0);
                } elseif ($hours > 0) {
                    IPS_SetEventCyclic($timerId, 2 /*Daily*/, 1 /*Unused*/,0 /*Unused*/,0 /*Unused*/,3 /*TimeType Hours*/,$hours /*Stunden*/);
                } elseif ($mins > 0) {
                    IPS_SetEventCyclic($timerId, 2 /*Daily*/, 1 /*Unused*/,0 /*Unused*/,0 /*Unused*/,2 /*TimeType Minutes*/,$mins /*Minutes*/);
                } else {
                    IPS_SetEventCyclic($timerId, 2 /*Daily*/, 1 /*Unused*/,0 /*Unused*/,0 /*Unused*/,1 /*TimeType Sec*/, $secs /*Sec*/);
                }
                IPS_SetEventActive($timerId, true);
            }
        }

        /**
         * @public
         *
         * Diese Funktion wird beim Auslösen eines Timers aufgerufen
         *
         * @param integer $timerId ID des Timers
         */
        // ----------------------------------------------------------------------------------------------------------------------------
        public function ActivateTimer($timerId) {
            $timerName = IPS_GetName($timerId);
            $timerNames = explode('_', $timerName);
            if (count($timerNames) < 2 ) { 
                trigger_error('Unknown Timer '.$timerName.'(ID='.$timerId.')'); 
            }
            $cameraIdx = $timerNames[1];
            switch($timerNames[0]) {
                case 'PictureRefresh';
                    $this->PictureRefresh($cameraIdx);
                    break;
                case 'PictureStore';
                    $this->PictureStore($cameraIdx);
                    break;
                case 'PictureReset';
                    $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
                    $variableIdMode      = IPS_GetObjectIDByIdent(IPSCAM_VAR_MODE, $this->categoryIdCommon);
                    if (GetValue($variableIdMode)<>IPSCAM_MODE_PICTURE and GetValue($variableIdCamSelect)==$cameraIdx) {
                        $this->PictureReset($cameraIdx);
                    }
                    break;
                case 'PictureMotion';
                    $this->PictureMotion($cameraIdx);
                    break;
                default:
                    trigger_error('Unknown Timer '.$timerName.'(ID='.$timerId.')');
            }
        }

        /**
         * @public
         *
         * Aktuallisiert das angezeigte Bild
         *
         * @param integer $cameraIdx Index der Kamera
         */
        // ----------------------------------------------------------------------------------------------------------------------------
        public function PictureRefresh($cameraIdx=null) {
            $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);

            // If CameraIndex is NULL use selected
            if ($cameraIdx===null) {
                $cameraIdx = GetValue($variableIdCamSelect);
            }

            // Download Camera Image
            $size       = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTSIZE, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams)));
            $result     = $this->DownloadImageFromCam($cameraIdx, 'Picture', $size, 'Current');

            if ($result) {
                // Set Media File for Camera View
                $categoryIdCam   = IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams);
                $variableIdMedia = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMPICT, $categoryIdCam);
                IPS_SetMediaFile($variableIdMedia, IPS_GetKernelDir().'Cams/'.$cameraIdx.'/Picture/CurrentDummy.jpg', false);
                IPS_SetMediaFile($variableIdMedia, IPS_GetKernelDir().'Cams/'.$cameraIdx.'/Picture/Current.jpg', false);
                
                // If Camera is selected, Refresh WebFront
                if (GetValue($variableIdCamSelect)==$cameraIdx) {
                    // Copy Image to Common File
                    Copy (IPS_GetKernelDir().'Cams/'.$cameraIdx.'/Picture/Current.jpg', 
                          IPS_GetKernelDir().'Cams/'.$cameraIdx.'/Picture/Common.jpg');
                        
                        
                    // Copy Image to webfront
                    Copy (IPS_GetKernelDir().'Cams/'.$cameraIdx.'/Picture/Current.jpg',
                          IPS_GetKernelDir().'webfront/user/IPSCam/ImageCurrent.jpg');

                    // Set Media File for Common View
                    $variableIdMedia = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMPICT, $this->categoryIdCommon);
                    IPS_SetMediaFile($variableIdMedia, IPS_GetKernelDir().'Cams/'.$cameraIdx.'/Picture/CommonDummy.jpg', false);
                    IPS_SetMediaFile($variableIdMedia, IPS_GetKernelDir().'Cams/'.$cameraIdx.'/Picture/Common.jpg', false);

                    $this->RefreshWebFront($cameraIdx);
                }
            }
            return $result;
        }

        /**
         * @public
         *
         * Speichert das aktuelle Bild in die History
         *
         * @param integer $cameraIdx Index der Kamera
         */
        // ----------------------------------------------------------------------------------------------------------------------------
        public function PictureStore($cameraIdx=null) {
            $result = false;
            if ($cameraIdx===null) {
                $cameraIdx = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon));
            }

            $size          = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTSIZE, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams)));
            if (IPSCam_BeforeStorePicture($cameraIdx)) {
                $result  = $this->PictureRefresh($cameraIdx);
            
                if ($result) {
                    Copy (IPS_GetKernelDir().'Cams/'.$cameraIdx.'/Picture/Current.jpg', 
                          IPS_GetKernelDir().'Cams/'.$cameraIdx.'/History/'.date(IPSCAM_NAV_DATEFORMATFILE).'.jpg');
                }

                $this->NavigatePictures(IPSCAM_NAV_FORWARD, 100, $cameraIdx);

                IPSCam_AfterStorePicture($cameraIdx);
            }
            return $result;
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        private function IsCameraAvailable($cameraIdx=null) {
            if ($cameraIdx===null) {
                $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
                $cameraIdx = GetValue($variableIdCamSelect);
            }
            $cameraAvailable = true;
            if (array_key_exists(IPSCAM_PROPERTY_SWITCHPOWER, $this->config[$cameraIdx])) { 
                $variableIdPower = $this->config[$cameraIdx][IPSCAM_PROPERTY_SWITCHPOWER];
                if ($variableIdPower<>'') {
                    $variableIdPower = IPSUtil_ObjectIDByPath($variableIdPower);
                    $cameraAvailable = ($cameraAvailable and GetValue($variableIdPower));
                }
            }
            if (array_key_exists(IPSCAM_PROPERTY_SWITCHWLAN, $this->config[$cameraIdx])) { 
                $variableIdWLAN = $this->config[$cameraIdx][IPSCAM_PROPERTY_SWITCHWLAN];
                if ($variableIdWLAN<>'') {
                    $variableIdWLAN = IPSUtil_ObjectIDByPath($variableIdWLAN);
                    $cameraAvailable = ($cameraAvailable and GetValue($variableIdWLAN));
                }
            }
            return $cameraAvailable;
        }
        
        // ----------------------------------------------------------------------------------------------------------------------------
        private function PictureReset($cameraIdx) {
            $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
            if ($cameraIdx===null) {
                $cameraIdx = GetValue($variableIdCamSelect);
            }
            if (GetValue($variableIdCamSelect) <> $cameraIdx) {
                $this->SetCamera($cameraIdx);
            }
            $this->SetMode (IPSCAM_MODE_PICTURE);
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        private function PictureMotion($cameraIdx) {
            $categoryIdCam = IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams);
            $size          = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_MOTSIZE, $categoryIdCam));
            if (IPSCam_BeforeStoreMotion($cameraIdx)) {
                $this->DownloadImageFromCam($cameraIdx, 'MotionCapture', $size, date(IPSCAM_NAV_DATEFORMATFILE));
                IPSCam_AfterStoreMotion($cameraIdx);
            }
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        private function GetLoggingTextFromURL($url) {
            return str_replace(parse_url($url, PHP_URL_USER).":".parse_url($url, PHP_URL_PASS)."@", "<<user:pwd>>",$url);
        }
        
        // ----------------------------------------------------------------------------------------------------------------------------
        private function DownloadImageFromCam($cameraIdx, $directoryName, $size, $fileName) {
            if (!$this->IsCameraAvailable($cameraIdx)) {
                return false;
            }

            $result = IPS_SemaphoreEnter('IPSCam_'.$cameraIdx, 5000);
            if ($result) {
                $componentParams = $this->config[$cameraIdx][IPSCAM_PROPERTY_COMPONENT];
                $component       = IPSComponent::CreateObjectByParams($componentParams);
                $urlPicture      = $component->Get_URLPicture($size);
                $localFile       = IPS_GetKernelDir().'Cams/'.$cameraIdx.'/'.$directoryName.'/'.$fileName.'.jpg';
                IPSLogger_Trc(__file__, "Copy ".$this->GetLoggingTextFromURL($urlPicture)." --> $localFile");

                $curl_handle=curl_init();
                curl_setopt($curl_handle, CURLOPT_URL, $urlPicture);
                curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 20);
                curl_setopt($curl_handle, CURLOPT_TIMEOUT, 30);  
                curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER,true);
                curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
                curl_setopt($curl_handle, CURLOPT_FAILONERROR, true);
                $fileContent = curl_exec($curl_handle);
                curl_close($curl_handle);

                if ($fileContent===false) {
                    IPS_SemaphoreLeave('IPSCam_'.$cameraIdx);
                    IPSLogger_Dbg (__file__, 'File '.$this->GetLoggingTextFromURL($urlPicture).' could NOT be found on the Server !!!');
                    return false;
                }
                $result = file_put_contents($localFile, $fileContent);
                IPS_SemaphoreLeave('IPSCam_'.$cameraIdx);

                if ($result===false) {
                    trigger_error('Error writing File Content to '.$localFile);
                }
                return $localFile;
            }
            return false;
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        public function NavigatePictures($direction, $count, $cameraIdx=null) {
            if ($cameraIdx===null) {
                $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
                $cameraIdx = GetValue($variableIdCamSelect);
            }
            $directory  = IPS_GetKernelDir().'/Cams/'.$cameraIdx.'/History/';
            
            $variableIdNavFile = IPS_GetObjectIDByIdent(IPSCAM_VAR_NAVFILE, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams));
            $variableIdNavTime = IPS_GetObjectIDByIdent(IPSCAM_VAR_NAVTIME, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams));
            $navTime    = GetValue($variableIdNavFile);
            $navPos     = -1;

            $fileList2   = scandir($directory, 0);
            $fileList2   = array_diff($fileList2, Array('.','..'));
            $fileList2   = explode('|',implode('|',$fileList2));

            $fileList    = array();
            foreach($fileList2 as $idx=>$file) {
                $fileExt  = pathinfo($file, PATHINFO_EXTENSION);
                if ($fileExt=='jpg') {
                    $fileList[] = $file;
                }
            }
            
            foreach($fileList as $idx=>$file) {
                $filename = basename($file);
                if ($filename==$navTime.'.jpg') {
                    $navPos=$idx;
                } elseif ($filename>=$navTime.'.jpg' and $navPos==-1) {
                    $navPos=$idx;
                } else {
                }
            }
            
            if ($navPos==-1) {
                $navPos=count($fileList)-1;
            } elseif ($direction==IPSCAM_NAV_BACK and $navPos > 0) {
                $navPos=$navPos-1;
            } elseif ($direction==IPSCAM_NAV_FORWARD and ($navPos+1)<count($fileList)) {
                $navPos=$navPos+1;
            } else {
            }

            if ($navPos<>-1) {
                $navFile = $fileList[$navPos];
                $navFile = str_replace('.jpg', '', $navFile);
                SetValue($variableIdNavFile, $navFile);
                $navTime = mktime(substr($navFile,9,2),  substr($navFile,11,2), substr($navFile,13,2), substr($navFile,4,2), substr($navFile,6,2), substr($navFile,0,4));
                SetValue($variableIdNavTime, date(IPSCAM_NAV_DATEFORMATDISP, $navTime));

                $mediaFileName     = IPS_GetKernelDir().'Cams/'.$cameraIdx.'/History/'.$navFile.'.jpg';
                $userFileName      = IPS_GetKernelDir().'webfront/user/IPSCam/ImageHistory.jpg';  

                $variableIdMedia   = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMHIST, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams));
                IPS_SetMediaFile($variableIdMedia, $mediaFileName, false);
                copy ($mediaFileName, $userFileName);

                $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
                if (GetValue($variableIdCamSelect)==$cameraIdx) {
                   IPS_SetMediaFile(IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMHIST, $this->categoryIdCommon), $mediaFileName, false);
                   SetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_NAVTIME, $this->categoryIdCommon), date(IPSCAM_NAV_DATEFORMATDISP, $navTime));
                }

            }
            $this->RefreshWebFront($cameraIdx);
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        public function NavigateDays($direction, $count, $cameraIdx=null) {
            if ($cameraIdx===null) {
                $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
                $cameraIdx = GetValue($variableIdCamSelect);
            }

            $variableIdNavFile = IPS_GetObjectIDByIdent(IPSCAM_VAR_NAVFILE, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams));
            $variableIdNavTime = IPS_GetObjectIDByIdent(IPSCAM_VAR_NAVTIME, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams));
            //012345678901234
            //YYYYMMDD_HHMISS
            $navTime = GetValue($variableIdNavFile);
            $navTime = mktime(substr($navTime,9,2),  substr($navTime,11,2), substr($navTime,13,2), substr($navTime,4,2), substr($navTime,6,2), substr($navTime,0,4));
            if ($direction==IPSCAM_DAY_BACK) {
                $navTime = strtotime('-'.$count.' day', $navTime);
            } elseif ($direction==IPSCAM_DAY_FORWARD) {
                $navTime = strtotime('+'.$count.' day', $navTime);
            } else {
                trigger_error('Unknown Direction='.$direction);
            }
            
            SetValue($variableIdNavTime, date(IPSCAM_NAV_DATEFORMATDISP, $navTime));
            SetValue($variableIdNavFile, date(IPSCAM_NAV_DATEFORMATFILE, $navTime));
            $this->NavigatePictures(IPSCAM_NAV_FORWARD, 1, $cameraIdx);
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        private function PurgeFilesByDirectory($directory, $days) {
            $refDate = strtotime('-'.$days.' day', time());
            $refDate = date(IPSCAM_NAV_DATEFORMATFILE, $refDate);
            $refDate = substr($refDate, 0 ,8);

            IPSLogger_Dbg(__file__, 'Purge Files with RefDate='.substr($refDate,0,4).'-'.substr($refDate,4,2).'-'.substr($refDate,6,2)
                                    .', Days='.str_pad("$days",3,' ').', Directory='.$directory);
            $fileList = scandir($directory, 0);
            $fileList = array_diff($fileList, Array('.','..'));
            foreach($fileList as $idx=>$file) {
                $filename = basename($file);
                $fileExt  = pathinfo($file, PATHINFO_EXTENSION);
                $filenameFull = $directory.$filename;
                $fileDate = substr($filename, 0, 8);
                if ($fileExt=='jpg') {
                    $MediaFileName = str_replace(IPS_GetKernelDir(),"",str_replace('/', '\\', $filenameFull));
                    if (($fileDate < $refDate) && (@IPS_GetMediaIDByFile($MediaFileName)== 0) ) {
                        IPSLogger_Trc(__file__, 'Delete Camera File: '.$filenameFull);
                        unlink($filenameFull);
                    }
                }
            }
        }
        
        /**
         * @public
         *
         * Löschen der nicht mehr benötigten Bilder in der History
         *
         */
        // ----------------------------------------------------------------------------------------------------------------------------
        public function PurgeFiles() {
            set_time_limit(600); // Set PHP Time Limit of 10 Minutes for Purging of Files
            IPSLogger_Inf(__file__, 'Purge History and MotionCapture Camera Files');

            foreach ($this->config as $cameraIdx=>$data) {
                $categoryIdCam      = IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams);
                $directoryHist      = IPS_GetKernelDir().'Cams/'.$cameraIdx.'/History/';
                $directoryMot       = IPS_GetKernelDir().'Cams/'.$cameraIdx.'/MotionCapture/';
                $daysHist           = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTHIST, $categoryIdCam));
                $daysMot            = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_MOTHIST, $categoryIdCam));
                $this->PurgeFilesByDirectory($directoryHist, $daysHist);
                $this->PurgeFilesByDirectory($directoryMot,  $daysMot);
            }
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        public function GenerateMovies() {
        }
        
        /**
         * @public
         *
         * Liefert eine URL um auf den LiveStream oder ein Bild einer Kamera zuzugreifen
         *
         * @param integer $cameraIdx Index der Kamera
         * @param integer $urlType Type der URL die geliefert werden soll:
         *    IPSCAM_URL_LIVE      ... URL des aktuellen Livestreams
         *    IPSCAM_URL_PICTURE   ... URL des aktuellen Bildes
         */
        // ----------------------------------------------------------------------------------------------------------------------------
        public function GetURL($cameraIdx, $urlType) {
            if ($cameraIdx===null) {
                $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
                $cameraIdx = GetValue($variableIdCamSelect);
            }
            $size            = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTSIZE, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams)));;
            $componentParams = $this->config[$cameraIdx][IPSCAM_PROPERTY_COMPONENT];
            $component       = IPSComponent::CreateObjectByParams($componentParams);
            switch($urlType) {
                case IPSCAM_URL_LIVE:
                    $url = $component->Get_URLLivestream($size);
                    break;
                case IPSCAM_URL_PICTURE:
                    $url = $component->Get_URLPicture($size);
                    break;
                case IPSCAM_URL_DISPLAY:
                    $mode = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_MODE, $this->categoryIdCommon));
                    if ($mode==IPSCAM_MODE_LIVE) {
                        $url = $component->Get_URLLivestream($size);
                    } else {
                        $url = $component->Get_URLPicture($size);
                    }
                    break;
                case IPSCAM_URL_MOVEHOME:   $url = $component->Get_URL(IPSCOMPONENTCAM_URL_MOVEHOME); break;
                case IPSCAM_URL_MOVEUP:     $url = $component->Get_URL(IPSCOMPONENTCAM_URL_MOVEUP); break;
                case IPSCAM_URL_MOVEDOWN:   $url = $component->Get_URL(IPSCOMPONENTCAM_URL_MOVEDOWN); break;
                case IPSCAM_URL_MOVERIGHT:  $url = $component->Get_URL(IPSCOMPONENTCAM_URL_MOVERIGHT); break;
                case IPSCAM_URL_MOVELEFT:   $url = $component->Get_URL(IPSCOMPONENTCAM_URL_MOVELEFT); break;
                case IPSCAM_URL_PREDEFPOS1: $url = $component->Get_URL(IPSCOMPONENTCAM_URL_PREDEFPOS1); break;
                case IPSCAM_URL_PREDEFPOS2: $url = $component->Get_URL(IPSCOMPONENTCAM_URL_PREDEFPOS2); break;
                case IPSCAM_URL_PREDEFPOS3: $url = $component->Get_URL(IPSCOMPONENTCAM_URL_PREDEFPOS3); break;
                case IPSCAM_URL_PREDEFPOS4: $url = $component->Get_URL(IPSCOMPONENTCAM_URL_PREDEFPOS4); break;
                case IPSCAM_URL_PREDEFPOS5: $url = $component->Get_URL(IPSCOMPONENTCAM_URL_PREDEFPOS5); break;
                case IPSCAM_URL_PREDEFPOS6: $url = $component->Get_URL(IPSCOMPONENTCAM_URL_PREDEFPOS6); break;
                default:
                    $url='';
                    trigger_error('Unknown UrlType "'.$urlType.'"');
            }
            return $url;
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        private function GetCameraProperty($cameraIdx, $property, $mandatory=false) {
            if (array_key_exists($property, $this->config[$cameraIdx])) {
                $value = $this->config[$cameraIdx][$property];
                if(mb_detect_encoding($value, 'UTF-8, ISO-8859-1') !== 'UTF-8')
                    $value = htmlentities($value, ENT_COMPAT, 'ISO-8859-1');
            } elseif ($mandatory) {
                trigger_error('Property "'.$property.'" could NOT be found for CameraIdx='.$cameraIdx);
            } else {
                $value = '';
            }
            return $value;
        }
        
        /**
         * @public
         *
         * Führt einen Command Befehl aus der GUI aus
         *
         * @param integer $cameraIdx Index der Kamera
         * @param string $actionProperty Action Property
         */
        // ----------------------------------------------------------------------------------------------------------------------------
        public function ProcessCommand($cameraIdx, $actionProperty) {
            $action    = $this->GetCameraProperty($cameraIdx, $actionProperty);

            if ($action!=='') {
                if (is_numeric($action)) {
                    IPSLogger_Dbg(__file__, 'Execute Camera Action Script "'.$action.'"');
                    $id = IPSUtil_ObjectIDByPath($action);
                    IPS_RunScript($id);
                } else {
                    IPSLogger_Dbg(__file__, 'Execute Camera Action "'.$action.'"');
                    $module    = IPSLibraryModule::CreateObjectByParams($action);
                    $module->ExecuteButton();
                }
            }
        }
        
        /**
         * @public
         *
         * Bewegt eine Kamera in eine bestimmte Richtung
         *
         * @param integer $cameraIdx Index der Kamera
         * @param string $urlType Type der URL zur Richtungsangabe
         */
        // ----------------------------------------------------------------------------------------------------------------------------
        public function Move($cameraIdx, $urlType) {
            $curl_handle=curl_init();
            curl_setopt($curl_handle, CURLOPT_URL, $this->GetURL($cameraIdx, $urlType));
            curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
            curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER,true);
            curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
            //curl_setopt($curl_handle, CURLOPT_USERPWD, "User:pwd");
            //curl_setopt($curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
            curl_setopt($curl_handle, CURLOPT_FAILONERROR, true);
            $fileContent = curl_exec($curl_handle);
        }
        
        // ----------------------------------------------------------------------------------------------------------------------------
        private function GetHTMLCameraMap($cameraIdx, $width, $height) {
            $return = '';
            $camType    = $this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_TYPE);
            if ($camType==IPSCAM_TYPE_MOVABLECAM) {
                $urlMoveUp    = $this->GetURL($cameraIdx, IPSCAM_URL_MOVEUP);
                $urlMoveDown  = $this->GetURL($cameraIdx, IPSCAM_URL_MOVEDOWN);
                $urlMoveLeft  = $this->GetURL($cameraIdx, IPSCAM_URL_MOVELEFT);
                $urlMoveRight = $this->GetURL($cameraIdx, IPSCAM_URL_MOVERIGHT);
                
                //   0  1  2  3  4  5
                //0  x  x        x  x
                //1  x  x        x  x
                //2        x  x 
                //3        x  x
                //4  x  x        x  x
                //5  x  x        x  x

                $w=round($width/5);
                $h=round($height/5);
                $cordsUp    = ''.($w*1).','.($h*0).','.($w*4).','.($h*0).','.($w*4).','.($h*1).','.($w*3).','.($h*2).','.($w*2).','.($h*2).','.($w*1).','.($h*1);
                $cordsDown  = ''.($w*1).','.($h*5).','.($w*4).','.($h*5).','.($w*4).','.($h*4).','.($w*3).','.($h*3).','.($w*2).','.($h*3).','.($w*1).','.($h*4);
                $cordsLeft  = ''.($w*0).','.($h*1).','.($w*1).','.($h*1).','.($w*2).','.($h*2).','.($w*2).','.($h*3).','.($w*1).','.($h*4).','.($w*0).','.($h*4);
                $cordsRight = ''.($w*5).','.($h*1).','.($w*4).','.($h*1).','.($w*3).','.($h*2).','.($w*3).','.($h*3).','.($w*4).','.($h*4).','.($w*5).','.($h*4);

                $return .= '         <area shape="poly" coords="'.$cordsUp.'" href="#" onClick="var img=new Image(); img.src=\''.$urlMoveUp.'\'" alt="" />'.PHP_EOL;
                $return .= '         <area shape="poly" coords="'.$cordsDown.'" href="#" onClick="var img=new Image(); img.src=\''.$urlMoveDown.'\'" alt="" />'.PHP_EOL;
                $return .= '         <area shape="poly" coords="'.$cordsLeft.'" href="#" onClick="var img=new Image(); img.src=\''.$urlMoveLeft.'\'" alt="" />'.PHP_EOL;
                $return .= '         <area shape="poly" coords="'.$cordsRight.'" href="#" onClick="var img=new Image(); img.src=\''.$urlMoveRight.'\'" alt="" />'.PHP_EOL;
            }
            return $return;
        }
        
        // ----------------------------------------------------------------------------------------------------------------------------
        private function GetHTMLMobileButtonNavi($cameraIdx, $idButton, $iconName) {
            $return  = '        <td class="camData">'.PHP_EOL;
            $return .= '            <div id="'.$idButton.'" cameraidx="'.$cameraIdx.'" class="camButton">'.PHP_EOL;
            $return .= '              <table width=100% height=100% border=1 style="font-size:28px;"><tr><td height=140px align="center">'.PHP_EOL;
            $return .= '                <img style="vertical-align:middle" src="/user/IPSCam/icons/'.$iconName.'.png">'.PHP_EOL;
            $return .= '               </td></tr></table>'.PHP_EOL;
            $return .= '            </div>'.PHP_EOL;
            $return .= '        </td>'.PHP_EOL;

            return $return;
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        private function GetHTMLMobileButton($cameraIdx, $property, $idButton) {
            $return = '';
            $return .= '        <td class="camData">'.PHP_EOL;
            $return .= '          <div id="'.$idButton.'" cameraidx="'.$cameraIdx.'" class="camButton" >'.PHP_EOL;
            $return .= '            <table width=100% height=100% border=1 style="font-size:28px;"><tr><td align="center">'.
                                        $this->GetCameraProperty($cameraIdx, $property).
                                     '</td></tr></table>'.PHP_EOL;
            $return .= '          </div>'.PHP_EOL;
            $return .= '        </td>'.PHP_EOL;

            return $return;
        }

        /**
         * @public
         *
         * Liefert den HTML Code für die WebFront Anzeige
         *
         * @param integer $cameraIdx Index der Kamera
         * @param integer $size Größe des Streams
         * @param boolean $showPreDefPosButtons definiert ob Buttons zum Anfahren der vordefinierten Positionen bei beweglichen Kameras erzeugt werden sollen 
         * @param boolean $showCommandButtons definiert ob Buttons zum Schalten von vordefinierten Lichtern etc. erzeugt werden soll 
         * @param boolean $showNavigationButtons definiert ob Buttons zur Steuerung beweglicher Kameras erzeugt werden sollen 
         * @return string HTML Code zur Anzeige
         */
        // ----------------------------------------------------------------------------------------------------------------------------
        public function GetHTMLMobile($cameraIdx, $size, $showPreDefPosButtons, $showCommandButtons, $showNavigationButtons) {
            if ($cameraIdx===null) {
                $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
                $cameraIdx = GetValue($variableIdCamSelect);
            }
            if ($size===null) {
                $size = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTSIZE, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams)));
            }
            $camType         = $this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_TYPE, true);
            $componentParams = $this->config[$cameraIdx][IPSCAM_PROPERTY_COMPONENT];
            $component       = IPSComponent::CreateObjectByParams($componentParams);
            $urlStream       = $component->Get_URLLivestream($size);
            $streamWidth     = $component->Get_Width($size); 
            $height          = $component->Get_Height($size);

            $width  = IPSCAM_WIDTH_MOBILE;
            $height =  $height * (($width)/$streamWidth);  

            
            $return = '';
            if ($showNavigationButtons and $camType==IPSCAM_TYPE_MOVABLECAM) {
                $return .= '    <table width = 100% border=0>'.PHP_EOL;
                $return .= '      <tr>'.PHP_EOL;
                $return .=          $this->GetHTMLMobileButtonNavi($cameraIdx, 'camButtonNavLeft', 'arrow_left');
                $return .=          $this->GetHTMLMobileButtonNavi($cameraIdx, 'camButtonNavUp',   'arrow_up');
                $return .=          $this->GetHTMLMobileButtonNavi($cameraIdx, 'camButtonNavDown', 'arrow_down');
                $return .=          $this->GetHTMLMobileButtonNavi($cameraIdx, 'camButtonNavRight','arrow_right');
                $return .= '        <td style="height:150px; text-align:center;" >'.PHP_EOL;
                $return .= '        </td>'.PHP_EOL;
                $return .= '      </tr>'.PHP_EOL;
                $return .= '    </table> '.PHP_EOL;
            }
            $return .= '    <div class="camContainer">'.PHP_EOL;
            $return .= '      <img width=100% class="camContentStream" src="'.$urlStream.'" usemap="#cam">'.PHP_EOL;
            $return .= '      <map id="cam" name="cam">'.PHP_EOL;
            $return .=           $this->GetHTMLCameraMap($cameraIdx, $width, $height);
            $return .= '      </map>'.PHP_EOL;
            $return .= '    </div>'.PHP_EOL;
            if ($showPreDefPosButtons and $camType==IPSCAM_TYPE_MOVABLECAM and $this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS1)<>'') {
                $return .= '    <table width = 100% border=0>'.PHP_EOL;
                $return .= '      <tr>'.PHP_EOL;
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS1, 'camButtonPreDef1');
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS2, 'camButtonPreDef2');
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS3, 'camButtonPreDef3');
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS4, 'camButtonPreDef4');
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS5, 'camButtonPreDef5');
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS6, 'camButtonPreDef6');
                $return .= '        <td style="height:150px; text-align:center;" >'.PHP_EOL;
                $return .= '        </td>'.PHP_EOL;
                $return .= '      </tr>'.PHP_EOL;
                $return .= '    </table> '.PHP_EOL;
            }
            if ($showCommandButtons  and $this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND1)<>'') {
                $return .= '    <table width = 100% border=0>'.PHP_EOL;
                $return .= '      <tr>'.PHP_EOL;
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_COMMAND1, 'camButtonCommand1');
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_COMMAND2, 'camButtonCommand2');
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_COMMAND3, 'camButtonCommand3');
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_COMMAND4, 'camButtonCommand4');
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_COMMAND5, 'camButtonCommand5');
                $return .=           $this->GetHTMLMobileButton($cameraIdx, IPSCAM_PROPERTY_COMMAND6, 'camButtonCommand6');
                $return .= '        <td style="height:150px; text-align:center;" >'.PHP_EOL;
                $return .= '        </td>'.PHP_EOL;
                $return .= '      </tr>'.PHP_EOL;
                $return .= '    </table>'.PHP_EOL;
            }
            
            return $return;
        }

        // ----------------------------------------------------------------------------------------------------------------------------
        private function GetStreamHeight($cameraIdx, $size=null, $calcWindowHeight=true, $showPreDefPosButtons=true, $showCommandButtons=true, $showNavigationButtons=false) {
            if ($size===null) {
                $size = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTSIZE, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams)));
            }
            switch($size) {
                case IPSCAM_SIZE_SMALL:
                    $maxHeight = IPSCAM_HEIGHT_SMALL;
                    break;
                case IPSCAM_SIZE_MIDDLE:
                    $maxHeight = IPSCAM_HEIGHT_MIDDLE;
                    break;
                case IPSCAM_SIZE_LARGE:
                    $maxHeight = IPSCAM_HEIGHT_LARGE;
                    break;
                default:
                    trigger_error('Unknown Size '.$size);
            }
            
            $camType         = $this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_TYPE, true);
            $componentParams = $this->config[$cameraIdx][IPSCAM_PROPERTY_COMPONENT];
            $component       = IPSComponent::CreateObjectByParams($componentParams);
            $streamHeight    = $component->Get_Height($size);
            $htmlHeight      = 0;
            if ($showNavigationButtons and $camType==IPSCAM_TYPE_MOVABLECAM) {$htmlHeight = $htmlHeight + 50;}
            if ($showPreDefPosButtons and $camType==IPSCAM_TYPE_MOVABLECAM and $this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS1)<>'') {$htmlHeight = $htmlHeight + 50;}
            if ($showCommandButtons  and $this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND1)<>'') { $htmlHeight = $htmlHeight + 50;}
            if ($calcWindowHeight) {
                if (($htmlHeight+$streamHeight) <= $maxHeight) {
                    $height = $htmlHeight + $streamHeight + 12;
                } else {
                    $height = $maxHeight; 
                }
            } else {
                if (($htmlHeight+$streamHeight) <= $maxHeight) {
                    $height = $streamHeight;
                } else {
                    $height = $streamHeight - ($htmlHeight + $streamHeight - $maxHeight) - 10; // StreamHeight - Diff
                }
            }
            return $height;
        }

        /**
         * @public
         *
         * Liefert den HTML Code für die WebFront Anzeige
         *
         * @param integer $cameraIdx Index der Kamera
         * @param integer $size Größe des Streams
         * @param boolean $showPreDefPosButtons definiert ob Buttons zum Anfahren der vordefinierten Positionen bei beweglichen Kameras erzeugt werden sollen 
         * @param boolean $showCommandButtons definiert ob Buttons zum Schalten von vordefinierten Lichtern etc. erzeugt werden soll 
         * @param boolean $showNavigationButtons definiert ob Buttons zur Steuerung beweglicher Kameras erzeugt werden sollen 
         * @return string HTML Code zur Anzeige
         */
        // ----------------------------------------------------------------------------------------------------------------------------
        public function GetHTMLWebFront($cameraIdx, $size, $showPreDefPosButtons, $showCommandButtons, $showNavigationButtons) {
            if ($cameraIdx===null) {
                $variableIdCamSelect = IPS_GetObjectIDByIdent(IPSCAM_VAR_CAMSELECT, $this->categoryIdCommon);
                $cameraIdx = GetValue($variableIdCamSelect);
            }
            if ($size===null) {
                $size = GetValue(IPS_GetObjectIDByIdent(IPSCAM_VAR_PICTSIZE, IPS_GetObjectIDByIdent($cameraIdx, $this->categoryIdCams)));
            }
            $camType         = $this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_TYPE, true);
            $componentParams = $this->config[$cameraIdx][IPSCAM_PROPERTY_COMPONENT];
            $component       = IPSComponent::CreateObjectByParams($componentParams);
            $urlStream       = $component->Get_URLLivestream($size);
            $origHeight      = $component->Get_Height($size); 
            $origWidth       = $component->Get_Width($size); 
            $streamHeight    = $this->GetStreamHeight($cameraIdx, $size, false, $showPreDefPosButtons, $showCommandButtons, $showNavigationButtons);
            $streamWidth     = $origWidth; 

            $return = '';
            if ($showNavigationButtons and $camType==IPSCAM_TYPE_MOVABLECAM) {
                $return .= '<div class="camContainer">'.PHP_EOL;
                $return .= '  <div class="camContent">'.PHP_EOL;
                $return .= '    <div class="camIcon">'.PHP_EOL;
                $return .= '      <div class="camIconWindDirection"> </div>'.PHP_EOL;
                $return .= '    </div>'.PHP_EOL;
                $return .= '    <div class="camTitle">'.PHP_EOL;
                $return .= '      <div class="camText"></div>'.PHP_EOL;
                $return .= '    </div>'.PHP_EOL;
                $return .= '    <div class="camData">'.PHP_EOL;
                $return .= '      <div class="camDataEnum">'.PHP_EOL;
                $return .= '        <div class="camDataEnumBlock">'.PHP_EOL;
                $return .= '          <div id="camButtonNavLeft"  class="camButton camIconArrowLeft"  cameraidx="'.$cameraIdx.'" style="margin-left: 0px;"></div>'.PHP_EOL;
                $return .= '          <div id="camButtonNavUp"    class="camButton camIconArrowUp"    cameraidx="'.$cameraIdx.'" style="margin-left: 0px;"></div>'.PHP_EOL;
                $return .= '          <div id="camButtonNavDown"  class="camButton camIconArrowDown"  cameraidx="'.$cameraIdx.'" style="margin-left: 0px;"></div>'.PHP_EOL;
                $return .= '          <div id="camButtonNavRight" class="camButton camIconArrowRight" cameraidx="'.$cameraIdx.'" style="margin-left: 0px;"></div>'.PHP_EOL;
                $return .= '        </div>'.PHP_EOL;
                $return .= '      </div>'.PHP_EOL;
                $return .= '    </div>'.PHP_EOL;
                $return .= '  </div>'.PHP_EOL;
                $return .= '</div>'.PHP_EOL;
            }
            $return .= '<div class="camContainer">'.PHP_EOL;
            if ($streamHeight===null) {
                $return .= '  <img class="camContentStream" src="'.$urlStream.'" usemap="#cam">'.PHP_EOL;
            } else {
                $return .= '  <img height='.$streamHeight.'px class="camContentStream" src="'.$urlStream.'" usemap="#cam">'.PHP_EOL;
                $streamWidth = $origWidth * (($streamHeight)/$origHeight);  
            }
            $return .= '  <map id="cam" name="cam">'.PHP_EOL;
            $return .=           $this->GetHTMLCameraMap($cameraIdx, $streamWidth, $streamHeight);
            $return .= '  </map>'.PHP_EOL;
            $return .= '</div>'.PHP_EOL;
            if ($showPreDefPosButtons and $camType==IPSCAM_TYPE_MOVABLECAM and $this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS1)<>'') {
                $return .= '<div class="camContainer">'.PHP_EOL;
                $return .= '  <div class="camContent">'.PHP_EOL;
                $return .= '    <div class="camIcon td">'.PHP_EOL;
                $return .= '      <div class="camIconImage"> </div>'.PHP_EOL;
                $return .= '    </div>'.PHP_EOL;
                $return .= '    <div class="camTitle">'.PHP_EOL;
                $return .= '      <div class="camText">Vordefinierte Positionen</div>'.PHP_EOL;
                $return .= '    </div>'.PHP_EOL;
                $return .= '    <div class="camData">'.PHP_EOL;
                $return .= '      <div class="camDataEnum">'.PHP_EOL;
                $return .= '        <div class="camDataEnumBlock">'.PHP_EOL;
                $return .= '          <div id="camButtonPreDef1" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS1).'</div>'.PHP_EOL;
                if ($this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS2)<>'') {
                    $return .= '          <div id="camButtonPreDef2" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS2).'</div>'.PHP_EOL;
                }
                if ($this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS3)<>'') {
                    $return .= '          <div id="camButtonPreDef3" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS3).'</div>'.PHP_EOL;
                }
                if ($this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS4)<>'') {
                    $return .= '          <div id="camButtonPreDef4" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS4).'</div>'.PHP_EOL;
                }
                if ($this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS5)<>'') {
                    $return .= '          <div id="camButtonPreDef5" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS5).'</div>'.PHP_EOL;
                }
                if ($this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS6)<>'') {
                    $return .= '          <div id="camButtonPreDef6" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_PREDEFPOS6).'</div>'.PHP_EOL;
                }
                $return .= '        </div>'.PHP_EOL;
                $return .= '      </div>'.PHP_EOL;
                $return .= '    </div>'.PHP_EOL;
                $return .= '  </div>'.PHP_EOL;
                $return .= '</div>'.PHP_EOL;
            }
            if ($showCommandButtons  and $this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND1)<>'') {
                $return .= '<div class="camContainer">'.PHP_EOL;
                $return .= '  <div class="camContent">'.PHP_EOL;
                $return .= '    <div class="camIcon td">'.PHP_EOL;
                $return .= '      <div class="camIconImage"> </div>'.PHP_EOL;
                $return .= '    </div>'.PHP_EOL;
                $return .= '    <div class="camTitle">'.PHP_EOL;
                $return .= '      <div class="camText">Licht</div>'.PHP_EOL;
                $return .= '    </div>'.PHP_EOL;
                $return .= '    <div class="camData">'.PHP_EOL;
                $return .= '      <div class="camDataEnum">'.PHP_EOL;
                $return .= '        <div class="camDataEnumBlock">'.PHP_EOL;
                $return .= '          <div id="camButtonCommand1" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND1).'</div>'.PHP_EOL;
                if ($this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND2)<>'') {
                    $return .= '          <div id="camButtonCommand2" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND2).'</div>'.PHP_EOL;
                }
                if ($this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND3)<>'') {
                    $return .= '          <div id="camButtonCommand3" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND3).'</div>'.PHP_EOL;
                }
                if ($this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND4)<>'') {
                    $return .= '          <div id="camButtonCommand4" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND4).'</div>'.PHP_EOL;
                }
                if ($this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND5)<>'') { /*Von mir hinzugefügt*/
                    $return .= '          <div id="camButtonCommand5" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND5).'</div>'.PHP_EOL;
                }
                if ($this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND6)<>'') { /*Von mir hinzugefügt*/
                    $return .= '          <div id="camButtonCommand6" class="camButton" cameraidx="'.$cameraIdx.'">'.$this->GetCameraProperty($cameraIdx, IPSCAM_PROPERTY_COMMAND6).'</div>'.PHP_EOL;
                }
                $return .= '        </div>'.PHP_EOL;
                $return .= '      </div>'.PHP_EOL;
                $return .= '    </div>'.PHP_EOL;
                $return .= '  </div>'.PHP_EOL;
                $return .= '</div>'.PHP_EOL;
            }

            return $return;
        }


    }


    /** @}*/
?>

IPSCAM_CameraReceiver Skript

<?
    /**@addtogroup ipscam
     * @{
     *
     * @file          IPSCam_Receiver.php
     * @author        Andreas Brauneis
     * @version
     *    Version 2.50.1, 23.09.2012<br/>
     *
     * Empfangs Script um Requests (JQuery) der HTML Seiten zu bearbeiten.
     *
     */

    $id         = $_POST['id'];
    $cameraIdx  = $_POST['cameraidx'];
    IPSUtils_Include ("IPSCam.inc.php", "IPSLibrary::app::modules::IPSCam");

    $camManager = new IPSCam_Manager();

    IPSLogger_Dbg(__file__, 'Process IPSCam Command='.$id.' for Camera='.$cameraIdx);

    switch ($id) {
        // Predefined Commands
        // ---------------------------------------------------------------------------------------
        case 'camButtonCommand1':
            $camManager->ProcessCommand($cameraIdx, IPSCAM_PROPERTY_ACTION1);
            break;
        case 'camButtonCommand2':
            $camManager->ProcessCommand($cameraIdx, IPSCAM_PROPERTY_ACTION2);
            break;
        case 'camButtonCommand3':
            $camManager->ProcessCommand($cameraIdx, IPSCAM_PROPERTY_ACTION3);
            break;
        case 'camButtonCommand4':
            $camManager->ProcessCommand($cameraIdx, IPSCAM_PROPERTY_ACTION4);
            break;
        case 'camButtonCommand5':
            $camManager->ProcessCommand($cameraIdx, IPSCAM_PROPERTY_ACTION5);
            break;
        case 'camButtonCommand6':
            $camManager->ProcessCommand($cameraIdx, IPSCAM_PROPERTY_ACTION6);
            break;

        // Navigation
        // ---------------------------------------------------------------------------------------
        case 'camButtonNavLeft':
            $camManager->Move($cameraIdx, IPSCAM_URL_MOVELEFT);
            break;
        case 'camButtonNavRight':
            $camManager->Move($cameraIdx, IPSCAM_URL_MOVERIGHT);
            break;
        case 'camButtonNavUp':
            $camManager->Move($cameraIdx, IPSCAM_URL_MOVEUP);
            break;
        case 'camButtonNavDown':
            $camManager->Move($cameraIdx, IPSCAM_URL_MOVEDOWN);
            break;
            
        // Predefined Positions
        // ---------------------------------------------------------------------------------------
        case 'camButtonPreDef1':
            $camManager->Move($cameraIdx, IPSCAM_URL_PREDEFPOS1);
            break;
        case 'camButtonPreDef2':
            $camManager->Move($cameraIdx, IPSCAM_URL_PREDEFPOS2);
            break;
        case 'camButtonPreDef3':
            $camManager->Move($cameraIdx, IPSCAM_URL_PREDEFPOS3);
            break;
        case 'camButtonPreDef4':
            $camManager->Move($cameraIdx, IPSCAM_URL_PREDEFPOS4);
            break;
        case 'camButtonPreDef5':
            $camManager->Move($cameraIdx, IPSCAM_URL_PREDEFPOS5);
            break;
        case 'camButtonPreDef6':
            $camManager->Move($cameraIdx, IPSCAM_URL_PREDEFPOS6);
            break;
            
        default:
            IPSLogger_Err(__file__, "Received Unknown IPSCam Command=".$id);
    }

    /** @}*/
?>

Das ist meine IPSComponentCam_Technaxx67

<?
    /*
     * This file is part of the IPSLibrary.
     *
     * The IPSLibrary is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published
     * by the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * The IPSLibrary is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with the IPSLibrary. If not, see http://www.gnu.org/licenses/gpl.txt.
     */

     /**@addtogroup ipscomponent
     * @{
     *
     * @file          IPSComponentCam_Foscam89x.class.php
     * @author        Andreas Brauneis
     *
     */

    /**
    * @class IPSComponentCam_Foscam89x
    *
    * Definiert ein IPSComponentCam Object, das die Funktionen einer Cam Componente für eine
    * Foscam89x Kamera implementiert
    *
    * @author Andreas Brauneis
    * @version
    *   Version 2.50.1, 10.08.2013<br/>
    */

    IPSUtils_Include ('IPSComponentCam.class.php', 'IPSLibrary::app::core::IPSComponent::IPSComponentCam');

    class IPSComponentCam_Technaxx67 extends IPSComponentCam {

        private $ipAddress;
        private $username;
        private $password;

        /**
         * @public
         *
         * Initialisierung eines IPSComponentCam_Foscam89x Objektes
         *
         * @param string $ipAddress IP Adresse der Kamera
         * @param string $username Username für Kamera Zugriff
         * @param string $password Passwort für Kamera Zugriff
         */
        public function __construct($ipAddress, $username, $password) {
            $this->ipAddress  = $ipAddress;
            $this->username   = $username;
            $this->password   = $password;
        }

            /**
         * @public
         *
         * Funktion liefert String IPSComponent Constructor String.
         * String kann dazu benützt werden, das Object mit der IPSComponent::CreateObjectByParams
         * wieder neu zu erzeugen.
         *
         * @return string Parameter String des IPSComponent Object
         */
        public function GetComponentParams() {
            return get_class($this).','.$this->instanceId;
        }

        /**
         * @public
         *
         * Function um Events zu behandeln, diese Funktion wird vom IPSMessageHandler aufgerufen, um ein aufgetretenes Event
         * an das entsprechende Module zu leiten.
         *
         * @param integer $variable ID der auslösenden Variable
         * @param string $value Wert der Variable
         * @param IPSModuleCam $module Module Object an das das aufgetretene Event weitergeleitet werden soll
         */
        public function HandleEvent($variable, $value, IPSModuleCam $module) {
            $name = IPS_GetName($variable);
            throw new IPSComponentException('Event Handling NOT supported for Variable '.$variable.'('.$name.')');
        }

        /**
         * @public
         *
         * Liefert URL des Kamera Live Streams
         *
         * @param integer $size Größe des Streams, mögliche Werte:
         *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE
         * @return string URL des Streams
         */
        public function Get_URLLiveStream($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {
            $url = 'http://'.$this->username.':'.$this->password.'@'.$this->ipAddress.'/cgi-bin/mjpg/video.cgi?channel=0&subtype=1';

            switch ($size) {
                case  IPSCOMPONENTCAM_SIZE_SMALL:
                    $url .= '&resolution=8&rate=0';
                    break;
                case  IPSCOMPONENTCAM_SIZE_MIDDLE:
                    $url .= '&resolution=8&rate=0';
                    break;
                case  IPSCOMPONENTCAM_SIZE_LARGE:
                    $url .= '&resolution=32&rate=0';
                    break;

                default:
                    trigger_error('Unknown Size '.$size);
            }
            return $url;
        }

        /**
         * @public
         *
         * Liefert URL des Kamera Bildes
         *
         * @param integer $size Größe des Bildes, mögliche Werte:
         *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE
         * @return string URL des Bildes
         */
        public function Get_URLPicture($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {

            $url = 'http://'.$this->username.':'.$this->password.'@'.$this->ipAddress.'/cgi-bin/snapshot.cgi?';

            switch ($size) {
                case  IPSCOMPONENTCAM_SIZE_SMALL:
                    $url .= '&resolution=8&rate=0';
                    break;
                case  IPSCOMPONENTCAM_SIZE_MIDDLE:
                    $url .= '&resolution=8&rate=0';
                    break;
                case  IPSCOMPONENTCAM_SIZE_LARGE:
                    $url .= '&resolution=32&rate=0';
                    break;

                default:
                    trigger_error('Unknown Size '.$size);
            }
            return $url;
        }

        /**
         * @public
         *
         * Bewegen der Kamera
         *
         * @param integer $urlType Type der URL die geliefert werden soll.
         *                         mögliche Werte: IPSCOMPONENTCAM_URL_MOVEHOME
                                                   IPSCOMPONENTCAM_URL_MOVELEFT
                                                   IPSCOMPONENTCAM_URL_MOVERIGHT
                                                   IPSCOMPONENTCAM_URL_MOVEUP
                                                   IPSCOMPONENTCAM_URL_MOVEDOWN
                                                   IPSCOMPONENTCAM_URL_PREDEFPOS1
                                                   IPSCOMPONENTCAM_URL_PREDEFPOS2
                                                   IPSCOMPONENTCAM_URL_PREDEFPOS3
                                                   IPSCOMPONENTCAM_URL_PREDEFPOS4
                                                   IPSCOMPONENTCAM_URL_PREDEFPOS5
         */
        public function Get_URL($urlType) {
            $url = 'http://'.$this->ipAddress.'/cgi-bin/ptz.cgi?action=start&channel=0&code='.$this->username.'&pwd='.$this->password;
            $url = 'http://'.$this->username.':'.$this->password.'@'.$this->ipAddress.'/cgi-bin/ptz.cgi?action=start&channel=0&code=';

            switch ($urlType) {
                    case IPSCOMPONENTCAM_URL_MOVELEFT:
                        $url = $url.'=Left&arg1=0&arg2=1&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_MOVERIGHT: 
                        $url = $url.'=Right&arg1=0&arg2=1&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_MOVEUP:
                        $url = $url.'=Up&arg1=0&arg2=1&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_MOVEDOWN: 
                        $url = $url.'=Down&arg1=0&arg2=1&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_MOVEHOME:
                        $url = $url.'command=1';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS1:
                        $url = $url.'GotoPreset&arg1=0&arg2=1&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS2:
                        $url = $url.'GotoPreset&arg1=0&arg2=2&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS3:
                        $url = $url.'GotoPreset&arg1=0&arg2=3&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS4:
                        $url = $url.'GotoPreset&arg1=0&arg2=4&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS5:
                        $url = $url.'GotoPreset&arg1=0&arg2=5&arg3=0';
                        break;
                    case IPSCOMPONENTCAM_URL_PREDEFPOS6:
                        $url = $url.'GotoPreset&arg1=0&arg2=6&arg3=0';
                        break;
                default:
                    trigger_error('Diese Funktion ist für eine Foxcam Kamera noch NICHT implementiert !!!');
            }

            return $url;

    }

        /**
         * @public
         *
         * Liefert Breite des Kamera Bildes
         *
         * @param integer $size Größe des Bildes, mögliche Werte:
         *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE
         * @return integer Breite des Bildes in Pixel
         */
        public function Get_Width($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {
            switch ($size) {
                case  IPSCOMPONENTCAM_SIZE_SMALL:
                    $return = 320;
                    break;
                case  IPSCOMPONENTCAM_SIZE_MIDDLE:
                    $return = 320;
                    break;
                case  IPSCOMPONENTCAM_SIZE_LARGE:
                    $return = 640;
                    break;

                default:
                    trigger_error('Unknown Size '.$size);
            }
            return $return;
        }

        /**
         * @public
         *
         * Liefert Höhe des Kamera Bildes
         *
         * @param integer $size Größe des Bildes, mögliche Werte:
         *                      IPSCOMPONENTCAM_SIZE_SMALL, IPSCOMPONENTCAM_SIZE_MIDDLE oder IPSCOMPONENTCAM_SIZE_LARGE
         * @return integer Höhe des Bildes in Pixel
         */
        public function Get_Height($size=IPSCOMPONENTCAM_SIZE_MIDDLE) {
            switch ($size) {
                case  IPSCOMPONENTCAM_SIZE_SMALL:
                    $return = 240;
                    break;
                case  IPSCOMPONENTCAM_SIZE_MIDDLE:
                    $return = 240;
                    break;
                case  IPSCOMPONENTCAM_SIZE_LARGE:
                    $return = 480;
                    break;
                default:
                    trigger_error('Unknown Size '.$size);
            }
            return $return;
        }
    }

    /** @}*/
?>

Und hier noch meine Config

<?
    /*
     * This file is part of the IPSLibrary.
     *
     * The IPSLibrary is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published
     * by the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * The IPSLibrary is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with the IPSLibrary. If not, see http://www.gnu.org/licenses/gpl.txt.
     */

    /**@defgroup ipscam_configuration IPSCam Konfiguration
     * @ingroup ipscam
     * @{
     *
     * @file          IPSCam_Configuration.inc.php
     * @author        Andreas Brauneis
     * @version
     *  Version 2.50.1, 09.08.2012<br/>
     *
     * Konfigurations File für IPSCam
     *
     */

    /**
     *
     * Definition der Kameras
     *
     * Die Konfiguration erfolgt in Form eines Arrays, für jede Kamera wird ein Eintrag im Array erzeugt.
     *   IPSCAM_PROPERTY_NAME - Name der Kamera
     *
     *   IPSCAM_PROPERTY_TYPE        - Type der Kamera (unterstüzte Werte: IPSCAM_TYPE_MOVABLECAM und IPSCAM_TYPE_FIXEDCAM)
     *
     *   IPSCAM_PROPERTY_COMPONENT   - Kamera Component Definition 
     *
     *   IPSCAM_PROPERTY_SWITCHPOWER - ID der Varible, die für das Schalten der Stromversorgung verwendet wird [optional]
     *   IPSCAM_PROPERTY_SWITCHWLAN  - ID der Varible, die für das Schalten des WLAN verwendet wird [optional]
     *
     *   IPSCAM_PROPERTY_PREDEFPOS1  - Bezeichnung für vordefinierte Kameraposition 1 [optional]
     *   IPSCAM_PROPERTY_PREDEFPOS2  - Bezeichnung für vordefinierte Kameraposition 2 [optional]
     *   IPSCAM_PROPERTY_PREDEFPOS3  - Bezeichnung für vordefinierte Kameraposition 3 [optional]
     *   IPSCAM_PROPERTY_PREDEFPOS4  - Bezeichnung für vordefinierte Kameraposition 4 [optional]
     *
     *   IPSCAM_PROPERTY_COMMAND1    - Name für vordefinierte Kamera Action 1 [optional]
     *   IPSCAM_PROPERTY_COMMAND2    - Name für vordefinierte Kamera Action 2 [optional]
     *   IPSCAM_PROPERTY_COMMAND3    - Name für vordefinierte Kamera Action 3 [optional]
     *   IPSCAM_PROPERTY_COMMAND4    - Name für vordefinierte Kamera Action 4 [optional]
     *
     *   IPSCAM_PROPERTY_ACTION1     - ActionScript für vordefinierte Kamera Action 1 (alternativ auch IPSComponentSensor Definition möglich) [optional]
     *   IPSCAM_PROPERTY_ACTION2     - ActionScript für vordefinierte Kamera Action 2 (alternativ auch IPSComponentSensor Definition möglich) [optional]
     *   IPSCAM_PROPERTY_ACTION3     - ActionScript für vordefinierte Kamera Action 3 (alternativ auch IPSComponentSensor Definition möglich) [optional]
     *   IPSCAM_PROPERTY_ACTION4     - ActionScript für vordefinierte Kamera Action 4 (alternativ auch IPSComponentSensor Definition möglich) [optional]
     *
     * Eine ausführliche Beispielliste findet sich auch im Example Ordner
     *
     * Beispiel:
     * @code
        function IPSCam_GetCamConfiguration() {
          return array(
            0    => array(IPSCAM_PROPERTY_NAME        => 'Wohnzimmer',
                          IPSCAM_PROPERTY_TYPE        => IPSCAM_TYPE_MOVABLECAM,
                          IPSCAM_PROPERTY_COMPONENT   => 'IPSComponentCam_Edimax,192.168.0.14,username,password',
                          IPSCAM_PROPERTY_SWITCHPOWER => '11625',
                          IPSCAM_PROPERTY_SWITCHWLAN  => '52861',
                          IPSCAM_PROPERTY_PREDEFPOS1  => 'Decke',
                          IPSCAM_PROPERTY_PREDEFPOS2  => 'Wohnzimmer',
                          IPSCAM_PROPERTY_PREDEFPOS3  => 'Stiege',
                          IPSCAM_PROPERTY_COMMAND1    => 'Licht Esstisch',
                          IPSCAM_PROPERTY_ACTION1     => 12345 /*[Program\IPSLibrary\data\modules\IPSShadowing\Devices\Device5\Movement]*/,
                         /* IPSCAM_PROPERTY_COMMAND2    => 'Licht Wohnzimmer',
                          IPSCAM_PROPERTY_ACTION2     => 'IPSModuleSensor_IPSLight,IPSLight_ToggleSwitchByName,Wohnzimmer',
                          IPSCAM_PROPERTY_COMMAND3    => 'Licht Wohnbereich',
                          IPSCAM_PROPERTY_ACTION3     => 'IPSModuleSensor_IPSLight,IPSLight_ToggleSwitchByName,Wohnbereich',
             );
        }
     * @endcocde
     *
     * @return string Liefert Array mit den Kameras
     */
    function IPSCam_GetConfiguration() {
        return array(
            0    => array(IPSCAM_PROPERTY_NAME        => 'Hofkamera',
                          IPSCAM_PROPERTY_TYPE        => IPSCAM_TYPE_MOVABLECAM,
                          IPSCAM_PROPERTY_COMPONENT   => 'IPSComponentCam_Technaxx67,moosranch.my-router.de:4000,IPSCam,5aphaela',
                          IPSCAM_PROPERTY_PREDEFPOS1  => 'Tor ohne Zoom',
                          IPSCAM_PROPERTY_PREDEFPOS2  => 'Tor mit Zoom',  
                          IPSCAM_PROPERTY_PREDEFPOS3  => 'Haustüre', 
                          IPSCAM_PROPERTY_PREDEFPOS4  => 'Stall', 
                          IPSCAM_PROPERTY_PREDEFPOS5  => 'Koppel ohne Zoom', 
                          IPSCAM_PROPERTY_PREDEFPOS6  => 'Koppel mit Zoom', 
                          ),
        );
    }

    /**
     * Höhe des HTML Elements für kleine Streams im WebFront
     */
    define ("IPSCAM_HEIGHT_SMALL",    340);

    /**
     * Höhe des HTML Elements für normale Streams im WebFront
     */
    define ("IPSCAM_HEIGHT_MIDDLE",   520);

    /**
     * Höhe des HTML Elements für große Streams im WebFront
     */
    define ("IPSCAM_HEIGHT_LARGE",    800);

    /**
     * Breite der HTML Elemente in der Mobile GUI (Auflösung des Displays)
     */
    define ("IPSCAM_WIDTH_MOBILE",    960);

    /** @}*/
?>

Hat hier jemand eine Idee und kann mir helfen??

Vielen Dank!!!

Grüße

Stephan

Kann mir niemand helfen oder einen Tipp geben? Ich finde einfach den Fehler nicht, warum funktionieren fünf gespeicherte Ansichten und eine nicht??

Danke schon mal. Wäre wirklich super wenn jemand helfen würde, Danke!!

Ich vermute ganz stark, dass das Kameramodul nur 5 Positionen unterstützt. Zumindest finden sich in der IPSComponentCam.class.php nur 5 Positionen:

	define ('IPSCOMPONENTCAM_URL_PREDEFPOS1',		100);
	define ('IPSCOMPONENTCAM_URL_PREDEFPOS2',		101);
	define ('IPSCOMPONENTCAM_URL_PREDEFPOS3',		102);
	define ('IPSCOMPONENTCAM_URL_PREDEFPOS4',		103);
	define ('IPSCOMPONENTCAM_URL_PREDEFPOS5',		104);

Ansonsten müsstest du vielleicht brownson mal direkt ansprechen.

Gruß

Burkhard