From 942bc9b998fb507741b67ac5d0b3649153554f13 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 13 Oct 2015 22:28:42 +0200 Subject: [PATCH] =?UTF-8?q?Bluetooth=20toggle=20hinzugef=C3=BCgt,=20ausser?= =?UTF-8?q?dem=20gibt=20es=20nun=20Beispiel=20Flows=20f=C3=BCr=20OwnReadin?= =?UTF-8?q?gs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 74_AMAD.pm | 18 +- ....7.7.xml => 74_AMADautomagicFlows0.7.8.xml | 317 ++++++++++++++---- 2 files changed, 270 insertions(+), 65 deletions(-) rename 74_AMADautomagicFlows0.7.7.xml => 74_AMADautomagicFlows0.7.8.xml (78%) diff --git a/74_AMAD.pm b/74_AMAD.pm index 5aee395..dce13ec 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.7"; +my $version = "0.7.8"; @@ -54,7 +54,7 @@ sub AMAD_Initialize($) { "setFullscreen:0,1 ". "setScreenOrientation:0,1 ". "setScreenBrightness:0,1 ". - #"setBluetoothDevice ". + "setBluetoothDevice ". "root:0,1 ". "interval ". "port ". @@ -459,7 +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" ); + $list .= "changetoBTDevice:$btdev " if( AttrVal( $name, "setBluetoothDevice", "none" ) ne "none" ); if( lc $cmd eq 'screenmsg' || lc $cmd eq 'ttsmsg' @@ -658,11 +658,15 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'changetobtdevice' ) { - my $btdevice = join( " ", @data ); - my @btmac = split( "|", $btdevice ); + my $swToBtDevice = join( " ", @data ); + my @swToBtMac = split( /\|/, $swToBtDevice ); + my $btDevices = AttrVal( $name, "setBluetoothDevice", "none" ) if( AttrVal( $name, "setBluetoothDevice", "none" ) ne "none" ); + my @btDevice = split( ',', $btDevices ); + my @btDeviceOne = split( /\|/, $btDevice[0] ); + my @btDeviceTwo = split( /\|/, $btDevice[1] ); + + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setbtdevice?swToBtDeviceMac=".$swToBtMac[1]."&btDeviceOne=".$btDeviceOne[1]."&btDeviceTwo=".$btDeviceTwo[1]; - my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setbtdevice?btdevicemac=".$btmac[1]; - return AMAD_HTTP_POST( $hash,$url ); } diff --git a/74_AMADautomagicFlows0.7.7.xml b/74_AMADautomagicFlows0.7.8.xml similarity index 78% rename from 74_AMADautomagicFlows0.7.7.xml rename to 74_AMADautomagicFlows0.7.8.xml index c3fa999..0e4f662 100644 --- a/74_AMADautomagicFlows0.7.7.xml +++ b/74_AMADautomagicFlows0.7.8.xml @@ -17,6 +17,24 @@ global_track = getString("track"); global_album = getString("album"); false + + true + Display Status: Aus + false + false + + + true + Display Status: Ein + false + true + + + true + Globale Variable: global_touched + false + global_touched + false HTTP Request: /fhem-amad/deviceInfo/ @@ -33,6 +51,26 @@ global_album = getString("album"); 8090 true + + true + Periodischer Timer: alle 4m + false + 240000 + true + false + false + Mon + Tue + Wed + Thu + Fri + Sat + Sun + 8 + 0 + 17 + 0 + true Akku Ladestand: grösser als 0% @@ -96,6 +134,20 @@ global_album = getString("album"); + + true + Bluetooth Gerät verbunden: {param_btdeviceone} + false + {param_btdeviceone} + + + + true + Bluetooth Gerät verbunden: {param_btdevicetwo} + false + {param_btdevicetwo} + + true Display automatisch drehen eingeschaltet @@ -124,6 +176,16 @@ global_album = getString("album"); Expression: App5 param_app == "" + + true + Expression: global_touched=="ja" + global_touched=="ja" + + + true + Expression: global_touched=="wait" + global_touched=="wait" + false Expression: gplay @@ -416,9 +478,25 @@ global_album = getString("album"); true - Bluetooth Gerät verbinden/trennen: Verbinden Headset {param_btdevicemac} - HEADSET - {param_btdevicemac} + Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdeviceone} + A2DP + {param_btdeviceone} + + false + + + true + Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdevicetwo} + A2DP + {param_btdevicetwo} + + false + + + true + Bluetooth Gerät verbinden/trennen: Verbinden Advanced Audio Distribution {param_swtobtdevicemac} + A2DP + {param_swtobtdevicemac} true @@ -476,6 +554,16 @@ global_album = getString("album"); volume_music_speaker volumeMusikSpeaker + + true + Kommandozeilenbefehl als Root ausführen: getevent -c 1 in + getevent -c 1 + + + stdout + stderr + exit_code + false Lautstärken setzen @@ -523,6 +611,18 @@ FHEMCMD: setreading response /storage/emulated/0/Download/file.bin + + true + Pause: 10s (Schlafmodus zulassen) + 10s + false + + + true + Pause: 15s (Gerät wach halten) + 15s + true + true Pause: 2s (Gerät wach halten) @@ -573,12 +673,42 @@ FHEMCMD: setreading global_track = "no soundplayer activ"; global_album = "no soundplayer activ"; + + true + Script: global_display="an";global_own_reading="{getDate()}_display" + + + + true + Script: global_display="aus";global_own_reading="{getDate()}_display" + + true Script: global_fhemip = {header_fhemip} global_fhemdevice = {header_fhemdevice} + + true + Script: global_touch="ja";global_own_reading="{getDate()}_touch";global_touched="ja" + + + + true + Script: global_touch="nein";global_own_reading="{getDate()}_touch" + + + + true + Script: global_touched="ja" + + + + true + Script: global_touched="wait" + + true Script: informationFlow_state = "aktiv" @@ -767,7 +897,7 @@ FHEMCMD: statusrequest Informations - FHEM Info / Steuerung über AMAD Modul v0.7.7 + FHEM Info / Steuerung über AMAD Modul v0.7.8 true QUEUE 120 @@ -872,9 +1002,68 @@ FHEMCMD: statusrequest + + Meldung Display An + AMAD FHEM / OwnReadings Examples + false + PARALLEL + + Display Status: Ein + + Script: global_display="an";global_own_reading="{getDate()}_display" + + + + Meldung Display Aus + AMAD FHEM / OwnReadings Examples + false + PARALLEL + + Display Status: Aus + + Script: global_display="aus";global_own_reading="{getDate()}_display" + + + + Meldung kein Touch + AMAD FHEM / OwnReadings Examples + false + STOP + + Globale Variable: global_touched + + Pause: 15s (Gerät wach halten) + Script: global_touched="wait" + Expression: global_touched=="ja" + Expression: global_touched=="wait" + Script: global_touch="nein";global_own_reading="{getDate()}_touch" + + + + + + + + Meldung Touch + AMAD FHEM / OwnReadings Examples + false + STOP + + Periodischer Timer: alle 4m + + Kommandozeilenbefehl als Root ausführen: getevent -c 1 in + Script: global_touched="ja" + Script: global_touch="ja";global_own_reading="{getDate()}_touch";global_touched="ja" + Pause: 10s (Schlafmodus zulassen) + + + + + + SetCommands - FHEM Info / Steuerung über AMAD Modul v0.7.7 + FHEM Info / Steuerung über AMAD Modul v0.7.8 true QUEUE 120 @@ -943,22 +1132,26 @@ FHEMCMD: statusrequest 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 - + Expression: openURL" + Expression: Reboot + Expression: setVolume" + Sprachausgabe: {param_message} + Sound: /storage/emulated/0/Notifications/{param_notifyfile} als Benachrichtigung + StatusRequest + Expression: notifysnd" + Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*" + Expression: param_bluetooth == "off" + Bluetooth ein-/ausschalten: Aus + Expression: param_bluetooth == "on" + Bluetooth ein-/ausschalten: Ein + Expression: setBTDevice" + Bluetooth eingeschaltet + Bluetooth Gerät verbunden: {param_btdeviceone} + Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdeviceone} + Bluetooth Gerät verbinden/trennen: Verbinden Advanced Audio Distribution {param_swtobtdevicemac} + Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdevicetwo} + Bluetooth Gerät verbunden: {param_btdevicetwo} + @@ -997,52 +1190,60 @@ FHEMCMD: statusrequest - + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file