From 5377076280f948b8716630547e0576f9830bf985 Mon Sep 17 00:00:00 2001
From: nasseeder1 <>
Date: Mon, 7 Mar 2016 22:35:51 +0000
Subject: [PATCH] 49_SSCAM: new attribute "videofolderMap", "uninitialized
value $lastrecstoptime", "uninitialized value $lastrecstarttime"
git-svn-id: https://svn.fhem.de/fhem/trunk@11025 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/CHANGED | 3 +++
fhem/FHEM/49_SSCam.pm | 36 +++++++++++++++++++++++++++++-------
2 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/fhem/CHANGED b/fhem/CHANGED
index 508bafc15..4ab38fac6 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.
+ - bugfix 49_SSCAM: "uninitialized value $lastrecstarttime",
+ "uninitialized value $lastrecstoptime"
+ - feature 49_SSCAM: new attribute "videofolderMap", see commandref
- feature 31_MilightDevice: added white "hsv" transitions, fixed RGB
- feature 49_SSCAM: Reading "CamLastRec" added which contains Path/name
of last recording
diff --git a/fhem/FHEM/49_SSCam.pm b/fhem/FHEM/49_SSCam.pm
index e7feba246..eb5b5db69 100644
--- a/fhem/FHEM/49_SSCam.pm
+++ b/fhem/FHEM/49_SSCam.pm
@@ -27,6 +27,9 @@
##########################################################################################################
# Versions History:
#
+# 1.19.3 07.03.2016 bugfix "uninitialized value $lastrecstarttime",
+# "uninitialized value $lastrecstoptime",
+# new attribute "videofolderMap"
# 1.19.2 06.03.2016 Reading "CamLastRec" added which contains Path/name
# of last recording
# 1.19.1 28.02.2016 enhanced command runView by option "link_open" to
@@ -129,6 +132,7 @@ sub SSCam_Initialize($) {
"httptimeout ".
"htmlattr ".
"livestreamprefix ".
+ "videofolderMap ".
"pollcaminfoall ".
"pollnologging:1,0 ".
"debugactivetoken:1 ".
@@ -234,7 +238,7 @@ sub SSCam_Attr {
}
if ($aName eq "httptimeout") {
unless ($aVal =~ /^[0-9]+$/) { return " The Value for $aName is not valid. Use only figures 1-9 !";}
- }
+ }
}
return undef;
}
@@ -408,14 +412,14 @@ sub SSCam_Set {
} else {
$hash->{HELPER}{OPENWINDOW} = 0;
}
-
+
$hash->{HELPER}{WLTYPE} = $prop;
runliveview($hash);
}
elsif ($opt eq "stopView")
{
stopliveview($hash);
- }
+ }
else
{
return $setlist;
@@ -498,8 +502,9 @@ sub SSCam_liveview ($$$$) {
# $alias = AttrVal($d, "alias", $d)."_liveview";
$alias = "LiveCam";
$ret = "$alias
"; # wenn attr target=_blank neuer Browsertab
+
}
-
+
return $ret;
}
@@ -3013,7 +3018,7 @@ sub camret_nonbl ($) {
readingsBulkUpdate($hash,"LastUpdateTime",$update_time);
readingsBulkUpdate($hash,"Record",$recStatus);
readingsBulkUpdate($hash,"UsedSpaceMB",$data->{'data'}->{'cameras'}->[0]->{'volume_space'});
- readingsBulkUpdate($hash,"VideoFolder",$data->{'data'}->{'cameras'}->[0]->{'folder'});
+ readingsBulkUpdate($hash,"VideoFolder",AttrVal($name, "videofolderMap", undef) ? AttrVal($name, "videofolderMap", undef) : $data->{'data'}->{'cameras'}->[0]->{'folder'});
readingsBulkUpdate($hash,"Errorcode","none");
readingsBulkUpdate($hash,"Error","none");
readingsEndUpdate($hash, 1);
@@ -3052,7 +3057,7 @@ sub camret_nonbl ($) {
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"CamEventNum",$eventnum);
readingsBulkUpdate($hash,"CamLastRec",$lastrecord);
- readingsBulkUpdate($hash,"CamLastRecTime",$lastrecstarttime." - ". $lastrecstoptime);
+ if ($lastrecstarttime) {readingsBulkUpdate($hash,"CamLastRecTime",$lastrecstarttime." - ". $lastrecstoptime);}
readingsBulkUpdate($hash,"Errorcode","none");
readingsBulkUpdate($hash,"Error","none");
readingsEndUpdate($hash, 1);
@@ -4012,8 +4017,10 @@ return;
For example the Reading "Availability" will be set to "disconnected" if the Camera would be disconnected from Synology Surveillance Station and can be used for further
processing like creating events.
By command "get <name> eventlist" the Reading "CamEventNum" and "CamLastRecord" will be refreshed which containes the total number of in SVS
- registered camera events and the path / name of the last recording..
+ registered camera events and the path / name of the last recording.
This command will be implicit executed when "get ... caminfoall" is running.
+ The attribute "videofolderMap" replaces the content of reading "VideoFolder". You can use it for example if you have mounted the videofolder of SVS
+ under another name or path and want to access by your local pc.
Using "get <name> snapfileinfo" the filename of the last snapshot will be retrieved. This command will be executed with "get <name> snap" automatically.
The command "get <name> svsinfo" is not really dependend on a camera, but rather a command to determine common informations about the installed SVS-version and other properties.
The functions "caminfoall" and "svsinfo" will be executed automatically once-only after FHEM restarts to collect some relevant informations for camera control.
@@ -4157,6 +4164,8 @@ return;
+ define CamHE1.snap.email DOIF ([CamHE1:"LastSnapFilename"]) + ({DebianMailnbl ('Recipient@Domain','Bewegungsalarm CamHE1','Eine Bewegung wurde an der Haustür registriert. Aufnahmelink: \ + \[CamHE1:VideoFolder]\[CamHE1:CamLastRec]','/media/sf_surveillance/@Snapshot/[CamHE1:LastSnapFilename]')}) ++ Mit "get <name> snapfileinfo" wird der Filename des letzten Schnapschusses ermittelt. Der Befehl wird implizit mit "get <name> snap" ausgeführt.