diff --git a/74_AMAD.pm b/74_AMAD.pm
index b665408..5aee395 100644
--- a/74_AMAD.pm
+++ b/74_AMAD.pm
@@ -35,7 +35,7 @@ use Time::HiRes qw(gettimeofday);
use HttpUtils;
use TcpServerUtils;
-my $version = "0.7.6";
+my $version = "0.7.7";
@@ -50,10 +50,11 @@ sub AMAD_Initialize($) {
$hash->{ReadFn} = "AMAD_CommBridge_Read";
$hash->{AttrList} = "setOpenApp ".
- "getActiveTask ".
+ "checkActiveTask ".
"setFullscreen:0,1 ".
"setScreenOrientation:0,1 ".
"setScreenBrightness:0,1 ".
+ #"setBluetoothDevice ".
"root:0,1 ".
"interval ".
"port ".
@@ -249,7 +250,7 @@ sub AMAD_RetrieveAutomagicInfo($) {
my $host = $hash->{HOST};
my $port = $hash->{PORT};
my $fhemip = ReadingsVal( "AMADCommBridge", "fhemServerIP", "none" );
- my $activetask = AttrVal( $name, "getActiveTask", "none" );
+ my $activetask = AttrVal( $name, "checkActiveTask", "none" );
my $url = "http://" . $host . ":" . $port . "/fhem-amad/deviceInfo/"; # Path muß so im Automagic als http request Trigger drin stehen
@@ -438,6 +439,7 @@ sub AMAD_Set($$@) {
if( $name ne "AMADCommBridge" ) {
my $apps = AttrVal( $name, "setOpenApp", "none" );
+ my $btdev = AttrVal( $name, "setBluetoothDevice", "none" );
my $activetask = AttrVal( $name, "setActiveTask", "none" );
my $list = "";
@@ -457,6 +459,7 @@ sub AMAD_Set($$@) {
$list .= "system:reboot " if( AttrVal( $name, "root", "1" ) eq "1" );
$list .= "bluetooth:on,off ";
$list .= "notifySndFile ";
+ #$list .= "changetoBTDevice:$btdev " if( AttrVal( $name, "setBluetoothDevice", "none" ) ne "none" );
if( lc $cmd eq 'screenmsg'
|| lc $cmd eq 'ttsmsg'
@@ -473,6 +476,7 @@ sub AMAD_Set($$@) {
|| lc $cmd eq 'bluetooth'
|| lc $cmd eq 'system'
|| lc $cmd eq 'notifysndfile'
+ || lc $cmd eq 'changetobtdevice'
|| lc $cmd eq 'statusrequest' ) {
Log3 $name, 5, "AMAD ($name) - set $name $cmd ".join(" ", @val);
@@ -652,6 +656,15 @@ sub AMAD_SelectSetCmd($$@) {
return AMAD_HTTP_POST( $hash,$url );
}
+
+ elsif( lc $cmd eq 'changetobtdevice' ) {
+ my $btdevice = join( " ", @data );
+ my @btmac = split( "|", $btdevice );
+
+ my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setbtdevice?btdevicemac=".$btmac[1];
+
+ return AMAD_HTTP_POST( $hash,$url );
+ }
return undef;
}
@@ -1087,7 +1100,7 @@ sub AMAD_CommBridge_Read($) {
Dieses Modul liefert, in Verbindung mit der Android APP Automagic, diverse Informationen von Android Geräten.
Die AndroidAPP Automagic (welche nicht von mir stammt und 2.90Euro kostet) funktioniert wie Tasker, ist aber bei weitem User freundlicher.
- Im Auslieferiungszustand werden folgende Zustände dargestellt:
+ Im Auslieferungszustand werden folgende Zustände dargestellt:
- Zustand von Automagic auf dem Gerät
- Bluetooth An/Aus
diff --git a/74_AMADautomagicFlows0.7_DEVEL.xml b/74_AMADautomagicFlows0.7.7.xml
similarity index 62%
rename from 74_AMADautomagicFlows0.7_DEVEL.xml
rename to 74_AMADautomagicFlows0.7.7.xml
index 5ec87ec..c3fa999 100644
--- a/74_AMADautomagicFlows0.7_DEVEL.xml
+++ b/74_AMADautomagicFlows0.7.7.xml
@@ -69,6 +69,12 @@ global_album = getString("album");
tunein.player
true
+
+ true
+ App Task läuft: {header_activetask} (neuster)
+ {header_activetask}
+ true
+
false
Benachrichtigung in Statusbar angezeigt: Automagic
@@ -128,6 +134,11 @@ global_album = getString("album");
Expression: mediaPlayer"
request_path == "/fhem-amad/setCommands/mediaPlayer"
+
+ false
+ Expression: notifysnd"
+ request_path == "/fhem-amad/setCommands/playnotifysnd"
+
false
Expression: openApp"
@@ -138,6 +149,16 @@ global_album = getString("album");
Expression: openURL"
request_path == "/fhem-amad/setCommands/openURL"
+
+ true
+ Expression: param_bluetooth == "off"
+ param_bluetooth == "off"
+
+
+ true
+ Expression: param_bluetooth == "on"
+ param_bluetooth == "on"
+
true
Expression: param_button == "back"
@@ -208,11 +229,21 @@ global_album = getString("album");
Expression: setAlarm"
request_path == "/fhem-amad/setCommands/setAlarm"
+
+ false
+ Expression: setBluetooth"
+ request_path == "/fhem-amad/setCommands/setbluetooth"
+
false
Expression: setBrightness"
request_path == "/fhem-amad/setCommands/setBrightness"
+
+ false
+ Expression: setBTDevice"
+ request_path == "/fhem-amad/setCommands/setbtdevice"
+
false
Expression: setScreenFullscreen"
@@ -243,6 +274,11 @@ global_album = getString("album");
Expression: trigger == "com.android.music.metachanged"
trigger == "com.android.music.metachanged"
+
+ true
+ Expression: trigger == "Globale Variable: global_own_reading"
+ trigger == "Globale Variable: global_own_reading"
+
true
Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*"
@@ -368,6 +404,24 @@ global_album = getString("album");
0
0
+
+ true
+ Bluetooth ein-/ausschalten: Aus
+ false
+
+
+ true
+ Bluetooth ein-/ausschalten: Ein
+ true
+
+
+ true
+ Bluetooth Gerät verbinden/trennen: Verbinden Headset {param_btdevicemac}
+ HEADSET
+ {param_btdevicemac}
+
+ true
+
true
Display automatisch drehen ein-/ausschalten: Aus
@@ -385,7 +439,7 @@ global_album = getString("album");
false
HTTP Response Information
- powerLevel@@{battery_percentage}@@@@powerPlugged@@{battery_plugged}@@@@volumeMusikBluetooth@@{volumeMusikBluetooth}@@@@volumeMusikSpeaker@@{volumeMusikSpeaker}@@@@screenBrightness@@{screenBrightness}@@@@nextAlarmTime@@{next_alarmtime}@@@@nextAlarmDay@@{next_alarmday}@@@@screen@@{screen_state}@@@@automagicState@@{notification_text}@@@@screenOrientation@@{screen_orientation}@@@@currentMusicTrack@@{global_track}@@@@currentMusicAlbum@@{global_album}@@@@currentMusicArtist@@{global_artist}@@@@bluetooth@@{bluetooth_state}@@@@connectedBTdevices@@{connected_devices_names}@@@@flow_SetCommands@@{setCommandFlow_state}
+ powerLevel@@{battery_percentage}@@@@powerPlugged@@{battery_plugged}@@@@volumeMusikBluetooth@@{volumeMusikBluetooth}@@@@volumeMusikSpeaker@@{volumeMusikSpeaker}@@@@screenBrightness@@{screenBrightness}@@@@nextAlarmTime@@{next_alarmtime}@@@@nextAlarmDay@@{next_alarmday}@@@@screen@@{screen_state}@@@@automagicState@@{notification_text}@@@@screenOrientation@@{screen_orientation}@@@@currentMusicTrack@@{global_track}@@@@currentMusicAlbum@@{global_album}@@@@currentMusicArtist@@{global_artist}@@@@bluetooth@@{bluetooth_state}@@@@connectedBTdevices@@{connected_devices_names}@@@@connectedBTdevicesMAC@@{connected_devices_addresses}@@@@flow_SetCommands@@{setCommandFlow_state}@@@@checkActiveTask@@{runTask}
true
text/plain
@@ -449,6 +503,26 @@ global_album = getString("album");
Neustart
+
+ false
+ Own Reading
+ http://{global_fhemip}:8090
+ false
+ false
+
+ POST
+ GENERAL_TEXT
+ text/plain
+ {substring(getValue("global_own_reading",""),14)}@@{replaceAll(getValue("global_{substring(getValue('global_own_reading',''),14)}","nicht gefunden"),"\\s","%20")}@@@@
+ @@@@readingsNameXYZ@@readingsValueABC
+ 5000
+ true
+ FHEMDEVICE: {global_fhemdevice}
+FHEMCMD: setreading
+ true
+ response
+ /storage/emulated/0/Download/file.bin
+
true
Pause: 2s (Gerät wach halten)
@@ -530,6 +604,16 @@ global_fhemdevice = {header_fhemdevice}
Script: notification_text = "no supported from your device"
+
+ true
+ Script: runTask = "0"
+
+
+
+ true
+ Script: runTask = "1"
+
+
true
Script: screen_orientation = "auto"
@@ -624,6 +708,18 @@ global_fhemdevice = {header_fhemdevice}
HIDE_NAVIGATION
false
+
+ true
+ Sound: /storage/emulated/0/Notifications/{param_notifyfile} als Benachrichtigung
+ FILE
+ Lautlos
+ /storage/emulated/0/Notifications/{param_notifyfile}
+ NOTIFICATION
+ false
+ true
+ true
+ TRANSIENT
+
true
Sprachausgabe: {param_message}
@@ -671,100 +767,114 @@ FHEMCMD: statusrequest
Informations
- FHEM Info / Steuerung über AMAD Modul v0.7 Develop
+ FHEM Info / Steuerung über AMAD Modul v0.7.7
true
QUEUE
120
- Script: notification_text = "no supported from your device"
- Script: screen_orientation = "auto"
- Display automatisch drehen eingeschaltet
- Script: screen_orientation = "portrait"
- Display Orientierung: Portrait
- Script: screen_orientation = "landscape"
- Bluetooth eingeschaltet
- Script: bluetooth_state = "on"
- Bluetooth Gerät verbunden: Beliebiges Geräte
- Script: bluetooth_state = "off"
- Script: screen_state = "off"
- Script: screen_state = "on"
- Display eingeschaltet
- Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}"
- Initialisiere Variable Nächster Alarm: next_alarm
- Script: next_alarmday = "{next_alarm,dateformat,c}"
- Initialisiere Variable Systemeinstellung: screenBrightness
- Initialisiere Variable Systemeinstellung: volumeMusikSpeaker
- Initialisiere Variable Systemeinstellung: volumeMusikBluetooth
- Flow Aktiv: SetCommands
- Script: setCommandFlow_state = "aktiv"
- Script: setCommandFlow_state = "inaktiv"
- Setze Flow Status: Aktivieren SetCommands
- Benachrichtigung in Statusbar angezeigt: Automagic
- Akku Ladestand: grösser als 0%
- Script: global_artist = "no soundplayer activ"; global_track = "no soundplayer activ"; global_album = "no soundplayer activ";
- Musik Aktiv
- Pause: 2s (Gerät wach halten)
- Expression: trigger == "com.android.music.metachanged"
- Script: global_fhemip = {header_fhemip} global_fhemdevice = {header_fhemdevice}
- HTTP Response Information
- WLAN Verbunden: Alle SSIDs
- Reading Music Metachanged
-
+
HTTP Request: /fhem-amad/deviceInfo/
com.android.music.metachanged
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Script: notification_text = "no supported from your device"
+ Script: screen_orientation = "auto"
+ Display automatisch drehen eingeschaltet
+ Script: screen_orientation = "portrait"
+ Display Orientierung: Portrait
+ Script: screen_orientation = "landscape"
+ Bluetooth eingeschaltet
+ Script: bluetooth_state = "off"
+ Script: screen_state = "off"
+ Script: screen_state = "on"
+ Display eingeschaltet
+ Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}"
+ Initialisiere Variable Nächster Alarm: next_alarm
+ Script: next_alarmday = "{next_alarm,dateformat,c}"
+ Initialisiere Variable Systemeinstellung: screenBrightness
+ Initialisiere Variable Systemeinstellung: volumeMusikSpeaker
+ Initialisiere Variable Systemeinstellung: volumeMusikBluetooth
+ Flow Aktiv: SetCommands
+ Script: setCommandFlow_state = "aktiv"
+ Setze Flow Status: Aktivieren SetCommands
+ Benachrichtigung in Statusbar angezeigt: Automagic
+ Script: global_artist = "no soundplayer activ"; global_track = "no soundplayer activ"; global_album = "no soundplayer activ";
+ Musik Aktiv
+ Pause: 2s (Gerät wach halten)
+ Expression: trigger == "com.android.music.metachanged"
+ Expression: trigger == "Globale Variable: global_own_reading"
+ WLAN Verbunden: Alle SSIDs
+ WLAN Verbunden: Alle SSIDs
+ Script: bluetooth_state = "on"
+ Bluetooth Gerät verbunden: Beliebiges Geräte
+ Akku Ladestand: grösser als 0%
+ Script: setCommandFlow_state = "inaktiv"
+ Script: global_fhemip = {header_fhemip} global_fhemdevice = {header_fhemdevice}
+ App Task läuft: {header_activetask} (neuster)
+ Script: runTask = "0"
+ Script: runTask = "1"
+ Reading Music Metachanged
+ Own Reading
+ HTTP Response Information
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
SetCommands
- FHEM Info / Steuerung über AMAD Modul v0.7 Develop
+ FHEM Info / Steuerung über AMAD Modul v0.7.7
true
QUEUE
120
@@ -776,140 +886,163 @@ FHEMCMD: statusrequest
Expression: setBrightness"
Expression: setAlarm"
Expression: screenMsg"
- Expression: openURL"
- URL in Browser öffnen: {param_url} (mit Chrome)
- Benachrichtigung auf Bildschirm: {param_message} (lange)
- Expression: setScreenFullscreen"
- Expression: param_orientation == "auto"
- Setze Display Orientierung: Portrait
- Setze Display Orientierung: Landscape
- Expression: param_orientation == "landscape"
- Expression: param_orientation == "portrait"
- Expression: param_fullscreen == "off"
- Setze Vollbild Modus: Navigation nicht anzeigen
- Expression: param_fullscreen == "on"
- Setze Vollbild Modus: Auf Default zurücksetzen
- Audio Player steuern: Medienknopf Zurück (Google Play Musik)
- Expression: param_button == "back"
- Expression: param_button == "next"
- Setze Display Orientierung: Auf Default zurücksetzen
- Audio Player steuern: Medienknopf Play (Google Play Musik)
- Expression: param_button == "play"
- Expression: mediaPlayer"
- Audio Player steuern: Medienknopf Weiter (Google Play Musik)
- Expression: param_button == "stop"
- Expression: param_screen=="off"
- Gerät sperren
- Expression: setScreenOnOff"
- Expression: setVolume"
- App Task läuft: App5 (neuster)
- Expression: App5
- Expression: App4
- App Task läuft: App3 (neuster)
- Expression: App3
- App Starten: App3
- App Starten: App4
- App Task läuft: App4 (neuster)
- Expression: tuneinradio
- App Task läuft: tuneinradio (neuster)
- App Starten: tuneinradio
- App Starten: App5
- App Task läuft: gplay (neuster)
- Expression: gplay
- App Starten: PlayMusic
- Expression: openApp"
- Expression: System Command"
- Expression: setScreenOrientation"
- Expression: Reboot
- Neustart
- Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*"
- Setze Flow Status: Aktivieren Informations
- Script: informationFlow_state = "inaktiv"
- Script: informationFlow_state = "aktiv"
- Flow Aktiv: Informations
- Sprachausgabe: {param_message}
- Expression: ttsMsg"
- Lautstärken setzen
- StatusRequest
- Setze Systemeinstellung: System screen_brightness auf {param_brightness}
- Schalte Display ein: Hell für 120s
- Display automatisch drehen ein-/ausschalten: Aus
- Display automatisch drehen ein-/ausschalten: Ein
- Setze Alarm: um {param_hour}:{param_minute}
- HTTP Response SetCommand
- Audio Player steuern: Medienknopf Stopp (Google Play Musik)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ URL in Browser öffnen: {param_url} (mit Chrome)
+ Benachrichtigung auf Bildschirm: {param_message} (lange)
+ Expression: setScreenFullscreen"
+ Expression: param_orientation == "auto"
+ Setze Display Orientierung: Portrait
+ Setze Display Orientierung: Landscape
+ Expression: param_orientation == "landscape"
+ Expression: param_orientation == "portrait"
+ Setze Vollbild Modus: Navigation nicht anzeigen
+ Setze Vollbild Modus: Auf Default zurücksetzen
+ Audio Player steuern: Medienknopf Zurück (Google Play Musik)
+ Expression: param_button == "back"
+ Expression: param_button == "next"
+ Setze Display Orientierung: Auf Default zurücksetzen
+ Audio Player steuern: Medienknopf Play (Google Play Musik)
+ Expression: param_button == "play"
+ Expression: mediaPlayer"
+ Audio Player steuern: Medienknopf Weiter (Google Play Musik)
+ Expression: param_button == "stop"
+ Expression: param_screen=="off"
+ Gerät sperren
+ Expression: setScreenOnOff"
+ App Task läuft: App5 (neuster)
+ Expression: App5
+ Expression: App4
+ App Task läuft: App3 (neuster)
+ Expression: App3
+ App Starten: App3
+ App Starten: App4
+ App Task läuft: App4 (neuster)
+ Expression: tuneinradio
+ App Task läuft: tuneinradio (neuster)
+ App Starten: tuneinradio
+ App Starten: App5
+ App Task läuft: gplay (neuster)
+ Expression: gplay
+ App Starten: PlayMusic
+ Expression: openApp"
+ Expression: System Command"
+ Neustart
+ Setze Flow Status: Aktivieren Informations
+ Script: informationFlow_state = "inaktiv"
+ Script: informationFlow_state = "aktiv"
+ Flow Aktiv: Informations
+ Expression: ttsMsg"
+ Lautstärken setzen
+ Setze Systemeinstellung: System screen_brightness auf {param_brightness}
+ Schalte Display ein: Hell für 120s
+ Display automatisch drehen ein-/ausschalten: Aus
+ Display automatisch drehen ein-/ausschalten: Ein
+ Setze Alarm: um {param_hour}:{param_minute}
+ HTTP Response SetCommand
+ Audio Player steuern: Medienknopf Stopp (Google Play Musik)
+ Expression: setScreenOrientation"
+ Expression: param_fullscreen == "off"
+ Expression: param_fullscreen == "on"
+ Expression: setBluetooth"
+ Expression: param_bluetooth == "on"
+ Expression: param_bluetooth == "off"
+ Bluetooth ein-/ausschalten: Ein
+ Bluetooth ein-/ausschalten: Aus
+ Expression: openURL"
+ Expression: Reboot
+ Expression: setVolume"
+ Sprachausgabe: {param_message}
+ Sound: /storage/emulated/0/Notifications/{param_notifyfile} als Benachrichtigung
+ StatusRequest
+ Expression: notifysnd"
+ Bluetooth Gerät verbinden/trennen: Verbinden Headset {param_btdevicemac}
+ Expression: setBTDevice"
+ Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*"
+ Bluetooth Gerät verbunden: Beliebiges Geräte
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file