mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-30 12:07:09 +00:00
DoorPi.pm: Bugfix
git-svn-id: https://svn.fhem.de/fhem/trunk@11382 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ff6a45df77
commit
a5ae65d17b
@ -39,7 +39,7 @@ use vars qw{%attr %defs};
|
|||||||
sub Log($$);
|
sub Log($$);
|
||||||
|
|
||||||
#-- globals on start
|
#-- globals on start
|
||||||
my $version = "1.0beta3";
|
my $version = "1.0beta4";
|
||||||
|
|
||||||
#-- these we may get on request
|
#-- these we may get on request
|
||||||
my %gets = (
|
my %gets = (
|
||||||
@ -71,7 +71,7 @@ sub DoorPi_Initialize ($) {
|
|||||||
"language:de,en ".
|
"language:de,en ".
|
||||||
"doorbutton dooropencmd doorlockcmd doorunlockcmd ".
|
"doorbutton dooropencmd doorlockcmd doorunlockcmd ".
|
||||||
"lightbutton lightoncmd lighttimercmd lightoffcmd ".
|
"lightbutton lightoncmd lighttimercmd lightoffcmd ".
|
||||||
"dashlightbutton ".
|
"dashlightbutton iconpic iconaudio ".
|
||||||
$readingFnAttributes;
|
$readingFnAttributes;
|
||||||
|
|
||||||
$hash->{FW_detailFn} = "DoorPi_makeTable";
|
$hash->{FW_detailFn} = "DoorPi_makeTable";
|
||||||
@ -115,6 +115,7 @@ sub DoorPi_Define($$) {
|
|||||||
my $oid = $init_done;
|
my $oid = $init_done;
|
||||||
$init_done = 1;
|
$init_done = 1;
|
||||||
readingsSingleUpdate($hash,"state","Initialized",1);
|
readingsSingleUpdate($hash,"state","Initialized",1);
|
||||||
|
readingsSingleUpdate($hash,"door","Unknown",1);
|
||||||
|
|
||||||
DoorPi_GetConfig($hash);
|
DoorPi_GetConfig($hash);
|
||||||
DoorPi_GetHistory($hash);
|
DoorPi_GetHistory($hash);
|
||||||
@ -154,16 +155,10 @@ sub DoorPi_Attr(@) {
|
|||||||
|
|
||||||
if ( $do eq "set") {
|
if ( $do eq "set") {
|
||||||
ARGUMENT_HANDLER: {
|
ARGUMENT_HANDLER: {
|
||||||
$key eq "interval" and do {
|
# TODO
|
||||||
$hash->{interval} = $value;
|
|
||||||
if ($main::init_done) {
|
|
||||||
# WHAT ?
|
|
||||||
}
|
|
||||||
last;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ret;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
@ -245,12 +240,12 @@ sub DoorPi_Set ($@) {
|
|||||||
$value = shift @a;
|
$value = shift @a;
|
||||||
|
|
||||||
return "[DoorPi_Set] With unknown argument $key, choose one of " . join(" ", @{$hash->{HELPER}->{CMDS}})
|
return "[DoorPi_Set] With unknown argument $key, choose one of " . join(" ", @{$hash->{HELPER}->{CMDS}})
|
||||||
if ( !grep( /$key/, @{$hash->{HELPER}->{CMDS}} ) && !($key eq "call") );
|
if ( !grep( /$key/, @{$hash->{HELPER}->{CMDS}} ) && ($key ne "call") && ($key n "door") );
|
||||||
|
|
||||||
#-- hidden command to be used by DoorPi for adding a new call
|
#-- hidden command to be used by DoorPi for adding a new call
|
||||||
if( $key eq "call" ){
|
if( $key eq "call" ){
|
||||||
if( $value eq "start" ){
|
if( $value eq "start" ){
|
||||||
readingsSingleUpdate($hash,"call","started",1);
|
readingsSingleUpdate($hash,"call","started",1);e
|
||||||
}elsif( $value eq "end" ){
|
}elsif( $value eq "end" ){
|
||||||
readingsSingleUpdate($hash,"call","ended",1);
|
readingsSingleUpdate($hash,"call","ended",1);
|
||||||
DoorPi_GetHistory($hash);
|
DoorPi_GetHistory($hash);
|
||||||
@ -261,13 +256,19 @@ sub DoorPi_Set ($@) {
|
|||||||
readingsSingleUpdate($hash,"call","dismissed",1);
|
readingsSingleUpdate($hash,"call","dismissed",1);
|
||||||
DoorPi_GetHistory($hash);
|
DoorPi_GetHistory($hash);
|
||||||
}
|
}
|
||||||
#-- door opening
|
#-- door opening - either from FHEM, or just as message from DoorPi
|
||||||
}elsif( $key eq "$door" ){
|
}elsif( ($key eq "$door")||($key eq "door" ){
|
||||||
if( $value eq "open" ){
|
if( $value eq "open" ){
|
||||||
$v=DoorPi_Cmd($hash,"door");
|
$v=DoorPi_Cmd($hash,"door");
|
||||||
if(AttrVal($name, "dooropencmd",undef)){
|
if(AttrVal($name, "dooropencmd",undef)){
|
||||||
fhem(AttrVal($name, "dooropencmd",undef));
|
fhem(AttrVal($name, "dooropencmd",undef));
|
||||||
}
|
}
|
||||||
|
readingsSingleUpdate($hash,$door,"opened",1);
|
||||||
|
}elsif( $value eq "opened" ){
|
||||||
|
if(AttrVal($name, "dooropencmd",undef)){
|
||||||
|
fhem(AttrVal($name, "dooropencmd",undef));
|
||||||
|
}
|
||||||
|
readingsSingleUpdate($hash,$door,"opened",1);
|
||||||
}
|
}
|
||||||
#-- scene lighting
|
#-- scene lighting
|
||||||
}elsif( $key eq "$light" ){
|
}elsif( $key eq "$light" ){
|
||||||
@ -275,9 +276,23 @@ sub DoorPi_Set ($@) {
|
|||||||
if( $value eq "on" ){
|
if( $value eq "on" ){
|
||||||
$v=DoorPi_Cmd($hash,"lighton");
|
$v=DoorPi_Cmd($hash,"lighton");
|
||||||
readingsSingleUpdate($hash,$light,"on",1);
|
readingsSingleUpdate($hash,$light,"on",1);
|
||||||
|
if(AttrVal($name, "lightoncmd",undef)){
|
||||||
|
fhem(AttrVal($name, "lightoncmd",undef));
|
||||||
|
}
|
||||||
|
readingsSingleUpdate($hash,$light,"on",1);
|
||||||
}elsif( $value eq "off" ){
|
}elsif( $value eq "off" ){
|
||||||
$v=DoorPi_Cmd($hash,"lightoff");
|
$v=DoorPi_Cmd($hash,"lightoff");
|
||||||
|
if(AttrVal($name, "lightoffcmd",undef)){
|
||||||
|
fhem(AttrVal($name, "lightoffcmd",undef));
|
||||||
|
}
|
||||||
readingsSingleUpdate($hash,$light,"off",1);
|
readingsSingleUpdate($hash,$light,"off",1);
|
||||||
|
}elsif( $value eq "on-for-timer" ){
|
||||||
|
$v=DoorPi_Cmd($hash,"lightonfortimer");
|
||||||
|
if(AttrVal($name, "lighttimercmd",undef)){
|
||||||
|
fhem(AttrVal($name, "lighttimercmd",undef));
|
||||||
|
}
|
||||||
|
readingsSingleUpdate($hash,$light,"on-for-timer",1);
|
||||||
|
#-- TODO: reset after time
|
||||||
}
|
}
|
||||||
#-- dashboard lighting
|
#-- dashboard lighting
|
||||||
}elsif( $key eq "$dashlight" ){
|
}elsif( $key eq "$dashlight" ){
|
||||||
@ -760,6 +775,13 @@ sub DoorPi_makeTable($$$$){
|
|||||||
setlocale(LC_ALL, "en_US.utf8");
|
setlocale(LC_ALL, "en_US.utf8");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $iconpic = AttrVal($hash->{NAME}, "iconpic", undef);
|
||||||
|
$iconpic = FW_makeImage($iconpic)
|
||||||
|
if($iconpic);
|
||||||
|
my $iconaudio = AttrVal($hash->{NAME}, "iconaudio", undef);
|
||||||
|
$iconaudio = FW_makeImage($iconaudio)
|
||||||
|
if($iconaudio);
|
||||||
|
|
||||||
my $ret = "<table>";
|
my $ret = "<table>";
|
||||||
|
|
||||||
if(AttrVal($name, "no-heading", "0") eq "0" and defined($FW_ME) and defined($FW_subdir))
|
if(AttrVal($name, "no-heading", "0") eq "0" and defined($FW_ME) and defined($FW_subdir))
|
||||||
@ -819,11 +841,13 @@ sub DoorPi_makeTable($$$$){
|
|||||||
if( $record ne ""){
|
if( $record ne ""){
|
||||||
my $rs = $record;
|
my $rs = $record;
|
||||||
$rs =~ s/.*$wwwpath\///;
|
$rs =~ s/.*$wwwpath\///;
|
||||||
|
$rs = ($iconaudio) ? $iconaudio : $rs;
|
||||||
$record = '<a href="http://'.$hash->{TCPIP}.'/'.$record.'">'.$rs.'</a>';
|
$record = '<a href="http://'.$hash->{TCPIP}.'/'.$record.'">'.$rs.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $snapshot ne ""){
|
if( $snapshot ne ""){
|
||||||
$state = '<a href="http://'.$hash->{TCPIP}.'/'.$snapshot.'"><img src="http://'.$hash->{TCPIP}.'/'.$snapshot.'" width="40" height="30"></a>';
|
$state = '<a href="http://'.$hash->{TCPIP}.'/'.$snapshot.'">';
|
||||||
|
$state .= ($iconpic) ? $iconpic : '<img src="http://'.$hash->{TCPIP}.'/'.$snapshot.'" width="40" height="30"></a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret .= '<tr align="center" class="doorpicalllist '.($index % 2 == 1 ? "odd" : "even").'">';
|
$ret .= '<tr align="center" class="doorpicalllist '.($index % 2 == 1 ? "odd" : "even").'">';
|
||||||
@ -867,7 +891,7 @@ sub DoorPi_makeTable($$$$){
|
|||||||
<a name="DoorPi_Define"></a>
|
<a name="DoorPi_Define"></a>
|
||||||
<h4>Define</h4>
|
<h4>Define</h4>
|
||||||
<p>
|
<p>
|
||||||
<code>define <name> DoorPi <IP address></code>
|
<code>define <DoorPi-Device> DoorPi <IP address></code>
|
||||||
<br /><br /> Define a DoorpiPi instance.<br /><br />
|
<br /><br /> Define a DoorpiPi instance.<br /><br />
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
@ -881,27 +905,27 @@ sub DoorPi_makeTable($$$$){
|
|||||||
<h4>Set</h4>
|
<h4>Set</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a name="doorpi_door">
|
<li><a name="doorpi_door">
|
||||||
<code>set <name> door open[|locked|unlocked] </code></a><br />
|
<code>set <DoorPi-Device> door open[|locked|unlocked] </code></a><br />
|
||||||
Activate the door opener in DoorPi, accompanied by an optional FHEM command
|
Activate the door opener in DoorPi, accompanied by an optional FHEM command
|
||||||
specified in the <i>dooropencmd</i> attribute.
|
specified in the <i>dooropencmd</i> attribute.
|
||||||
<br><b>If the Attributes doorlockcmd and doorunlockcmd are specified, these commands may be used to lock and unlock the door</b><br>
|
<br>If the Attributes doorlockcmd and doorunlockcmd are specified, these commands may be used to lock and unlock the door<br>
|
||||||
Instead of <i>door</i>, one must use the value of the doorbutton attribute.</li>
|
Instead of <i>door</i>, one must use the value of the doorbutton attribute.</li>
|
||||||
<li><a name="doorpi_dashlight">
|
<li><a name="doorpi_dashlight">
|
||||||
<code>set <name> dashlight on|off </code></a><br />
|
<code>set <DoorPi-Device> dashlight on|off </code></a><br />
|
||||||
Set the dashlight (illuminating the door station) on or off.
|
Set the dashlight (illuminating the door station) on or off.
|
||||||
Instead of <i>dashlight</i>, one must use the value of the dashlightbutton attribute</li>
|
Instead of <i>dashlight</i>, one must use the value of the dashlightbutton attribute</li>
|
||||||
<li><a name="doorpi_light">
|
<li><a name="doorpi_light">
|
||||||
<code>set <name> light on|on-for-timer|off </code></a><br />
|
<code>set <DoorPi-Device> light on|on-for-timer|off </code></a><br />
|
||||||
Set the scene light (illuminating the visitor) on, on for a minute or off.
|
Set the scene light (illuminating the visitor) on, on for a minute or off.
|
||||||
Instead of <i>light</i>, one must use the value of the lightbutton attribute</li>
|
Instead of <i>light</i>, one must use the value of the lightbutton attribute</li>
|
||||||
<li><a name="doorpi_button">
|
<li><a name="doorpi_button">
|
||||||
<code>set <name> <i>buttonDD</i> </code></a><br />
|
<code>set <DoorPi-Device> <i>buttonDD</i> </code></a><br />
|
||||||
Activate one of the virtual buttons specified in DoorPi.
|
Activate one of the virtual buttons specified in DoorPi.
|
||||||
<li><a name="doorpi_purge">
|
<li><a name="doorpi_purge">
|
||||||
<code>set <name> purge </code></a><br />
|
<code>set <DoorPi-Device> purge </code></a><br />
|
||||||
Clean all recordings and snapshots which are older than the current process </li>
|
Clean all recordings and snapshots which are older than the current process </li>
|
||||||
<li><a name="doorpi_clear">
|
<li><a name="doorpi_clear">
|
||||||
<code>set <name> clear </code></a><br />
|
<code>set <DoorPi-Device> clear </code></a><br />
|
||||||
Clear all recordings and snapshots </li>
|
Clear all recordings and snapshots </li>
|
||||||
</ul>
|
</ul>
|
||||||
<br />
|
<br />
|
||||||
@ -909,50 +933,91 @@ sub DoorPi_makeTable($$$$){
|
|||||||
<h4>Get</h4>
|
<h4>Get</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a name="doorpi_config">
|
<li><a name="doorpi_config">
|
||||||
<code>get <name> config</code></a>
|
<code>get <DoorPi-Device> config</code></a>
|
||||||
<br /> Returns the current configuration of DoorPi </li>
|
<br /> Returns the current configuration of DoorPi </li>
|
||||||
<li><a name="doorpi_history">
|
<li><a name="doorpi_history">
|
||||||
<code>get <name> history</code></a>
|
<code>get <DoorPi-Device> history</code></a>
|
||||||
<br /> Returns the current call history of DoorPi </li>
|
<br /> Returns the current call history of DoorPi </li>
|
||||||
<li><a name="doorpi_version">
|
<li><a name="doorpi_version">
|
||||||
<code>get <name> version</code></a>
|
<code>get <DoorPi-Device> version</code></a>
|
||||||
<br /> Returns the version number of the FHEM DoorPi module</li>
|
<br /> Returns the version number of the FHEM DoorPi module</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4>Attributes</h4>
|
<h4>Attributes</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a name="doorpi_doorbutton"><code>attr <name> doorbutton
|
<li><a name="doorpi_doorbutton"><code>attr <DoorPi-Device> doorbutton
|
||||||
<string></code></a>
|
<string></code></a>
|
||||||
<br />DoorPi name for door action (default: door)</li>
|
<br />DoorPi name for door action (default: door)</li>
|
||||||
<li><a name="doorpi_dooropencmd"><code>attr <name> dooropencmd
|
<li><a name="doorpi_dooropencmd"><code>attr <DoorPi-Device> dooropencmd
|
||||||
<string></code></a>
|
<string></code></a>
|
||||||
<br />FHEM command additionally executed for door opening action (no default)</li>
|
<br />FHEM command additionally executed for door opening action (no default)</li>
|
||||||
<li><a name="doorpi_doorlockcmd"><code>attr <name> doorlockcmd
|
<li><a name="doorpi_doorlockcmd"><code>attr <DoorPi-Device> doorlockcmd
|
||||||
<string></code></a>
|
<string></code></a>
|
||||||
<br />FHEM command for door locking action (no default)</li>
|
<br />FHEM command for door locking action (no default)</li>
|
||||||
<li><a name="doorpi_doorunlockcmd"><code>attr <name> doorunlockcmd
|
<li><a name="doorpi_doorunlockcmd"><code>attr <DoorPi-Device> doorunlockcmd
|
||||||
<string></code></a>
|
<string></code></a>
|
||||||
<br />FHEM command for door unlocking action (no default)</li>
|
<br />FHEM command for door unlocking action (no default)</li>
|
||||||
<li><a name="doorpi_lightbutton"><code>attr <name> lightbutton
|
<li><a name="doorpi_lightbutton"><code>attr <DoorPi-Device> lightbutton
|
||||||
<string></code></a>
|
<string></code></a>
|
||||||
<br />DoorPi name for light action (default: light)</li>
|
<br />DoorPi name for light action (default: light)</li>
|
||||||
<li><a name="doorpi_dashlightbutton"><code>attr <name> dashlightbutton
|
<li><a name="doorpi_lightoncmd"><code>attr <DoorPi-Device> lightoncmd
|
||||||
|
<string></code></a>
|
||||||
|
<br />FHEM command additionally executed for "light on" action (no default)</li>
|
||||||
|
<li><a name="doorpi_lightoffcmd"><code>attr <DoorPi-Device> lightoffcmd
|
||||||
|
<string></code></a>
|
||||||
|
<br />FHEM command additionally executed for "light off" action (no default)</li>
|
||||||
|
<li><a name="doorpi_lighttimercmd"><code>attr <DoorPi-Device> lighttimercmd
|
||||||
|
<string></code></a>
|
||||||
|
<br />FHEM command additionally executed for "light off" action (no default)</li>
|
||||||
|
<li><a name="doorpi_dashlightbutton"><code>attr <DoorPi-Device> dashlightbutton
|
||||||
<string></code></a>
|
<string></code></a>
|
||||||
<br />DoorPi name for dashlight action (default: dashlight)</li>
|
<br />DoorPi name for dashlight action (default: dashlight)</li>
|
||||||
|
<li><a name="doorpi_iconpic"><code>attr <DoorPi-Device> iconpic
|
||||||
|
<string></code></a>
|
||||||
|
<br />Icon to be used in overview instead of a (slow !) miniature picture</li>
|
||||||
|
<li><a name="doorpi_iconaudio"><code>attr <DoorPi-Device> iconaudio
|
||||||
|
<string></code></a>
|
||||||
|
<br />Icon to be used in overview instead of a verbal link to the audio recording</li>
|
||||||
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
|
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4>Necessary parts of the DoorPi configuration</h4>
|
<h4>Necessary ingredients of the DoorPi configuration</h4>
|
||||||
The following Events need to be defined for DoorPi:
|
The following Events need to be defined for DoorPi in order to communicate with FHEM:
|
||||||
<ul>
|
<pre>
|
||||||
<li>[EVENT_BeforeSipPhoneMakeCall]<br>
|
[EVENT_BeforeSipPhoneMakeCall]
|
||||||
10 = url_call:<URL of FHEM>/fhem?XHR=1&cmd.<Device name for DoorPi>=set <Device name for DoorPi> call start</li>
|
10 = url_call:<URL of FHEM>/fhem?XHR=1&cmd.<DoorPi-Device>=set <DoorPi-Device> call start
|
||||||
<li>[EVENT_OnCallStateDisconnect]<br>
|
20 = take_snapshot
|
||||||
10 = url_call:<URL of FHEM>/fhem?XHR=1&cmd.<Device name for DoorPi>=set <Device name for DoorPi> call end</li>
|
|
||||||
<li>[EVENT_OnCallStateDismissed]<br>
|
|
||||||
10 = url_call:<URL of FHEM>/fhem?XHR=1&cmd.<Device name for DoorPi>=set <Device name for DoorPi> call dismissed</li>
|
|
||||||
<li>[EVENT_OnCallStateReject]<br>
|
|
||||||
10 = url_call:<URL of FHEM>/fhem?XHR=1&cmd.<Device name for DoorPi>=set <Device name for DoorPi> call rejected</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
[EVENT_OnCallStateDisconnect]
|
||||||
|
10 = url_call:<URL of FHEM>/fhem?XHR=1&cmd.<DoorPi-Device>=set <DoorPi-Device> call end
|
||||||
|
|
||||||
|
[EVENT_OnCallStateDismissed]
|
||||||
|
10 = url_call:<URL of FHEM>/fhem?XHR=1&cmd.<DoorPi-Device>=set <DoorPi-Device> call dismissed
|
||||||
|
|
||||||
|
[EVENT_OnCallStateReject]
|
||||||
|
10 = url_call:<URL of FHEM>/fhem?XHR=1&cmd.<DoorPi-Device>=set <DoorPi-Device> call rejected
|
||||||
|
</pre>
|
||||||
|
DoorPi <b>must</b> have a virtual (= filesystem) keyboard
|
||||||
|
<pre>
|
||||||
|
[keyboards]
|
||||||
|
...
|
||||||
|
<virtualkeyboardname> = filesystem
|
||||||
|
|
||||||
|
[<virtualkeyboardname>_keyboard]
|
||||||
|
base_path_input = <dome directory>
|
||||||
|
base_path_output = <some directory>
|
||||||
|
|
||||||
|
[<virtualkeyboardname>_InputPins]
|
||||||
|
door = <some doorpi action>
|
||||||
|
lighton = <some doorpi action>
|
||||||
|
lightonfortimer = <some doorpi action>
|
||||||
|
lightoff = <some doorpi action>
|
||||||
|
dashlighton = <some doorpi action>
|
||||||
|
dashlightoff = <some doorpi action>
|
||||||
|
purge = <some doorpi action>
|
||||||
|
clear = <some doorpi action>
|
||||||
|
... (optional buttons)
|
||||||
|
button1 = <some doorpi action>
|
||||||
|
... (further button definitions)
|
||||||
|
</pre>
|
||||||
=end html
|
=end html
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ port = 80
|
|||||||
public = AREA_public
|
public = AREA_public
|
||||||
www = /home/doorpi/records
|
www = /home/doorpi/records
|
||||||
|
|
||||||
|
|
||||||
[AREA_public]
|
[AREA_public]
|
||||||
.*
|
.*
|
||||||
|
|
||||||
@ -55,19 +54,22 @@ guests = dashboard
|
|||||||
[EVENT_OnStartup]
|
[EVENT_OnStartup]
|
||||||
10 = sleep:1
|
10 = sleep:1
|
||||||
|
|
||||||
#-- notify the FHEM module
|
|
||||||
[EVENT_BeforeSipPhoneMakeCall]
|
[EVENT_BeforeSipPhoneMakeCall]
|
||||||
10 = url_call:http://192.168.0.20:8083/fhem?XHR=1&cmd.DoorPi=set DoorPi call start
|
10 = url_call:http://192.168.0.90:8083/fhem?XHR=1&cmd.A.Haus.T=set A.Haus.T call start
|
||||||
20 = take_snapshot
|
20 = take_snapshot
|
||||||
|
30 = mailto:haus271828@henning-weingarten.de,DoorPi,DoorPi initiating call
|
||||||
|
|
||||||
[EVENT_OnCallStateDisconnect]
|
[EVENT_OnCallStateDisconnect]
|
||||||
10 = url_call:http://192.168.0.20:8083/fhem?XHR=1&cmd.DoorPi=set DoorPi call end
|
10 = url_call:http://192.168.0.90:8083/fhem?XHR=1&cmd.A.Haus.T=set A.Haus.T call end
|
||||||
|
|
||||||
[EVENT_OnCallStateDismissed]
|
[EVENT_OnCallStateDismissed]
|
||||||
10 = url_call:http://192.168.0.20:8083/fhem?XHR=1&cmd.DoorPi=set DoorPi call dismissed
|
10 = url_call:http://192.168.0.90:8083/fhem?XHR=1&cmd.A.Haus.T=set A.Haus.T call dismissed
|
||||||
|
|
||||||
[EVENT_OnCallStateReject]
|
[EVENT_OnCallStateReject]
|
||||||
10 = url_call:http://192.168.0.20:8083/fhem?XHR=1&cmd.DoorPi=set DoorPi call rejected
|
10 = url_call:http://192.168.0.90:8083/fhem?XHR=1&cmd.A.Haus.T=set A.Haus.T call rejected
|
||||||
|
|
||||||
|
[EVENT_OnTimeMinuteEvery5]
|
||||||
|
10=statuswatchdog:/tmp/doorpi.watchdog
|
||||||
|
|
||||||
[SIP-Phone]
|
[SIP-Phone]
|
||||||
identity = DoorPi
|
identity = DoorPi
|
||||||
@ -75,7 +77,7 @@ local_port = 5060
|
|||||||
firewallpolicy = PolicyNoFirewall
|
firewallpolicy = PolicyNoFirewall
|
||||||
#
|
#
|
||||||
sipphonetyp = linphone
|
sipphonetyp = linphone
|
||||||
sipserver_password = xxxxxxxxxxxx
|
sipserver_password = XXXX
|
||||||
sipserver_realm = fritz.box
|
sipserver_realm = fritz.box
|
||||||
sipserver_server = 192.168.0.254
|
sipserver_server = 192.168.0.254
|
||||||
sipserver_username = 620
|
sipserver_username = 620
|
||||||
@ -121,17 +123,19 @@ clear = sleep:0
|
|||||||
button1 = sleep:0
|
button1 = sleep:0
|
||||||
button2 = sleep:0
|
button2 = sleep:0
|
||||||
|
|
||||||
|
#-- purge all files older than current PID file
|
||||||
[EVENT_OnKeyPressed_webservice.purge]
|
[EVENT_OnKeyPressed_webservice.purge]
|
||||||
10 = os_execute:/home/doorpi/purge.sh purge
|
10 = os_execute:find /home/doorpi/records/ -type f ! -newer var/run/doorpi.pid -delete
|
||||||
|
|
||||||
|
#-- clear all files (NOT YET OK)
|
||||||
[EVENT_OnKeyPressed_webservice.clear]
|
[EVENT_OnKeyPressed_webservice.clear]
|
||||||
10 = os_execute:/home/doorpi/purge.sh clear
|
10 = os_execute:/home/doorpi/purge.sh clear > /home/doorpi/yyy
|
||||||
|
|
||||||
[EVENT_OnKeyPressed_webservice.button1]
|
[EVENT_OnKeyPressed_webservice.button1]
|
||||||
10 = call:722622
|
10 = call:722622
|
||||||
|
|
||||||
[EVENT_OnKeyPressed_webservice.button2]
|
[EVENT_OnKeyPressed_webservice.button2]
|
||||||
10 = sleep:0
|
10 = echo -e '{ReadingsVal("A.Haus.T","call_number",722622)}' | socat -t50 - TCP:192.168.0.90:7072 > /home/doorpi/callnumber
|
||||||
|
|
||||||
[onboardpins_keyboard]
|
[onboardpins_keyboard]
|
||||||
pull_up_down = PUD_UP
|
pull_up_down = PUD_UP
|
||||||
@ -152,13 +156,19 @@ pull_up_down = PUD_UP
|
|||||||
#-- NOK pin from Arduino
|
#-- NOK pin from Arduino
|
||||||
7 = sleep:0
|
7 = sleep:0
|
||||||
|
|
||||||
[EVENT_OnKeyPressed_onboardpins.7]
|
#-- OK pin from Arduino
|
||||||
10 = os_execute:/home/doorpi/iButton_NOK.sh
|
|
||||||
|
|
||||||
[EVENT_OnKeyPressed_onboardpins.6]
|
[EVENT_OnKeyPressed_onboardpins.6]
|
||||||
10 = os_execute:/home/doorpi/iButton_OK.sh
|
10 = os_execute:aplay -D plughw:1,0 /home/doorpi/sounds/067_willkommen.wav
|
||||||
20 = out:door,1,0,3
|
20 = url_call:http://192.168.0.90:8085/fhem?XHR=1&cmd.GalaxyTab=set GalaxyTab ttsSay Ein Bewohner betritt das Haus
|
||||||
|
30 = url_call:http://192.168.0.90:8085/fhem?XHR=1&cmd.A.Haus.T=set A.Haus.T door opened
|
||||||
|
40 = out:door,1,0,3
|
||||||
|
|
||||||
|
#-- NOK pin from Arduino
|
||||||
|
[EVENT_OnKeyPressed_onboardpins.7]
|
||||||
|
10 = take_snapshot
|
||||||
|
20 = url_call:http://192.168.0.90:8085/fhem?XHR=1&cmd.GalaxyTab=set GalaxyTab ttsSay Unerlaubter Zutrittsversuch
|
||||||
|
30 = url_call:http://192.168.0.90:8085/fhem?XHR=1&cmd.A.Haus.T=set A.Haus.T door wrong_id
|
||||||
|
|
||||||
[DTMF]
|
[DTMF]
|
||||||
"2" = out:door,1,0,3
|
"#" = out:door,1,0,3
|
||||||
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
# ! /usr/bin/sh
|
|
||||||
# get FHEM values
|
|
||||||
callnumber='{ReadingsVal("A.Haus.T.Klingel","callnumber",0)}'
|
|
||||||
FHEM=`echo -e "$callnumber" | socat -t50 - TCP:192.168.0.90:7072`
|
|
||||||
|
|
||||||
echo "$FHEM" > /var/DoorPi/callnumber
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
# ! /usr/bin/sh
|
|
||||||
curl "http://192.168.0.90:8085/fhem?XHR=1&cmd.GalaxyTab=set%20GalaxyTab%20ttsSay%20Unerlaubter%20Zutrittsversuch"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
# ! /usr/bin/sh
|
|
||||||
aplay -D plughw:1,0 /home/doorpi/sounds/067_willkommen.wav
|
|
||||||
curl "http://192.168.0.90:8085/fhem?XHR=1&cmd.GalaxyTab=set%20GalaxyTab%20ttsSay%20Ein%20Bewohner%20betritt%20das%20Haus"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
# ! /usr/bin/sh
|
|
||||||
action=$1
|
|
||||||
|
|
||||||
get_modify_time()
|
|
||||||
{
|
|
||||||
stat $1 | grep -Po "Modify: \K[0-9- :]*"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$action" == "purge" ]; then
|
|
||||||
reference=/var/run/doorpi.pid
|
|
||||||
find records/ -type f ! -newer $reference -delete
|
|
||||||
elif [ "$action" == "clear" ]; then
|
|
||||||
echo "clear"
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "so what"
|
|
||||||
fi
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user