mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
49_SSCAM: fixed a problem that manual updates using
"getcaminfoall" are leading to additional pollingloops if polling is used, attribute "debugactivetoken" added for debugging- use git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@10822 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e0a34494d4
commit
409337bb1e
4
CHANGED
4
CHANGED
@ -1,5 +1,9 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- bugfix: 49_SSCAM: fixed a problem that manual updates using
|
||||||
|
"getcaminfoall" are leading to additional pollingloops
|
||||||
|
if polling is used,
|
||||||
|
attribute "debugactivetoken" added for debugging-use
|
||||||
- feature: version: version command shows latest revision since last update
|
- feature: version: version command shows latest revision since last update
|
||||||
- feature: 02_RSS: new attribute itemtitle
|
- feature: 02_RSS: new attribute itemtitle
|
||||||
- bugfix: 57_Calendar: weekly recurring events on several weekdays, that
|
- bugfix: 57_Calendar: weekly recurring events on several weekdays, that
|
||||||
|
181
FHEM/49_SSCam.pm
181
FHEM/49_SSCam.pm
@ -27,6 +27,9 @@
|
|||||||
##########################################################################################################
|
##########################################################################################################
|
||||||
# Versions History:
|
# Versions History:
|
||||||
#
|
#
|
||||||
|
# 1.13.2 13.02.2016 fixed a problem that manual updates using "getcaminfoall" are
|
||||||
|
# leading to additional pollingloops if polling is used,
|
||||||
|
# attribute "debugactivetoken" added for debugging-use
|
||||||
# 1.13.1 12.02.2016 fixed a problem that a usersession won't be destroyed if a
|
# 1.13.1 12.02.2016 fixed a problem that a usersession won't be destroyed if a
|
||||||
# function couldn't be executed successfully
|
# function couldn't be executed successfully
|
||||||
# 1.13 feature for retrieval snapfilename added
|
# 1.13 feature for retrieval snapfilename added
|
||||||
@ -105,6 +108,7 @@ sub SSCam_Initialize($) {
|
|||||||
"httptimeout ".
|
"httptimeout ".
|
||||||
"pollcaminfoall ".
|
"pollcaminfoall ".
|
||||||
"pollnologging:1,0 ".
|
"pollnologging:1,0 ".
|
||||||
|
"debugactivetoken:1 ".
|
||||||
"rectime ".
|
"rectime ".
|
||||||
"session:SurveillanceStation,DSM ".
|
"session:SurveillanceStation,DSM ".
|
||||||
"webCmd ".
|
"webCmd ".
|
||||||
@ -368,7 +372,8 @@ sub SSCam_Get {
|
|||||||
# hier die Verarbeitung starten
|
# hier die Verarbeitung starten
|
||||||
if ($opt eq "caminfoall")
|
if ($opt eq "caminfoall")
|
||||||
{
|
{
|
||||||
&getcaminfoall($hash);
|
# "1" ist Statusbit für manuelle Abfrage, kein Einstieg in Pollingroutine
|
||||||
|
&getcaminfoall($hash,1);
|
||||||
}
|
}
|
||||||
elsif ($opt eq "svsinfo")
|
elsif ($opt eq "svsinfo")
|
||||||
{
|
{
|
||||||
@ -548,10 +553,9 @@ sub watchdogpollcaminfo ($) {
|
|||||||
&printlog($hash,$logstr,"3");
|
&printlog($hash,$logstr,"3");
|
||||||
|
|
||||||
# in $hash eintragen für späteren Vergleich (Changes von pollcaminfoall)
|
# in $hash eintragen für späteren Vergleich (Changes von pollcaminfoall)
|
||||||
$hash->{HELPER}{OLDVALPOLL} = AttrVal($name, "pollcaminfoall", undef);
|
$hash->{HELPER}{OLDVALPOLL} = $attr{$name}{pollcaminfoall};
|
||||||
|
|
||||||
# Pollingroutine aufrufen
|
&getcaminfoall($hash);
|
||||||
getcaminfoall($hash);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined($hash->{HELPER}{OLDVALPOLL}) and defined($attr{$name}{pollcaminfoall}) and $attr{$name}{pollcaminfoall} > 10) {
|
if (defined($hash->{HELPER}{OLDVALPOLL}) and defined($attr{$name}{pollcaminfoall}) and $attr{$name}{pollcaminfoall} > 10) {
|
||||||
@ -647,6 +651,11 @@ sub camstartrec ($) {
|
|||||||
$hash->{OPMODE} = "Start";
|
$hash->{OPMODE} = "Start";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -696,6 +705,11 @@ sub camstoprec ($) {
|
|||||||
$hash->{OPMODE} = "Stop";
|
$hash->{OPMODE} = "Stop";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -745,11 +759,16 @@ sub camexpmode ($) {
|
|||||||
$hash->{OPMODE} = "ExpMode";
|
$hash->{OPMODE} = "ExpMode";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InternalTimer(gettimeofday()+0.21, "camexpmode", $hash, 0);
|
InternalTimer(gettimeofday()+1.1, "camexpmode", $hash, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -796,6 +815,11 @@ sub camsnap ($) {
|
|||||||
$hash->{OPMODE} = "Snap";
|
$hash->{OPMODE} = "Snap";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -821,11 +845,16 @@ sub getsnapfilename ($) {
|
|||||||
$hash->{OPMODE} = "getsnapfilename";
|
$hash->{OPMODE} = "getsnapfilename";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
getapisites_nonbl($hash);
|
getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InternalTimer(gettimeofday()+0.22, "getsnapfilename", $hash, 0);
|
InternalTimer(gettimeofday()+0.23, "getsnapfilename", $hash, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -923,6 +952,11 @@ sub doptzaction ($) {
|
|||||||
$hash->{OPMODE} = $hash->{HELPER}{PTZACTION};
|
$hash->{OPMODE} = $hash->{HELPER}{PTZACTION};
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -948,6 +982,11 @@ sub movestop ($) {
|
|||||||
$hash->{OPMODE} = "movestop";
|
$hash->{OPMODE} = "movestop";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -975,6 +1014,11 @@ sub camenable ($) {
|
|||||||
$hash->{OPMODE} = "Enable";
|
$hash->{OPMODE} = "Enable";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1002,6 +1046,11 @@ sub camdisable ($) {
|
|||||||
$hash->{OPMODE} = "Disable";
|
$hash->{OPMODE} = "Disable";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1013,28 +1062,34 @@ sub camdisable ($) {
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
### Kamera alle Informationen abrufen (Get) bzw. Einstieg Polling
|
### Kamera alle Informationen abrufen (Get) bzw. Einstieg Polling
|
||||||
|
|
||||||
sub getcaminfoall ($) {
|
sub getcaminfoall {
|
||||||
my ($hash) = @_;
|
my ($hash,$mode) = @_;
|
||||||
my $camname = $hash->{CAMNAME};
|
my $camname = $hash->{CAMNAME};
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $logstr;
|
my $logstr;
|
||||||
|
my ($now,$new);
|
||||||
|
|
||||||
if ($hash->{HELPER}{ACTIVE} eq "off") {
|
getcaminfo($hash);
|
||||||
|
getcapabilities($hash);
|
||||||
|
getptzlistpreset($hash);
|
||||||
|
getptzlistpatrol($hash);
|
||||||
|
|
||||||
&getcaminfo($hash);
|
# wenn gesetzt = manuelle Abfrage,
|
||||||
&getcapabilities($hash);
|
if ($mode) {return;}
|
||||||
&getptzlistpreset($hash);
|
|
||||||
&getptzlistpatrol($hash);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
InternalTimer(gettimeofday()+0.53, "getcaminfoall", $hash, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (defined($attr{$name}{pollcaminfoall}) and $attr{$name}{pollcaminfoall} > 10) {
|
if (defined($attr{$name}{pollcaminfoall}) and $attr{$name}{pollcaminfoall} > 10) {
|
||||||
# Pollen wenn pollcaminfo > 10, sonst kein Polling
|
# Pollen wenn pollcaminfo > 10, sonst kein Polling
|
||||||
InternalTimer(gettimeofday()+$attr{$name}{pollcaminfoall}, "getcaminfoall", $hash, 0);
|
|
||||||
|
$new = gettimeofday()+$attr{$name}{pollcaminfoall};
|
||||||
|
|
||||||
|
InternalTimer($new, "getcaminfoall", $hash, 0);
|
||||||
|
|
||||||
|
if (!$attr{$name}{pollnologging}) {
|
||||||
|
$now = FmtTime(gettimeofday());
|
||||||
|
$new = FmtTime(gettimeofday()+$attr{$name}{pollcaminfoall});
|
||||||
|
$logstr = "Polling now: $now , next Polling: $new";
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1044,7 +1099,7 @@ sub getcaminfoall ($) {
|
|||||||
$logstr = "Polling of Camera $camname is currently deactivated";
|
$logstr = "Polling of Camera $camname is currently deactivated";
|
||||||
&printlog($hash,$logstr,"3");
|
&printlog($hash,$logstr,"3");
|
||||||
}
|
}
|
||||||
return undef;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
@ -1064,6 +1119,11 @@ sub getsvsinfo ($) {
|
|||||||
$hash->{OPMODE} = "Getsvsinfo";
|
$hash->{OPMODE} = "Getsvsinfo";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1090,11 +1150,16 @@ sub getcaminfo ($) {
|
|||||||
$hash->{OPMODE} = "Getcaminfo";
|
$hash->{OPMODE} = "Getcaminfo";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
|
getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InternalTimer(gettimeofday()+0.55, "getcaminfo", $hash, 0);
|
InternalTimer(gettimeofday()+1.33 , "getcaminfo", $hash, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1116,11 +1181,16 @@ sub getcapabilities ($) {
|
|||||||
$hash->{OPMODE} = "Getcapabilities";
|
$hash->{OPMODE} = "Getcapabilities";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InternalTimer(gettimeofday()+0.56, "getcapabilities", $hash, 0);
|
InternalTimer(gettimeofday()+1.56, "getcapabilities", $hash, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1148,11 +1218,16 @@ sub getptzlistpreset ($) {
|
|||||||
$hash->{OPMODE} = "Getptzlistpreset";
|
$hash->{OPMODE} = "Getptzlistpreset";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InternalTimer(gettimeofday()+0.57, "getptzlistpreset", $hash, 0);
|
InternalTimer(gettimeofday()+1.57, "getptzlistpreset", $hash, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1181,11 +1256,16 @@ sub getptzlistpatrol ($) {
|
|||||||
$hash->{OPMODE} = "Getptzlistpatrol";
|
$hash->{OPMODE} = "Getptzlistpatrol";
|
||||||
$hash->{HELPER}{ACTIVE} = "on";
|
$hash->{HELPER}{ACTIVE} = "on";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token was set by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
&getapisites_nonbl($hash);
|
&getapisites_nonbl($hash);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
InternalTimer(gettimeofday()+0.58, "getptzlistpatrol", $hash, 0);
|
InternalTimer(gettimeofday()+1 .58, "getptzlistpatrol", $hash, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1301,6 +1381,11 @@ sub login_nonbl ($) {
|
|||||||
# ausgeführte Funktion ist abgebrochen, Freigabe Funktionstoken
|
# ausgeführte Funktion ist abgebrochen, Freigabe Funktionstoken
|
||||||
$hash->{HELPER}{ACTIVE} = "off";
|
$hash->{HELPER}{ACTIVE} = "off";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token deleted by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
elsif ($myjson ne "") # wenn die Abfrage erfolgreich war ($data enthält die Ergebnisdaten des HTTP Aufrufes)
|
elsif ($myjson ne "") # wenn die Abfrage erfolgreich war ($data enthält die Ergebnisdaten des HTTP Aufrufes)
|
||||||
@ -1438,6 +1523,11 @@ sub login_nonbl ($) {
|
|||||||
# ausgeführte Funktion ist abgebrochen, Freigabe Funktionstoken
|
# ausgeführte Funktion ist abgebrochen, Freigabe Funktionstoken
|
||||||
$hash->{HELPER}{ACTIVE} = "off";
|
$hash->{HELPER}{ACTIVE} = "off";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token deleted by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1518,6 +1608,11 @@ sub getcamid_nonbl ($) {
|
|||||||
# ausgeführte Funktion ist abgebrochen, Freigabe Funktionstoken
|
# ausgeführte Funktion ist abgebrochen, Freigabe Funktionstoken
|
||||||
$hash->{HELPER}{ACTIVE} = "off";
|
$hash->{HELPER}{ACTIVE} = "off";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token deleted by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
elsif ($myjson ne "") # wenn die Abfrage erfolgreich war ($data enthält die Ergebnisdaten des HTTP Aufrufes)
|
elsif ($myjson ne "") # wenn die Abfrage erfolgreich war ($data enthält die Ergebnisdaten des HTTP Aufrufes)
|
||||||
@ -1578,6 +1673,11 @@ sub getcamid_nonbl ($) {
|
|||||||
# ausgeführte Funktion nicht erfolgreich, Freigabe Funktionstoken
|
# ausgeführte Funktion nicht erfolgreich, Freigabe Funktionstoken
|
||||||
$hash->{HELPER}{ACTIVE} = "off";
|
$hash->{HELPER}{ACTIVE} = "off";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token deleted by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1906,7 +2006,7 @@ sub camret_nonbl ($) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$rectime = AttrVal($name, "rectime",undef) ? AttrVal($name, "rectime",undef) : $hash->{HELPER}{RECTIME_DEF};
|
$rectime = $attr{$name}{rectime} ? $attr{$name}{rectime} : $hash->{HELPER}{RECTIME_DEF};
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($err ne "") # wenn ein Fehler bei der HTTP Abfrage aufgetreten ist
|
if ($err ne "") # wenn ein Fehler bei der HTTP Abfrage aufgetreten ist
|
||||||
@ -2320,12 +2420,12 @@ sub camret_nonbl ($) {
|
|||||||
# Logausgabe
|
# Logausgabe
|
||||||
$logstr = "Camera-Informations of $camname retrieved";
|
$logstr = "Camera-Informations of $camname retrieved";
|
||||||
# wenn "pollnologging" = 1 -> logging nur bei Verbose=4, sonst 2
|
# wenn "pollnologging" = 1 -> logging nur bei Verbose=4, sonst 2
|
||||||
if (defined(AttrVal($name, "pollnologging", undef)) and AttrVal($name, "pollnologging", undef) eq "1") {
|
if (defined($attr{$name}{pollnologging}) and $attr{$name}{pollnologging} eq "1") {
|
||||||
$verbose = 4;
|
$verbose = 4;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$verbose = 2;
|
$verbose = 3;
|
||||||
}
|
}
|
||||||
&printlog($hash,$logstr,$verbose);
|
&printlog($hash,$logstr,$verbose);
|
||||||
$logstr = "--- End Function cam: $OpMode nonblocking ---";
|
$logstr = "--- End Function cam: $OpMode nonblocking ---";
|
||||||
@ -2414,7 +2514,7 @@ sub camret_nonbl ($) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$verbose = 2;
|
$verbose = 3;
|
||||||
}
|
}
|
||||||
&printlog($hash,$logstr,$verbose);
|
&printlog($hash,$logstr,$verbose);
|
||||||
$logstr = "--- End Function cam: $OpMode nonblocking ---";
|
$logstr = "--- End Function cam: $OpMode nonblocking ---";
|
||||||
@ -2460,7 +2560,7 @@ sub camret_nonbl ($) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$verbose = 2;
|
$verbose = 3;
|
||||||
}
|
}
|
||||||
&printlog($hash,$logstr,$verbose);
|
&printlog($hash,$logstr,$verbose);
|
||||||
$logstr = "--- End Function cam: $OpMode nonblocking ---";
|
$logstr = "--- End Function cam: $OpMode nonblocking ---";
|
||||||
@ -2508,7 +2608,7 @@ sub camret_nonbl ($) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$verbose = 2;
|
$verbose = 3;
|
||||||
}
|
}
|
||||||
&printlog($hash,$logstr,$verbose);
|
&printlog($hash,$logstr,$verbose);
|
||||||
$logstr = "--- End Function cam: $OpMode nonblocking ---";
|
$logstr = "--- End Function cam: $OpMode nonblocking ---";
|
||||||
@ -2599,6 +2699,7 @@ sub logout_nonbl ($) {
|
|||||||
sub logoutret_nonbl ($) {
|
sub logoutret_nonbl ($) {
|
||||||
my ($param, $err, $myjson) = @_;
|
my ($param, $err, $myjson) = @_;
|
||||||
my $hash = $param->{hash};
|
my $hash = $param->{hash};
|
||||||
|
my $name = $hash->{NAME};
|
||||||
my $sid = $hash->{HELPER}{SID};
|
my $sid = $hash->{HELPER}{SID};
|
||||||
my ($success, $username) = getcredentials($hash,0);
|
my ($success, $username) = getcredentials($hash,0);
|
||||||
my $OpMode = $hash->{OPMODE};
|
my $OpMode = $hash->{OPMODE};
|
||||||
@ -2616,9 +2717,6 @@ sub logoutret_nonbl ($) {
|
|||||||
|
|
||||||
readingsSingleUpdate($hash, "Error", $err, 1); # Readings erzeugen
|
readingsSingleUpdate($hash, "Error", $err, 1); # Readings erzeugen
|
||||||
|
|
||||||
# freigabe Funktionstoken
|
|
||||||
$hash->{HELPER}{ACTIVE} = "off";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
elsif($myjson ne "") # wenn die Abfrage erfolgreich war ($data enthält die Ergebnisdaten des HTTP Aufrufes)
|
elsif($myjson ne "") # wenn die Abfrage erfolgreich war ($data enthält die Ergebnisdaten des HTTP Aufrufes)
|
||||||
{
|
{
|
||||||
@ -2671,6 +2769,11 @@ sub logoutret_nonbl ($) {
|
|||||||
# ausgeführte Funktion ist erledigt (auch wenn logout nicht erfolgreich), Freigabe Funktionstoken
|
# ausgeführte Funktion ist erledigt (auch wenn logout nicht erfolgreich), Freigabe Funktionstoken
|
||||||
$hash->{HELPER}{ACTIVE} = "off";
|
$hash->{HELPER}{ACTIVE} = "off";
|
||||||
|
|
||||||
|
if ($attr{$name}{debugactivetoken}) {
|
||||||
|
$logstr = "Active-Token deleted by OPMODE: $hash->{OPMODE}" ;
|
||||||
|
&printlog($hash,$logstr,"3");
|
||||||
|
}
|
||||||
|
|
||||||
# nach Snap Aufnahme Filename des Snaps ermitteln
|
# nach Snap Aufnahme Filename des Snaps ermitteln
|
||||||
if ($OpMode eq "Snap") {
|
if ($OpMode eq "Snap") {
|
||||||
return (getsnapfilename($hash));
|
return (getsnapfilename($hash));
|
||||||
@ -3155,9 +3258,9 @@ return;
|
|||||||
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 <br>
|
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 <br>
|
||||||
respectively stopped when the value was set to > 10 before. <br><br>
|
respectively stopped when the value was set to > 10 before. <br><br>
|
||||||
|
|
||||||
The attribute "pollcaminfoall" is monitored by a watchdog-timer. Changes of th attributevalue will be checked every 90 seconds and transact correspondig. <br>
|
The attribute "pollcaminfoall" is monitored by a watchdog-timer. Changes of the attribute-value will be checked every 90 seconds and transact corresponding. <br>
|
||||||
Changes of the pollingstate and pollinginterval will be reported in FHEM-Logfile. The reporting can be switched off by setting the attribute "pollnologging=1". <br>
|
Changes of the pollingstate and pollinginterval will be reported in FHEM-Logfile. The reporting can be switched off by setting the attribute "pollnologging=1". <br>
|
||||||
Thereby the needless growing of the logfile can be avoided. But if verbose is set to 4 or above even though the attribute "pollnologging" is set as well, the polling <br>
|
Thereby the needless growing of the logfile can be avoided. But if verbose level is set to 4 or above even though the attribute "pollnologging" is set as well, the polling <br>
|
||||||
will be actived due to analysis purposes. <br><br>
|
will be actived due to analysis purposes. <br><br>
|
||||||
|
|
||||||
If FHEM will be restarted, the first data retrieval will be done within 60 seconds after start. <br><br>
|
If FHEM will be restarted, the first data retrieval will be done within 60 seconds after start. <br><br>
|
||||||
@ -3263,6 +3366,8 @@ return;
|
|||||||
<br><br>
|
<br><br>
|
||||||
<ul>
|
<ul>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li><b>debugactivetoken</b> - if set the state of active token will be logged - only for debugging, don't use it in normal operation </li>
|
||||||
|
|
||||||
<li><b>httptimeout</b> - Timeout-Value of HTTP-Calls to Synology Surveillance Station, Default: 4 seconds (if httptimeout = "0" or not set) </li>
|
<li><b>httptimeout</b> - Timeout-Value of HTTP-Calls to Synology Surveillance Station, Default: 4 seconds (if httptimeout = "0" or not set) </li>
|
||||||
|
|
||||||
<li><b>pollcaminfoall</b> - Interval of automatic polling the Camera properties (if < 10: no polling, if > 10: polling with interval) </li>
|
<li><b>pollcaminfoall</b> - Interval of automatic polling the Camera properties (if < 10: no polling, if > 10: polling with interval) </li>
|
||||||
@ -3753,6 +3858,8 @@ return;
|
|||||||
<br><br>
|
<br><br>
|
||||||
<ul>
|
<ul>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li><b>debugactivetoken</b> - wenn gesetzt wird der Status des Active-Tokens gelogged - nur für Debuggung, nicht im normalen Betrieb benutzen </li>
|
||||||
|
|
||||||
<li><b>httptimeout</b> - Timeout-Wert für HTTP-Aufrufe zur Synology Surveillance Station, Default: 4 Sekunden (wenn httptimeout = "0" oder nicht gesetzt) </li>
|
<li><b>httptimeout</b> - Timeout-Wert für HTTP-Aufrufe zur Synology Surveillance Station, Default: 4 Sekunden (wenn httptimeout = "0" oder nicht gesetzt) </li>
|
||||||
|
|
||||||
<li><b>pollcaminfoall</b> - Intervall der automatischen Eigenschaftsabfrage (Polling) einer Kamera (kleiner 10: kein Polling, größer 10: Polling mit Intervall) </li>
|
<li><b>pollcaminfoall</b> - Intervall der automatischen Eigenschaftsabfrage (Polling) einer Kamera (kleiner 10: kein Polling, größer 10: Polling mit Intervall) </li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user