mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
msg: rename 99_msg.pm to 98_msg.pm; initial commit for global configuration device msgConfig
git-svn-id: https://svn.fhem.de/fhem/trunk@9518 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2a67128409
commit
f38068d5f4
222
fhem/contrib/97_msgConfig.pm
Executable file
222
fhem/contrib/97_msgConfig.pm
Executable file
@ -0,0 +1,222 @@
|
|||||||
|
# $Id$
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# 97_msgConfig.pm
|
||||||
|
# Global configuration settings for FHEM msg command.
|
||||||
|
#
|
||||||
|
# Copyright by Julian Pawlowski
|
||||||
|
# e-mail: julian.pawlowski at gmail.com
|
||||||
|
#
|
||||||
|
# This file is part of fhem.
|
||||||
|
#
|
||||||
|
# Fhem is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Fhem is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Version: 1.0.0
|
||||||
|
#
|
||||||
|
# Major Version History:
|
||||||
|
# - 1.0.0 - 2015-10-18
|
||||||
|
# -- First release
|
||||||
|
#
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
package main;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
sub msgConfig_Set($@);
|
||||||
|
sub msgConfig_Define($$);
|
||||||
|
sub msgConfig_Undefine($$);
|
||||||
|
|
||||||
|
###################################
|
||||||
|
sub msgConfig_Initialize($) {
|
||||||
|
my ($hash) = @_;
|
||||||
|
|
||||||
|
$hash->{DefFn} = "msgConfig_Define";
|
||||||
|
$hash->{UndefFn} = "msgConfig_Undefine";
|
||||||
|
|
||||||
|
# add attributes for configuration
|
||||||
|
no warnings 'qw';
|
||||||
|
my @attrList = qw(
|
||||||
|
msgCmdAudio
|
||||||
|
msgCmdAudioShort
|
||||||
|
msgCmdAudioShortPrio
|
||||||
|
msgCmdLight
|
||||||
|
msgCmdLightHigh
|
||||||
|
msgCmdLightLow
|
||||||
|
msgCmdMail
|
||||||
|
msgCmdMailHigh
|
||||||
|
msgCmdMailLow
|
||||||
|
msgCmdPush
|
||||||
|
msgCmdPushHigh
|
||||||
|
msgCmdPushLow
|
||||||
|
msgCmdScreen
|
||||||
|
msgCmdScreenHigh
|
||||||
|
msgCmdScreenLow
|
||||||
|
msgFwPrioAbsentAudio
|
||||||
|
msgFwPrioAbsentLight
|
||||||
|
msgFwPrioAbsentScreen
|
||||||
|
msgFwPrioEmergencyAudio
|
||||||
|
msgFwPrioEmergencyLight
|
||||||
|
msgFwPrioEmergencyPush
|
||||||
|
msgFwPrioEmergencyScreen
|
||||||
|
msgFwPrioGoneAudio
|
||||||
|
msgFwPrioGoneLight
|
||||||
|
msgFwPrioGoneScreen
|
||||||
|
msgLocationDevs
|
||||||
|
msgPriorityAudio:-2,-1,0,1,2
|
||||||
|
msgPriorityLight:-2,-1,0,1,2
|
||||||
|
msgPriorityMail:-2,-1,0,1,2
|
||||||
|
msgPriorityPush:-2,-1,0,1,2
|
||||||
|
msgPriorityScreen:-2,-1,0,1,2
|
||||||
|
msgPriorityText:-2,-1,0,1,2
|
||||||
|
msgResidentsDev
|
||||||
|
msgSwitcherDev
|
||||||
|
msgThPrioHigh:-2,-1,0,1,2
|
||||||
|
msgThPrioNormal:-2,-1,0,1,2
|
||||||
|
msgThPrioAudioEmergency:-2,-1,0,1,2
|
||||||
|
msgThPrioAudioHigh:-2,-1,0,1,2
|
||||||
|
msgThPrioTextEmergency:-2,-1,0,1,2
|
||||||
|
msgThPrioTextNormal:-2,-1,0,1,2
|
||||||
|
msgThPrioGwEmergency:-2,-1,0,1,2
|
||||||
|
msgTitleAudio
|
||||||
|
msgTitleAudioShort
|
||||||
|
msgTitleAudioShortPrio
|
||||||
|
msgTitleLight
|
||||||
|
msgTitleLightHigh
|
||||||
|
msgTitleLightLow
|
||||||
|
msgTitleMail
|
||||||
|
msgTitleMailHigh
|
||||||
|
msgTitleMailLow
|
||||||
|
msgTitlePush
|
||||||
|
msgTitlePushHigh
|
||||||
|
msgTitlePushLow
|
||||||
|
msgTitleScreen
|
||||||
|
msgTitleScreenHigh
|
||||||
|
msgTitleScreenLow
|
||||||
|
msgTitleText
|
||||||
|
msgTitleTextHigh
|
||||||
|
msgTitleTextLow
|
||||||
|
|
||||||
|
);
|
||||||
|
use warnings 'qw';
|
||||||
|
$hash->{AttrList} = join( " ", @attrList ) . " " . $readingFnAttributes;
|
||||||
|
|
||||||
|
# add global attributes
|
||||||
|
foreach (
|
||||||
|
"msgContactAudio", "msgContactMail", "msgContactPush",
|
||||||
|
"msgContactScreen", "msgContactLight", "msgRecipient",
|
||||||
|
"msgRecipientAudio", "msgRecipientMail", "msgRecipientPush",
|
||||||
|
"msgRecipientScreen", "msgRecipientText", "msgRecipientLight",
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addToAttrList($_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
###################################
|
||||||
|
sub msgConfig_Define($$) {
|
||||||
|
|
||||||
|
my ( $hash, $def ) = @_;
|
||||||
|
|
||||||
|
my @a = split( "[ \t]+", $def, 5 );
|
||||||
|
|
||||||
|
return "Usage: define <name> msgConfig"
|
||||||
|
if ( int(@a) < 2 );
|
||||||
|
my $name = $a[0];
|
||||||
|
|
||||||
|
# set default settings on first define
|
||||||
|
if ($init_done) {
|
||||||
|
my $group = AttrVal("global","group","Global");
|
||||||
|
my $room = AttrVal("global","room","");
|
||||||
|
my $verbose = AttrVal("global","verbose",3);
|
||||||
|
|
||||||
|
$attr{$name}{group} = $group;
|
||||||
|
$attr{$name}{verbose} = $verbose;
|
||||||
|
$attr{$name}{room} = $room if ($room ne "");
|
||||||
|
$attr{$name}{comment} = "FHEM Global Configuration for command 'msg'";
|
||||||
|
$attr{$name}{stateFormat} = "fhemMsgState";
|
||||||
|
|
||||||
|
readingsBeginUpdate($hash);
|
||||||
|
readingsBulkUpdate( $hash, "fhemMsgState", "initialized" );
|
||||||
|
readingsEndUpdate( $hash, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
|
###################################
|
||||||
|
sub msgConfig_Undefine($$) {
|
||||||
|
|
||||||
|
my ( $hash, $name ) = @_;
|
||||||
|
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
=pod
|
||||||
|
|
||||||
|
=begin html
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a name="msgConfig" id="msgConfig"></a>
|
||||||
|
</p>
|
||||||
|
<h3>
|
||||||
|
msgConfig
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Provides global settings to configure FHEM command 'msg'.<br>
|
||||||
|
<br>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a name="msgConfigdefine" id="msgConfigdefine"></a> <b>Define</b>
|
||||||
|
<div style="margin-left: 2em">
|
||||||
|
<code>define <name></code><br>
|
||||||
|
<br>
|
||||||
|
Defines the global msg control device instance. Pleae note there can only be one unique definition of this device type.<br>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<b>Usage information</b><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<b>Integration with Home Automation</b><br>
|
||||||
|
<br>
|
||||||
|
<div style="margin-left: 2em">
|
||||||
|
You might want to have a look to the module family of <a href="#ROOMMATE">ROOMMATE</a>, <a href="#GUEST">GUEST</a> and <a href="#RESIDENTS">RESIDENTS</a> for an easy processing of msgConfig events.
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
=end html
|
||||||
|
|
||||||
|
=begin html_DE
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a name="msgConfig" id="msgConfig"></a>
|
||||||
|
</p>
|
||||||
|
<h3>
|
||||||
|
msgConfig
|
||||||
|
</h3>
|
||||||
|
<div style="margin-left: 2em">
|
||||||
|
Eine deutsche Version der Dokumentation ist derzeit nicht vorhanden. Die englische Version ist hier zu finden:
|
||||||
|
</div>
|
||||||
|
<div style="margin-left: 2em">
|
||||||
|
<a href='http://fhem.de/commandref.html#msgConfig'>msgConfig</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
=end html_DE
|
||||||
|
|
||||||
|
=cut
|
224
fhem/contrib/99_msg.pm → fhem/contrib/98_msg.pm
Normal file → Executable file
224
fhem/contrib/99_msg.pm → fhem/contrib/98_msg.pm
Normal file → Executable file
@ -1,7 +1,7 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# 99_msg.pm
|
# 98_msg.pm
|
||||||
# Dynamic message and notification routing for FHEM
|
# Dynamic message and notification routing for FHEM
|
||||||
#
|
#
|
||||||
# Copyright by Julian Pawlowski
|
# Copyright by Julian Pawlowski
|
||||||
@ -50,84 +50,6 @@ sub msg_Initialize($$) {
|
|||||||
"[<type>] [<\@device>|<e-mail address>] [<priority>] [|<title>|] <message>",
|
"[<type>] [<\@device>|<e-mail address>] [<priority>] [|<title>|] <message>",
|
||||||
);
|
);
|
||||||
$cmds{msg} = \%hash;
|
$cmds{msg} = \%hash;
|
||||||
|
|
||||||
# add attributes for configuration
|
|
||||||
no warnings 'qw';
|
|
||||||
my @attrList = qw(
|
|
||||||
msgCmdAudio
|
|
||||||
msgCmdAudioShort
|
|
||||||
msgCmdAudioShortPrio
|
|
||||||
msgCmdLight
|
|
||||||
msgCmdLightHigh
|
|
||||||
msgCmdLightLow
|
|
||||||
msgCmdMail
|
|
||||||
msgCmdMailHigh
|
|
||||||
msgCmdMailLow
|
|
||||||
msgCmdPush
|
|
||||||
msgCmdPushHigh
|
|
||||||
msgCmdPushLow
|
|
||||||
msgCmdScreen
|
|
||||||
msgCmdScreenHigh
|
|
||||||
msgCmdScreenLow
|
|
||||||
msgFwPrioAbsentAudio
|
|
||||||
msgFwPrioAbsentLight
|
|
||||||
msgFwPrioAbsentScreen
|
|
||||||
msgFwPrioEmergencyAudio
|
|
||||||
msgFwPrioEmergencyLight
|
|
||||||
msgFwPrioEmergencyPush
|
|
||||||
msgFwPrioEmergencyScreen
|
|
||||||
msgFwPrioGoneAudio
|
|
||||||
msgFwPrioGoneLight
|
|
||||||
msgFwPrioGoneScreen
|
|
||||||
msgLocationDevs
|
|
||||||
msgPriorityAudio:-2,-1,0,1,2
|
|
||||||
msgPriorityLight:-2,-1,0,1,2
|
|
||||||
msgPriorityMail:-2,-1,0,1,2
|
|
||||||
msgPriorityPush:-2,-1,0,1,2
|
|
||||||
msgPriorityScreen:-2,-1,0,1,2
|
|
||||||
msgPriorityText:-2,-1,0,1,2
|
|
||||||
msgResidentsDev
|
|
||||||
msgSwitcherDev
|
|
||||||
msgThPrioHigh:-2,-1,0,1,2
|
|
||||||
msgThPrioNormal:-2,-1,0,1,2
|
|
||||||
msgThPrioAudioEmergency:-2,-1,0,1,2
|
|
||||||
msgThPrioAudioHigh:-2,-1,0,1,2
|
|
||||||
msgThPrioTextEmergency:-2,-1,0,1,2
|
|
||||||
msgThPrioTextNormal:-2,-1,0,1,2
|
|
||||||
msgThPrioGwEmergency:-2,-1,0,1,2
|
|
||||||
msgTitleAudio
|
|
||||||
msgTitleAudioShort
|
|
||||||
msgTitleAudioShortPrio
|
|
||||||
msgTitleLight
|
|
||||||
msgTitleLightHigh
|
|
||||||
msgTitleLightLow
|
|
||||||
msgTitleMail
|
|
||||||
msgTitleMailHigh
|
|
||||||
msgTitleMailLow
|
|
||||||
msgTitlePush
|
|
||||||
msgTitlePushHigh
|
|
||||||
msgTitlePushLow
|
|
||||||
msgTitleScreen
|
|
||||||
msgTitleScreenHigh
|
|
||||||
msgTitleScreenLow
|
|
||||||
msgTitleText
|
|
||||||
msgTitleTextHigh
|
|
||||||
msgTitleTextLow
|
|
||||||
|
|
||||||
);
|
|
||||||
use warnings 'qw';
|
|
||||||
$modules{Global}{AttrList} .= " " . join( " ", @attrList );
|
|
||||||
|
|
||||||
# add global attributes
|
|
||||||
foreach (
|
|
||||||
"msgContactAudio", "msgContactMail", "msgContactPush",
|
|
||||||
"msgContactScreen", "msgContactLight", "msgRecipient",
|
|
||||||
"msgRecipientAudio", "msgRecipientMail", "msgRecipientPush",
|
|
||||||
"msgRecipientScreen", "msgRecipientText", "msgRecipientLight",
|
|
||||||
)
|
|
||||||
{
|
|
||||||
addToAttrList($_);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
@ -135,6 +57,20 @@ sub CommandMsg($$;$$) {
|
|||||||
my ( $cl, $msg, $testMode ) = @_;
|
my ( $cl, $msg, $testMode ) = @_;
|
||||||
my $return = "";
|
my $return = "";
|
||||||
|
|
||||||
|
# find existing msgConfig device or create a new instance
|
||||||
|
my $globalDevName = "";
|
||||||
|
if (defined ($defs{"msgConfig"})) {
|
||||||
|
if ($defs{"msgConfig"}{TYPE} eq "msgConfig") {
|
||||||
|
$globalDevName = "msgConfig";
|
||||||
|
} else {
|
||||||
|
return "Device msgConfig has incorrect type - aborting...";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fhem "define msgConfig msgConfig";
|
||||||
|
$globalDevName = "msgConfig";
|
||||||
|
$return .= "Global configuration device msgConfig was created.";
|
||||||
|
}
|
||||||
|
|
||||||
if ( $msg eq "" || $msg =~ /^\?[\s\t]*$/ || $msg eq "help" ) {
|
if ( $msg eq "" || $msg =~ /^\?[\s\t]*$/ || $msg eq "help" ) {
|
||||||
return
|
return
|
||||||
"Usage: msg [<type>] [<\@device>|<e-mail address>] [<priority>] [|<title>|] <message>";
|
"Usage: msg [<type>] [<\@device>|<e-mail address>] [<priority>] [|<title>|] <message>";
|
||||||
@ -430,9 +366,9 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
eval 'use JSON qw( decode_json ); 1';
|
eval 'use JSON qw( decode_json ); 1';
|
||||||
if ( !$@ ) {
|
if ( !$@ ) {
|
||||||
$advanced = decode_json( Encode::encode_utf8($1) );
|
$advanced = decode_json( Encode::encode_utf8($1) );
|
||||||
Log3 "global", 5, "msg: Advanced options\n" . Dumper($advanced);
|
Log3 $globalDevName, 5, "msg: Advanced options\n" . Dumper($advanced);
|
||||||
} else {
|
} else {
|
||||||
Log3 "global", 3, "msg: To use advanced options, please install Perl::JSON.";
|
Log3 $globalDevName, 3, "msg: To use advanced options, please install Perl::JSON.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -451,11 +387,11 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
my $isRecipientOr = 1;
|
my $isRecipientOr = 1;
|
||||||
my $hasTypeOr = 0;
|
my $hasTypeOr = 0;
|
||||||
my $hasRecipientOr = 0;
|
my $hasRecipientOr = 0;
|
||||||
$recipients = "\@global" if ( $recipients eq "" );
|
$recipients = "\@".$globalDevName if ( $recipients eq "" );
|
||||||
|
|
||||||
my @typesOr = split( /\|/, $types );
|
my @typesOr = split( /\|/, $types );
|
||||||
$hasTypeOr = 1 if ( scalar( grep { defined $_ } @typesOr ) > 1 );
|
$hasTypeOr = 1 if ( scalar( grep { defined $_ } @typesOr ) > 1 );
|
||||||
Log3 "global", 5,
|
Log3 $globalDevName, 5,
|
||||||
"msg: typeOr total is " . scalar( grep { defined $_ } @typesOr )
|
"msg: typeOr total is " . scalar( grep { defined $_ } @typesOr )
|
||||||
if ( $testMode ne "1" );
|
if ( $testMode ne "1" );
|
||||||
|
|
||||||
@ -465,13 +401,13 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
$iTypesOr++
|
$iTypesOr++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Log3 "global", 5,
|
Log3 $globalDevName, 5,
|
||||||
"msg: start typeOr loop for type(s) $typesOr[$iTypesOr]"
|
"msg: start typeOr loop for type(s) $typesOr[$iTypesOr]"
|
||||||
if ( $testMode ne "1" );
|
if ( $testMode ne "1" );
|
||||||
|
|
||||||
my @type = split( /,/, $typesOr[$iTypesOr] );
|
my @type = split( /,/, $typesOr[$iTypesOr] );
|
||||||
for ( my $i = 0 ; $i < scalar( grep { defined $_ } @type ) ; $i++ ) {
|
for ( my $i = 0 ; $i < scalar( grep { defined $_ } @type ) ; $i++ ) {
|
||||||
Log3 "global", 5, "msg: running loop for type $type[$i]"
|
Log3 $globalDevName, 5, "msg: running loop for type $type[$i]"
|
||||||
if ( $testMode ne "1" );
|
if ( $testMode ne "1" );
|
||||||
last if ( !defined( $type[$i] ) );
|
last if ( !defined( $type[$i] ) );
|
||||||
|
|
||||||
@ -496,7 +432,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
my @recipientsOr = split( /\|/, $recipients );
|
my @recipientsOr = split( /\|/, $recipients );
|
||||||
$hasRecipientOr = 1
|
$hasRecipientOr = 1
|
||||||
if ( scalar( grep { defined $_ } @recipientsOr ) > 1 );
|
if ( scalar( grep { defined $_ } @recipientsOr ) > 1 );
|
||||||
Log3 "global", 5,
|
Log3 $globalDevName, 5,
|
||||||
"msg: recipientOr total is "
|
"msg: recipientOr total is "
|
||||||
. scalar( grep { defined $_ } @recipientsOr )
|
. scalar( grep { defined $_ } @recipientsOr )
|
||||||
if ( $testMode ne "1" );
|
if ( $testMode ne "1" );
|
||||||
@ -507,14 +443,14 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
$iRecipOr++
|
$iRecipOr++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Log3 "global", 5,
|
Log3 $globalDevName, 5,
|
||||||
"msg: start recipientsOr loop for recipient(s) $recipientsOr[$iRecipOr]"
|
"msg: start recipientsOr loop for recipient(s) $recipientsOr[$iRecipOr]"
|
||||||
if ( $testMode ne "1" );
|
if ( $testMode ne "1" );
|
||||||
|
|
||||||
my @recipient = split( /,/, $recipientsOr[$iRecipOr] );
|
my @recipient = split( /,/, $recipientsOr[$iRecipOr] );
|
||||||
foreach my $device (@recipient) {
|
foreach my $device (@recipient) {
|
||||||
|
|
||||||
Log3 "global", 5, "msg: running loop for device $device"
|
Log3 $globalDevName, 5, "msg: running loop for device $device"
|
||||||
if ( $testMode ne "1" );
|
if ( $testMode ne "1" );
|
||||||
|
|
||||||
my $messageSentDev = 0;
|
my $messageSentDev = 0;
|
||||||
@ -542,7 +478,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
&& $deviceType eq "device" )
|
&& $deviceType eq "device" )
|
||||||
{
|
{
|
||||||
$return .= "Device $device does not exist\n";
|
$return .= "Device $device does not exist\n";
|
||||||
Log3 "global", 5, "msg $device: Device does not exist"
|
Log3 $globalDevName, 5, "msg $device: Device does not exist"
|
||||||
if ( $testMode ne "1" );
|
if ( $testMode ne "1" );
|
||||||
|
|
||||||
my $regex1 =
|
my $regex1 =
|
||||||
@ -568,7 +504,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
my $useLocation = 0;
|
my $useLocation = 0;
|
||||||
|
|
||||||
my $logDevice;
|
my $logDevice;
|
||||||
$logDevice = "global";
|
$logDevice = $globalDevName;
|
||||||
$logDevice = $device
|
$logDevice = $device
|
||||||
if (
|
if (
|
||||||
# look for direct
|
# look for direct
|
||||||
@ -617,12 +553,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgLocationDevs",
|
$globalDevName, "msgLocationDevs",
|
||||||
|
|
||||||
#look for global indirect
|
#look for global indirect
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient$typeUc", ""
|
"msgRecipient$typeUc", ""
|
||||||
),
|
),
|
||||||
"msgLocationDevs",
|
"msgLocationDevs",
|
||||||
@ -630,7 +566,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
# look for global indirect general
|
# look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgLocationDevs",
|
"msgLocationDevs",
|
||||||
@ -897,7 +833,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
# fallback/catchall
|
# fallback/catchall
|
||||||
if ( $gatewayDevs eq "" ) {
|
if ( $gatewayDevs eq "" ) {
|
||||||
$catchall = 1
|
$catchall = 1
|
||||||
if ( $device ne "global" );
|
if ( $device ne $globalDevName );
|
||||||
|
|
||||||
Log3 $logDevice, 5,
|
Log3 $logDevice, 5,
|
||||||
"msg $device: (No $typeUc contact defined, trying global instead)"
|
"msg $device: (No $typeUc contact defined, trying global instead)"
|
||||||
@ -907,18 +843,18 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for direct
|
# look for direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgContact$typeUc",
|
$globalDevName, "msgContact$typeUc",
|
||||||
|
|
||||||
#look for indirect
|
#look for indirect
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient$typeUc", ""
|
$globalDevName, "msgRecipient$typeUc", ""
|
||||||
),
|
),
|
||||||
"msgContact$typeUc",
|
"msgContact$typeUc",
|
||||||
|
|
||||||
#look for indirect general
|
#look for indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal( "global", "msgRecipient", "" ),
|
AttrVal( $globalDevName, "msgRecipient", "" ),
|
||||||
"msgContact$typeUc",
|
"msgContact$typeUc",
|
||||||
|
|
||||||
# no contact found
|
# no contact found
|
||||||
@ -949,12 +885,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgPriority$typeUc",
|
$globalDevName, "msgPriority$typeUc",
|
||||||
|
|
||||||
#look for global indirect
|
#look for global indirect
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient$typeUc",
|
$globalDevName, "msgRecipient$typeUc",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgPriority$typeUc",
|
"msgPriority$typeUc",
|
||||||
@ -962,7 +898,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general
|
#look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgPriority$typeUc",
|
"msgPriority$typeUc",
|
||||||
@ -1078,12 +1014,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgThPrioTextEmergency",
|
$globalDevName, "msgThPrioTextEmergency",
|
||||||
|
|
||||||
#look for global indirect type
|
#look for global indirect type
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient$typeUc", ""
|
"msgRecipient$typeUc", ""
|
||||||
),
|
),
|
||||||
"msgThPrioTextEmergency",
|
"msgThPrioTextEmergency",
|
||||||
@ -1091,7 +1027,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general
|
#look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgThPrioTextEmergency",
|
"msgThPrioTextEmergency",
|
||||||
@ -1124,12 +1060,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgThPrioTextNormal",
|
$globalDevName, "msgThPrioTextNormal",
|
||||||
|
|
||||||
#look for global indirect type
|
#look for global indirect type
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient$typeUc", ""
|
"msgRecipient$typeUc", ""
|
||||||
),
|
),
|
||||||
"msgThPrioTextNormal",
|
"msgThPrioTextNormal",
|
||||||
@ -1137,7 +1073,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general
|
#look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgThPrioTextNormal",
|
"msgThPrioTextNormal",
|
||||||
@ -1238,7 +1174,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
# FATAL ERROR: we could not find any targets for
|
# FATAL ERROR: we could not find any targets for
|
||||||
# user specified device...
|
# user specified device...
|
||||||
if ( $gatewayDevs eq ""
|
if ( $gatewayDevs eq ""
|
||||||
&& $device ne "global" )
|
&& $device ne $globalDevName )
|
||||||
{
|
{
|
||||||
$return .=
|
$return .=
|
||||||
"ERROR: Could not find any $typeUc contact for device $device - set attributes: msgContact$typeUc | msgRecipient$typeUc | msgRecipient\n";
|
"ERROR: Could not find any $typeUc contact for device $device - set attributes: msgContact$typeUc | msgRecipient$typeUc | msgRecipient\n";
|
||||||
@ -1283,12 +1219,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgSwitcherDev",
|
$globalDevName, "msgSwitcherDev",
|
||||||
|
|
||||||
#look for global indirect type
|
#look for global indirect type
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient$typeUc", ""
|
"msgRecipient$typeUc", ""
|
||||||
),
|
),
|
||||||
"msgSwitcherDev",
|
"msgSwitcherDev",
|
||||||
@ -1296,7 +1232,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general
|
#look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgSwitcherDev",
|
"msgSwitcherDev",
|
||||||
@ -1331,12 +1267,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgThPrioAudioEmergency",
|
$globalDevName, "msgThPrioAudioEmergency",
|
||||||
|
|
||||||
#look for global indirect type
|
#look for global indirect type
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient$typeUc", ""
|
"msgRecipient$typeUc", ""
|
||||||
),
|
),
|
||||||
"msgThPrioAudioEmergency",
|
"msgThPrioAudioEmergency",
|
||||||
@ -1344,7 +1280,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general
|
#look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgThPrioAudioEmergency",
|
"msgThPrioAudioEmergency",
|
||||||
@ -1377,12 +1313,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgThPrioAudioHigh",
|
$globalDevName, "msgThPrioAudioHigh",
|
||||||
|
|
||||||
#look for global indirect type
|
#look for global indirect type
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient$typeUc", ""
|
"msgRecipient$typeUc", ""
|
||||||
),
|
),
|
||||||
"msgThPrioAudioHigh",
|
"msgThPrioAudioHigh",
|
||||||
@ -1390,7 +1326,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general
|
#look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgThPrioAudioHigh",
|
"msgThPrioAudioHigh",
|
||||||
@ -1423,12 +1359,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgThPrioHigh",
|
$globalDevName, "msgThPrioHigh",
|
||||||
|
|
||||||
#look for global indirect type
|
#look for global indirect type
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient$typeUc", ""
|
"msgRecipient$typeUc", ""
|
||||||
),
|
),
|
||||||
"msgThPrioHigh",
|
"msgThPrioHigh",
|
||||||
@ -1436,7 +1372,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general
|
#look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgThPrioHigh",
|
"msgThPrioHigh",
|
||||||
@ -1469,12 +1405,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgThPrioNormal",
|
$globalDevName, "msgThPrioNormal",
|
||||||
|
|
||||||
#look for global indirect type
|
#look for global indirect type
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient$typeUc", ""
|
"msgRecipient$typeUc", ""
|
||||||
),
|
),
|
||||||
"msgThPrioNormal",
|
"msgThPrioNormal",
|
||||||
@ -1482,7 +1418,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general
|
#look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgThPrioNormal",
|
"msgThPrioNormal",
|
||||||
@ -1609,18 +1545,18 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|| $residentDevPresence eq ""
|
|| $residentDevPresence eq ""
|
||||||
)
|
)
|
||||||
&& ReadingsVal(
|
&& ReadingsVal(
|
||||||
AttrVal( "global", "msgRecipient$typeUc", "" ),
|
AttrVal( $globalDevName, "msgRecipient$typeUc", "" ),
|
||||||
"presence", "-" ) ne "-"
|
"presence", "-" ) ne "-"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$residentDevState =
|
$residentDevState =
|
||||||
ReadingsVal(
|
ReadingsVal(
|
||||||
AttrVal( "global", "msgRecipient$typeUc", "" ),
|
AttrVal( $globalDevName, "msgRecipient$typeUc", "" ),
|
||||||
"state", "" )
|
"state", "" )
|
||||||
if ( $residentDevState eq "" );
|
if ( $residentDevState eq "" );
|
||||||
$residentDevPresence =
|
$residentDevPresence =
|
||||||
ReadingsVal(
|
ReadingsVal(
|
||||||
AttrVal( "global", "msgRecipient$typeUc", "" ),
|
AttrVal( $globalDevName, "msgRecipient$typeUc", "" ),
|
||||||
"presence", "" )
|
"presence", "" )
|
||||||
if ( $residentDevPresence eq "" );
|
if ( $residentDevPresence eq "" );
|
||||||
}
|
}
|
||||||
@ -1631,16 +1567,16 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
$residentDevState eq ""
|
$residentDevState eq ""
|
||||||
|| $residentDevPresence eq ""
|
|| $residentDevPresence eq ""
|
||||||
)
|
)
|
||||||
&& ReadingsVal( AttrVal( "global", "msgRecipient", "" ),
|
&& ReadingsVal( AttrVal( $globalDevName, "msgRecipient", "" ),
|
||||||
"presence", "-" ) ne "-"
|
"presence", "-" ) ne "-"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$residentDevState =
|
$residentDevState =
|
||||||
ReadingsVal( AttrVal( "global", "msgRecipient", "" ),
|
ReadingsVal( AttrVal( $globalDevName, "msgRecipient", "" ),
|
||||||
"state", "" )
|
"state", "" )
|
||||||
if ( $residentDevState eq "" );
|
if ( $residentDevState eq "" );
|
||||||
$residentDevPresence =
|
$residentDevPresence =
|
||||||
ReadingsVal( AttrVal( "global", "msgRecipient", "" ),
|
ReadingsVal( AttrVal( $globalDevName, "msgRecipient", "" ),
|
||||||
"presence", "" )
|
"presence", "" )
|
||||||
if ( $residentDevPresence eq "" );
|
if ( $residentDevPresence eq "" );
|
||||||
}
|
}
|
||||||
@ -1652,18 +1588,18 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|| $residentDevPresence eq ""
|
|| $residentDevPresence eq ""
|
||||||
)
|
)
|
||||||
&& ReadingsVal(
|
&& ReadingsVal(
|
||||||
AttrVal( "global", "msgResidentsDev", "" ),
|
AttrVal( $globalDevName, "msgResidentsDev", "" ),
|
||||||
"presence", "-" ) ne "-"
|
"presence", "-" ) ne "-"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$residentDevState =
|
$residentDevState =
|
||||||
ReadingsVal(
|
ReadingsVal(
|
||||||
AttrVal( "global", "msgResidentsDev", "" ),
|
AttrVal( $globalDevName, "msgResidentsDev", "" ),
|
||||||
"state", "" )
|
"state", "" )
|
||||||
if ( $residentDevState eq "" );
|
if ( $residentDevState eq "" );
|
||||||
$residentDevPresence =
|
$residentDevPresence =
|
||||||
ReadingsVal(
|
ReadingsVal(
|
||||||
AttrVal( "global", "msgResidentsDev", "" ),
|
AttrVal( $globalDevName, "msgResidentsDev", "" ),
|
||||||
"presence", "" )
|
"presence", "" )
|
||||||
if ( $residentDevPresence eq "" );
|
if ( $residentDevPresence eq "" );
|
||||||
}
|
}
|
||||||
@ -1690,12 +1626,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgThPrioGwEmergency",
|
$globalDevName, "msgThPrioGwEmergency",
|
||||||
|
|
||||||
#look for global indirect type
|
#look for global indirect type
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient$typeUc", ""
|
"msgRecipient$typeUc", ""
|
||||||
),
|
),
|
||||||
"msgThPrioGwEmergency",
|
"msgThPrioGwEmergency",
|
||||||
@ -1703,7 +1639,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general
|
#look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgThPrioGwEmergency",
|
"msgThPrioGwEmergency",
|
||||||
@ -1882,12 +1818,12 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct high
|
# look for global direct high
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgTitle$typeUc$priorityCat",
|
$globalDevName, "msgTitle$typeUc$priorityCat",
|
||||||
|
|
||||||
# look for global indirect high
|
# look for global indirect high
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient$typeUc",
|
$globalDevName, "msgRecipient$typeUc",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgTitle$typeUc$priorityCat",
|
"msgTitle$typeUc$priorityCat",
|
||||||
@ -1895,7 +1831,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general high
|
#look for global indirect general high
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global", "msgRecipient",
|
$globalDevName, "msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"msgTitle$typeUc$priorityCat",
|
"msgTitle$typeUc$priorityCat",
|
||||||
@ -1965,13 +1901,13 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
|
|
||||||
# look for global direct
|
# look for global direct
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgCmd$typeUc$priorityCat",
|
"msgCmd$typeUc$priorityCat",
|
||||||
|
|
||||||
# look for global indirect
|
# look for global indirect
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient$typeUc",
|
"msgRecipient$typeUc",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
@ -1980,7 +1916,7 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
#look for global indirect general
|
#look for global indirect general
|
||||||
AttrVal(
|
AttrVal(
|
||||||
AttrVal(
|
AttrVal(
|
||||||
"global",
|
$globalDevName,
|
||||||
"msgRecipient",
|
"msgRecipient",
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
@ -2113,19 +2049,19 @@ s/^[\s\t]*\|([\w\süöäß^°!"§$%&\/\\()<>=?´`"+\[\]#*@€]+)\|[\s\t]+//
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( !defined( $sentTypesPerDevice{$device} ) ) {
|
if ( !defined( $sentTypesPerDevice{$device} ) ) {
|
||||||
$sentTypesPerDevice{"global"} = "";
|
$sentTypesPerDevice{$globalDevName} = "";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$sentTypesPerDevice{"global"} .= " ";
|
$sentTypesPerDevice{$globalDevName} .= " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sentTypesPerDevice{"global"} .=
|
$sentTypesPerDevice{$globalDevName} .=
|
||||||
$type[$i] . ":" . $messageSentDev;
|
$type[$i] . ":" . $messageSentDev;
|
||||||
}
|
}
|
||||||
|
|
||||||
# update device readings
|
# update device readings
|
||||||
my $readingsDev = $defs{$device};
|
my $readingsDev = $defs{$device};
|
||||||
$readingsDev = $defs{"global"} if ( $catchall == 1 );
|
$readingsDev = $defs{$globalDevName} if ( $catchall == 1 );
|
||||||
readingsBeginUpdate($readingsDev);
|
readingsBeginUpdate($readingsDev);
|
||||||
|
|
||||||
readingsBulkUpdate( $readingsDev, "fhemMsg" . $typeUc,
|
readingsBulkUpdate( $readingsDev, "fhemMsg" . $typeUc,
|
Loading…
x
Reference in New Issue
Block a user