";
if(AttrVal($camname,"ptzPanel_use",1)) {
my $ptz_ret = SSCam_ptzpanel($camname);
@@ -5852,7 +5879,15 @@ sub SSCam_StreamDev($$$) {
Your browser does not support the video tag
";
$ret .= "$imgstop ";
- $ret .= "$imghlsreact ";
+ $ret .= "$imghlsreact ";
+ if(ReadingsVal($camname, "Record", "Stop") eq "Stop") {
+ # Aufnahmebutton endlos Start
+ $ret .= "$imgrecendless ";
+ } else {
+ # Aufnahmebutton Stop
+ $ret .= "$imgrecstop ";
+ }
+ $ret .= "$imgdosnap ";
$ret .= "";
if(AttrVal($camname,"ptzPanel_use",1)) {
my $ptz_ret = SSCam_ptzpanel($camname);
@@ -5863,7 +5898,7 @@ sub SSCam_StreamDev($$$) {
}
} else {
my $cam = AttrVal($camname, "alias", $camname);
- $cause = "Videostream of camera \"$cam\" is switched off";
+ $cause = "Playback cam \"$cam\" switched off";
$ret .= "
$cause
";
$ret .= "$imgmjpegrun ";
$ret .= "$imghlsrun " if($hlslfw);
@@ -5890,7 +5925,7 @@ return $ret;
# Schnappschußgalerie zusammenstellen
###############################################################################
sub composegallery ($;$$) {
- my ($name,$wlname,$model) = @_;
+ my ($name,$strmdev,$model) = @_;
my $hash = $defs{$name};
my $camname = $hash->{CAMNAME};
my $allsnaps = $hash->{HELPER}{".SNAPHASH"}; # = \%allsnaps
@@ -5908,20 +5943,22 @@ sub composegallery ($;$$) {
my $ha = AttrVal($name, "snapGalleryHtmlAttr", AttrVal($name, "htmlattr", 'width="500" height="325"'));
# falls "composegallery" durch ein mit "createSnapGallery" angelegtes Device aufgerufen wird
- my ($devWlink,$wlhash,$wlha,$wlalias);
- if ($wlname) {
- $wlalias = AttrVal($wlname, "alias", $wlname); # Linktext als Aliasname oder Devicename setzen
- $devWlink = "$wlalias";
- $wlhash = $defs{$wlname};
- $wlha = AttrVal($wlname, "htmlattr", undef);
- $ha = (defined($wlha))?$wlha:$ha; # htmlattr vom weblink-Device übernehmen falls von wl-Device aufgerufen und gesetzt
+ my ($devWlink);
+ if ($strmdev) {
+ if($defs{$strmdev}{TYPE} ne "SSCamSTRM") {
+ # Abfrage wegen Kompatibilität zu "alten" compose mit weblink-Modul
+ my $sdalias = AttrVal($strmdev, "alias", $strmdev); # Linktext als Aliasname oder Devicename setzen
+ $devWlink = "$sdalias ";
+ }
+ my $wlha = AttrVal($strmdev, "htmlattr", undef);
+ $ha = (defined($wlha))?$wlha:$ha; # htmlattr vom weblink-Device übernehmen falls von wl-Device aufgerufen und gesetzt
} else {
$devWlink = " ";
}
# wenn Weblink genutzt wird und attr "snapGalleryBoost" nicht gesetzt ist -> Warnung in Gallerie ausgeben
my $sgbnote = " ";
- if($wlname && !AttrVal($name,"snapGalleryBoost",0)) {
+ if($strmdev && !AttrVal($name,"snapGalleryBoost",0)) {
$sgbnote = "CAUTION - No snapshots can be retrieved. Please set the attribute \"snapGalleryBoost=1\" in device $name" if ($lang eq "EN");
$sgbnote = "ACHTUNG - Es können keine Schnappschüsse abgerufen werden. Bitte setzen sie das Attribut \"snapGalleryBoost=1\" im Device $name" if ($lang eq "DE");
}
@@ -5943,7 +5980,7 @@ sub composegallery ($;$$) {
# Ausgabetabelle erstellen
my ($htmlCode,$ct);
$htmlCode = "";
- $htmlCode .= sprintf("$devWlink
$header ");
+ $htmlCode .= sprintf("$devWlink
$header ");
$htmlCode .= "
";
$htmlCode .= "";
$htmlCode .= "
";
@@ -6512,14 +6549,16 @@ sub SSCam_experror {
-
set <name> [on|off] (valid for CAM)
+
set <name> [on [<rectime>] | off] (valid for CAM)
- The command "set <name> on" starts a recording. The default recording time takes 15 seconds. It can be changed by the attribute "rectime" individualy.
- With the attribute (respectively the default value) provided recording time can be overwritten once by "set <name> on [rectime]".
+ The command "set <name> on" starts a recording. The default recording time takes 15 seconds. It can be changed by
+ the attribute "rectime" individualy.
+ With the attribute (respectively the default value) provided recording time can be overwritten
+ once by "set <name> on <rectime>".
The recording will be stopped after processing time "rectime"automatically.
- A special case is the start using "set <name> on 0" respectively the attribute value "rectime = 0". In that case a endless-recording will be started. One have to stop this recording
- by command "set <name> off" explicitely.
+ A special case is start recording by "set <name> on 0" respectively the attribute value "rectime = 0". In that case
+ a endless-recording will be started. One have to stop this recording by command "set <name> off" explicitely.
The recording behavior can be impacted with attribute "recextend" furthermore as explained as follows.
- Der Befehl "set <name> on" startet eine Aufnahme. Die Standardaufnahmedauer beträgt 15 Sekunden. Sie kann mit dem Attribut "rectime" individuell festgelegt werden.
- Die im Attribut (bzw. im Standard) hinterlegte Aufnahmedauer kann einmalig mit "set <name> on [rectime]" überschrieben werden.
+ Der Befehl "set <name> on" startet eine Aufnahme. Die Standardaufnahmedauer beträgt 15 Sekunden. Sie kann mit dem
+ Attribut "rectime" individuell festgelegt werden.
+ Die im Attribut (bzw. im Standard) hinterlegte Aufnahmedauer kann einmalig mit "set <name> on <rectime>"
+ überschrieben werden.
Die Aufnahme stoppt automatisch nach Ablauf der Zeit "rectime".
- Ein Sonderfall ist der Start einer Daueraufnahme mit "set <name> on 0" bzw. dem Attributwert "rectime = 0". In diesem Fall wird eine Daueraufnahme gestartet die
- explizit wieder mit dem Befehl "set <name> off" gestoppt werden muß.
+ Ein Sonderfall ist der Start einer Daueraufnahme mit "set <name> on 0" bzw. dem Attributwert "rectime = 0".
+ In diesem Fall wird eine Daueraufnahme gestartet, die explizit wieder mit dem Befehl "set <name> off" gestoppt
+ werden muß.
- Das Aufnahmeverhalten kann weiterhin mit dem Attribut "recextend" wie folgt beeinflusst werden.
+ Das Aufnahmeverhalten kann weiterhin mit dem Attribut "recextend" beeinflusst werden.
Attribut "recextend = 0" bzw. nicht gesetzt (Standard):
Hinweis:
- Abhängig von der Anzahl und Auflösung (Qualität) der Schnappschuß-Images werden entsprechende ausreichende CPU und/oder
+ Abhängig von der Anzahl und Auflösung (Qualität) der Schnappschuß-Images werden entsprechend ausreichende CPU und/oder
RAM-Ressourcen benötigt.
diff --git a/fhem/FHEM/49_SSCamSTRM.pm b/fhem/FHEM/49_SSCamSTRM.pm
index 99168367e..e212167ba 100644
--- a/fhem/FHEM/49_SSCamSTRM.pm
+++ b/fhem/FHEM/49_SSCamSTRM.pm
@@ -28,6 +28,8 @@
#########################################################################################################################
# Versions History:
#
+# 1.0.0 14.06.2018 switch to longpoll refresh
+# 0.4 13.06.2018 new attribute "noDetaillink" (deleted in V1.0.0)
# 0.3 12.06.2018 new attribute "forcePageRefresh"
# 0.2 11.06.2018 check in with SSCam 5.0.0
# 0.1 10.06.2018 initial Version
@@ -37,9 +39,8 @@ package main;
use strict;
use warnings;
-use vars qw($FW_subdir); # Sub-path in URL for extensions, e.g. 95_FLOORPLAN
-my $SSCamSTRMVersion = "0.3";
+my $SSCamSTRMVersion = "1.0.0";
################################################################
sub SSCamSTRM_Initialize($) {
@@ -49,7 +50,8 @@ sub SSCamSTRM_Initialize($) {
$hash->{AttrList} = "disable:1,0 forcePageRefresh:1,0 htmlattr ";
$hash->{FW_summaryFn} = "SSCamSTRM_FwFn";
$hash->{FW_detailFn} = "SSCamSTRM_FwFn";
- $hash->{FW_atPageEnd} = 1;
+ $hash->{AttrFn} = "SSCamSTRM_Attr";
+ # $hash->{FW_atPageEnd} = 1;
}
@@ -68,26 +70,34 @@ sub SSCamSTRM_Define($$) {
$hash->{VERSION} = $SSCamSTRMVersion;
$hash->{LINK} = $link;
+ $attr{$name}{alias} = ".";
- readingsBeginUpdate($hash);
- readingsBulkUpdate($hash,"state", "initialized"); # Init für "state"
- readingsEndUpdate($hash,1);
+ readingsSingleUpdate($hash,"state", "initialized", 1); # Init für "state"
return undef;
}
################################################################
-sub SSCamSTRM_FwDetail($@) {
- my ($d, $text, $nobr)= @_;
- return "" if(AttrVal($d, "group", ""));
- my $alias = AttrVal($d, "alias", $d);
+sub SSCamSTRM_Attr($$$$) {
+ my ($cmd,$name,$aName,$aVal) = @_;
+ my $hash = $defs{$name};
+ my ($do,$val);
+
+ # $cmd can be "del" or "set"
+ # $name is device name
+ # aName and aVal are Attribute name and value
+
+ if ($aName eq "disable") {
+ if($cmd eq "set") {
+ $do = ($aVal) ? 1 : 0;
+ }
+ $do = 0 if($cmd eq "del");
+ $val = ($do == 1 ? "Stream-device of \"$hash->{PARENT}\" disabled" : "initialized");
+
+ readingsSingleUpdate($hash, "state", $val, 1);
+ }
- my $ret = ($nobr ? "" : " ");
- $ret .= "$text " if($text);
- $ret .= FW_pHPlain("detail=$d", $alias) if(!$FW_subdir);
- $ret .= " ";
-
-return $ret;
+return undef;
}
################################################################
@@ -95,14 +105,13 @@ sub SSCamSTRM_FwFn($$$$) {
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
my $hash = $defs{$d};
my $link = $hash->{LINK};
- my $ret = "";
-
- return "" if(IsDisabled($d));
- my $attr = AttrVal($d, "htmlattr", "");
+ return undef if(IsDisabled($d));
- $link = AnalyzePerlCommand(undef, $link) if($link =~ m/^{(.*)}$/s);
- $ret = $link;
+ $link = AnalyzePerlCommand(undef, $link) if($link =~ m/^{(.*)}$/s);
+
+ my $ret = "";
+ $ret .= $link;
return $ret;
}
@@ -116,6 +125,26 @@ return $ret;
SSCamSTRM
+
+The module SSCamSTRM is a special device module synchronized to the SSCam module. It is used for definition of
+Streaming-Devices.
+Dependend of the Streaming-Device state, different buttons are provided to start actions:
+
+
+
+
MJPEG
- starts a MJPEG Livestream
+
HLS
- starts HLS (HTTP Live Stream)
+
Last Record
- playback the last recording as iFrame
+
Last Rec H.264
- playback the last recording if available as H.264
+
Last Rec MJPEG
- playback the last recording if available as MJPEG
+
Last SNAP
- show the last snapshot
+
Start Recording
- starts an endless recording
+
Stop Recording
- stopps the recording
+
Take Snapshot
- take a snapshot
+
Switch off
- stops a running playback
+
+
+
@@ -158,9 +187,8 @@ return $ret;
HTML attributes to be used for Streaming device e.g.:
+
+Das Modul SSCamSTRM ist ein mit SSCam abgestimmtes Gerätemodul zur Definition von Streaming-Devices.
+Abhängig vom Zustand des Streaming-Devices werden zum Start von Aktionen unterschiedliche Drucktasten angeboten:
+
+
+
+
MJPEG
- Startet MJPEG Livestream
+
HLS
- Startet HLS (HTTP Live Stream)
+
Last Record
- spielt die letzte Aufnahme als iFrame
+
Last Rec H.264
- spielt die letzte Aufnahme wenn als H.264 vorliegend
+
Last Rec MJPEG
- spielt die letzte Aufnahme wenn als MJPEG vorliegend
+
Last SNAP
- zeigt den letzten Snapshot
+
Start Recording
- startet eine Endlosaufnahme
+
Stop Recording
- stoppt eine Aufnahme
+
Take Snapshot
- löst einen Schnappschuß aus
+
Switch off
- stoppt eine laufende Wiedergabe
+
+
+
+
Define
@@ -217,9 +265,8 @@ return $ret;
HTML-Attribute zur Darstellungsänderung des SSCam Streaming Device z.B.: