2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-19 00:26:03 +00:00

73_DoorBird: Feature: No Picture/video menue for stations without camera

git-svn-id: https://svn.fhem.de/fhem/trunk@20246 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Sailor 2019-09-25 18:48:29 +00:00
parent 62aceb7a5c
commit 6fb710f62e

View File

@ -37,7 +37,6 @@
# Check problems with error message after startup: "PERL WARNING: Prototype mismatch: sub main::memcmp: none vs ($$;$) at /usr/local/share/perl/5.24.1/Sub/Exporter.pm line 445." # Check problems with error message after startup: "PERL WARNING: Prototype mismatch: sub main::memcmp: none vs ($$;$) at /usr/local/share/perl/5.24.1/Sub/Exporter.pm line 445."
# #
# #
#
######################################################################################################################## ########################################################################################################################
package main; package main;
@ -161,7 +160,7 @@ sub DoorBird_Define($$)
###START###### Writing values to global hash ###############################################################START#### ###START###### Writing values to global hash ###############################################################START####
$hash->{NAME} = $name; $hash->{NAME} = $name;
$hash->{RevisonAPI} = "0.25"; $hash->{RevisonAPI} = "0.26";
$hash->{helper}{SOX} = "/usr/bin/sox"; #On Windows systems use "C:\Programme\sox\sox.exe" $hash->{helper}{SOX} = "/usr/bin/sox"; #On Windows systems use "C:\Programme\sox\sox.exe"
$hash->{helper}{URL} = $url; $hash->{helper}{URL} = $url;
$hash->{helper}{SipDevice} = AttrVal($name,"SipDevice",""); $hash->{helper}{SipDevice} = AttrVal($name,"SipDevice","");
@ -176,6 +175,7 @@ sub DoorBird_Define($$)
$hash->{helper}{ImageFileDir} = AttrVal($name, "ImageFileDir", 0); $hash->{helper}{ImageFileDir} = AttrVal($name, "ImageFileDir", 0);
$hash->{helper}{EventReset} = AttrVal($name, "EventReset", 5); $hash->{helper}{EventReset} = AttrVal($name, "EventReset", 5);
$hash->{helper}{WaitForHistory} = AttrVal($name, "WaitForHistory", 7); $hash->{helper}{WaitForHistory} = AttrVal($name, "WaitForHistory", 7);
$hash->{helper}{CameraInstalled} = false;
$hash->{helper}{SessionId} = 0; $hash->{helper}{SessionId} = 0;
$hash->{helper}{UdpMessageId} = 0; $hash->{helper}{UdpMessageId} = 0;
$hash->{helper}{UdpMotionId} = 0; $hash->{helper}{UdpMotionId} = 0;
@ -391,22 +391,34 @@ sub DoorBird_Attr(@)
elsif ($a[2] eq "SessionIdSec") { elsif ($a[2] eq "SessionIdSec") {
### Remove Timer for LostConn ### Remove Timer for LostConn
RemoveInternalTimer($hash, "DoorBird_RenewSessionID"); RemoveInternalTimer($hash, "DoorBird_RenewSessionID");
### If the attribute has not been deleted entirely
if (defined $a[3]) {
### Check whether SessionIdSec is 0 = disabled ### Check whether SessionIdSec is 0 = disabled
if ($a[3] == int($a[3]) && ($a[3] == 0)) { if ($a[3] == int($a[3]) && ($a[3] == 0)) {
### Save attribute as internal ### Save attribute as internal
$hash->{helper}{SessionIdSec} = 0; $hash->{helper}{SessionIdSec} = 0;
} }
### If KeepAliveTimeout is numeric and greater than 9s ### If KeepAliveTimeout is numeric and greater than 9s
elsif ($a[3] == int($a[3]) && ($a[3] > 9)) { elsif ($a[3] == int($a[3]) && ($a[3] > 9)) {
### Save attribute as internal ### Save attribute as internal
$hash->{helper}{SessionIdSec} = $a[3]; $hash->{helper}{SessionIdSec} = $a[3];
### Re-Initiate the timer ### Re-Initiate the timer
InternalTimer(gettimeofday()+$hash->{helper}{SessionIdSec}, "DoorBird_RenewSessionID", $hash, 0); InternalTimer(gettimeofday()+$hash->{helper}{SessionIdSec}, "DoorBird_RenewSessionID", $hash, 0);
}
### If KeepAliveTimeout is NOT numeric or smaller than 10
else{
### Save standard interval as internal
$hash->{helper}{SessionIdSec} = 540;
### Re-Initiate the timer
InternalTimer(gettimeofday()+$hash->{helper}{SessionIdSec}, "DoorBird_RenewSessionID", $hash, 0);
}
} }
### If KeepAliveTimeout is NOT numeric or smaller than 10 ### If the attribute has been deleted entirely
else{ else{
### Save standard interval as internal ### Save standard interval as internal
$hash->{helper}{SessionIdSec} = 540; $hash->{helper}{SessionIdSec} = 540;
@ -497,19 +509,18 @@ sub DoorBird_Get($@)
### Define "get" menu ### Define "get" menu
my $usage = "Unknown argument, choose one of "; my $usage = "Unknown argument, choose one of ";
$usage .= "Image_Request:noArg History_Request:noArg "; $usage .= "Info_Request:noArg List_Favorites:noArg List_Schedules:noArg ";
### If DoorBird has a Camera installed
### If debug modus is enabled and allows JSON extract if ($hash->{helper}{CameraInstalled} == true) {
if ($hash->{helper}{debug} == 1) { $usage .= "Image_Request:noArg History_Request:noArg "
$usage .= " Info_Request:,JSON List_Favorites:,JSON List_Schedules:,JSON";
} }
### If debug modus is NOT enabled ### If DoorBird has NO Camera installed
else { else {
$usage .= " Info_Request:noArg List_Favorites:noArg List_Schedules:noArg"; # Do not add anything
} }
### Return values
return $usage if $command eq '?'; return $usage if $command eq '?';
### Log Entry for debugging purposes ### Log Entry for debugging purposes
Log3 $name, 5, $name. " : DoorBird_Get - usage : " . $usage; Log3 $name, 5, $name. " : DoorBird_Get - usage : " . $usage;
@ -588,11 +599,20 @@ sub DoorBird_Set($@)
Log3 $name, 5, $name. " : DoorBird_Set - RelayAdresses : " . join(",", @RelayAdresses); Log3 $name, 5, $name. " : DoorBird_Set - RelayAdresses : " . join(",", @RelayAdresses);
### Define "set" menu ### Define "set" menu
my $usage = 'Unknown argument, choose one of '; my $usage = "Unknown argument, choose one of ";
$usage .= "Open_Door:" . join(",", @RelayAdresses) . " Restart:noArg Transmit_Audio ";
### Create Selection List
$usage .= "Live_Video:on,off Open_Door:" . join(",", @RelayAdresses) . " Light_On:noArg Restart:noArg Live_Audio:on,off Transmit_Audio";
### If DoorBird has a Camera installed
if ($hash->{helper}{CameraInstalled} == true) {
### Create Selection List for camera
$usage .= "Live_Video:on,off Light_On:noArg Live_Audio:on,off ";
}
### If DoorBird has NO Camera installed
else {
# Do not add anything
}
### Return values
return $usage if $command eq '?'; return $usage if $command eq '?';
### Log Entry for debugging purposes ### Log Entry for debugging purposes
@ -1349,196 +1369,201 @@ sub DoorBird_FW_detailFn($$$$) {
my $VideoURL = ReadingsVal($name, ".VideoURL", ""); my $VideoURL = ReadingsVal($name, ".VideoURL", "");
my $ImageURL = ReadingsVal($name, ".ImageURL", ""); my $ImageURL = ReadingsVal($name, ".ImageURL", "");
my $AudioURL = ReadingsVal($name, ".AudioURL", ""); my $AudioURL = ReadingsVal($name, ".AudioURL", "");
my $htmlCode;
my $VideoHtmlCode; my $VideoHtmlCode;
my $ImageHtmlCode; my $ImageHtmlCode;
my $ImageHtmlCodeBig; my $ImageHtmlCodeBig;
my $AudioHtmlCode; my $AudioHtmlCode;
my @HistoryDoorbell; my @HistoryDoorbell;
my @HistoryMotion; my @HistoryMotion;
### Log Entry for debugging purposes
if (defined $hash->{helper}{Images}{History}{doorbell}) {
@HistoryDoorbell = @{$hash->{helper}{Images}{History}{doorbell}};
Log3 $name, 5, $name. " : DoorBird_FW_detailFn - Size ImageData doorbell : " . @HistoryDoorbell;
}
### Log Entry for debugging purposes
if (defined $hash->{helper}{Images}{History}{motionsensor}) {
@HistoryMotion = @{$hash->{helper}{Images}{History}{motionsensor}};
Log3 $name, 5, $name. " : DoorBird_FW_detailFn - Size ImageData motion : " . @HistoryMotion;
}
### If VideoURL is empty
if ($VideoURL eq "") {
### Create Standard Response
$VideoHtmlCode = "Video Stream deactivated";
}
### If VideoURL is NOT empty
else {
### Create proper html code including popup
my $ImageHtmlCodeBig = "<img src=\\'" . $VideoURL . "\\'>";
my $PopupfunctionCode = "onclick=\"FW_okDialog(\'" . $ImageHtmlCodeBig . "\') \" ";
$VideoHtmlCode = '<img ' . $PopupfunctionCode . ' width="400" height="300" src="' . $VideoURL . '">';
### Create proper html link ### Only if DoorBird has a Camera installed view the Image and History Part
#$VideoHtmlCode = '<img src="' . $VideoURL . '" width="400px" height="300px">'; if ($hash->{helper}{CameraInstalled} == true) {
}
### Log Entry for debugging purposes
### If ImageData is empty if (defined $hash->{helper}{Images}{History}{doorbell}) {
if ($ImageData eq "") { @HistoryDoorbell = @{$hash->{helper}{Images}{History}{doorbell}};
### Create Standard Response Log3 $name, 5, $name. " : DoorBird_FW_detailFn - Size ImageData doorbell : " . @HistoryDoorbell;
$ImageHtmlCode = "Image not available"; }
} ### Log Entry for debugging purposes
### If ImageData is NOT empty if (defined $hash->{helper}{Images}{History}{motionsensor}) {
else { @HistoryMotion = @{$hash->{helper}{Images}{History}{motionsensor}};
### Create proper html code including popup Log3 $name, 5, $name. " : DoorBird_FW_detailFn - Size ImageData motion : " . @HistoryMotion;
my $ImageHtmlCodeBig = "<img src=\\'data:image/jpeg;base64," . $ImageData . "\\'><br><center>" . $ImageTimeStamp . "</center>"; }
my $PopupfunctionCode = "onclick=\"FW_okDialog(\'" . $ImageHtmlCodeBig . "\') \" ";
$ImageHtmlCode = '<img ' . $PopupfunctionCode . ' width="400" height="300" alt="tick" src="data:image/jpeg;base64,' . $ImageData . '">'; ### If VideoURL is empty
} if ($VideoURL eq "") {
### Create Standard Response
### If AudioURL is empty $VideoHtmlCode = "Video Stream deactivated";
if ($AudioURL eq "") { }
### Create Standard Response ### If VideoURL is NOT empty
$AudioHtmlCode = "Audio Stream deactivated"; else {
}
### If AudioURL is NOT empty
else {
### Create proper html code
$AudioHtmlCode = '<audio id="audio_with_controls" controls src="' . $AudioURL . '" ">Your Browser cannot play this audio stream.</audio>';
}
#type="audio/wav
### Create html Code
my $htmlCode = '
<table border="1" style="border-collapse:separate;">
<tbody >
<tr>
<td width="400px" align="center"><b>Image from ' . $ImageTimeStamp . '</b></td>
<td width="400px" align="center"><b>Live Stream</b></td>
</tr>
<tr>
<td id="ImageCell" width="430px" height="300px" align="center">
' . $ImageHtmlCode . '
</td>
<td id="ImageCell" width="435px" height="300px" align="center"> ### Create proper html code including popup
' . $VideoHtmlCode . '<BR> my $ImageHtmlCodeBig = "<img src=\\'" . $VideoURL . "\\'>";
</td> my $PopupfunctionCode = "onclick=\"FW_okDialog(\'" . $ImageHtmlCodeBig . "\') \" ";
</tr> $VideoHtmlCode = '<img ' . $PopupfunctionCode . ' width="400" height="300" src="' . $VideoURL . '">';
<tr> ### Create proper html link
<td></td> #$VideoHtmlCode = '<img src="' . $VideoURL . '" width="400px" height="300px">';
<td align="center">' . $AudioHtmlCode . '</td> }
</tr>
</tbody> ### If ImageData is empty
</table> if ($ImageData eq "") {
'; ### Create Standard Response
$ImageHtmlCode = "Image not available";
### Log Entry for debugging purposes }
# Log3 $name, 5, $name. " : DoorBird_FW_detailFn - ImageHtmlCode : " . $ImageHtmlCode; ### If ImageData is NOT empty
# Log3 $name, 5, $name. " : DoorBird_FW_detailFn - VideoHtmlCode : " . $VideoHtmlCode; else {
# Log3 $name, 5, $name. " : DoorBird_FW_detailFn - AudioHtmlCode : " . $AudioHtmlCode; ### Create proper html code including popup
my $ImageHtmlCodeBig = "<img src=\\'data:image/jpeg;base64," . $ImageData . "\\'><br><center>" . $ImageTimeStamp . "</center>";
if ((@HistoryDoorbell > 0) || (@HistoryMotion > 0)) { my $PopupfunctionCode = "onclick=\"FW_okDialog(\'" . $ImageHtmlCodeBig . "\') \" ";
$htmlCode .= $ImageHtmlCode = '<img ' . $PopupfunctionCode . ' width="400" height="300" alt="tick" src="data:image/jpeg;base64,' . $ImageData . '">';
' }
<BR>
<BR> ### If AudioURL is empty
if ($AudioURL eq "") {
### Create Standard Response
$AudioHtmlCode = "Audio Stream deactivated";
}
### If AudioURL is NOT empty
else {
### Create proper html code
$AudioHtmlCode = '<audio id="audio_with_controls" controls src="' . $AudioURL . '" ">Your Browser cannot play this audio stream.</audio>';
}
#type="audio/wav
### Create html Code
$htmlCode = '
<table border="1" style="border-collapse:separate;"> <table border="1" style="border-collapse:separate;">
<tbody > <tbody >
<tr> <tr>
<td align="center" colspan="5"><b>History of events - Last download: ' . $hash->{helper}{HistoryTime} . '</b></td> <td width="400px" align="center"><b>Image from ' . $ImageTimeStamp . '</b></td>
<td width="400px" align="center"><b>Live Stream</b></td>
</tr> </tr>
<tr>
<td id="ImageCell" width="430px" height="300px" align="center">
' . $ImageHtmlCode . '
</td>
<tr> <td id="ImageCell" width="435px" height="300px" align="center">
<td align="center" colspan="2"><b>Doorbell</b></td> ' . $VideoHtmlCode . '<BR>
<td align="center"></td> </td>
<td align="center" colspan="2"><b>Motion-Sensor</b></td>
</tr> </tr>
<tr> <tr>
<td width="195px" align="center"><b>Picture</b></td> <td></td>
<td width="195px" align="center"><b>Timestamp</b></td> <td align="center">' . $AudioHtmlCode . '</td>
<td width="20px" align="center">#</td> </tr>
<td width="195px" align="center"><b>Picture</b></td> </tbody>
<td width="195px" align="center"><b>Timestamp</b></td> </table>
</tr>
'; ';
### Log Entry for debugging purposes ### Log Entry for debugging purposes
Log3 $name, 5, $name. " : DoorBird_FW_detailFn - hash->{helper}{MaxHistory} : " . $hash->{helper}{MaxHistory}; # Log3 $name, 5, $name. " : DoorBird_FW_detailFn - ImageHtmlCode : " . $ImageHtmlCode;
# Log3 $name, 5, $name. " : DoorBird_FW_detailFn - VideoHtmlCode : " . $VideoHtmlCode;
# Log3 $name, 5, $name. " : DoorBird_FW_detailFn - AudioHtmlCode : " . $AudioHtmlCode;
### For all entries in Picture-Array do if ((@HistoryDoorbell > 0) || (@HistoryMotion > 0)) {
for (my $i=0; $i <= ($hash->{helper}{MaxHistory} - 1); $i++) { $htmlCode .=
'
<BR>
<BR>
<table border="1" style="border-collapse:separate;">
<tbody >
<tr>
<td align="center" colspan="5"><b>History of events - Last download: ' . $hash->{helper}{HistoryTime} . '</b></td>
</tr>
<tr>
<td align="center" colspan="2"><b>Doorbell</b></td>
<td align="center"></td>
<td align="center" colspan="2"><b>Motion-Sensor</b></td>
</tr>
<tr>
<td width="195px" align="center"><b>Picture</b></td>
<td width="195px" align="center"><b>Timestamp</b></td>
<td width="20px" align="center">#</td>
<td width="195px" align="center"><b>Picture</b></td>
<td width="195px" align="center"><b>Timestamp</b></td>
</tr>
';
### Log Entry for debugging purposes
Log3 $name, 5, $name. " : DoorBird_FW_detailFn - hash->{helper}{MaxHistory} : " . $hash->{helper}{MaxHistory};
my $ImageHtmlCodeDoorbell; ### For all entries in Picture-Array do
my $ImageHtmlCodeMotion; for (my $i=0; $i <= ($hash->{helper}{MaxHistory} - 1); $i++) {
### Create proper html code for image triggered by doorbell my $ImageHtmlCodeDoorbell;
if ($HistoryDoorbell[$i]{data} ne "") { my $ImageHtmlCodeMotion;
### If element contains an error message
if ($HistoryDoorbell[$i]{data} =~ m/Error/) { ### Create proper html code for image triggered by doorbell
$ImageHtmlCodeDoorbell = $HistoryDoorbell[$i]{data}; if ($HistoryDoorbell[$i]{data} ne "") {
### If element contains an error message
if ($HistoryDoorbell[$i]{data} =~ m/Error/) {
$ImageHtmlCodeDoorbell = $HistoryDoorbell[$i]{data};
}
### If element does not contain an error message
else {
### Create proper html code including popup
my $ImageHtmlCodeBig = "<img src=\\'data:image/jpeg;base64," . $HistoryDoorbell[$i]{data} . "\\'><br><center>" . $HistoryDoorbell[$i]{timestamp} . "</center>";
my $PopupfunctionCode = "onclick=\"FW_okDialog(\'" . $ImageHtmlCodeBig . "\') \" ";
$ImageHtmlCodeDoorbell = '<img ' . $PopupfunctionCode . ' width="190" height="auto" alt="tick" src="data:image/jpeg;base64,' . $HistoryDoorbell[$i]{data} . '">';
}
} }
### If element does not contain an error message
else { else {
### Create proper html code including popup $ImageHtmlCodeDoorbell = 'No image available';
my $ImageHtmlCodeBig = "<img src=\\'data:image/jpeg;base64," . $HistoryDoorbell[$i]{data} . "\\'><br><center>" . $HistoryDoorbell[$i]{timestamp} . "</center>";
my $PopupfunctionCode = "onclick=\"FW_okDialog(\'" . $ImageHtmlCodeBig . "\') \" ";
$ImageHtmlCodeDoorbell = '<img ' . $PopupfunctionCode . ' width="190" height="auto" alt="tick" src="data:image/jpeg;base64,' . $HistoryDoorbell[$i]{data} . '">';
} }
} ### Create proper html code for image triggered by motionsensor
else { if ($HistoryMotion[$i]{data} ne "") {
$ImageHtmlCodeDoorbell = 'No image available'; ### If element contains an error message
} if ($HistoryMotion[$i]{data} =~ m/Error/) {
### Create proper html code for image triggered by motionsensor $ImageHtmlCodeMotion = $HistoryMotion[$i]{data};
if ($HistoryMotion[$i]{data} ne "") { }
### If element contains an error message ### If element does not contain an error message
if ($HistoryMotion[$i]{data} =~ m/Error/) { else {
$ImageHtmlCodeMotion = $HistoryMotion[$i]{data}; ### Create proper html code including popup
my $ImageHtmlCodeBig = "<img src=\\'data:image/jpeg;base64," . $HistoryMotion[$i]{data} . "\\'><br><center>" . $HistoryMotion[$i]{timestamp} . "</center>";
my $PopupfunctionCode = "onclick=\"FW_okDialog(\'" . $ImageHtmlCodeBig . "\') \" ";
$ImageHtmlCodeMotion = '<img ' . $PopupfunctionCode . ' width="190" height="auto" alt="tick" src="data:image/jpeg;base64,' . $HistoryMotion[$i]{data} . '">';
}
} }
### If element does not contain an error message
else { else {
### Create proper html code including popup $ImageHtmlCodeMotion = 'No image available';
my $ImageHtmlCodeBig = "<img src=\\'data:image/jpeg;base64," . $HistoryMotion[$i]{data} . "\\'><br><center>" . $HistoryMotion[$i]{timestamp} . "</center>"; }
my $PopupfunctionCode = "onclick=\"FW_okDialog(\'" . $ImageHtmlCodeBig . "\') \" ";
$ImageHtmlCodeMotion = '<img ' . $PopupfunctionCode . ' width="190" height="auto" alt="tick" src="data:image/jpeg;base64,' . $HistoryMotion[$i]{data} . '">'; $htmlCode .=
} '
<tr>
<td align="center">' . $ImageHtmlCodeDoorbell . '</td>
<td align="center">' . $HistoryDoorbell[$i]{timestamp} . '</td>
<td align="center">' . ($i + 1) . '</td>
<td align="center">' . $ImageHtmlCodeMotion . '</td>
<td align="center">' . $HistoryMotion[$i]{timestamp} . '</td>
</tr>
';
### Log Entry for debugging purposes
# Log3 $name, 5, $name. " : DoorBird_FW_detailFn - ImageHtmlCodeDoorbell : " . $ImageHtmlCodeDoorbell;
# Log3 $name, 5, $name. " : DoorBird_FW_detailFn - ImageHtmlCodeMotion : " . $ImageHtmlCodeMotion;
} }
else {
$ImageHtmlCodeMotion = 'No image available';
}
### Finish table
$htmlCode .= $htmlCode .=
' '
<tr> </tbody>
<td align="center">' . $ImageHtmlCodeDoorbell . '</td> </table>
<td align="center">' . $HistoryDoorbell[$i]{timestamp} . '</td>
<td align="center">' . ($i + 1) . '</td>
<td align="center">' . $ImageHtmlCodeMotion . '</td>
<td align="center">' . $HistoryMotion[$i]{timestamp} . '</td>
</tr>
'; ';
### Log Entry for debugging purposes
# Log3 $name, 5, $name. " : DoorBird_FW_detailFn - ImageHtmlCodeDoorbell : " . $ImageHtmlCodeDoorbell; }
# Log3 $name, 5, $name. " : DoorBird_FW_detailFn - ImageHtmlCodeMotion : " . $ImageHtmlCodeMotion; }
}
### Finish table
$htmlCode .=
'
</tbody>
</table>
';
}
### Log Entry for debugging purposes ### Log Entry for debugging purposes
# Log3 $name, 5, $name. " : DoorBird_FW_detailFn - htmlCode : " . $htmlCode; # Log3 $name, 5, $name. " : DoorBird_FW_detailFn - htmlCode : " . $htmlCode;
# my $infoBtn = "</td><td><a onClick='FW_cmd(FW_root+\"?cmd.$name=get $name all&XHR=1\",function(data){FW_okDialog(data)})'\>$info</a>" # my $infoBtn = "</td><td><a onClick='FW_cmd(FW_root+\"?cmd.$name=get $name all&XHR=1\",function(data){FW_okDialog(data)})'\>$info</a>"
# <a href=\"#!\" onclick=\"FW_okDialog('Testtitle<br><br>TestDescription')\">Testtitle</a> # <a href=\"#!\" onclick=\"FW_okDialog('Testtitle<br><br>TestDescription')\">Testtitle</a>
return($htmlCode ); return($htmlCode );
} }
@ -1572,7 +1597,7 @@ sub DoorBird_Info_Request($$) {
### If no error has been handed back ### If no error has been handed back
if ($err eq "") { if ($err eq "") {
### If the option is asking for the JSON string ### If the option is asking for the JSON string
if (defined($option) && ($option =~ /JSON/i)) { if (defined($option) && ($option =~ /JSON/i)) {
return $data; return $data;
} }
@ -1628,6 +1653,21 @@ sub DoorBird_Info_Request($$) {
readingsBulkUpdate($hash, "RelayAddr_" . sprintf("%02d", $RelayNumber), $RelayAddress); readingsBulkUpdate($hash, "RelayAddr_" . sprintf("%02d", $RelayNumber), $RelayAddress);
} }
} }
### If the entry has the information about the device type
elsif ( $key eq "DEVICE-TYPE") {
### If the Device Type is not containing type numbers which have no camera installed - Currently only "DoorBird D301A - Door Intercom IP Upgrade"
if ($VersionContent -> {$key} !~ m/301/) {
### Set Information about Camera installed to true
$hash->{helper}{CameraInstalled} = true;
}
### Log Entry for debugging purposes
Log3 $name, 5, $name. " : DoorBird_Info_Request - Content of" . sprintf("%15s %-s", $key, ": " . $VersionContent -> {$key});
### Update Reading
readingsBulkUpdate($hash, $key, $VersionContent -> {$key} );
}
### For all other entries ### For all other entries
else { else {
@ -1641,6 +1681,9 @@ sub DoorBird_Info_Request($$) {
### Update Reading for Firmware-Status ### Update Reading for Firmware-Status
readingsBulkUpdate($hash, "Firmware-Status", "up-to-date"); readingsBulkUpdate($hash, "Firmware-Status", "up-to-date");
### Update SessionId
DoorBird_RenewSessionID($hash);
### Execute Readings Bulk Update ### Execute Readings Bulk Update
readingsEndUpdate($hash, 1); readingsEndUpdate($hash, 1);