diff --git a/fhem/CHANGED b/fhem/CHANGED
index c99bc851f..a3a24c807 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,8 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - change: 49_SSCam: version 2.2.1, last record playback possible as iFrame,
+ deviceoverview available,
+ CAUTION - syntax of runView options has been changed !!
- change: 22_HOMEMODE: v1.1.0 please change %ALARM% to %ALARMHR%
- change: 93_DbRep: version 4.15.0, limitation of fetchrows result to 1000
adjustable by attr limit, performance increased in many
diff --git a/fhem/FHEM/49_SSCam.pm b/fhem/FHEM/49_SSCam.pm
index d38e9e886..ed7dcc4d1 100644
--- a/fhem/FHEM/49_SSCam.pm
+++ b/fhem/FHEM/49_SSCam.pm
@@ -27,6 +27,11 @@
#########################################################################################################################
# Versions History:
#
+# 2.2.1 15.05.2017 avoid FW_detailFn because of FW_deviceOverview is active (double streams in detailview if on)
+# 2.2.0 10.05.2017 check if JSON module has been loaded successfully, DeviceOverview available, options of
+# runView changed image->live_fw, link->live_link, link_open->live_open, lastrec ->lastrec_fw,
+# commandref revised
+# 2.1.4 08.05.2017 commandref changed
# 2.1.3 05.05.2017 issue of operation error if CAMID is set and SID isn't valid, more login-errorcodes evaluation
# 2.1.2 04.05.2017 default login retries increased to 3
# 2.1.1 17.04.2017 runliveview routine changed, {HELPER}{SID_STRM} deleted
@@ -43,8 +48,7 @@
# 1.35 17.09.2016 internal timer of start-routines optimized
# 1.34 15.09.2016 simu_SVSversion changed, added 407 errorcode message, external recording changed
# for SVS 7.2
-# 1.33 21.08.2016 function get stmUrlPath added, fit to new commandref style, attribute showStmInfoFull
-# added
+# 1.33 21.08.2016 function get stmUrlPath added, fit to new commandref style, attribute showStmInfoFull added
# 1.32.1 18.08.2016 empty event LastSnapId fixed
# 1.32 17.08.2016 Logging of verbose 4 changed
# 1.31 15.08.2016 Attr "noQuotesForSID" added, avoid possible 402 - permission denied problems
@@ -154,9 +158,9 @@
#
package main;
-
-use JSON qw( decode_json ); # from CPAN, Debian: apt-get install libjson-perl
-use Data::Dumper; # Perl Core module
+
+eval "use JSON qw( decode_json );1" or my $SScamMMDBI = "JSON"; # Debian: apt-get install libjson-perl
+use Data::Dumper; # Perl Core module
use strict;
use warnings;
use MIME::Base64;
@@ -164,7 +168,7 @@ use Time::HiRes;
use HttpUtils;
# no if $] >= 5.017011, warnings => 'experimental';
-my $SSCamVersion = "2.1.3";
+my $SSCamVersion = "2.2.1";
# Aufbau Errorcode-Hashes (siehe Surveillance Station Web API)
my %SSCam_errauthlist = (
@@ -218,8 +222,9 @@ sub SSCam_Initialize($) {
$hash->{GetFn} = "SSCam_Get";
$hash->{AttrFn} = "SSCam_Attr";
# Aufrufe aus FHEMWEB
- $hash->{FW_summaryFn} = "SSCam_liveview";
- $hash->{FW_detailFn} = "SSCam_liveview";
+ $hash->{FW_summaryFn} = "SSCam_FWview";
+ # $hash->{FW_detailFn} = "SSCam_FWview";
+ $hash->{FW_deviceOverview} = 1;
$hash->{AttrList} =
"disable:1,0 ".
@@ -253,6 +258,8 @@ sub SSCam_Define {
my ($hash, $def) = @_;
my $name = $hash->{NAME};
+ return "Error: Perl module ".$SScamMMDBI." is missing. Install it on Debian with: sudo apt-get install libjson-perl" if($SScamMMDBI);
+
my @a = split("[ \t][ \t]*", $def);
if(int(@a) < 4) {
@@ -400,7 +407,7 @@ sub SSCam_Set {
"snap ".
"enable ".
"disable ".
- "runView:image,lastrec,lastrec_open,link,link_open ".
+ "runView:live_fw,live_link,live_open,lastrec_fw,lastrec_open ".
"stopView:noArg ".
"extevent:1,2,3,4,5,6,7,8,9,10 ".
((ReadingsVal("$name", "CapPTZPan", "false") ne "false") ? "runPatrol:".ReadingsVal("$name", "Patrols", "")." " : "").
@@ -572,19 +579,35 @@ sub SSCam_Set {
return "module is deactivated" if(IsDisabled($name));
if (!$hash->{CREDENTIALS}) {return "Credentials of $name are not set - make sure you've set it with \"set $name credentials username password\"";}
- if ($prop eq "link_open") {
- $prop = "link";
+ if ($prop eq "live_open") {
if ($prop1) {$hash->{HELPER}{VIEWOPENROOM} = $prop1;} else {delete $hash->{HELPER}{VIEWOPENROOM};}
$hash->{HELPER}{OPENWINDOW} = 1;
- $hash->{HELPER}{WLTYPE} = $prop;
- } elsif ($prop eq "lastrec_open") {
- $prop = "lastrec";
- if ($prop1) {$hash->{HELPER}{VIEWOPENROOM} = $prop1;} else {delete $hash->{HELPER}{VIEWOPENROOM};}
- $hash->{HELPER}{OPENWINDOW} = 1;
- $hash->{HELPER}{WLTYPE} = $prop;
- } else {
+ $hash->{HELPER}{WLTYPE} = "link";
+ $hash->{HELPER}{ALIAS} = "LiveView";
+ $hash->{HELPER}{RUNVIEW} = "live_open";
+ } elsif ($prop eq "live_link") {
$hash->{HELPER}{OPENWINDOW} = 0;
- $hash->{HELPER}{WLTYPE} = $prop;
+ $hash->{HELPER}{WLTYPE} = "link";
+ $hash->{HELPER}{ALIAS} = "LiveView";
+ $hash->{HELPER}{RUNVIEW} = "live_link";
+ } elsif ($prop eq "lastrec_open") {
+ if ($prop1) {$hash->{HELPER}{VIEWOPENROOM} = $prop1;} else {delete $hash->{HELPER}{VIEWOPENROOM};}
+ $hash->{HELPER}{OPENWINDOW} = 1;
+ $hash->{HELPER}{WLTYPE} = "link";
+ $hash->{HELPER}{ALIAS} = "LastRecording";
+ $hash->{HELPER}{RUNVIEW} = "lastrec_open";
+ } elsif ($prop eq "lastrec_fw") {
+ $hash->{HELPER}{OPENWINDOW} = 0;
+ $hash->{HELPER}{WLTYPE} = "iframe";
+ $hash->{HELPER}{ALIAS} = " ";
+ $hash->{HELPER}{RUNVIEW} = "lastrec";
+ } elsif ($prop eq "live_fw") {
+ $hash->{HELPER}{OPENWINDOW} = 0;
+ $hash->{HELPER}{WLTYPE} = "image";
+ $hash->{HELPER}{ALIAS} = " ";
+ $hash->{HELPER}{RUNVIEW} = "live_fw";
+ } else {
+ return "$prop isn't a valid option of runview, use one of live_fw, live_link, live_open, lastrec_fw, lastrec_open";
}
runliveview($hash);
@@ -664,8 +687,10 @@ return;
######################################################################################
# Kamera Liveview Anzeige in FHEMWEB
######################################################################################
-sub SSCam_liveview ($$$$) {
- my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash für summaryFn in FHEMWEB
+# wird von FW aufgerufen. $FW_wname = aufrufende Webinstanz, $d = aufrufendes
+# Device (z.B. CamCP1)
+sub SSCam_FWview ($$$$) {
+ my ($FW_wname, $d, $room, $pageHash) = @_; # # pageHash is set for summaryFn in FHEMWEB
my $hash = $defs{$d};
my $name = $hash->{NAME};
my $link = $hash->{HELPER}{LINK};
@@ -675,25 +700,21 @@ sub SSCam_liveview ($$$$) {
return if(!$hash->{HELPER}{LINK} || ReadingsVal("$name", "state", "") =~ /^dis.*/ || IsDisabled($name));
+ Log3($name, 5, "$name - SSCam_FWview called by FW_wname: $FW_wname, device: $d, room: $room");
my $attr = AttrVal($d, "htmlattr", "");
if($wltype eq "image") {
- $ret = "
";
+ $ret = "
" .weblink_FwDetail($d);
} elsif($wltype eq "iframe") {
- $ret = "";
+ $ret = "" .weblink_FwDetail($d);
} elsif($wltype eq "link") {
- # $alias = AttrVal($d, "alias", $d)."_liveview";
- $alias = "LiveCam";
+ $alias = $hash->{HELPER}{ALIAS};
$ret = "$alias
"; # wenn attr target=_blank neuer Browsertab
-
- } elsif($wltype eq "lastrec") {
- $alias = "LastRecording";
- $ret = "$alias
"; # wenn attr target=_blank neuer Browsertab
-
+
}
-
+ # FW_directNotify("FILTER=room=$room", "#FHEMWEB:$FW_wname", "location.reload('true')", "") if($d eq $name);
return $ret;
}
@@ -1242,7 +1263,7 @@ sub stopliveview ($) {
if ($hash->{HELPER}{ACTIVE} eq "off") {
- # kurzer state-switch -> Browser aktualisieren
+ # kurzer state-switch -> Browser aktualisieren
readingsSingleUpdate($hash,"state","stopview",1);
# Liveview stoppen
@@ -1262,6 +1283,7 @@ sub stopliveview ($) {
# Reading LiveStreamUrl löschen
delete($defs{$name}{READINGS}{LiveStreamUrl}) if ($defs{$name}{READINGS}{LiveStreamUrl});
+ # vorhandenen Aufnahmestatus wieder herstellen
if (ReadingsVal("$name", "Record", "") eq "Start") {
readingsSingleUpdate( $hash,"state", "on", 1);
} else {
@@ -1272,7 +1294,7 @@ sub stopliveview ($) {
if ($attr{$name}{debugactivetoken}) {
Log3($name, 3, "$name - Active-Token deleted by OPMODE: $hash->{OPMODE}");
}
-
+
} else {
RemoveInternalTimer($hash, "stopliveview");
InternalTimer(gettimeofday()+0.5, "stopliveview", $hash, 0);
@@ -2561,7 +2583,7 @@ sub sscam_camop ($) {
$url = "http://$serveraddr:$serverport/webapi/$apiextevtpath?api=$apiextevt&version=$apiextevtmaxver&method=Trigger&eventId=$hash->{HELPER}{EVENTID}&eventName=$hash->{HELPER}{EVENTID}&_sid=\"$sid\"";
} elsif ($OpMode eq "runliveview") {
- if ($hash->{HELPER}{WLTYPE} ne "lastrec") {
+ if ($hash->{HELPER}{RUNVIEW} =~ m/live/) {
# externe URL
$livestream = !AttrVal($name, "livestreamprefix", undef) ? "http://$serveraddr:$serverport" : AttrVal($name, "livestreamprefix", undef);
$livestream .= "/webapi/$apivideostmpath?api=$apivideostm&version=$apivideostmmaxver&method=Stream&cameraId=$camid&format=mjpeg&_sid=\"$sid\"";
@@ -2574,7 +2596,7 @@ sub sscam_camop ($) {
$url = "http://$serveraddr:$serverport/webapi/$apistmpath?api=$apistm&version=$apistmmaxver&method=EventStream&eventId=$hash->{HELPER}{CAMLASTRECID}&_sid=$sid";
}
- # Liveview-Link in Hash speichern -> Anzeige über SSCam_liveview, in Reading setzen für Linkversand
+ # Liveview-Link in Hash speichern -> Anzeige über SSCam_FWview, in Reading setzen für Linkversand
$hash->{HELPER}{LINK} = $url;
Log3($name, 4, "$name - Set Streaming-URL: $url");
@@ -3784,8 +3806,8 @@ sub experror {
1;
=pod
-=item summary operate surveillance cameras which are defined in Synology Surveillance Station
-=item summary_DE steuert Kameras welche in der Synology Surveillance Station definiert sind
+=item summary operates surveillance cameras defined in Synology Surveillance Station
+=item summary_DE steuert Kameras welche der Synology Surveillance Station
=begin html
@@ -3933,6 +3955,7 @@ sub experror {
set ... credentials | - |
get ... caminfoall | session: ServeillanceStation - observer |
get ... eventlist | session: ServeillanceStation - observer |
+ get ... scanVirgin | session: ServeillanceStation - observer |
get ... svsinfo | session: ServeillanceStation - observer |
get ... snapfileinfo | session: ServeillanceStation - observer |
get ... stmUrlPath | session: ServeillanceStation - observer |
@@ -3943,8 +3966,8 @@ sub experror {
HTTP-Timeout Settings
- All functions of the SSCam-Module are using HTTP-Calls to the SVS Web API.
- The Default-Value of the HTTP-Timeout amounts 4 seconds. You can set the Attribute "httptimeout" > 0 to adjust the value as needed in your technical environment.
+ All functions of SSCam use HTTP-calls to SVS Web API.
+ The default-value of HTTP-Timeout amounts 4 seconds. You can set the attribute "httptimeout" > 0 to adjust the value as needed in your technical environment.
@@ -3977,7 +4000,8 @@ sub experror {
- "set <name> [on] [off]"
+
+ - set <name> [on] [off]
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]".
@@ -4013,11 +4037,11 @@ sub experror {
set <name> on [rectime] | starts a recording of camera <name>, stops automatically after [rectime] (default 15s or defined by attribute) |
set <name> off | stops the recording of camera <name> |
-
-
+
+
-
- "set <name> snap"
+
+ - set <name> snap
A snapshot can be triggered with:
@@ -4042,10 +4066,14 @@ sub experror {
The ID and the filename of the last snapshot will be displayed as value of variable "LastSnapId" respectively "LastSnapFilename" in the device-Readings.
+
+
- "set <name> [enable] [disable]"
+
+ - set <name> [enable] [disable]
- For
deactivating / activating a list of cameras or all cameras using a Regex-expression, subsequent two examples using "at":
+ For deactivating / activating a list of cameras or all cameras by Regex-expression, subsequent two
+ examples using "at":
define a13 at 21:46 set CamCP1,CamFL,CamHE1,CamTER disable (enable)
define a14 at 21:46 set Cam.* disable (enable)
@@ -4068,21 +4096,24 @@ sub experror {
define all_cams_enable notify allcams:on set CamCP1,CamFL,CamHE1,CamTER enable
attr all_cams_enable room Cams
+
- "set <name> expmode [day] [night] [auto]"
+
+ - set <name> expmode [day] [night] [auto]
With this command you are able to control the exposure mode and can set it to day, night or automatic mode.
Thereby, for example, the behavior of camera LED's will be suitable controlled.
The successful switch will be reported by the reading CamExposureMode (command "get ... caminfoall").
- Hint:
+ Note:
The successfully execution of this function depends on if SVS supports that functionality of the connected camera.
Is the field for the Day/Night-mode shown greyed in SVS -> IP-camera -> optimization -> exposure mode, this function will be probably unsupported.
+
+
-
-
- "set <name> motdetsc [camera] [SVS] [disable]"
+
+ - set <name> motdetsc [camera] [SVS] [disable]
The command "motdetsc" (stands for "motion detection source") switchover the motion detection to the desired mode.
If motion detection will be done by camera / SVS without any parameters, the original camera motion detection settings are kept.
@@ -4125,12 +4156,13 @@ sub experror {
Example:
- CamMotDetSc SVS, sensitivity: 76, threshold: 55
+ CamMotDetSc SVS, sensitivity: 76, threshold: 55
-
+
- "set <name> goPreset <Preset>"
+
+ - set <name> goPreset <Preset>
Using this command you can move PTZ-cameras to a predefined position.
The Preset-positions have to be defined first of all in the Synology Surveillance Station. This usually happens in the PTZ-control of IP-camera setup in SVS.
@@ -4162,10 +4194,11 @@ sub experror {
2016.02.04 15:02:39 2: CamFL - Snapshot of Camera Flur_Vorderhaus has been done successfully
2016.02.04 15:02:44 2: CamFL - Camera Flur_Vorderhaus has moved to position "Home"
-
+
- "set <name> runPatrol <Patrolname>"
+
+ - set <name> runPatrol <Patrolname>
This commans starts a predefined patrol (tour) of a PTZ-camera.
At first the patrol has to be predefined in the Synology Surveillance Station. It can be done in the PTZ-control of IP-Kamera Setup -> PTZ-control -> patrol.
@@ -4173,9 +4206,11 @@ sub experror {
The import process can be repeated regular by camera polling. A long polling interval is recommendable in this case because of the patrols are only will be changed
if the user change it in the IP-camera setup itself.
Further informations for creating patrols you can get in the online-help of Surveillance Station.
+
- "set <name> goAbsPTZ [ X Y | up | down | left | right ]"
+
+ - set <name> goAbsPTZ [ X Y | up | down | left | right ]
This command can be used to move a PTZ-camera to an arbitrary absolute X/Y-coordinate, or to absolute position using up/down/left/right.
The option is only available for cameras which are having the Reading "CapPTZAbs=true". The property of a camera can be requested with "get <name> caminfoall" .
@@ -4206,10 +4241,11 @@ sub experror {
In this case the lense will be moved with largest possible increment into the given absolute position.
Also in this case the procedure has to be repeated to bring the lense into the desired position if necessary.
-
-
+
+
- set <name> move [ up | down | left | right | dir_X ] [seconds]
+
+ - set <name> move [ up | down | left | right | dir_X ] [seconds]
With this command a continuous move of a PTZ-camera will be started. In addition to the four basic directions up/down/left/right is it possible to use angular dimensions
"dir_X". The grain size of graduation depends on properties of the camera and can be identified by the Reading "CapPTZDirections".
@@ -4228,14 +4264,23 @@ sub experror {
set <name> move dir_1 1.5 : moves PTZ 1,5 Sek. (plus processing time) to top-right
set <name> move dir_20 0.7 : moves PTZ 1,5 Sek. (plus processing time) to left-bottom ("CapPTZDirections = 32)"
+
+
-
+
+ - set <name> runView live_fw | live_link | live_open [<room>] | lastrec_fw | lastrec_open [<room>]
- set <name> runView [ image | lastrec | lastrec_open | link | link_open <room> ]
+ With "live_fw, live_link, live_open" a livestream (mjpeg-stream) of a camera will be started, either as embedded image
+ or as a generated link.
+ The option "live_open" starts a new browser window. If the optional <room> was set, the window will only be
+ started if the specified room is currently opend in a browser session.
- With "image, link, link_open" a livestream (mjpeg-stream) of a camera will be started, either as embedded image or as a generated link.
- Access to the last recording of a camera can be done using "lastrec" respectively "lastrec_open".
- The behavior of livestream in FHEMWEB can be affected by statements in attribute "htmlattr".
+ Access to the last recording of a camera can be done using "lastrec_fw" respectively "lastrec_open".
+ The recording will be opened in iFrame. So there are some control elements available, e.g. to increase/descrease
+ reproduce speed.
+
+ The art of windows in FHEMWEB can be affected by HTML-tags in attribute "htmlattr".
+
Examples:
@@ -4246,31 +4291,37 @@ sub experror {
With these attribute values a streaming link will be opened (by click on) in a new browser tab or windows. If the stream will be started as an image, the size changes appropriately the
values of width and hight.
- The command "set <name> runView link_open" starts the stream immediately in a new browser window (longpoll=1 must be set for WEB).
- A browser window will be initiated to open for every FHEM session which is active. If you want to change this,
- you can use command "set <name> runView link_open <room>" what initiates to open a browser window in that FHEM session that has just opend the room <room>.
- The settings of attribute "livestreamprefix" overwrites the data for protocol, servername and port in reading "LiveStreamUrl".
- By "livestreamprefix" the LivestreamURL (is shown if attribute "showStmInfoFull" is set) can be modified and used for distribution and external
- access to SVS livestream.
+
+ The command "set <name> runView live_open" starts the stream immediately in a new browser window (longpoll=1
+ must be set for WEB).
+ A browser window will be initiated to open for every FHEM session which is active. If you want to change this behavior,
+ you can use command "set <name> runView live_open <room>". It initiates open a browser window in that
+ FHEM session which has just opend the room <room>.
+
+ The settings of attribute "livestreamprefix" overwrites the data for protocol, servername and
+ port in reading "LiveStreamUrl".
+ By "livestreamprefix" the LivestreamURL (is shown if attribute "showStmInfoFull" is set) can
+ be modified and used for distribution and external access to SVS livestream.
Example:
attr <name> livestreamprefix https://<Servername>:<Port>
- The livestream will be stopped again using command "set <name> stopView" .
-
+ The livestream can be stopped again by command "set <name> stopView".
+
- set <name> extevent [ 1-10 ]
+
+ - set <name> extevent [ 1-10 ]
This command triggers an external event (1-10) in SVS.
The actions which will are used have to be defined in the actionrule editor of SVS at first. There are the events 1-10 possible.
In the message application of SVS you may select Email, SMS or Mobil (DS-Cam) messages to release if an external event has been triggerd.
Further informations can be found in the online help of the actionrule editor.
The used user needs to be a member of the admin-group and DSM-session is needed too.
-
-
+
+
@@ -4279,10 +4330,11 @@ sub experror {
Get
- With SSCam the properties of SVS and defined Cameras could be retrieved. Actually it could be done by using the following commands:
+ With SSCam the properties of SVS and defined Cameras could be retrieved. Actually it could be done by following commands:
get <name> caminfoall
get <name> eventlist
+ get <name> scanVirgin
get <name> stmUrlPath
get <name> svsinfo
get <name> snapfileinfo
@@ -4302,13 +4354,17 @@ sub experror {
Please consider to save the credentials what will be used for login to DSM or SVS !
- get <name> scanVirgin
+
+ - get <name> scanVirgin
This command is similar to get caminfoall, informations relating to SVS and the camera will be retrieved.
In difference to caminfoall in either case a new session ID will be generated (do a new login), the camera ID will be
- new identified and all necessary API-parameters will be new investigated.
+ new identified and all necessary API-parameters will be new investigated.
+
+
- get <name> stmUrlPath
+
+ - get <name> stmUrlPath
This command is to fetch the streamkey information and streamurl using that streamkey. The reading "StmKey" will be filled when this command will be executed and can be used
to send it and run by your own application like a browser (see example).
@@ -4317,7 +4373,7 @@ sub experror {
The strUrlPath function will be included automatically if polling is used.
- Example to create an http-call to a livestream using the StmKey:
+ Example to create an http-call to a livestream using StmKey:
http(s)://<hostname><port>/webapi/entry.cgi?api=SYNO.SurveillanceStation.VideoStreaming&version=1&method=Stream&format=mjpeg&cameraId=5&StmKey="31fd87279976d89bb98409728cced890"
@@ -4325,15 +4381,15 @@ sub experror {
cameraId (INTERNAL), StmKey has to be replaced by valid values.
- Hint:
+ Note:
If you use the stream-call from external and replace hostname / port with valid values and open your router ip ports, please make shure that no
unauthorized person could get this sensible data !
-
+
Polling of Camera-Properties:
-
+
Retrieval of Camera-Properties can be done automatically if the attribute "pollcaminfoall" will be set to a value > 10.
As default that attribute "pollcaminfoall" isn't be set and the automatic polling isn't be active.
The value of that attribute determines the interval of property-retrieval in seconds. If that attribute isn't be set or < 10 the automatic polling won't be started
@@ -4354,7 +4410,7 @@ sub experror {
- The meaning of reading values is described under Readings .
+ The readings are described here.
Notes:
@@ -4366,11 +4422,14 @@ sub experror {
If several Cameras are defined in SSCam, attribute "pollcaminfoall" of every Cameras shouldn't be set exactly to the same value to avoid processing bottlenecks
and thereby caused potential source of errors during request Synology Surveillance Station.
- A marginal difference between the polling intervals of the defined cameras, e.g. 1 second, can already be faced as sufficient value.
+ A marginal difference between the polling intervals of the defined cameras, e.g. 1 second, can already be faced as
+ sufficient value.
+
+
-Internals
+Internals
The meaning of used Internals is depicted in following list:
@@ -4458,37 +4517,67 @@ sub experror {
@@ -4665,6 +4752,7 @@ sub experror {
- set ... extevent
| session: DSM - Nutzer Mitglied von Admin-Gruppe |
- get ... caminfoall
| session: ServeillanceStation - Betrachter |
- get ... eventlist
| session: ServeillanceStation - Betrachter |
+ - get ... scanVirgin
| session: ServeillanceStation - Betrachter |
- get ... svsinfo
| session: ServeillanceStation - Betrachter |
- get ... snapfileinfo
| session: ServeillanceStation - Betrachter |
- get ... stmUrlPath
| session: ServeillanceStation - Betrachter |
@@ -4705,14 +4793,14 @@ sub experror {
"runPatrol <Patrolname>": | startet eine vordefinierte Überwachungstour einer PTZ-Kamera |
"goAbsPTZ [ X Y | up | down | left | right ]": | positioniert eine PTZ-camera zu einer absoluten X/Y-Koordinate oder maximalen up/down/left/right-position |
"move [ up | down | left | right | dir_X ]": | startet kontinuerliche Bewegung einer PTZ-Kamera in Richtung up/down/left/right bzw. dir_X |
- "runView [image | link | link_open | lastrec | lastrec_open | <room> ]": | startet einen Livestream als eingbettetes Image oder als Link |
+ "runView live_fw | live_link | live_open [<room>] | lastrec_fw | lastrec_open [<room>]": | startet einen Livestream als eingbettetes Image, IFrame bzw. Link |
"stopView": | stoppt einen Kamera-Livestream |
-
- "set <name> [on] [off]"
-
+
+ - set <name> [on] [off]
+
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".
@@ -4729,7 +4817,7 @@ sub experror {
- Attribut "recextend = 1" gesetzt:
+ Attribut "recextend = 1" gesetzt:
- eine zuvor gestartete Aufnahme wird bei einem erneuten "set on" -Befehl um die Aufnahmezeit "rectime" verlängert. Das bedeutet, dass der Timer für
den automatischen Stop auf den Wert "rectime" neu gesetzt wird. Dieser Vorgang wiederholt sich mit jedem Start-Befehl. Dadurch verlängert sich eine laufende
@@ -4747,11 +4835,11 @@ sub experror {
set <name> on [rectime] | startet die Aufnahme der Kamera <name>, automatischer Stop der Aufnahme nach Ablauf der Zeit [rectime] (default 15s oder wie im Attribut "rectime" angegeben) |
set <name> off | stoppt die Aufnahme der Kamera <name> |
-
-
+
+
-
- "set <name> snap"
+
+ - set <name> snap
Ein Schnappschuß kann ausgelöst werden mit:
@@ -4775,8 +4863,11 @@ sub experror {
Es wird die ID und der Filename des letzten Snapshots als Wert der Variable "LastSnapId" bzw. "LastSnapFilename" in den Readings der Kamera ausgegeben.
+
+
- "set <name> [enable] [disable]"
+
+ - set <name> [enable] [disable]
Um eine Liste von Kameras oder alle Kameras (mit Regex) zum Beispiel um 21:46 zu deaktivieren / zu aktivieren zwei Beispiele mit at:
@@ -4800,9 +4891,11 @@ sub experror {
define all_cams_enable notify allcams:on set CamCP1,CamFL,CamHE1,CamTER enable
attr all_cams_enable room Cams
+
- "set <name> expmode [day] [night] [auto]"
+
+
Es ist immer die Reihenfolge der Optionswerte zu beachten. Nicht gewünschte Optionen sind mit "0" zu besetzen sofern danach Optionen folgen
@@ -4857,10 +4951,10 @@ sub experror {
CamMotDetSc SVS, sensitivity: 76, threshold: 55
-
- "set <name> goPreset <Preset>"
+
+ - set <name> goPreset <Preset>
Mit diesem Kommando können PTZ-Kameras in eine vordefininierte Position bewegt werden.
Die Preset-Positionen müssen dazu zunächst in der Synology Surveillance Station angelegt worden sein. Das geschieht in der PTZ-Steuerung im IP-Kamera Setup.
@@ -4891,10 +4985,11 @@ sub experror {
2016.02.04 15:02:39 2: CamFL - Snapshot of Camera Flur_Vorderhaus has been done successfully
2016.02.04 15:02:44 2: CamFL - Camera Flur_Vorderhaus has moved to position "Home"
+
+
-
-
- "set <name> runPatrol <Patrolname>"
+
+ - set <name> runPatrol <Patrolname>
Dieses Kommando startet die vordefinierterte Überwachungstour einer PTZ-Kamera.
Die Überwachungstouren müssen dazu zunächst in der Synology Surveillance Station angelegt worden sein.
@@ -4903,9 +4998,11 @@ sub experror {
Der Einlesevorgang kann durch ein Kamerapolling regelmäßig wiederholt werden. Ein langes Pollingintervall ist in diesem Fall empfehlenswert, da sich die
Überwachungstouren nur im Fall der Neuanlage bzw. Änderung verändern werden.
Nähere Informationen zur Anlage von Überwachungstouren sind in der Hilfe zur Surveillance Station enthalten.
+
- "set <name> goAbsPTZ [ X Y | up | down | left | right ]"
+
+ - set <name> goAbsPTZ [ X Y | up | down | left | right ]
Mit diesem Kommando wird eine PTZ-Kamera in Richtung einer wählbaren absoluten X/Y-Koordinate bewegt, oder zur maximalen Absolutposition in Richtung up/down/left/right.
Die Option ist nur für Kameras verfügbar die das Reading "CapPTZAbs=true" (die Fähigkeit für PTZAbs-Aktionen) besitzen. Die Eigenschaften der Kamera kann mit "get <name> caminfoall" abgefragt werden.
@@ -4936,10 +5033,11 @@ sub experror {
verwendet werden. Die Optik wird in diesem Fall mit der größt möglichen Schrittweite zur Absolutposition in der angegebenen Richtung bewegt.
Auch in diesem Fall muß der Vorgang ggf. mehrfach wiederholt werden um die Kameralinse in die gewünschte Position zu bringen.
+
+
-
-
- set <name> move [ up | down | left | right | dir_X ] [Sekunden]
+
+ - set <name> move [ up | down | left | right | dir_X ] [Sekunden]
Mit diesem Kommando wird eine kontinuierliche Bewegung der PTZ-Kamera gestartet. Neben den vier Grundrichtungen up/down/left/right stehen auch
Zwischenwinkelmaße "dir_X" zur Verfügung. Die Feinheit dieser Graduierung ist von der Kamera abhängig und kann dem Reading "CapPTZDirections" entnommen werden.
@@ -4958,14 +5056,23 @@ sub experror {
set <name> move dir_1 1.5 : bewegt PTZ 1,5 Sek. (zzgl. Prozesszeit) nach rechts-oben
set <name> move dir_20 0.7 : bewegt PTZ 1,5 Sek. (zzgl. Prozesszeit) nach links-unten ("CapPTZDirections = 32)"
-
-
+
+
- set <name> runView [ image | lastrec | lastrec_open | link | link_open <room> ]
+
+ - set <name> runView live_fw | live_link | live_open [<room>] | lastrec_fw | lastrec_open [<room>]
- Mit "image, link, link_open" wird ein Livestream (mjpeg-Stream) der Kamera, entweder als eingebettetes Image oder als generierter Link, gestartet.
- Der Zugriff auf die letzte Aufnahme einer Kamera kann über die Zusätze "lastrec" bzw. "lastrec_open" erfolgen.
- Das Verhalten des Livestreams im FHEMWEB kann durch Angaben im Attribut "htmlattr" beeinflusst werden.
+ Mit "live_fw, live_link, live_open" wird ein Livestream (mjpeg-Stream) der Kamera, entweder als eingebettetes Image
+ oder als generierter Link, gestartet.
+ Die Option "live_open" startet ein separates Browserfenster mit dem Lifestream. Wird dabei optional der Raum mit
+ angegeben, wird das Browserfenster nur gestartet wenn dieser Raum aktuell im Browser geöffnet ist.
+
+ Der Zugriff auf die letzte Aufnahme einer Kamera kann über die Optionen "lastrec_fw" bzw. "lastrec_open" erfolgen.
+ Bei Verwendung von "lastrec_fw" wird die letzte Aufnahme als eingebettetes iFrame-Objekt abgespielt. Es stehen entsprechende
+ Steuerungselemente zur Wiedergabegeschwindigkeit usw. zur Verfügung.
+ Durch Angabe des optionalen Raumes bei "lastrec_open" erfolgt die gleiche Einschränkung wie bei "live_open".
+
+ Die Gestaltung der Fenster im FHEMWEB kann durch HTML-Tags im Attribut "htmlattr" beeinflusst werden.
Beispiel:
@@ -4974,13 +5081,16 @@ sub experror {
attr <name> htmlattr width=700,height=525,top=200,left=300
- Mit diesen Attributwerten öffnet der Link (mit Klick) als weiteres Fenster/Browsertab. Wird der Stream als Image gestartet, ändert sich die Größe entsprechend der
- Angaben von Width und Hight.
- Das Kommando "set <name> runView link_open" startet den Livestreamlink sofort in einem neuen Browserfenster (longpoll=1 muß für WEB gesetzt sein).
- Dabei wird für jede aktive FHEM-Session eine Fensteröffnung initiiert. Soll dieses Verhalten geändert werden, kann "set <name> runView link_open <room>"
- verwendet werden um das Öffnen des Browserwindows in einem beliebigen, in einer FHEM-Session angezeigten Raum <room>, zu initiieren.
- Das gesetzte Attribut "livestreamprefix" überschreibt im Reading "LiveStreamUrl" die Angaben für Protokoll, Servername und Port.
- Damit kann z.B. die LiveStreamUrl für den Versand und externen Zugriff auf die SVS modifiziert werden.
+ Mit diesen Attributwerten öffnet der Link (mit Klick) als weiteres Fenster/Browsertab. Wird der Stream als live_fw gestartet,
+ ändert sich die Größe entsprechend der Angaben von Width und Hight.
+ Das Kommando "set <name> runView live_open" startet den Livestreamlink sofort in einem neuen
+ Browserfenster (longpoll=1 muß für WEB gesetzt sein).
+ Dabei wird für jede aktive FHEM-Session eine Fensteröffnung initiiert. Soll dieses Verhalten geändert werden, kann
+ "set <name> runView live_open <room>" verwendet werden um das Öffnen des Browserwindows in einem
+ beliebigen, in einer FHEM-Session angezeigten Raum <room>, zu initiieren.
+ Das gesetzte Attribut "livestreamprefix" überschreibt im Reading "LiveStreamUrl"
+ die Angaben für Protokoll, Servername und Port. Damit kann z.B. die LiveStreamUrl für den Versand und externen Zugriff
+ auf die SVS modifiziert werden.
Beispiel:
@@ -4988,18 +5098,19 @@ sub experror {
Der Livestream wird über das Kommando "set <name> stopView" wieder beendet.
-
+
- set <name> extevent [ 1-10 ]
+
+ - set <name> extevent [ 1-10 ]
Dieses Kommando triggert ein externes Ereignis (1-10) in der SVS.
Die Aktionen, die dieses Ereignis auslöst, sind zuvor in dem Aktionsregeleditor der SVS einzustellen. Es stehen die Ereignisse 1-10 zur Verfügung.
In der Banchrichtigungs-App der SVS können auch Email, SMS oder Mobil (DS-Cam) Nachrichten ausgegeben werden wenn ein externes Ereignis ausgelöst wurde.
Nähere Informationen dazu sind in der Hilfe zum Aktionsregeleditor zu finden.
Der verwendete User benötigt Admin-Rechte in einer DSM-Session.
-
-
+
+
@@ -5043,13 +5154,17 @@ sub experror {
Es ist darauf zu achten dass die Credentials gespeichert wurden !
- get <name> scanVirgin
+
+ - get <name> scanVirgin
Wie mit get caminfoall werden alle Informationen der SVS und Kamera abgerufen. Allerdings wird in jedem Fall eine
neue Session ID generiert (neues Login), die Kamera-ID neu ermittelt und es werden alle notwendigen API-Parameter neu
- eingelesen.
+ eingelesen.
+
+
- get <name> stmUrlPath
+
+ - get <name> stmUrlPath
Mit diesem Kommando wird der aktuelle Streamkey der Kamera abgerufen und das Reading mit dem Key-Wert gefüllt.
Dieser Streamkey kann verwendet werden um eigene Aufrufe eines Livestreams aufzubauen (siehe Beispiel).
@@ -5071,7 +5186,8 @@ sub experror {
Falls der Stream-Aufruf versendet und von extern genutzt wird sowie hostname / port durch gültige Werte ersetzt und die Routerports entsprechend geöffnet
werden, ist darauf zu achten dass diese sensiblen Daten nicht durch unauthorisierte Personen für den Zugriff genutzt werden können !
-
+
+
Polling der Kameraeigenschaften:
@@ -5111,8 +5227,9 @@ sub experror {
Ein geringfügiger Unterschied zwischen den Pollingintervallen der definierten Kameras von z.B. 1s kann bereits als ausreichend angesehen werden.
+
-Internals
+Internals
Die Bedeutung der verwendeten Internals stellt die nachfolgende Liste dar:
@@ -5201,37 +5318,75 @@ sub experror {