diff --git a/fhem/FHEM/73_AMADCommBridge.pm b/fhem/FHEM/73_AMADCommBridge.pm
index 46315e0ca..c1c8eb2f1 100644
--- a/fhem/FHEM/73_AMADCommBridge.pm
+++ b/fhem/FHEM/73_AMADCommBridge.pm
@@ -70,8 +70,8 @@ eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode ";
eval "use JSON;1" or $missingModul .= "JSON ";
-my $modulversion = "4.0.0";
-my $flowsetversion = "4.0.0";
+my $modulversion = "4.0.1";
+my $flowsetversion = "4.0.1";
@@ -114,6 +114,7 @@ sub AMADCommBridge_Initialize($) {
$hash->{AttrFn} = "AMADCommBridge_Attr";
$hash->{AttrList} = "fhemControlMode:trigger,setControl,thirdPartControl ".
"debugJSON:0,1 ".
+ "enableSubCalls:0,1 ".
"disable:1 ".
"allowFrom ".
$readingFnAttributes;
@@ -266,7 +267,6 @@ sub AMADCommBridge_ErrorHandling($$$) {
my ($param,$err,$data) = @_;
my $hash = $param->{hash};
- #my $name = $hash->{NAME};
my $dhash = $modules{AMADDevice}{defptr}{$param->{'amad_id'}};
my $dname = $dhash->{NAME};
@@ -804,10 +804,11 @@ sub AMADCommBridge_ResponseProcessing($$) {
my $fhemCmd = $decode_json->{payload}{setcmd};
fhem ("set $fhemCmd") if( AttrVal( $bname, 'fhemControlMode', 'trigger' ) eq 'setControl' );
- readingsSingleUpdate( $bhash, "receiveFhemCommand", "set ".$fhemCmd, 1 ) if( AttrVal( $bname, 'fhemControlMode', 'trigger' ) eq 'trigger' );;
+ my $r = AnalyzeCommandChain($bhash, 'set'.$fhemCmd);
+ readingsSingleUpdate( $bhash, "receiveFhemCommand", "set ".$fhemCmd, 1 ) if( AttrVal( $bname, 'fhemControlMode', 'trigger' ) eq 'trigger' );
Log3 $bname, 4, "AMADCommBridge ($name) - AMADCommBridge_CommBridge: set reading receive fhem command";
- $response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM execute set command now\r\n";
+ $response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM response $r\r\n";
$c = $hash->{CD};
print $c "HTTP/1.1 200 OK\r\n",
"Content-Type: text/plain\r\n",
@@ -853,34 +854,34 @@ sub AMADCommBridge_ResponseProcessing($$) {
return;
}
+ elsif ( $fhemcmd eq 'fhemfunc' ) {
+ my $fhemCmd = $decode_json->{payload}{fhemsub};
+
+ Log3 $bname, 4, "AMADCommBridge ($name) - AMADCommBridge_CommBridge: receive fhem-function command";
+
+ if( AttrVal( $bname, 'enableSubCalls', 0 ) == 1 ) {
-# elsif ( $fhemcmd =~ /fhemfunc\b/ ) {
-# my $fhemCmd = $data[1];
-#
-# Log3 $bname, 4, "AMADCommBridge ($name) - AMADCommBridge_CommBridge: receive fhem-function command";
-#
-# if( $fhemCmd =~ /^{.*}$/ ) {
-#
-# $response = $fhemCmd if( ReadingsVal( $name, "expertMode", 0 ) eq "1" );
-#
-# } else {
-#
-# $response = "header lines: \r\n AMADCommBridge receive no typical FHEM function\r\n FHEM to do nothing\r\n";
-# }
-#
-# $c = $hash->{CD};
-# print $c "HTTP/1.1 200 OK\r\n",
-# "Content-Type: text/plain\r\n",
-# "Connection: close\r\n",
-# "Content-Length: ".length($response)."\r\n\r\n",
-# $response;
-#
-# return;
-# }
-
+ $response = AnalyzeCommand($bhash, '{'.$fhemCmd.'}');
+
+ } else {
+
+ $response = "header lines: \r\n Attribut enableSubCalls is not set or value is 0\r\n FHEM to do nothing\r\n";
+ Log3 $bname, 3, "AMADCommBridge ($name) - Attribut enableSubCalls is not set or value is 0, FHEM to do nothing";
+ }
+
+ $c = $hash->{CD};
+ print $c "HTTP/1.1 200 OK\r\n",
+ "Content-Type: text/plain\r\n",
+ "Connection: close\r\n",
+ "Content-Length: ".length($response)."\r\n\r\n",
+ $response;
+
+ return;
+ }
}
+
$response = "header lines: \r\n AMADCommBridge receive incomplete or corrupt Data\r\n FHEM to do nothing\r\n";
$c = $hash->{CD};
print $c "HTTP/1.1 200 OK\r\n",
diff --git a/fhem/FHEM/74_AMADDevice.pm b/fhem/FHEM/74_AMADDevice.pm
index 244da3ca6..3b0def9b8 100644
--- a/fhem/FHEM/74_AMADDevice.pm
+++ b/fhem/FHEM/74_AMADDevice.pm
@@ -55,7 +55,7 @@ eval "use JSON;1" or $missingModul .= "JSON ";
my $modulversion = "4.0.3";
-my $flowsetversion = "4.0.0";
+my $flowsetversion = "4.0.1";
@@ -916,7 +916,7 @@ sub AMADDevice_decrypt($) {
In this case, an AMADDevice is created by hand. The AMAD_ID, here 123456, must also be entered exactly as a global variable in Automagic.
-
+
Readings
- airplanemode - on/off, state of the aeroplane mode
@@ -972,7 +972,7 @@ sub AMADDevice_decrypt($) {
-
+
Set
- activateVoiceInput - start voice input on Android device
@@ -1028,7 +1028,7 @@ sub AMADDevice_decrypt($) {
Example: attr Nexus10Wohnzimmer setBluetoothDevice Logitech_BT_Adapter|AB:12:CD:34:EF:32,Anker_A3565|GH:56:IJ:78:KL:76
-
+
state
- initialized - shown after initial define.
diff --git a/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.0.xml b/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.1.xml
similarity index 87%
rename from fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.0.xml
rename to fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.1.xml
index a5bdf175d..1dae04b7c 100644
--- a/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.0.xml
+++ b/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.1.xml
@@ -1,9 +1,9 @@
-
+
true
Akku Ladestand: grösser als 0%
- false
+ true
0
HIGHER_THAN
true
@@ -12,21 +12,19 @@
false
App Task Beendet
- false
- CLASSIC
+ true
*
true
App Task Beendet: ch.gridvision.ppam.androidautomagic
false
- CLASSIC
ch.gridvision.ppam.androidautomagic
true
Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic
- false
+ true
ch.gridvision.ppam.androidautomagic
TEXT
CONTAINS_TEXT
@@ -37,7 +35,7 @@
true
Benachrichtigung in Statusbar angezeigt: com.whatsapp
- false
+ true
com.whatsapp
TEXT
CONTAINS_TEXT
@@ -48,7 +46,7 @@
true
Benachrichtigung in Statusbar angezeigt: org.telegram.messenger
- false
+ true
org.telegram.messenger
TEXT
CONTAINS_TEXT
@@ -59,7 +57,7 @@
true
Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic
- false
+ true
ch.gridvision.ppam.androidautomagic
TEXT
CONTAINS_TEXT
@@ -70,7 +68,7 @@
true
Bluetooth Gerät getrennt: Alle Geräte
- false
+ true
true
@@ -78,7 +76,7 @@
true
Bluetooth Gerät verbunden: Alle Geräte
- false
+ true
true
@@ -86,7 +84,7 @@
true
Bluetooth Status: Schaltet aus, Aus
- false
+ true
false
false
true
@@ -95,7 +93,7 @@
true
Bluetooth Status: Schaltet ein, Ein
- false
+ true
true
true
false
@@ -104,55 +102,55 @@
true
Daydream Status: Gestartet
- false
+ true
true
true
Daydream Status: Gestoppt
- false
+ true
false
true
Display Orientierung: Landscape
- false
+ true
false
true
Display Orientierung: Portrait
- false
+ true
true
true
Display Status: Aus
- false
+ true
false
true
Display Status: Ein
- false
+ true
true
true
Dock Event: Docked
- false
+ true
true
true
Dock Event: Undocked
- false
+ true
false
true
Eingehender Anruf. Status: Klingelt, Nummern: Alle
- false
+ true
true
true
@@ -164,13 +162,13 @@
true
Flugmodus: Aus
- false
+ true
false
true
Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT
- false
+ true
com.android.deskclock.ALARM_ALERT
@@ -185,7 +183,7 @@
true
Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS
- false
+ true
com.android.deskclock.ALARM_DISMISS
@@ -200,7 +198,7 @@
true
Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE
- false
+ true
com.android.deskclock.ALARM_DONE
@@ -215,7 +213,7 @@
true
Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE
- false
+ true
com.android.deskclock.ALARM_SNOOZE
@@ -230,7 +228,7 @@
true
Genereller Broadcast: wenn org.smblott.intentradio.STATE
- false
+ true
org.smblott.intentradio.STATE
@@ -254,7 +252,7 @@ irname=getString("name")
false
HTTP Request: /fhem-amad/deviceInfo/
- false
+ true
/fhem-amad/deviceInfo/
8090
true
@@ -262,7 +260,7 @@ irname=getString("name")
false
HTTP Request: /fhem-amad/setCommands/*
- false
+ true
/fhem-amad/setCommands/*
8090
true
@@ -270,13 +268,13 @@ irname=getString("name")
false
Medien Session verändert
- false
+ true
com.amazon.mp3,com.amazon.avod.thirdpartyclient,com.audible.application,com.rhapsody.alditalk,com.spotify.music,com.google.android.videos,com.google.android.music,org.smblott.intentradioio,de.maxdome.app.android,tunein.player,org.videolan.vlc,com.google.android.youtube,com.sec.android.app.music
false
Periodischer Timer: alle 120s
- false
+ true
120000
true
false
@@ -298,12 +296,12 @@ irname=getString("name")
true
Sprachbefehl angefordert
- false
+ true
true
Stromversorgung: Angeschlossen
- false
+ true
true
true
true
@@ -312,7 +310,7 @@ irname=getString("name")
true
Stromversorgung: Entfernt
- false
+ true
false
true
true
@@ -321,7 +319,7 @@ irname=getString("name")
false
Systemeinstellung verändert: System next_alarm
- false
+ true
SYSTEM
next_alarm_formatted
setting
@@ -329,7 +327,7 @@ irname=getString("name")
true
Systemeinstellung verändert: System screen_brightness
- false
+ true
SYSTEM
screen_brightness
screenBrightness
@@ -337,7 +335,7 @@ irname=getString("name")
true
Systemeinstellung verändert: System volume_music_bt_a2dp
- false
+ true
SYSTEM
volume_music_bt_a2dp
volume
@@ -345,7 +343,7 @@ irname=getString("name")
true
Systemeinstellung verändert: System volume_music_headphone
- false
+ true
SYSTEM
volume_music_headphone
volume
@@ -353,7 +351,7 @@ irname=getString("name")
false
Systemeinstellung verändert: System volume_music_headset
- false
+ true
SYSTEM
volume_music_headset
volume
@@ -361,7 +359,7 @@ irname=getString("name")
true
Systemeinstellung verändert: System volume_music_speaker
- false
+ true
SYSTEM
volume_music_speaker
volume
@@ -369,7 +367,7 @@ irname=getString("name")
true
Systemeinstellung verändert: System volume_ring
- false
+ true
SYSTEM
volume_ring
volumeRingSound
@@ -377,7 +375,7 @@ irname=getString("name")
true
Systemeinstellung verändert: System volume_ring_speaker
- false
+ true
SYSTEM
volume_ring_speaker
volumeNotification
@@ -385,25 +383,25 @@ irname=getString("name")
true
Unterbrechnungen-Modus: Alle / Immer unterbrechen
- false
+ true
OFF
true
Unterbrechnungen-Modus: Keine / Nicht unterbrechen
- false
+ true
NO_INTERRUPTIONS
true
Unterbrechnungen-Modus: Nur Wecker (Android 6+)
- false
+ true
ALARMS_ONLY
true
Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen
- false
+ true
IMPORTANT_INTERRUPTIONS
@@ -423,14 +421,12 @@ irname=getString("name")
false
App Task läuft: App (neuster)
- CLASSIC
{param_app}
true
true
App Task läuft: {global_activetask} (neuster)
- CLASSIC
{global_activetask}
true
@@ -558,6 +554,11 @@ irname=getString("name")
Expression: do not Disturb"
request_path == "/fhem-amad/setCommands/donotdisturb"
+
+ true
+ Expression: fhemcmd == "fhemfunc"
+ fhemcmd == "fhemfunc"
+
true
Expression: fhemcmd == "readingsval"
@@ -1775,6 +1776,26 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich"
true
Herunterfahren
+
+ false
+ HTTP Request: send FHEMFUNC data to AMADCommBridge JSON
+ http://{global_fhemip}:{global_bridgeport}
+ false
+ false
+
+ POST
+ GENERAL_TEXT
+ text/json
+ {fhemfunc}
+ @@@@readingsNameXYZ@@readingsValueABC
+ 15000
+ true
+ Connection: close
+ true
+ respfhemfunc
+ /storage/emulated/0/Download/file.bin
+ false
+
false
HTTP Request: send FIRSTRUN data to AMADCommBridge JSON
@@ -1782,8 +1803,6 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich"
false
false
- false
-
POST
GENERAL_TEXT
text/json
@@ -1804,8 +1823,6 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich"
false
false
- false
-
POST
GENERAL_TEXT
text/json
@@ -1826,8 +1843,6 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich"
false
false
- false
-
POST
GENERAL_TEXT
text/json
@@ -1848,8 +1863,6 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich"
false
false
- false
-
POST
GENERAL_TEXT
text/json
@@ -1870,8 +1883,6 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich"
false
false
- false
-
POST
GENERAL_TEXT
text/json
@@ -2157,7 +2168,6 @@ Connection: close
true
Nummer anrufen: {param_callnumber}
-
{param_callnumber}
true
@@ -2813,10 +2823,15 @@ fhemcmd = "setreading";
+ "," + "\"screenOrientationMode\":" + " \"" + {screen_orientation_mode} + "\"";
fhemcmd = "setreading";
+
+ false
+ Script: Set FHEMCALLSUB JSON
+
+
false
Script: Set FHEMDATA JSON
-