diff --git a/75_msgConfig.pm b/75_msgConfig.pm
index 49ca255..32a72fd 100755
--- a/75_msgConfig.pm
+++ b/75_msgConfig.pm
@@ -143,7 +143,7 @@ sub msgConfig_Initialize($) {
"msgType:text,push,mail,screen,light,audio,queue",
)
{
- addToAttrList($_);
+ addToAttrList( $_, 'msgConfig' );
}
return FHEM::Meta::InitMod( __FILE__, $hash );
@@ -171,7 +171,6 @@ sub msgConfig_Define($$) {
# create global unique device definition
$modules{$TYPE}{defptr} = $hash;
- $hash->{SCOPE} = "global";
# set default settings on first define
if ( $init_done && !defined( $hash->{OLDDEF} ) ) {
@@ -191,9 +190,9 @@ sub msgConfig_Define($$) {
readingsEndUpdate( $hash, 1 );
}
- $hash->{NOTIFYDEV} = "TYPE=(Jabber|TelegramBot|yowsup)";
+ setNotifyDev( $hash, 'TYPE=(Jabber|TelegramBot|yowsup|Signalbot)' );
- return undef;
+ return;
}
sub msgConfig_Undefine($$) {
@@ -227,9 +226,9 @@ sub msgConfig_Set($@) {
# addLocation
elsif ( lc($what) eq "addlocation" ) {
my $location = join( " ", @a );
- my $group = AttrVal( $name, "group", $TYPE );
- my $room = AttrVal( $name, "room", "" );
- my $return = "";
+ my $group = AttrVal( $name, "group", $TYPE );
+ my $room = AttrVal( $name, "room", "" );
+ my $return = "";
return "Missing argument 'location'"
if ( $location eq "" );
@@ -251,7 +250,7 @@ sub msgConfig_Set($@) {
}
$attr{$device}{group} = $group if ( !defined( $attr{$device}{group} ) );
- $attr{$device}{room} = $room
+ $attr{$device}{room} = $room
if ( !defined( $attr{$device}{room} ) && $room ne "" );
$attr{$device}{comment} = "Auto-created by $name"
if ( !defined( $attr{$device}{comment} ) );
@@ -617,6 +616,12 @@ sub msgConfig_Notify($$) {
$msg = ReadingsVal( $devName, "message", undef );
}
+ #Signalbot
+ elsif ( $devType eq 'Signalbot' ) {
+ $sender = ReadingsVal( $devName, 'msgSender', undef );
+ $msg = ReadingsVal( $devName, 'msgText', undef );
+ }
+
next unless ( $msg && $msg ne "" );
unless ( $sender && $sender ne "" ) {
@@ -810,14 +815,19 @@ sub msgConfig_QueueReleaseMsgId($$) {
1;
+__END__
+
=pod
+
+=encoding utf8
+
=item helper
=item summary global settings and tools for FHEM command msg
-=item summary_DE globale Einstellungen und Tools f¨r das FHEM Kommando msg
+=item summary_DE globale Einstellungen und Tools für das FHEM Kommando msg
=begin html
-
+
msgConfig
@@ -827,30 +837,30 @@ sub msgConfig_QueueReleaseMsgId($$) {
A device named globalMsg will be created automatically when using msg-command for the first time and no msgConfig device could be found.
The device name can be renamed and reconfigured afterwards if desired.
- Define
+ Define
- Set
+ Set
-
- addLocation
+ addLocation
Conveniently creates a Dummy device based on the given location name. It will be pre-configured to be used together with location-based routing when using the msg-command. The dummy device will be added to attribute msgLocationDevs automatically. Afterwards additional configuration is required by adding msgContact* or msgRecipient* attributes for gateway devices placed at this specific location.
-
- cleanReadings []
+ cleanReadings []
Easy way to cleanup all fhemMsg readings. A parameter is optional and can be a concrete device name or mixed together with regex. This command is an alias for "deletereading fhemMsg.*".
-
- createResidentsDev
+ createResidentsDev
Creates a new device named rgr_Residents of type RESIDENTS. It will be pre-configured based on the given language. In case rgr_Residents exists it will be updated based on the given language (basically only a language change). Afterwards next configuration steps will be displayed to use RESIDENTS together with presence-based routing of the msg-command.
This next step is basically to set attribute msgResidentsDevice to refer to this RESIDENTS device either globally or for any other specific FHEM device (most likely you do NOT want to have this attribute set globally as otherwise this will affect ALL devices and therefore ALL msg-commands in your automations).
Note that use of RESIDENTS only makes sense together with ROOMMATE and or GUEST devices which still need to be created manually. See RESIDENTS Set commands addRoommate and addGuest respectively.
-
- createSwitcherDev
+ createSwitcherDev
Creates a pre-configured Dummy device named HouseAnn and updates globalMsg attribute msgSwitcherDev to refer to it.
@@ -862,7 +872,7 @@ This next step is basically to set attribute msgResidentsDevice to refer to this
=begin html_DE
-
+
msgConfig
@@ -872,20 +882,54 @@ This next step is basically to set attribute msgResidentsDevice to refer to this
Ein Device mit dem Namen globalMsg wird automatisch bei der ersten Benutzung des msg Kommandos angelegt, sofern kein msgConfig Device gefunden wurde.
Der Device Name kann anschließend beliebig umbenannt und umkonfiguriert werden.
- Define
+ Define
- Set
+
+ Set
-
- addLocation
+ addLocation
Erstellt auf einfache Weise ein Dummy Device basierend auf dem übergebenen Lokationsnamen. Es wird for die lokations-basierte Verwendung mit dem msg-Kommando vorkonfiguriert. Das Dummy Device wird automatisch zum Attribut msgLocationDevs hinzugefügt. Anschließend ist eine weitere Konfiguration über die Attribute msgContact* oder msgRecipient* notwendig, die auf entsprechende Gateway Devices verweisen, die an dieser Lokation stehen.
+ -
+ cleanReadings []
+ Einfache Methode, um alle fhemMsg-Readings zu säubern. Optional kann ein Parameter angegeben werden, um ein bestimmtes Device zu säubern, als Device Name kann auch regex angegeben werden. Dieses Kommando ist ein Alias for "deletereading fhemMsg.*".
+
+ -
+ createResidentsDev
+ Creates a new device named rgr_Residents of type RESIDENTS. It will be pre-configured based on the given language. In case rgr_Residents exists it will be updated based on the given language (basically only a language change). Afterwards next configuration steps will be displayed to use RESIDENTS together with presence-based routing of the msg-command.
+This next step is basically to set attribute msgResidentsDevice to refer to this RESIDENTS device either globally or for any other specific FHEM device (most likely you do NOT want to have this attribute set globally as otherwise this will affect ALL devices and therefore ALL msg-commands in your automations).
+ Note that use of RESIDENTS only makes sense together with ROOMMATE and or GUEST devices which still need to be created manually. See RESIDENTS Set commands addRoommate and addGuest respectively.
+
+ -
+ createSwitcherDev
+ Creates a pre-configured Dummy device named HouseAnn and updates globalMsg attribute msgSwitcherDev to refer to it.
+
+
+ Attribute
+
+
+ -
+ msgContact<TYPE>
+ FHEM Gerätename, welcher zur Übermittlung von Nachrichten des jeweiligen Typs angesprochen werden soll.
+
+ - Muss bei Audio Nachrichten ohne eigene Definition von msgCmdAudio* ein Gerät vom Typ SONOSPLAYER sein.
+ - Muss bei Screen Nachrichten ohne eigene Definition von msgCmdScreen* ein Gerät vom Typ ENIGMA2 sein.
+ - Muss bei Light Nachrichten ohne eigene Definition von msgCmdLight* ein Gerät vom Typ HUEDevice sein.
+ - Muss bei Push Nachrichten ohne eigene Definition von msgCmdPush* ein Gerät vom Typ Pushover sein.
+ - Muss bei Mail Nachrichten eine oder mehrere gültige E-Mail Adressen enthalten.
+
+ Bei FHEM Gerätenamen, über die mehrere Empfänger adressiert werden können, kann der Empfänger mittels Doppelpunkt getrennt vom FHEM Gerätenamen angegeben werden. Je nach Modul ist das optional oder verbindlich.
+
+
+
+
=end html_DE