From cd5cf5db6a6ba1d6eb03109f74bd535e27da1a0d Mon Sep 17 00:00:00 2001 From: LeonGaultier Date: Thu, 2 Mar 2017 10:46:22 +0000 Subject: [PATCH] 74_AMAD: new Version 2.6.11, add startDaydream and more media git-svn-id: https://svn.fhem.de/fhem/trunk@13577 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 + fhem/FHEM/74_AMAD.pm | 749 +++++---- ...xml => 74_AMADautomagicFlowset_2.6.11.xml} | 1332 +++++++++-------- 3 files changed, 1141 insertions(+), 942 deletions(-) rename fhem/FHEM/lib/{74_AMADautomagicFlowset_2.6.10.xml => 74_AMADautomagicFlowset_2.6.11.xml} (78%) diff --git a/fhem/CHANGED b/fhem/CHANGED index 2652f6091..457c395c8 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - update: 74_AMAD: new Version 2.6.11, add startDaydream and more media + commands - update: 93_DbRep: V4.11.1, new options for timestamp_begin,timestamp_end see commandref for details - update: 88_HMCCU: added tracing for RPC set config diff --git a/fhem/FHEM/74_AMAD.pm b/fhem/FHEM/74_AMAD.pm index 5b1b31cb5..820f5263f 100644 --- a/fhem/FHEM/74_AMAD.pm +++ b/fhem/FHEM/74_AMAD.pm @@ -37,8 +37,31 @@ use TcpServerUtils; use Encode qw(encode); -my $modulversion = "2.6.10"; -my $flowsetversion = "2.6.10"; +my $modulversion = "2.6.11"; +my $flowsetversion = "2.6.11"; + + + + +# Declare functions +sub AMAD_Attr(@); +sub AMAD_checkDeviceState($); +sub AMAD_CommBridge_Open($); +sub AMAD_CommBridge_Read($); +sub AMAD_decrypt($); +sub AMAD_Define($$); +sub AMAD_encrypt($); +sub AMAD_GetUpdate($); +sub AMAD_Header2Hash($); +sub AMAD_HTTP_POST($$); +sub AMAD_HTTP_POSTerrorHandling($$$); +sub AMAD_Initialize($); +sub AMAD_ResponseProcessing($$); +sub AMAD_SelectSetCmd($$@); +sub AMAD_Set($$@); +sub AMAD_statusRequest($); +sub AMAD_statusRequestErrorHandling($$$); +sub AMAD_Undef($$); @@ -47,35 +70,36 @@ sub AMAD_Initialize($) { my ($hash) = @_; - $hash->{SetFn} = "AMAD_Set"; - $hash->{DefFn} = "AMAD_Define"; - $hash->{UndefFn} = "AMAD_Undef"; - $hash->{AttrFn} = "AMAD_Attr"; - $hash->{ReadFn} = "AMAD_CommBridge_Read"; + $hash->{SetFn} = "AMAD_Set"; + $hash->{DefFn} = "AMAD_Define"; + $hash->{UndefFn} = "AMAD_Undef"; + $hash->{AttrFn} = "AMAD_Attr"; + $hash->{ReadFn} = "AMAD_CommBridge_Read"; - $hash->{AttrList} = "setOpenApp ". - "checkActiveTask ". - "setFullscreen:0,1 ". - "setScreenOrientation:0,1 ". - "setScreenBrightness:noArg ". - "setBluetoothDevice ". - "setScreenlockPIN ". - "setScreenOnForTimer ". - "setOpenUrlBrowser ". - "setNotifySndFilePath ". - "setTtsMsgSpeed ". - "setUserFlowState ". - "setTtsMsgLang:de,en ". - "setAPSSID ". - "root:0,1 ". - "port ". - "disable:1 ". - $readingFnAttributes; + $hash->{AttrList} = "setOpenApp ". + "checkActiveTask ". + "setFullscreen:0,1 ". + "setScreenOrientation:0,1 ". + "setScreenBrightness:noArg ". + "setBluetoothDevice ". + "setScreenlockPIN ". + "setScreenOnForTimer ". + "setOpenUrlBrowser ". + "setNotifySndFilePath ". + "setTtsMsgSpeed ". + "setUserFlowState ". + "setTtsMsgLang:de,en ". + "setAPSSID ". + "root:0,1 ". + "port ". + "disable:1 ". + $readingFnAttributes; foreach my $d(sort keys %{$modules{AMAD}{defptr}}) { - my $hash = $modules{AMAD}{defptr}{$d}; - $hash->{VERSIONMODUL} = $modulversion; - $hash->{VERSIONFLOWSET} = $flowsetversion; + + my $hash = $modules{AMAD}{defptr}{$d}; + $hash->{VERSIONMODUL} = $modulversion; + $hash->{VERSIONFLOWSET} = $flowsetversion; } } @@ -85,6 +109,7 @@ sub AMAD_Define($$) { my @a = split( "[ \t][ \t]*", $def ); + return "too few parameters: define AMAD " if( $a[0] ne "AMADCommBridge" and @a < 2 and @a > 4 ); my $name = $a[0]; @@ -106,39 +131,45 @@ sub AMAD_Define($$) { if( ! $hash->{HOST} ) { - return "there is already a AMAD Bridge, did you want to define a AMAD host use: define AMAD " if( $modules{AMAD}{defptr}{BRIDGE} ); + return "there is already a AMAD Bridge, did you want to define a AMAD host use: define AMAD " if( $modules{AMAD}{defptr}{BRIDGE} ); - $hash->{BRIDGE} = 1; - $modules{AMAD}{defptr}{BRIDGE} = $hash; - $attr{$name}{room} = "AMAD" if( !defined( $attr{$name}{room} ) ); - Log3 $name, 3, "AMAD ($name) - defined Bridge with Socketport $hash->{PORT}"; - Log3 $name, 3, "AMAD ($name) - Attention!!! By the first run, dont forget to \"set $name fhemServerIP \""; - AMAD_CommBridge_Open( $hash ); + $hash->{BRIDGE} = 1; + $modules{AMAD}{defptr}{BRIDGE} = $hash; + $attr{$name}{room} = "AMAD" if( !defined( $attr{$name}{room} ) ); + + Log3 $name, 3, "AMAD ($name) - defined Bridge with Socketport $hash->{PORT}"; + Log3 $name, 3, "AMAD ($name) - Attention!!! By the first run, dont forget to \"set $name fhemServerIP \""; + + AMAD_CommBridge_Open( $hash ); } else { - if( ! $modules{AMAD}{defptr}{BRIDGE} && $init_done ) { - CommandDefine( undef, "AMADCommBridge AMAD" ); - } + if( ! $modules{AMAD}{defptr}{BRIDGE} && $init_done ) { + CommandDefine( undef, "AMADCommBridge AMAD" ); + } - Log3 $name, 3, "AMAD ($name) - defined with host $hash->{HOST} on port $hash->{PORT} and AccessPoint-SSID $hash->{APSSID}" if( $hash->{APSSID} ); - Log3 $name, 3, "AMAD ($name) - defined with host $hash->{HOST} on port $hash->{PORT} and NONE AccessPoint-SSID" if( ! $hash->{APSSID} ); - - $attr{$name}{room} = "AMAD" if( !defined( $attr{$name}{room} ) ); - readingsSingleUpdate ( $hash, "state", "initialized", 1 ) if( $hash->{HOST} ); - readingsSingleUpdate ( $hash, "deviceState", "unknown", 1 ) if( $hash->{HOST} ); + Log3 $name, 3, "AMAD ($name) - defined with host $hash->{HOST} on port $hash->{PORT} and AccessPoint-SSID $hash->{APSSID}" if( $hash->{APSSID} ); + Log3 $name, 3, "AMAD ($name) - defined with host $hash->{HOST} on port $hash->{PORT} and NONE AccessPoint-SSID" if( ! $hash->{APSSID} ); + + $attr{$name}{room} = "AMAD" if( !defined( $attr{$name}{room} ) ); + + readingsSingleUpdate ( $hash, "state", "initialized", 1 ) if( $hash->{HOST} ); + readingsSingleUpdate ( $hash, "deviceState", "unknown", 1 ) if( $hash->{HOST} ); RemoveInternalTimer($hash); if( $init_done ) { + AMAD_GetUpdate($hash); + } else { + InternalTimer( gettimeofday()+30, "AMAD_GetUpdate", $hash, 0 ) if( ($hash->{HOST}) ); } - $modules{AMAD}{defptr}{$hash->{HOST}} = $hash; + $modules{AMAD}{defptr}{$hash->{HOST}} = $hash; - return undef; + return undef; } } @@ -159,7 +190,7 @@ sub AMAD_Undef($$) { foreach my $d(sort keys %{$modules{AMAD}{defptr}}) { my $hash = $modules{AMAD}{defptr}{$d}; my $host = $hash->{HOST}; - + return if( $host ); my $name = $hash->{NAME}; CommandDelete( undef, $name ); @@ -177,23 +208,26 @@ sub AMAD_Attr(@) { my $orig = $attrVal; if( $attrName eq "disable" ) { - if( $cmd eq "set" ) { - if( $attrVal eq "0" ) { - RemoveInternalTimer( $hash ); - InternalTimer( gettimeofday()+2, "AMAD_GetUpdate", $hash, 0 ) if( ReadingsVal( $hash->{NAME}, "state", 0 ) eq "disabled" ); - readingsSingleUpdate ( $hash, "state", "active", 1 ); - Log3 $name, 3, "AMAD ($name) - enabled"; - } else { - readingsSingleUpdate ( $hash, "state", "disabled", 1 ); - RemoveInternalTimer( $hash ); - Log3 $name, 3, "AMAD ($name) - disabled"; + if( $cmd eq "set" ) { + if( $attrVal eq "0" ) { + + RemoveInternalTimer( $hash ); + InternalTimer( gettimeofday()+2, "AMAD_GetUpdate", $hash, 0 ) if( ReadingsVal( $hash->{NAME}, "state", 0 ) eq "disabled" ); + readingsSingleUpdate ( $hash, "state", "active", 1 ); + Log3 $name, 3, "AMAD ($name) - enabled"; + } else { + + readingsSingleUpdate ( $hash, "state", "disabled", 1 ); + RemoveInternalTimer( $hash ); + Log3 $name, 3, "AMAD ($name) - disabled"; } } else { - RemoveInternalTimer( $hash ); - InternalTimer( gettimeofday()+2, "AMAD_GetUpdate", $hash, 0 ) if( ReadingsVal( $hash->{NAME}, "state", 0 ) eq "disabled" ); - readingsSingleUpdate ( $hash, "state", "active", 1 ); - Log3 $name, 3, "AMAD ($name) - enabled"; + + RemoveInternalTimer( $hash ); + InternalTimer( gettimeofday()+2, "AMAD_GetUpdate", $hash, 0 ) if( ReadingsVal( $hash->{NAME}, "state", 0 ) eq "disabled" ); + readingsSingleUpdate ( $hash, "state", "active", 1 ); + Log3 $name, 3, "AMAD ($name) - enabled"; } } @@ -208,23 +242,24 @@ sub AMAD_Attr(@) { } elsif( $attrName eq "port" ) { - if( $cmd eq "set" ) { - $hash->{PORT} = $attrVal; - Log3 $name, 3, "AMAD ($name) - set port to $attrVal"; - - if( $hash->{BRIDGE} ) { + if( $cmd eq "set" ) { + + $hash->{PORT} = $attrVal; + Log3 $name, 3, "AMAD ($name) - set port to $attrVal"; + + if( $hash->{BRIDGE} ) { delete $modules{AMAD}{defptr}{BRIDGE}; TcpServer_Close( $hash ); Log3 $name, 3, "AMAD ($name) - CommBridge Port changed. CommBridge are closed and new open!"; AMAD_CommBridge_Open( $hash ); } - } else { - $hash->{PORT} = 8090; - Log3 $name, 3, "AMAD ($name) - set port to default"; - - if( $hash->{BRIDGE} ) { + + $hash->{PORT} = 8090; + Log3 $name, 3, "AMAD ($name) - set port to default"; + + if( $hash->{BRIDGE} ) { delete $modules{AMAD}{defptr}{BRIDGE}; TcpServer_Close( $hash ); Log3 $name, 3, "AMAD ($name) - CommBridge Port changed. CommBridge are closed and new open!"; @@ -235,15 +270,19 @@ sub AMAD_Attr(@) { } elsif( $attrName eq "setScreenlockPIN" ) { - if( $cmd eq "set" && $attrVal ) { + if( $cmd eq "set" && $attrVal ) { + $attrVal = AMAD_encrypt($attrVal); + } else { + CommandDeleteReading( undef, "$name screenLock" ); } } elsif( $attrName eq "setUserFlowState" ) { - if( $cmd eq "del" ) { + if( $cmd eq "del" ) { + CommandDeleteReading( undef, "$name userFlowState" ); } @@ -256,6 +295,7 @@ sub AMAD_Attr(@) { if( $cmd eq "set" ) { if( $attrVal && $orig ne $attrVal ) { + $attr{$name}{$attrName} = $attrVal; return $attrName ." set to ". $attrVal if( $init_done ); } @@ -307,15 +347,15 @@ sub AMAD_statusRequest($) { my $url = "http://" . $host . ":" . $port . "/fhem-amad/deviceInfo/"; # Pfad muß so im Automagic als http request Trigger drin stehen HttpUtils_NonblockingGet( - { - url => $url, - timeout => 5, - hash => $hash, - method => "GET", - header => "Connection: close\r\nfhemip: $fhemip\r\nfhemdevice: $name\r\nactivetask: $activetask\r\napssid: $apssid\r\nbport: $bport\r\nuserflowstate: $userFlowState", - doTrigger => 1, - callback => \&AMAD_statusRequestErrorHandling, - } + { + url => $url, + timeout => 5, + hash => $hash, + method => "GET", + header => "Connection: close\r\nfhemip: $fhemip\r\nfhemdevice: $name\r\nactivetask: $activetask\r\napssid: $apssid\r\nbport: $bport\r\nuserflowstate: $userFlowState", + doTrigger => 1, + callback => \&AMAD_statusRequestErrorHandling, + } ); Log3 $name, 5, "AMAD ($name) - Send statusRequest with URL: \"$url\" and Header: \"fhemIP: $fhemip\r\nfhemDevice: $name\r\nactiveTask: $activetask\r\napSSID: $apssid\""; @@ -332,127 +372,130 @@ sub AMAD_statusRequestErrorHandling($$$) { ### Begin Error Handling if( $hash->{helper}{infoErrorCounter} > 0 ) { - readingsBeginUpdate( $hash ); - readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); - - if( ReadingsVal( $name, "flow_Informations", "active" ) eq "inactive" && ReadingsVal( $name, "flow_SetCommands", "active" ) eq "inactive" ) { - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: CHECK THE LAST ERROR READINGS FOR MORE INFO, DEVICE IS SET OFFLINE"; - - readingsBulkUpdate( $hash, "deviceState", "offline" ); - readingsBulkUpdate ( $hash, "state", "AMAD Flows inactive, device set offline"); - } - - elsif( $hash->{helper}{infoErrorCounter} > 7 && $hash->{helper}{setCmdErrorCounter} > 4 ) { - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: UNKNOWN ERROR, PLEASE CONTACT THE DEVELOPER, DEVICE DISABLED"; - - $attr{$name}{disable} = 1; - readingsBulkUpdate ( $hash, "state", "Unknown Error, device disabled"); - - $hash->{helper}{infoErrorCounter} = 0; - $hash->{helper}{setCmdErrorCounter} = 0; - - return; - } - - elsif( ReadingsVal( $name, "flow_Informations", "active" ) eq "inactive" ) { - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: Informations Flow on your Device is inactive, will try to reactivate"; - } - - elsif( $hash->{helper}{infoErrorCounter} > 7 ) { - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: To many Errors please check your Network or Device Configuration, DEVICE IS SET OFFLINE"; - - readingsBulkUpdate( $hash, "deviceState", "offline" ); - readingsBulkUpdate ( $hash, "state", "To many Errors, device set offline"); - $hash->{helper}{infoErrorCounter} = 0; - } - - elsif($hash->{helper}{infoErrorCounter} > 2 && ReadingsVal( $name, "flow_Informations", "active" ) eq "active" ){ - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: Please check the AutomagicAPP on your Device"; - } - - readingsEndUpdate( $hash, 1 ); + + readingsBeginUpdate( $hash ); + readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); + + if( ReadingsVal( $name, "flow_Informations", "active" ) eq "inactive" && ReadingsVal( $name, "flow_SetCommands", "active" ) eq "inactive" ) { + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: CHECK THE LAST ERROR READINGS FOR MORE INFO, DEVICE IS SET OFFLINE"; + + readingsBulkUpdate( $hash, "deviceState", "offline" ); + readingsBulkUpdate ( $hash, "state", "AMAD Flows inactive, device set offline"); + } + + elsif( $hash->{helper}{infoErrorCounter} > 7 && $hash->{helper}{setCmdErrorCounter} > 4 ) { + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: UNKNOWN ERROR, PLEASE CONTACT THE DEVELOPER, DEVICE DISABLED"; + + $attr{$name}{disable} = 1; + readingsBulkUpdate ( $hash, "state", "Unknown Error, device disabled"); + + $hash->{helper}{infoErrorCounter} = 0; + $hash->{helper}{setCmdErrorCounter} = 0; + + return; + } + + elsif( ReadingsVal( $name, "flow_Informations", "active" ) eq "inactive" ) { + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: Informations Flow on your Device is inactive, will try to reactivate"; + } + + elsif( $hash->{helper}{infoErrorCounter} > 7 ) { + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: To many Errors please check your Network or Device Configuration, DEVICE IS SET OFFLINE"; + + readingsBulkUpdate( $hash, "deviceState", "offline" ); + readingsBulkUpdate ( $hash, "state", "To many Errors, device set offline"); + $hash->{helper}{infoErrorCounter} = 0; + } + + elsif($hash->{helper}{infoErrorCounter} > 2 && ReadingsVal( $name, "flow_Informations", "active" ) eq "active" ){ + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: Please check the AutomagicAPP on your Device"; + } + + readingsEndUpdate( $hash, 1 ); } if( defined( $err ) ) { - if( $err ne "" ) { - readingsBeginUpdate( $hash ); - readingsBulkUpdate ( $hash, "state", "$err") if( ReadingsVal( $name, "state", 1 ) ne "initialized" ); - $hash->{helper}{infoErrorCounter} = ( $hash->{helper}{infoErrorCounter} + 1 ); + if( $err ne "" ) { + + readingsBeginUpdate( $hash ); + readingsBulkUpdate ( $hash, "state", "$err") if( ReadingsVal( $name, "state", 1 ) ne "initialized" ); + $hash->{helper}{infoErrorCounter} = ( $hash->{helper}{infoErrorCounter} + 1 ); - readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); - - if( $err =~ /timed out/ ) { - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: connect to your device is timed out. check network"; - } - - elsif( ( $err =~ /Keine Route zum Zielrechner/ ) && $hash->{helper}{infoErrorCounter} > 1 ) { - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: no route to target. bad network configuration or network is down"; - - } else { + readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); + + if( $err =~ /timed out/ ) { + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: connect to your device is timed out. check network"; + } + + elsif( ( $err =~ /Keine Route zum Zielrechner/ ) && $hash->{helper}{infoErrorCounter} > 1 ) { + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: no route to target. bad network configuration or network is down"; + + } else { - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: $err"; - } + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: $err"; + } - readingsEndUpdate( $hash, 1 ); - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: AMAD_statusRequestErrorHandling: error while requesting AutomagicInfo: $err"; - - return; - } + readingsEndUpdate( $hash, 1 ); + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: AMAD_statusRequestErrorHandling: error while requesting AutomagicInfo: $err"; + + return; + } } if( $data eq "" and exists( $param->{code} ) && $param->{code} ne 200 ) { - readingsBeginUpdate( $hash ); - readingsBulkUpdate ( $hash, "state", $param->{code} ) if( ReadingsVal( $name, "state", 1 ) ne "initialized" ); - $hash->{helper}{infoErrorCounter} = ( $hash->{helper}{infoErrorCounter} + 1 ); - readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); + readingsBeginUpdate( $hash ); + readingsBulkUpdate ( $hash, "state", $param->{code} ) if( ReadingsVal( $name, "state", 1 ) ne "initialized" ); + $hash->{helper}{infoErrorCounter} = ( $hash->{helper}{infoErrorCounter} + 1 ); + + readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); - if( $param->{code} ne 200 ) { + if( $param->{code} ne 200 ) { - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: ".$param->{code}; - } + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: ".$param->{code}; + } - readingsEndUpdate( $hash, 1 ); + readingsEndUpdate( $hash, 1 ); - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: received http code ".$param->{code}." without any data after requesting AMAD AutomagicInfo"; + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: received http code ".$param->{code}." without any data after requesting AMAD AutomagicInfo"; - return; + return; } if( ( $data =~ /Error/i ) and exists( $param->{code} ) ) { - readingsBeginUpdate( $hash ); - readingsBulkUpdate( $hash, "state", $param->{code} ) if( ReadingsVal( $name, "state" ,0) ne "initialized" ); - $hash->{helper}{infoErrorCounter} = ( $hash->{helper}{infoErrorCounter} + 1 ); + readingsBeginUpdate( $hash ); + readingsBulkUpdate( $hash, "state", $param->{code} ) if( ReadingsVal( $name, "state" ,0) ne "initialized" ); + $hash->{helper}{infoErrorCounter} = ( $hash->{helper}{infoErrorCounter} + 1 ); - readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); + readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); + + if( $param->{code} eq 404 && ReadingsVal( $name, "flow_Informations", "inactive" ) eq "inactive" ) { + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: check the informations flow on your device"; + } - if( $param->{code} eq 404 && ReadingsVal( $name, "flow_Informations", "inactive" ) eq "inactive" ) { - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: check the informations flow on your device"; - } - - elsif( $param->{code} eq 404 && ReadingsVal( $name, "flow_Informations", "active" ) eq "active" ) { - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: check the automagicApp on your device"; - - } else { - - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: http error ".$param->{code}; - } - - readingsEndUpdate( $hash, 1 ); + elsif( $param->{code} eq 404 && ReadingsVal( $name, "flow_Informations", "active" ) eq "active" ) { - Log3 $name, 5, "AMAD ($name) - statusRequestERROR: received http code ".$param->{code}." receive Error after requesting AMAD AutomagicInfo"; + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: check the automagicApp on your device"; + + } else { - return; + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: http error ".$param->{code}; + } + + readingsEndUpdate( $hash, 1 ); + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: received http code ".$param->{code}." receive Error after requesting AMAD AutomagicInfo"; + + return; } ### End Error Handling @@ -473,9 +516,11 @@ sub AMAD_ResponseProcessing($$) { my @valuestring = split( '@@@@', $data ); my %buffer; + foreach( @valuestring ) { - my @values = split( '@@' , $_ ); - $buffer{$values[0]} = $values[1]; + + my @values = split( '@@' , $_ ); + $buffer{$values[0]} = $values[1]; } @@ -528,10 +573,14 @@ sub AMAD_Set($$@) { $list .= "screenMsg "; $list .= "ttsMsg "; $list .= "volume:slider,0,1,15 "; - $list .= "mediaGoogleMusic:play,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); - $list .= "mediaAmazonMusic:play,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); - $list .= "mediaSpotifyMusic:play,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); - $list .= "mediaTuneinRadio:play,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); + $list .= "mediaGoogleMusic:play/pause,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); + $list .= "mediaAmazonMusic:play/pause,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); + $list .= "mediaSpotifyMusic:play/pause,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); + $list .= "mediaTuneinRadio:play/pause,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); + $list .= "mediaAldiMusic:play/pause,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); + $list .= "mediaYouTube:play/pause,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); + $list .= "mediaVlcPlayer:play/pause,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); + $list .= "mediaAudible:play/pause,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); $list .= "screenBrightness:slider,0,1,255 "; $list .= "screen:on,off,lock,unlock "; $list .= "screenOrientation:auto,landscape,portrait " if( AttrVal( $name, "setScreenOrientation", "0" ) eq "1" ); @@ -548,6 +597,7 @@ sub AMAD_Set($$@) { $list .= "changetoBTDevice:$btdev " if( AttrVal( $name, "setBluetoothDevice", "none" ) ne "none" ); $list .= "activateVoiceInput:noArg "; $list .= "volumeNotification:slider,0,1,7 "; + $list .= "volumeRingSound:slider,0,1,7 "; $list .= "vibrate:noArg "; $list .= "sendIntent "; $list .= "openCall "; @@ -557,6 +607,7 @@ sub AMAD_Set($$@) { $list .= "doNotDisturb:never,always,alarmClockOnly,onlyImportant "; $list .= "userFlowState "; $list .= "sendSMS "; + $list .= "startDaydream:noArg "; if( lc $cmd eq 'screenmsg' || lc $cmd eq 'ttsmsg' @@ -565,6 +616,10 @@ sub AMAD_Set($$@) { || lc $cmd eq 'mediaamazonmusic' || lc $cmd eq 'mediaspotifymusic' || lc $cmd eq 'mediatuneinradio' + || lc $cmd eq 'mediaaldimusic' + || lc $cmd eq 'mediayoutube' + || lc $cmd eq 'mediavlcplayer' + || lc $cmd eq 'mediaaudible' || lc $cmd eq 'screenbrightness' || lc $cmd eq 'screenorientation' || lc $cmd eq 'screenfullscreen' @@ -580,6 +635,7 @@ sub AMAD_Set($$@) { || lc $cmd eq 'clearnotificationbar' || lc $cmd eq 'activatevoiceinput' || lc $cmd eq 'volumenotification' + || lc $cmd eq 'volumeringsound' || lc $cmd eq 'screenlock' || lc $cmd eq 'statusrequest' || lc $cmd eq 'sendsms' @@ -590,6 +646,7 @@ sub AMAD_Set($$@) { || lc $cmd eq 'closecall' || lc $cmd eq 'donotdisturb' || lc $cmd eq 'userflowstate' + || lc $cmd eq 'startdaydream' || lc $cmd eq 'vibrate') { Log3 $name, 5, "AMAD ($name) - set $name $cmd ".join(" ", @val); @@ -601,7 +658,7 @@ sub AMAD_Set($$@) { return "Cannot set command, FHEM Device is unknown" if( ReadingsVal( $name, "deviceState", "online" ) eq "unknown" ); return "Cannot set command, FHEM Device is offline" if( ReadingsVal( $name, "deviceState", "online" ) eq "offline" ); - return AMAD_SelectSetCmd( $hash, $cmd, @val ) if( @val ) || ( lc $cmd eq 'activatevoiceinput' ) || ( lc $cmd eq 'vibrate' ) || ( lc $cmd eq 'currentflowsetupdate' ) || ( lc $cmd eq 'closecall' ); + return AMAD_SelectSetCmd( $hash, $cmd, @val ) if( (@val) or (lc $cmd eq 'activatevoiceinput') or (lc $cmd eq 'vibrate') or (lc $cmd eq 'currentflowsetupdate') or (lc $cmd eq 'closecall') or (lc $cmd eq 'startdaydream') ); } return "Unknown argument $cmd, bearword as argument or wrong parameter(s), choose one of $list"; @@ -635,13 +692,13 @@ sub AMAD_SelectSetCmd($$@) { if( lc $cmd eq 'screenmsg' ) { my $msg = join( " ", @data ); - + $msg =~ s/%/%25/g; $msg =~ s/\s/%20/g; - + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/screenMsg?message=$msg"; Log3 $name, 4, "AMAD ($name) - Sub AMAD_SetScreenMsg"; - + return AMAD_HTTP_POST( $hash,$url ); } @@ -650,10 +707,10 @@ sub AMAD_SelectSetCmd($$@) { my $msg = join( " ", @data ); my $speed = AttrVal( $name, "setTtsMsgSpeed", "1.0" ); my $lang = AttrVal( $name, "setTtsMsgLang","de" ); - + $msg =~ s/%/%25/g; $msg =~ s/\s/%20/g; - + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/ttsMsg?message=".$msg."&msgspeed=".$speed."&msglang=".$lang; return AMAD_HTTP_POST( $hash,$url ); @@ -665,7 +722,7 @@ sub AMAD_SelectSetCmd($$@) { my ($flow,$state) = split( ":", $datas); $flow =~ s/\s/%20/g; - + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/flowState?flowstate=".$state."&flowname=".$flow; return AMAD_HTTP_POST( $hash,$url ); @@ -674,7 +731,7 @@ sub AMAD_SelectSetCmd($$@) { elsif( lc $cmd eq 'volume' ) { my $vol = join( " ", @data ); - + if( $vol =~ /^\+(.*)/ or $vol =~ /^-(.*)/ ) { if( $vol =~ /^\+(.*)/ ) { @@ -692,7 +749,7 @@ sub AMAD_SelectSetCmd($$@) { } my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setVolume?volume=$vol"; - + return AMAD_HTTP_POST( $hash, $url ); } @@ -701,11 +758,20 @@ sub AMAD_SelectSetCmd($$@) { my $vol = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setNotifiVolume?notifivolume=$vol"; - + return AMAD_HTTP_POST( $hash, $url ); } - elsif( lc $cmd eq 'mediagooglemusic' or lc $cmd eq 'mediaamazonmusic' or lc $cmd eq 'mediaspotifymusic' or lc $cmd eq 'mediatuneinradio' ) { + elsif( lc $cmd eq 'volumeringsound' ) { + + my $vol = join( " ", @data ); + + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setRingSoundVolume?ringsoundvolume=$vol"; + + return AMAD_HTTP_POST( $hash, $url ); + } + + elsif( lc $cmd =~ /^media/ ) { my $btn = join( " ", @data ); @@ -719,7 +785,7 @@ sub AMAD_SelectSetCmd($$@) { my $bri = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setBrightness?brightness=$bri"; - + return AMAD_HTTP_POST( $hash,$url ); } @@ -728,16 +794,16 @@ sub AMAD_SelectSetCmd($$@) { my $mod = join( " ", @data ); my $scot = AttrVal( $name, "setScreenOnForTimer", undef ); $scot = 60 if( !$scot ); - + if ($mod eq "on" || $mod eq "off") { - + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setScreenOnOff?screen=".$mod."&screenontime=".$scot if ($mod eq "on" || $mod eq "off"); return AMAD_HTTP_POST( $hash,$url ); } - + elsif ($mod eq "lock" || $mod eq "unlock") { - + return "Please set \"setScreenlockPIN\" Attribut first" if( AttrVal( $name, "setScreenlockPIN", "none" ) eq "none" ); my $PIN = AttrVal( $name, "setScreenlockPIN", undef ); $PIN = AMAD_decrypt($PIN); @@ -753,14 +819,14 @@ sub AMAD_SelectSetCmd($$@) { my $mod = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setScreenOrientation?orientation=$mod"; - + return AMAD_HTTP_POST( $hash,$url ); } elsif( lc $cmd eq 'activatevoiceinput' ) { my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setvoicecmd"; - + return AMAD_HTTP_POST( $hash,$url ); } @@ -771,7 +837,7 @@ sub AMAD_SelectSetCmd($$@) { my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setScreenFullscreen?fullscreen=$mod"; readingsSingleUpdate( $hash, $cmd, $mod, 1 ); - + return AMAD_HTTP_POST( $hash, $url ); } @@ -792,7 +858,7 @@ sub AMAD_SelectSetCmd($$@) { my @alarm = split( ":", $value ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setAlarm?hour=".$alarm[0]."&minute=".$alarm[1]; - + return AMAD_HTTP_POST( $hash, $url ); } @@ -801,7 +867,7 @@ sub AMAD_SelectSetCmd($$@) { my $timer = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setTimer?minute=$timer"; - + return AMAD_HTTP_POST( $hash, $url ); } @@ -868,9 +934,9 @@ sub AMAD_SelectSetCmd($$@) { 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]; - + return AMAD_HTTP_POST( $hash,$url ); } @@ -886,7 +952,7 @@ sub AMAD_SelectSetCmd($$@) { elsif( lc $cmd eq 'vibrate' ) { my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setvibrate"; - + return AMAD_HTTP_POST( $hash,$url ); } @@ -900,7 +966,7 @@ sub AMAD_SelectSetCmd($$@) { $exval2 = "" if( !$exval2 ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/sendIntent?action=".$action."&exkey1=".$exkey1."&exval1=".$exval1."&exkey2=".$exkey2."&exval2=".$exval2; - + return AMAD_HTTP_POST( $hash,$url ); } @@ -909,7 +975,7 @@ sub AMAD_SelectSetCmd($$@) { my $flowname = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/installFlow?flowname=$flowname"; - + return AMAD_HTTP_POST( $hash,$url ); } @@ -920,21 +986,28 @@ sub AMAD_SelectSetCmd($$@) { $time = "none" if( !$time ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/openCall?callnumber=".$callnumber."&hanguptime=".$time; - + return AMAD_HTTP_POST( $hash,$url ); } elsif( lc $cmd eq 'closecall' ) { my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/closeCall"; - + + return AMAD_HTTP_POST( $hash,$url ); + } + + elsif( lc $cmd eq 'startdaydream' ) { + + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/startDaydream"; + return AMAD_HTTP_POST( $hash,$url ); } elsif( lc $cmd eq 'currentflowsetupdate' ) { my $url = "http://" . $host . ":" . $port . "/fhem-amad/currentFlowsetUpdate"; - + return AMAD_HTTP_POST( $hash,$url ); } @@ -946,7 +1019,7 @@ sub AMAD_SelectSetCmd($$@) { $smsmessage =~ s/\s/%20/g; my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/sendSms?smsmessage=".$smsmessage."&smsnumber=".$smsnumber; - + return AMAD_HTTP_POST( $hash,$url ); } @@ -963,16 +1036,17 @@ sub AMAD_HTTP_POST($$) { readingsSingleUpdate( $hash, "state", "Send HTTP POST", 1 ); HttpUtils_NonblockingGet( - { - url => $url, - timeout => 15, - hash => $hash, - method => "POST", - header => "Connection: close", - doTrigger => 1, - callback => \&AMAD_HTTP_POSTerrorHandling, - } + { + url => $url, + timeout => 15, + hash => $hash, + method => "POST", + header => "Connection: close", + doTrigger => 1, + callback => \&AMAD_HTTP_POSTerrorHandling, + } ); + Log3 $name, 4, "AMAD ($name) - Send HTTP POST with URL $url"; readingsSingleUpdate( $hash, "state", $state, 1 ); @@ -989,114 +1063,118 @@ sub AMAD_HTTP_POSTerrorHandling($$$) { ### Begin Error Handling if( $hash->{helper}{setCmdErrorCounter} > 2 ) { - readingsBeginUpdate( $hash ); - readingsBulkUpdate( $hash, "lastSetCommandState", "statusRequest_error" ); - - if( ReadingsVal( $name, "flow_Informations", "active" ) eq "inactive" && ReadingsVal( $name, "flow_SetCommands", "active" ) eq "inactive" ) { - Log3 $name, 5, "AMAD ($name) - setCommandERROR: CHECK THE LAST ERROR READINGS FOR MORE INFO, DEVICE IS SET OFFLINE"; - - readingsBulkUpdate( $hash, "deviceState", "offline" ); - readingsBulkUpdate( $hash, "state", "AMAD Flows inactive, device set offline" ); - } - - elsif( $hash->{helper}{infoErrorCounter} > 7 && $hash->{helper}{setCmdErrorCounter} > 4 ) { - - Log3 $name, 5, "AMAD ($name) - setCommandERROR: UNKNOWN ERROR, PLEASE CONTACT THE DEVELOPER, DEVICE DISABLED"; - - $attr{$name}{disable} = 1; - readingsBulkUpdate( $hash, "state", "Unknown Error, device disabled" ); - $hash->{helper}{infoErrorCounter} = 0; - $hash->{helper}{setCmdErrorCounter} = 0; - - return; - } - - elsif( ReadingsVal( $name, "flow_SetCommands", "active" ) eq "inactive" ) { - - Log3 $name, 5, "AMAD ($name) - setCommandERROR: Flow SetCommands on your Device is inactive, will try to reactivate"; - } - - elsif( $hash->{helper}{setCmdErrorCounter} > 9 ) { - - Log3 $name, 5, "AMAD ($name) - setCommandERROR: To many Errors please check your Network or Device Configuration, DEVICE IS SET OFFLINE"; - - readingsBulkUpdate( $hash, "deviceState", "offline" ); - readingsBulkUpdate( $hash, "state", "To many Errors, device set offline" ); - $hash->{helper}{setCmdErrorCounter} = 0; - } - - elsif( $hash->{helper}{setCmdErrorCounter} > 4 && ReadingsVal( $name, "flow_SetCommands", "active" ) eq "active" ){ - - Log3 $name, 5, "AMAD ($name) - setCommandERROR: Please check the AutomagicAPP on your Device"; - } - - readingsEndUpdate( $hash, 1 ); + + readingsBeginUpdate( $hash ); + readingsBulkUpdate( $hash, "lastSetCommandState", "statusRequest_error" ); + + if( ReadingsVal( $name, "flow_Informations", "active" ) eq "inactive" && ReadingsVal( $name, "flow_SetCommands", "active" ) eq "inactive" ) { + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: CHECK THE LAST ERROR READINGS FOR MORE INFO, DEVICE IS SET OFFLINE"; + + readingsBulkUpdate( $hash, "deviceState", "offline" ); + readingsBulkUpdate( $hash, "state", "AMAD Flows inactive, device set offline" ); + } + + elsif( $hash->{helper}{infoErrorCounter} > 7 && $hash->{helper}{setCmdErrorCounter} > 4 ) { + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: UNKNOWN ERROR, PLEASE CONTACT THE DEVELOPER, DEVICE DISABLED"; + + $attr{$name}{disable} = 1; + readingsBulkUpdate( $hash, "state", "Unknown Error, device disabled" ); + $hash->{helper}{infoErrorCounter} = 0; + $hash->{helper}{setCmdErrorCounter} = 0; + + return; + } + + elsif( ReadingsVal( $name, "flow_SetCommands", "active" ) eq "inactive" ) { + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: Flow SetCommands on your Device is inactive, will try to reactivate"; + } + + elsif( $hash->{helper}{setCmdErrorCounter} > 9 ) { + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: To many Errors please check your Network or Device Configuration, DEVICE IS SET OFFLINE"; + + readingsBulkUpdate( $hash, "deviceState", "offline" ); + readingsBulkUpdate( $hash, "state", "To many Errors, device set offline" ); + $hash->{helper}{setCmdErrorCounter} = 0; + } + + elsif( $hash->{helper}{setCmdErrorCounter} > 4 && ReadingsVal( $name, "flow_SetCommands", "active" ) eq "active" ){ + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: Please check the AutomagicAPP on your Device"; + } + + readingsEndUpdate( $hash, 1 ); } if( defined( $err ) ) { - if( $err ne "" ) { - readingsBeginUpdate( $hash ); - readingsBulkUpdate( $hash, "state", $err ) if( ReadingsVal( $name, "state", 0 ) ne "initialized" ); - $hash->{helper}{setCmdErrorCounter} = ($hash->{helper}{setCmdErrorCounter} + 1); - - readingsBulkUpdate( $hash, "lastSetCommandState", "setCmd_error" ); - - if( $err =~ /timed out/ ) { - - Log3 $name, 5, "AMAD ($name) - setCommandERROR: connect to your device is timed out. check network"; - } - - elsif( $err =~ /Keine Route zum Zielrechner/ ) { - - Log3 $name, 5, "AMAD ($name) - setCommandERROR: no route to target. bad network configuration or network is down"; - - } else { - - Log3 $name, 5, "AMAD ($name) - setCommandERROR: $err"; - } - - readingsEndUpdate( $hash, 1 ); - - Log3 $name, 5, "AMAD ($name) - setCommandERROR: error while POST Command: $err"; - - return; - } + if( $err ne "" ) { + readingsBeginUpdate( $hash ); + readingsBulkUpdate( $hash, "state", $err ) if( ReadingsVal( $name, "state", 0 ) ne "initialized" ); + $hash->{helper}{setCmdErrorCounter} = ($hash->{helper}{setCmdErrorCounter} + 1); + + readingsBulkUpdate( $hash, "lastSetCommandState", "setCmd_error" ); + + if( $err =~ /timed out/ ) { + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: connect to your device is timed out. check network"; + } + + elsif( $err =~ /Keine Route zum Zielrechner/ ) { + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: no route to target. bad network configuration or network is down"; + + } else { + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: $err"; + } + + readingsEndUpdate( $hash, 1 ); + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: error while POST Command: $err"; + + return; + } } if( $data eq "" and exists( $param->{code} ) && $param->{code} ne 200 ) { - readingsBeginUpdate( $hash ); - readingsBulkUpdate( $hash, "state", $param->{code} ) if( ReadingsVal( $hash, "state", 0 ) ne "initialized" ); - - $hash->{helper}{setCmdErrorCounter} = ( $hash->{helper}{setCmdErrorCounter} + 1 ); - - readingsBulkUpdate($hash, "lastSetCommandState", "setCmd_error" ); - - readingsEndUpdate( $hash, 1 ); - Log3 $name, 5, "AMAD ($name) - setCommandERROR: received http code ".$param->{code}; + readingsBeginUpdate( $hash ); + readingsBulkUpdate( $hash, "state", $param->{code} ) if( ReadingsVal( $hash, "state", 0 ) ne "initialized" ); - return; + $hash->{helper}{setCmdErrorCounter} = ( $hash->{helper}{setCmdErrorCounter} + 1 ); + + readingsBulkUpdate($hash, "lastSetCommandState", "setCmd_error" ); + + readingsEndUpdate( $hash, 1 ); + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: received http code ".$param->{code}; + + return; } if( ( $data =~ /Error/i ) and exists( $param->{code} ) ) { - readingsBeginUpdate( $hash ); - readingsBulkUpdate( $hash, "state", $param->{code} ) if( ReadingsVal( $name, "state", 0 ) ne "initialized" ); - - $hash->{helper}{setCmdErrorCounter} = ( $hash->{helper}{setCmdErrorCounter} + 1 ); - - readingsBulkUpdate( $hash, "lastSetCommandState", "setCmd_error" ); - if( $param->{code} eq 404 ) { - - readingsBulkUpdate( $hash, "lastSetCommandError", "" ); - Log3 $name, 5, "AMAD ($name) - setCommandERROR: setCommands flow is inactive on your device!"; - - } else { - - Log3 $name, 5, "AMAD ($name) - setCommandERROR: http error ".$param->{code}; - } - - return; + readingsBeginUpdate( $hash ); + readingsBulkUpdate( $hash, "state", $param->{code} ) if( ReadingsVal( $name, "state", 0 ) ne "initialized" ); + + $hash->{helper}{setCmdErrorCounter} = ( $hash->{helper}{setCmdErrorCounter} + 1 ); + + readingsBulkUpdate( $hash, "lastSetCommandState", "setCmd_error" ); + + if( $param->{code} eq 404 ) { + + readingsBulkUpdate( $hash, "lastSetCommandError", "" ); + Log3 $name, 5, "AMAD ($name) - setCommandERROR: setCommands flow is inactive on your device!"; + + } else { + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: http error ".$param->{code}; + } + + return; } ### End Error Handling @@ -1139,8 +1217,9 @@ sub AMAD_CommBridge_Open($) { my $ret = TcpServer_Open( $hash, $port, "global" ); if( $ret && !$init_done ) { - Log3 $name, 3, "$ret. Exiting."; - exit(1); + + Log3 $name, 3, "$ret. Exiting."; + exit(1); } readingsSingleUpdate ( $hash, "state", "opened", 1 ); @@ -1319,25 +1398,25 @@ sub AMAD_CommBridge_Read($) { elsif ( $fhemcmd =~ /fhemfunc\b/ ) { my $fhemCmd = $data[1]; - + Log3 $bname, 4, "AMAD ($bname) - AMAD_CommBridge: receive fhem-function command"; - + if( $fhemCmd =~ /^{.*}$/ ) { $response = $fhemCmd if( ReadingsVal( $bname, "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; } @@ -1530,6 +1609,11 @@ sub AMAD_decrypt($) {
  • mediaAmazonMusic - play/stop/next/back , controlling the amazon music media player
  • mediaGoogleMusic - play/stop/next/back , controlling the google play music media player
  • mediaSpotifyMusic - play/stop/next/back , controlling the spotify media player
  • +
  • mediaTuneinRadio - play/stop/next/back , controlling the TuneinRadio media player
  • +
  • mediaAldiMusic - play/stop/next/back , controlling the Aldi music media player
  • +
  • mediaAudible - play/stop/next/back , controlling the Audible media player
  • +
  • mediaYouTube - play/stop/next/back , controlling the YouTube media player
  • +
  • mediaVlcPlayer - play/stop/next/back , controlling the VLC media player
  • nextAlarmTime - sets the alarm time. Only valid for the next 24 hours.
  • notifySndFile - plays a media-file which by default needs to be stored in the folder "/storage/emulated/0/Notifications/" of the Android device. You may use the attribute setNotifySndFilePath for defining a different folder.
  • openCall - initial a call and hang up after optional time / set DEVICE openCall 0176354 10 call this number and hang up after 10s
  • @@ -1537,6 +1621,7 @@ sub AMAD_decrypt($) {
  • screenMsg - display message on screen of Android device
  • sendintent - send intent string Example: set $AMADDEVICE sendIntent org.smblott.intentradio.PLAY url http://stream.klassikradio.de/live/mp3-192/stream.klassikradio.de/play.m3u name Klassikradio, first parameter contains the action, second parameter contains the extra. At most two extras can be used.
  • sendSMS - Sends an SMS to a specific phone number. Bsp.: sendSMS Dies ist ein Test|555487263
  • +
  • startDaydream - start Daydream
  • statusRequest - Get a new status report of Android device. Not all readings can be updated using a statusRequest as some readings are only updated if the value of the reading changes.
  • timer - set a countdown timer in the "Clock" stock app. Only seconds are allowed as parameter.
  • ttsMsg - send a message which will be played as voice message
  • @@ -1701,12 +1786,18 @@ sub AMAD_decrypt($) {
  • mediaAmazonMusic - play, stop, next, back ,steuert den Amazon Musik Mediaplayer
  • mediaGoogleMusic - play, stop, next, back ,steuert den Google Play Musik Mediaplayer
  • mediaSpotifyMusic - play, stop, next, back ,steuert den Spotify Mediaplayer
  • +
  • mediaTuneinRadio - play, stop, next, back ,steuert den TuneIn Radio Mediaplayer
  • +
  • mediaAldiMusic - play, stop, next, back ,steuert den Aldi Musik Mediaplayer
  • +
  • mediaAudible - play, stop, next, back ,steuert den Audible Mediaplayer
  • +
  • mediaYouTube - play, stop, next, back ,steuert den YouTube Mediaplayer
  • +
  • mediaVlcPlayer - play, stop, next, back ,steuert den VLC Mediaplayer
  • nextAlarmTime - setzt die Alarmzeit. gilt aber nur innerhalb der nächsten 24Std.
  • openCall - ruft eine Nummer an und legt optional nach X Sekunden auf / set DEVICE openCall 01736458 10 / ruft die Nummer an und beendet den Anruf nach 10s
  • screenBrightness - setzt die Bildschirmhelligkeit, von 0-255.
  • screenMsg - versendet eine Bildschirmnachricht
  • sendintent - sendet einen Intentstring Bsp: set $AMADDEVICE sendIntent org.smblott.intentradio.PLAY url http://stream.klassikradio.de/live/mp3-192/stream.klassikradio.de/play.m3u name Klassikradio, der erste Befehl ist die Aktion und der zweite das Extra. Es können immer zwei Extras mitgegeben werden.
  • sendSMS - sendet eine SMS an eine bestimmte Telefonnummer. Bsp.: sendSMS Dies ist ein Test|555487263
  • +
  • startDaydream - startet den Daydream
  • statusRequest - Fordert einen neuen Statusreport beim Device an. Es können nicht von allen Readings per statusRequest die Daten geholt werden. Einige wenige geben nur bei Statusänderung ihren Status wieder.
  • timer - setzt einen Timer innerhalb der als Standard definierten ClockAPP auf dem Device. Es können nur Sekunden angegeben werden.
  • ttsMsg - versendet eine Nachricht welche als Sprachnachricht ausgegeben wird
  • diff --git a/fhem/FHEM/lib/74_AMADautomagicFlowset_2.6.10.xml b/fhem/FHEM/lib/74_AMADautomagicFlowset_2.6.11.xml similarity index 78% rename from fhem/FHEM/lib/74_AMADautomagicFlowset_2.6.10.xml rename to fhem/FHEM/lib/74_AMADautomagicFlowset_2.6.11.xml index 35816f839..1c4a15aa7 100644 --- a/fhem/FHEM/lib/74_AMADautomagicFlowset_2.6.10.xml +++ b/fhem/FHEM/lib/74_AMADautomagicFlowset_2.6.11.xml @@ -247,7 +247,7 @@ irname=getString("name") false Medien Session verändert true - com.amazon.mp3,com.rhapsody.alditalk,com.spotify.music,com.google.android.videos,com.google.android.music,tunein.player,com.google.android.youtube + 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 false @@ -342,6 +342,14 @@ irname=getString("name") volume_music_speaker volume + + true + Systemeinstellung verändert: System volume_ring + true + SYSTEM + volume_ring + volumeRingSound + true Systemeinstellung verändert: System volume_ring_speaker @@ -627,8 +635,8 @@ irname=getString("name") true - Expression: param_button == "play" - param_button == "play" + Expression: param_button == "play/pause" + param_button == "play/pause" true @@ -765,6 +773,11 @@ irname=getString("name") Expression: setNotifiVolume" request_path == "/fhem-amad/setCommands/setNotifiVolume" + + false + Expression: setRingSoundVolume" + request_path == "/fhem-amad/setCommands/setRingSoundVolume" + false Expression: setScreenFullscreen" @@ -810,6 +823,11 @@ irname=getString("name") Expression: Shutdown param_syscmd == "shutdown" + + false + Expression: startDaydream" + request_path == "/fhem-amad/setCommands/startDaydream" + false Expression: System Command" @@ -921,10 +939,8 @@ or trigger == "HTTP Request: /fhem-amad/deviceInfo/" true - Expression: trigger == "Medien Session verändert" // or trigger == "Medien Session verändert: com.amazon.mp3" // or trigger == "com.amazon.mp3.metachanged" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Medien Session verändert" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" trigger == "Medien Session verändert" - // or trigger == "Medien Session verändert: com.amazon.mp3" -// or trigger == "com.amazon.mp3.metachanged" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" @@ -961,6 +977,11 @@ or trigger == "HTTP Request: /fhem-amad/deviceInfo/" or trigger == "Systemeinstellung verändert: System volume_music_headphone" or trigger == "Systemeinstellung verändert: System volume_music_headset" + + true + Expression: trigger == "Systemeinstellung verändert: System volume_ring" + trigger == "Systemeinstellung verändert: System volume_ring" + true Expression: trigger == "Systemeinstellung verändert: System volume_ring_speaker" @@ -1108,10 +1129,10 @@ or trigger == "HTTP Request: /fhem-amad/deviceInfo/" true - Audio Player steuern: Medienknopf Play ({pname}/{kname}) + Audio Player steuern: Medienknopf Play/Pause (/{kname}) true - LAUNCH - KEYCODE_MEDIA_PLAY + TOGGLE_PAUSE + KEYCODE_MEDIA_PLAY_PAUSE true {pname} {kname} @@ -1673,6 +1694,13 @@ Connection: close volume_ring_speaker volumeNotification + + false + Initialisiere Variable Systemeinstellung: volumeRingSound + SYSTEM + volume_ring + volumeRingSound + false Lautstärken setzen param_notifivolume @@ -1695,6 +1723,28 @@ Connection: close false global_interruptions_mode + + false + Lautstärken setzen param_ringsoundvolume + false + global_volume_alarm + false + global_volume_dtmf + false + param_volume + false + param_notifivolume + true + param_ringsoundvolume + false + global_volume_system + false + global_volume_voice_call + false + global_ringer_mode + false + global_interruptions_mode + false Lautstärken setzen param_volume @@ -2032,7 +2082,7 @@ fhemcmd = "setreading"; true - Script: if(package_name == "com.google.android.music") { musicapp = "Google Musik" } if(package_name == "com.amazon.mp3") { musicapp = "Amazon Musik" } if(package_name == "com.google.android.videos") { musicapp = "Google Video" } if(package_name == "com.spotify.music") { musicapp = "Spotify Musik" } if(package_name == "com.google.android.youtube") { musicapp = "YouTube" } if(package_name == "tunein.player") { musicapp = "TuneIn Player" } if(package_name == "com.rhapsody.alditalk") { musicapp = "Aldi Life Musik" } + Script: if(package_name == "com.google.android.music") { musicapp = "Google Musik" } if(package_name == "com.amazon.mp3") { musicapp = "Amazon Musik" } if(package_name == "com.google.android.videos") { musicapp = "Google Video" } if(package_name == "com.spotify.music") { musicapp = "Spotify Musik" } if(package_name == "com.google.android.youtube") { musicapp = "YouTube" } if(package_name == "tunein.player") { musicapp = "TuneIn Player" } if(package_name == "com.rhapsody.alditalk") { musicapp = "Aldi Life Musik" } if(package_name == "org.videolan.vlc") { musicapp = "VLC Player" } @@ -2347,7 +2401,7 @@ fhemcmd = "setreading"; false Script: Set FHEMDATA - true Script: volumeNotification = "volumeNotification@@" + {volumeNotification}; fhemcmd = "setreading"; + + + true + Script: volumeRingSound = "volumeRingSound@@" + {volumeRingSound}; fhemcmd = "setreading"; + @@ -2496,6 +2556,12 @@ fhemcmd = "setreading"; kname = "com.google.android.music.playback.MediaButtonIntentReceiver"; } +if(param_mplayer == "mediaVlcPlayer") +{ + pname = "org.videolan.vlc"; + kname = "org.videolan.vlc.RemoteControlClientReceiver"; +} + if(param_mplayer == "mediaAmazonMusic") { pname = "com.amazon.mp3"; @@ -2512,6 +2578,24 @@ if(param_mplayer == "mediaTuneinRadio") { pname = "tunein.player"; kname = "tunein.ui.helpers.MediaButtonIntentReceiver"; +} + +if(param_mplayer == "mediaAldiMusic") +{ + pname = "com.rhapsody.alditalk"; + kname = "com.napster.player.MediaButtonReceiver"; +} + +if(param_mplayer == "mediaYouTube") +{ + pname = "com.google.android.youtube"; + kname = "com.google.android.libraries.youtube.player.PlayerUiModule$LegacyMediaButtonIntentReceiver"; +} + +if(param_mplayer == "mediaAudible") +{ + pname = "com.audible.application"; + kname = "com.audible.application.AudibleMediaButtonProcessingReceiver"; } @@ -2725,6 +2809,10 @@ if(param_mplayer == "mediaTuneinRadio") true TRANSIENT + + true + Starte Daydream + true URL in Browser öffnen: {param_url} (mit {param_browserapp}/{param_browserappclass}) @@ -2747,471 +2835,481 @@ if(param_mplayer == "mediaTuneinRadio") Informations - AMAD2 Info/Control Flowset v2.6.10 + AMAD2 Info/Control Flowset v2.6.11 true QUEUE 900 - + Script: daydream_state = "on" + Script: daydream_state = "off" + Expression: airpcount < 11 + Script: keyguard = "unlocked" + Display Orientierung: Portrait + Script: screen_orientation = "portrait" + Script: screen_orientation = "landscape" + Script: dock_state = "docked" + Script: dock_state = "undocked" + Script: keyguardSet = "0" + Script: screen_orientation_mode = "manual" + Script: scrcount = 0 + Script: keyguard = "locked" + Expression: scrcount < 5 + Script: scrcount = scrcount + 1 + Pause: 2s (Gerät wach halten) + Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" + Benachrichtigung in Statusbar angezeigt: Automagic + Script: airpcount = airpcount + 1 + Dock Status: Docked + Script: notification_text = "not supported from your device" + Display automatisch drehen eingeschaltet + Expression: trigger == "Daydream Status: Gestartet" + Bluetooth eingeschaltet + Expression: trigger == "App Task Beendet" + Keyguard gesperrt + Expression: keyguard == "locked" + Expression: getAndroidSDKVersion() >= "19" + Expression: getAndroidSDKVersion() >= "16" + Script: keyguardSet = "not supported from your device" + Display eingeschaltet + Display eingeschaltet + Expression: getAndroidSDKVersion() >= "16" + Unterbrechnungen-Modus: Nur Wecker (Android 6+) + Unterbrechnungen-Modus: Keine / Nicht unterbrechen + Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen + Unterbrechnungen-Modus: Alle / Immer unterbrechen + Script: dndValue = "always" + Script: dndValue = "onlyImportant" + Script: dndValue = "never" + Script: dndValue = "alarmClockOnly" + Script: screen_state = "on" + Script: screen_state = "off" + Script: screen_state = "on {keyguard}" + Script: screen_state = "off {keyguard}" + Script: airplanemode = "off" + Script: bluetooth_state = "on" + Script: androidVersion = "not supported funktion" + Expression: package_name == {global_activetask} + App Task läuft: {global_activetask} (neuster) + Script: runTask = "1" + Script: runTask = "0" + Expression: getAndroidSDKVersion() >= "19" + Script: runTask = "not supported android version" + Script: runTask = "null" + Expression: trigger == "Periodischer Timer: alle 30s" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Periodischer Timer: alle 30s" + Expression: global_activetask != null + Expression: trigger == "Display Status: Aus" or trigger == "Display Status: Ein" or udef_trigger == "setLockPin" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Daydream Status: Gestartet" or trigger == "Daydream Status: Gestoppt" + Expression: trigger == "Display Orientierung: Landscape" or trigger == "Display Orientierung: Portrait" or trigger == "Display Status: Ein" or trigger == "Display Status: Aus" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic" or trigger == "Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Dock Event: Docked" or trigger == "Dock Event: Undocked" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Akku Ladestand: grösser als 0%" + Stromversorgung: Angeschlossen + Script: screen_orientation_mode = "auto" + Script: screen = "screen@@" + {screen_state}; fhemcmd = "setreading"; + Script: bluetooth = "bluetooth@@" + {bluetooth_state}; fhemcmd = "setreading"; + Script: daydream = "daydream@@" + {daydream_state}; fhemcmd = "setreading"; + Script: automagicState = "automagicState@@" + {notification_text}; fhemcmd = "setreading"; + Script: dockingState = "dockingState@@" + {dock_state}; fhemcmd = "setreading"; + Script: incomingCaller = "incomingCallerName@@" + {contact_name} + "@@@@incomingCallerNumber@@" + {incoming_number}; fhemcmd = "setreading"; + Script: androidVersion = "androidVersion@@" + {androidVersion}; fhemcmd = "setreading"; + Script: checkActiveTask = "checkActiveTask@@" + {runTask}; fhemcmd = "setreading"; + Script: deviceState = "deviceState@@online"; fhemcmd = "setreading"; + Get Android Version + Script: bluetooth_state = "off" + Script: if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT") { nextalarmstate = "alert" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS") { nextalarmstate = "dismiss" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE") { nextalarmstate = "done" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE") { nextalarmstate = "snooze" } + Bluetooth Gerät verbunden: Beliebiges Geräte + Script: btdeviceinfo = "connectedBTdevices@@" + {connected_devices_names} + "@@@@connectedBTdevicesMAC@@" + {connected_devices_addresses}; fhemcmd = "setreading"; + Script: connected_devices_names = "none"; connected_devices_addresses = "none" + Expression: trigger == "Bluetooth Status: Schaltet aus, Aus" or trigger == "Bluetooth Status: Schaltet ein, Ein" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Keyguard mit Sicherheit + Script: keyguardSet = "1" + Script: keyguardSet = "keyguardSet@@" + {keyguardSet}; fhemcmd = "setreading"; + Expression: udef_trigger == "setLockPin" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Eingehender Anruf. Status: Klingelt, Nummern: Alle" + Expression: trigger == "Flugmodus: Aus" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Script: screenBrightness = "screenBrightness@@" + {screenBrightness}; fhemcmd = "setreading"; + Expression: trigger == "Systemeinstellung verändert: System screen_brightness" + Bluetooth Gerät verbunden: Beliebiges Geräte (Advanced Audio Distribution) + Script: volumevalue = "volume@@" + {volume}; fhemcmd = "setreading"; + Script: volume = {volumeBT} + Script: screenOrientation = "screenOrientation@@" + {screen_orientation} + "@@@@screenOrientationMode@@" + {screen_orientation_mode}; fhemcmd = "setreading"; + Script: powerinfo = "powerLevel@@" + "{battery_percentage,numberformat,0}" + "@@@@powerPlugged@@" + {battery_plugged} + "@@@@batteryTemperature@@" + "{battery_temperature/10.0,numberformat.0.0}" + "@@@@batteryHealth@@" + {battery_health}; fhemcmd = "setreading"; + Pause: 2s (Gerät wach halten) + Musik Aktiv + Script: currentMusic = "currentMusicTrack@@" + {title} + "@@@@currentMusicAlbum@@" + {description} + "@@@@currentMusicArtist@@" + {subtitle} + "@@@@currentMusicApp@@" + {musicapp} + "@@@@currentMusicIcon@@" + {icon} + "@@@@currentMusicState@@" + {playback_state}; fhemcmd = "setreading"; + Script: airplanemode = "airplanemode@@" + {airplanemode}; fhemcmd = "setreading"; + Benachrichtigung auf Bildschirm: [AMAD2] Nicht mehr benötigte AMAD Flows wurden entfernt! (lange) + Expression: trigger == "Systemeinstellung verändert: System volume_music_bt_a2dp" or trigger == "Systemeinstellung verändert: System volume_music_speaker" or trigger == "Systemeinstellung verändert: System volume_music_headphone" or trigger == "Systemeinstellung verändert: System volume_music_headset" + Initialisiere Variable Systemeinstellung: volumeMusikBluetooth.2 + Script: volume = {volumeSP} + Initialisiere Variable Systemeinstellung: volumeMusikSpeaker.2 + Expression: trigger == "Unterbrechnungen-Modus: Alle / Immer unterbrechen" or trigger == "Unterbrechnungen-Modus: Keine / Nicht unterbrechen" or trigger == "Unterbrechnungen-Modus: Nur Wecker (Android 6+)" or trigger == "Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: getAndroidSDKVersion() >= "21" + Flow Aktiv: SetCommands + Script: setCommandFlow_state = "aktiv" + Script: setCommandFlow_state = "inaktiv" + Setze Flow Status: Aktivieren SetCommands + Script: flow_SetCommands = "flow_SetCommands@@" + {setCommandFlow_state}; fhemcmd = "setreading"; + Script: flowState = "active" + Script: flow_informations = "userFlowState@@" + {flowState}; fhemcmd = "setreading"; + Expression: global_userflowstate != "none" + Flow Aktiv: {global_userflowstate} + Expression: trigger == "Periodischer Timer: alle 30s" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Periodischer Timer: alle 30s" + Script: flowState = "inactive" + Expression: Leon == "Gaultier" + Flows löschen: MultimediaControl + Script: airpcount = 0 + Host erreichbar: {global_fhemip}:{global_bridgeport} + Pause: 2s (Gerät wach halten) + WLAN verfügbar: {global_apssid} + WLAN Reassoziieren + Expression: trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Systemeinstellung verändert: System next_alarm" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Initialisiere Variable Nächster Alarm: next_alarm + Script: next_alarmday = "{next_alarm,dateformat,c}" + Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}" + Script: nextAlarm = "nextAlarmTime@@" + {next_alarmtime} + "@@@@nextAlarmDay@@" + {next_alarmday}; fhemcmd = "setreading"; + Prüfe und setze globale Variablen + Expression: global_fhemip != null or global_bridgeport != null + Flows ausführen: Send Data to AMADCommBridge + Script: nextAlarmState = "nextAlarmState@@" + {nextalarmstate}; fhemcmd = "setreading"; + Script: doNotDisturb = "doNotDisturb@@" + {dndValue}; fhemcmd = "setreading"; + Expression: getAndroidSDKVersion() >= "19" + Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" + Script: notification_text = "not supported from your device" + Script: incommingWhatsAppMessage = "incommingWhatsAppMessageFrom@@" + {notification_text}; fhemcmd = "setreading"; + Expression: getAndroidSDKVersion() >= "19" + Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" + Script: intentRadioState = "intentRadioState@@" + {irstate} + "@@@@intentRadioName@@" + {irname}; fhemcmd = "setreading"; + Expression: trigger == "Genereller Broadcast: wenn org.smblott.intentradio.STATE" + Expression: trigger == "Benachrichtigung in Statusbar angezeigt: com.whatsapp" + Benachrichtigung in Statusbar angezeigt: WhatsApp + Script: notification_text = "not supported from your device" + Benachrichtigung in Statusbar angezeigt: Telegram Messenger + Script: incommingTelegramMessage = "incommingTelegramMessageFrom@@" + {notification_text}; fhemcmd = "setreading"; + Script: volumeNotification = "volumeNotification@@" + {volumeNotification}; fhemcmd = "setreading"; + Host erreichbar: {global_fhemip}:{global_bridgeport} + Expression: trigger == "Benachrichtigung in Statusbar angezeigt: org.telegram.messenger" + Initialisiere Variable Systemeinstellung: screenBrightness + Expression: trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Systemeinstellung verändert: System volume_ring_speaker" + Initialisiere Variable Systemeinstellung: volumeNotification + Expression: trigger == "Systemeinstellung verändert: System volume_ring" + Script: volumeRingSound = "volumeRingSound@@" + {volumeRingSound}; fhemcmd = "setreading"; + Initialisiere Variable Systemeinstellung: volumeRingSound + Script: subtitle = "no player active"; title = "no player active"; description = "no player active"; musicapp = "no player active"; icon = "no player active" + Script: if(playback_state == 0) { playback_state = "keiner" } if(playback_state == 1) { playback_state = "gestoppt" } if(playback_state == 2) { playback_state = "pausiert" } if(playback_state == 3) { playback_state = "spielt ab" } if(playback_state == 4) { playback_state = "spult vorwärts" } if(playback_state == 5) { playback_state = "spült rückwärts" } if(playback_state == 6) { playback_state = "buffert" } if(playback_state == 7) { playback_state = "Fehler" } if(playback_state == 8) { playback_state = "verbindet" } if(playback_state == 9) { playback_state = "springt zum vorherigen" } if(playback_state == 10) { playback_state = "springt zum nächsten" } if(playback_state == 11) { playback_state = "springt zu Position in Wiedergabeliste" } + Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE - Systemeinstellung verändert: System screen_brightness Genereller Broadcast: wenn org.smblott.intentradio.STATE - Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic - Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen - Akku Ladestand: grösser als 0% + Systemeinstellung verändert: System volume_music_headphone + Systemeinstellung verändert: System volume_music_headset Stromversorgung: Angeschlossen Bluetooth Status: Schaltet ein, Ein - Unterbrechnungen-Modus: Alle / Immer unterbrechen Display Status: Aus Display Orientierung: Portrait Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE - Unterbrechnungen-Modus: Nur Wecker (Android 6+) Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS Bluetooth Status: Schaltet aus, Aus - Medien Session verändert + Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen Benachrichtigung in Statusbar angezeigt: com.whatsapp - Systemeinstellung verändert: System volume_music_speaker Daydream Status: Gestoppt - Systemeinstellung verändert: System volume_ring_speaker - Unterbrechnungen-Modus: Keine / Nicht unterbrechen - Eingehender Anruf. Status: Klingelt, Nummern: Alle - Systemeinstellung verändert: System volume_music_headset - Display Status: Ein - Daydream Status: Gestartet - Systemeinstellung verändert: System volume_music_headphone - Systemeinstellung verändert: System next_alarm - Dock Event: Docked Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic - Periodischer Timer: alle 30s - HTTP Request: /fhem-amad/deviceInfo/ - Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT - Stromversorgung: Entfernt - App Task Beendet - Dock Event: Undocked + Akku Ladestand: grösser als 0% + Eingehender Anruf. Status: Klingelt, Nummern: Alle + Display Status: Ein + Systemeinstellung verändert: System volume_music_speaker + Systemeinstellung verändert: System screen_brightness + Daydream Status: Gestartet + Dock Event: Docked Systemeinstellung verändert: System volume_music_bt_a2dp - Display Orientierung: Landscape - Flugmodus: Aus + Unterbrechnungen-Modus: Alle / Immer unterbrechen + HTTP Request: /fhem-amad/deviceInfo/ + Periodischer Timer: alle 30s + Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT Benachrichtigung in Statusbar angezeigt: org.telegram.messenger + Stromversorgung: Entfernt + Systemeinstellung verändert: System next_alarm + Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic + App Task Beendet + Unterbrechnungen-Modus: Keine / Nicht unterbrechen + Dock Event: Undocked + Display Orientierung: Landscape + Unterbrechnungen-Modus: Nur Wecker (Android 6+) + Flugmodus: Aus + Systemeinstellung verändert: System volume_ring_speaker + Systemeinstellung verändert: System volume_ring + Medien Session verändert - Script: daydream_state = "on" - Script: daydream_state = "off" - Expression: airpcount < 11 - Script: keyguard = "unlocked" - Display Orientierung: Portrait - Script: screen_orientation = "portrait" - Script: screen_orientation = "landscape" - Script: dock_state = "docked" - Script: dock_state = "undocked" - Script: keyguardSet = "0" - Script: screen_orientation_mode = "manual" - Script: scrcount = 0 - Script: keyguard = "locked" - Expression: scrcount < 5 - Script: scrcount = scrcount + 1 - Pause: 2s (Gerät wach halten) - Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" - Benachrichtigung in Statusbar angezeigt: Automagic - Script: airpcount = airpcount + 1 - Dock Status: Docked - Script: notification_text = "not supported from your device" - Display automatisch drehen eingeschaltet - Expression: trigger == "Daydream Status: Gestartet" - Bluetooth eingeschaltet - Expression: trigger == "App Task Beendet" - Keyguard gesperrt - Expression: keyguard == "locked" - Expression: getAndroidSDKVersion() >= "19" - Expression: getAndroidSDKVersion() >= "16" - Script: keyguardSet = "not supported from your device" - Display eingeschaltet - Display eingeschaltet - Expression: getAndroidSDKVersion() >= "16" - Unterbrechnungen-Modus: Nur Wecker (Android 6+) - Unterbrechnungen-Modus: Keine / Nicht unterbrechen - Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen - Unterbrechnungen-Modus: Alle / Immer unterbrechen - Script: dndValue = "always" - Script: dndValue = "onlyImportant" - Script: dndValue = "never" - Script: dndValue = "alarmClockOnly" - Script: screen_state = "on" - Script: screen_state = "off" - Script: screen_state = "on {keyguard}" - Script: screen_state = "off {keyguard}" - Script: airplanemode = "off" - Script: bluetooth_state = "on" - Script: androidVersion = "not supported funktion" - Expression: package_name == {global_activetask} - App Task läuft: {global_activetask} (neuster) - Script: runTask = "1" - Script: runTask = "0" - Expression: getAndroidSDKVersion() >= "19" - Script: runTask = "not supported android version" - Script: runTask = "null" - Expression: trigger == "Periodischer Timer: alle 30s" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Expression: trigger == "Periodischer Timer: alle 30s" - Expression: global_activetask != null - Expression: trigger == "Display Status: Aus" or trigger == "Display Status: Ein" or udef_trigger == "setLockPin" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Expression: trigger == "Daydream Status: Gestartet" or trigger == "Daydream Status: Gestoppt" - Expression: trigger == "Display Orientierung: Landscape" or trigger == "Display Orientierung: Portrait" or trigger == "Display Status: Ein" or trigger == "Display Status: Aus" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Expression: trigger == "Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic" or trigger == "Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Expression: trigger == "Dock Event: Docked" or trigger == "Dock Event: Undocked" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Expression: trigger == "Akku Ladestand: grösser als 0%" - Stromversorgung: Angeschlossen - Script: screen_orientation_mode = "auto" - Script: screen = "screen@@" + {screen_state}; fhemcmd = "setreading"; - Script: bluetooth = "bluetooth@@" + {bluetooth_state}; fhemcmd = "setreading"; - Script: daydream = "daydream@@" + {daydream_state}; fhemcmd = "setreading"; - Script: automagicState = "automagicState@@" + {notification_text}; fhemcmd = "setreading"; - Script: dockingState = "dockingState@@" + {dock_state}; fhemcmd = "setreading"; - Script: incomingCaller = "incomingCallerName@@" + {contact_name} + "@@@@incomingCallerNumber@@" + {incoming_number}; fhemcmd = "setreading"; - Script: androidVersion = "androidVersion@@" + {androidVersion}; fhemcmd = "setreading"; - Script: checkActiveTask = "checkActiveTask@@" + {runTask}; fhemcmd = "setreading"; - Script: deviceState = "deviceState@@online"; fhemcmd = "setreading"; - Get Android Version - Script: bluetooth_state = "off" - Script: if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT") { nextalarmstate = "alert" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS") { nextalarmstate = "dismiss" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE") { nextalarmstate = "done" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE") { nextalarmstate = "snooze" } - Bluetooth Gerät verbunden: Beliebiges Geräte - Script: btdeviceinfo = "connectedBTdevices@@" + {connected_devices_names} + "@@@@connectedBTdevicesMAC@@" + {connected_devices_addresses}; fhemcmd = "setreading"; - Script: connected_devices_names = "none"; connected_devices_addresses = "none" - Expression: trigger == "Bluetooth Status: Schaltet aus, Aus" or trigger == "Bluetooth Status: Schaltet ein, Ein" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Keyguard mit Sicherheit - Script: keyguardSet = "1" - Script: keyguardSet = "keyguardSet@@" + {keyguardSet}; fhemcmd = "setreading"; - Expression: udef_trigger == "setLockPin" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Expression: trigger == "Eingehender Anruf. Status: Klingelt, Nummern: Alle" - Expression: trigger == "Flugmodus: Aus" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Initialisiere Variable Systemeinstellung: screenBrightness - Script: screenBrightness = "screenBrightness@@" + {screenBrightness}; fhemcmd = "setreading"; - Expression: trigger == "Systemeinstellung verändert: System screen_brightness" - Initialisiere Variable Systemeinstellung: volumeNotification - Bluetooth Gerät verbunden: Beliebiges Geräte (Advanced Audio Distribution) - Script: volumevalue = "volume@@" + {volume}; fhemcmd = "setreading"; - Script: volume = {volumeBT} - Script: volumeNotification = "volumeNotification@@" + {volumeNotification}; fhemcmd = "setreading"; - Script: screenOrientation = "screenOrientation@@" + {screen_orientation} + "@@@@screenOrientationMode@@" + {screen_orientation_mode}; fhemcmd = "setreading"; - Script: powerinfo = "powerLevel@@" + "{battery_percentage,numberformat,0}" + "@@@@powerPlugged@@" + {battery_plugged} + "@@@@batteryTemperature@@" + "{battery_temperature/10.0,numberformat.0.0}" + "@@@@batteryHealth@@" + {battery_health}; fhemcmd = "setreading"; - Expression: trigger == "Medien Session verändert" // or trigger == "Medien Session verändert: com.amazon.mp3" // or trigger == "com.amazon.mp3.metachanged" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Pause: 2s (Gerät wach halten) - Musik Aktiv - Script: subtitle = "no player active"; title = "no player active"; description = "no player active"; musicapp = "no player active"; icon = "no player active" - Script: currentMusic = "currentMusicTrack@@" + {title} + "@@@@currentMusicAlbum@@" + {description} + "@@@@currentMusicArtist@@" + {subtitle} + "@@@@currentMusicApp@@" + {musicapp} + "@@@@currentMusicIcon@@" + {icon} + "@@@@currentMusicState@@" + {playback_state}; fhemcmd = "setreading"; - Script: airplanemode = "airplanemode@@" + {airplanemode}; fhemcmd = "setreading"; - Benachrichtigung auf Bildschirm: [AMAD2] Nicht mehr benötigte AMAD Flows wurden entfernt! (lange) - Expression: trigger == "Systemeinstellung verändert: System volume_ring_speaker" - Expression: trigger == "Systemeinstellung verändert: System volume_music_bt_a2dp" or trigger == "Systemeinstellung verändert: System volume_music_speaker" or trigger == "Systemeinstellung verändert: System volume_music_headphone" or trigger == "Systemeinstellung verändert: System volume_music_headset" - Initialisiere Variable Systemeinstellung: volumeMusikBluetooth.2 - Script: volume = {volumeSP} - Initialisiere Variable Systemeinstellung: volumeMusikSpeaker.2 - Script: if(playback_state == 0) { playback_state = "keiner" } if(playback_state == 1) { playback_state = "gestoppt" } if(playback_state == 2) { playback_state = "pausiert" } if(playback_state == 3) { playback_state = "spielt ab" } if(playback_state == 4) { playback_state = "spult vorwärts" } if(playback_state == 5) { playback_state = "spült rückwärts" } if(playback_state == 6) { playback_state = "buffert" } if(playback_state == 7) { playback_state = "Fehler" } if(playback_state == 8) { playback_state = "verbindet" } if(playback_state == 9) { playback_state = "springt zum vorherigen" } if(playback_state == 10) { playback_state = "springt zum nächsten" } if(playback_state == 11) { playback_state = "springt zu Position in Wiedergabeliste" } - Script: if(package_name == "com.google.android.music") { musicapp = "Google Musik" } if(package_name == "com.amazon.mp3") { musicapp = "Amazon Musik" } if(package_name == "com.google.android.videos") { musicapp = "Google Video" } if(package_name == "com.spotify.music") { musicapp = "Spotify Musik" } if(package_name == "com.google.android.youtube") { musicapp = "YouTube" } if(package_name == "tunein.player") { musicapp = "TuneIn Player" } if(package_name == "com.rhapsody.alditalk") { musicapp = "Aldi Life Musik" } - Expression: trigger == "Unterbrechnungen-Modus: Alle / Immer unterbrechen" or trigger == "Unterbrechnungen-Modus: Keine / Nicht unterbrechen" or trigger == "Unterbrechnungen-Modus: Nur Wecker (Android 6+)" or trigger == "Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Expression: getAndroidSDKVersion() >= "21" - Flow Aktiv: SetCommands - Script: setCommandFlow_state = "aktiv" - Script: setCommandFlow_state = "inaktiv" - Setze Flow Status: Aktivieren SetCommands - Script: flow_SetCommands = "flow_SetCommands@@" + {setCommandFlow_state}; fhemcmd = "setreading"; - Script: flowState = "active" - Script: flow_informations = "userFlowState@@" + {flowState}; fhemcmd = "setreading"; - Expression: global_userflowstate != "none" - Flow Aktiv: {global_userflowstate} - Expression: trigger == "Periodischer Timer: alle 30s" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Expression: trigger == "Periodischer Timer: alle 30s" - Script: flowState = "inactive" - Host erreichbar: {global_fhemip}:{global_bridgeport} - Expression: Leon == "Gaultier" - Flows löschen: MultimediaControl - Script: airpcount = 0 - Host erreichbar: {global_fhemip}:{global_bridgeport} - Pause: 2s (Gerät wach halten) - WLAN verfügbar: {global_apssid} - WLAN Reassoziieren - Expression: trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Expression: trigger == "Systemeinstellung verändert: System next_alarm" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Initialisiere Variable Nächster Alarm: next_alarm - Script: next_alarmday = "{next_alarm,dateformat,c}" - Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}" - Script: nextAlarm = "nextAlarmTime@@" + {next_alarmtime} + "@@@@nextAlarmDay@@" + {next_alarmday}; fhemcmd = "setreading"; - Expression: trigger == "HTTP Request: /fhem-amad/deviceInfo/" - Prüfe und setze globale Variablen - Expression: global_fhemip != null or global_bridgeport != null - Flows ausführen: Send Data to AMADCommBridge - Script: nextAlarmState = "nextAlarmState@@" + {nextalarmstate}; fhemcmd = "setreading"; - Script: doNotDisturb = "doNotDisturb@@" + {dndValue}; fhemcmd = "setreading"; - Expression: getAndroidSDKVersion() >= "19" - Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" - Script: notification_text = "not supported from your device" - Script: incommingWhatsAppMessage = "incommingWhatsAppMessageFrom@@" + {notification_text}; fhemcmd = "setreading"; - Expression: getAndroidSDKVersion() >= "19" - Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" - Script: intentRadioState = "intentRadioState@@" + {irstate} + "@@@@intentRadioName@@" + {irname}; fhemcmd = "setreading"; - Expression: trigger == "Genereller Broadcast: wenn org.smblott.intentradio.STATE" - Expression: trigger == "Benachrichtigung in Statusbar angezeigt: com.whatsapp" - Expression: trigger == "Benachrichtigung in Statusbar angezeigt: org.telegram.messenger" - Benachrichtigung in Statusbar angezeigt: WhatsApp - Script: notification_text = "not supported from your device" - Benachrichtigung in Statusbar angezeigt: Telegram Messenger - Script: incommingTelegramMessage = "incommingTelegramMessageFrom@@" + {notification_text}; fhemcmd = "setreading"; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Expression: trigger == "Medien Session verändert" or trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Script: if(package_name == "com.google.android.music") { musicapp = "Google Musik" } if(package_name == "com.amazon.mp3") { musicapp = "Amazon Musik" } if(package_name == "com.google.android.videos") { musicapp = "Google Video" } if(package_name == "com.spotify.music") { musicapp = "Spotify Musik" } if(package_name == "com.google.android.youtube") { musicapp = "YouTube" } if(package_name == "tunein.player") { musicapp = "TuneIn Player" } if(package_name == "com.rhapsody.alditalk") { musicapp = "Aldi Life Musik" } if(package_name == "org.videolan.vlc") { musicapp = "VLC Player" } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Send Data to AMADCommBridge - AMAD2 Info/Control Flowset v2.6.10 + AMAD2 Info/Control Flowset v2.6.11 true PARALLEL 900 HTTP Request: send VOICEINPUTVALUE data to AMADCommBridge - HTTP Request: send READINGSVAL data to AMADCommBridge - HTTP Request: send SET data to AMADCommBridge - Benachrichtigung auf Bildschirm: {response} (lange) - HTTP Request: send READINGS data to AMADCommBridge - Expression: fhemcmd == "set" - Expression: fhemcmd == "readingsval" - Expression: fhemcmd == "voiceinputvalue" - Host erreichbar: {global_fhemip}:{global_bridgeport} - Expression: fhemcmd == "setreading" + HTTP Request: send SET data to AMADCommBridge + Benachrichtigung auf Bildschirm: {response} (lange) + HTTP Request: send READINGS data to AMADCommBridge + Expression: fhemcmd == "set" + Expression: fhemcmd == "voiceinputvalue" + Host erreichbar: {global_fhemip}:{global_bridgeport} + Expression: fhemcmd == "setreading" + Expression: fhemcmd == "readingsval" + HTTP Request: send READINGSVAL data to AMADCommBridge Script: Set FHEMDATA - - - - + + + + + + + + - - - - - + SetCommands - AMAD2 Info/Control Flowset v2.6.10 + AMAD2 Info/Control Flowset v2.6.11 true QUEUE 900 @@ -3305,80 +3403,84 @@ if(param_mplayer == "mediaTuneinRadio") Expression: openApp" App Task läuft: App (neuster) Expression: setVolume" - Lautstärken setzen param_volume - App Starten: App - Dateien löschen: /storage/emulated/0/Download/installFlow_{param_flowname} - Dateien löschen: /storage/sdcard0/Download/installFlow_{param_flowname} - Dateien löschen: /storage/sdcard0/Download/installFlow_{param_flowname} - Script: notification_text = "Flow install: path for download not exist" - Script: automagicState = "automagicState@@" + {notification_text}; fhemcmd = "setreading"; - Flows/Widgets importieren: /storage/sdcard0/Download/installFlow_{param_flowname} - Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma} - Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/sdcard0/Download - Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/sdcard0/Download - Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/emulated/0/Download - Flows/Widgets importieren: /storage/emulated/0/Download/installFlow_{param_flowname} - Flows/Widgets importieren: /storage/sdcard0/Download/installFlow_{param_flowname} - Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma} - Gerätespeicherplatz: Freier Speicherplatz > 1kb (/storage/emulated/0) - Gerätespeicherplatz: Freier Speicherplatz > 1kb (/storage/sdcard0) - Gerätespeicherplatz: Freier Speicherplatz > 1kb (/sdcard) - Expression: installFlow" - Neustart - Expression: Reboot - Expression: System Command" - Expression: Shutdown - Expression: Airplanemode - Script: airplanemode = "airplanemode@@on"; fhemcmd = "setreading"; - Flows ausführen: Send Data to AMADCommBridge mit warten - Flugmodus ein-/ausschalten: Ein - Herunterfahren - Notification Lautstärke Wiederherstellen - Expression: param_notifyfile == "RedAlert.mp3" - Sound: {param_notifypath}{param_notifyfile} als Benachrichtigung - Benachrichtigung aus Statusbar entfernen: Alle - Benachrichtigung aus Statusbar entfernen: Alle (Automagic) - Expression: Automagic - Expression: All - Expression: notifysnd" - NotificationLautstärke auf Level 7 - Notification Lautstärke Speichern - Expression: param_notifyfile == "RedAlert.mp3" - Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma} - Expression: Clear Automagic Meldungen" - Expression: setNotifiVolume" - Expression: setVibrate" - Vibrieren: Pattern 2 (-- --) - Lautstärken setzen param_notifivolume - Audio Player steuern: Medienknopf Zurück ({pname}/{kname}) - Audio Player steuern: Medienknopf Play ({pname}/{kname}) - Expression: param_button == "stop" - Expression: param_button == "play" - Expression: param_button == "next" - Expression: param_button == "back" - Script: Zuordnung Mediaplayer - Schalte Display ein: Hell für {param_screenontime}s - Sprachausgabe: Englisch - Expression: ttsMsgLang" - Expression: global_fhemip != null or global_bridgeport != null - Setze Alarm: um {param_hour}:{param_minute} - Audio Player steuern: Medienknopf Weiter ({pname}/{kname}) - Audio Player steuern: Medienknopf Stopp ({pname}/{kname}) - Expression: openCall" - Nummer anrufen: {param_callnumber} - Expression: multimediaControl" - Expression: sendSms" - Expression: param_flowstate == "active" or param_flowstate == "inactive" - Expression: param_flowstate == "active" - SMS senden an: an {param_smsnumber} '{param_smsmessage}' (10 in 12h) - Setze Flow Status: Deaktivieren {param_flowname} - Setze Flow Status: Aktivieren {param_flowname} - Script: notification_text = "Flow '{param_flowname}' has been set {param_flowstate}" - Script: automagicState = "automagicState@@" + {notification_text}; fhemcmd = "setreading"; - Expression: flowState" - Expression: closeCall" - Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*" - + App Starten: App + Dateien löschen: /storage/emulated/0/Download/installFlow_{param_flowname} + Dateien löschen: /storage/sdcard0/Download/installFlow_{param_flowname} + Dateien löschen: /storage/sdcard0/Download/installFlow_{param_flowname} + Script: notification_text = "Flow install: path for download not exist" + Script: automagicState = "automagicState@@" + {notification_text}; fhemcmd = "setreading"; + Flows/Widgets importieren: /storage/sdcard0/Download/installFlow_{param_flowname} + Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma} + Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/sdcard0/Download + Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/sdcard0/Download + Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/emulated/0/Download + Flows/Widgets importieren: /storage/emulated/0/Download/installFlow_{param_flowname} + Flows/Widgets importieren: /storage/sdcard0/Download/installFlow_{param_flowname} + Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma} + Gerätespeicherplatz: Freier Speicherplatz > 1kb (/storage/emulated/0) + Gerätespeicherplatz: Freier Speicherplatz > 1kb (/storage/sdcard0) + Gerätespeicherplatz: Freier Speicherplatz > 1kb (/sdcard) + Expression: installFlow" + Neustart + Expression: Reboot + Expression: System Command" + Expression: Shutdown + Expression: Airplanemode + Script: airplanemode = "airplanemode@@on"; fhemcmd = "setreading"; + Flows ausführen: Send Data to AMADCommBridge mit warten + Flugmodus ein-/ausschalten: Ein + Herunterfahren + Notification Lautstärke Wiederherstellen + Expression: param_notifyfile == "RedAlert.mp3" + Sound: {param_notifypath}{param_notifyfile} als Benachrichtigung + Benachrichtigung aus Statusbar entfernen: Alle + Benachrichtigung aus Statusbar entfernen: Alle (Automagic) + Expression: Automagic + Expression: All + Expression: notifysnd" + NotificationLautstärke auf Level 7 + Notification Lautstärke Speichern + Expression: param_notifyfile == "RedAlert.mp3" + Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma} + Expression: Clear Automagic Meldungen" + Expression: setVibrate" + Vibrieren: Pattern 2 (-- --) + Audio Player steuern: Medienknopf Zurück ({pname}/{kname}) + Expression: param_button == "stop" + Expression: param_button == "next" + Expression: param_button == "back" + Schalte Display ein: Hell für {param_screenontime}s + Sprachausgabe: Englisch + Expression: ttsMsgLang" + Expression: global_fhemip != null or global_bridgeport != null + Setze Alarm: um {param_hour}:{param_minute} + Audio Player steuern: Medienknopf Weiter ({pname}/{kname}) + Expression: openCall" + Nummer anrufen: {param_callnumber} + Expression: sendSms" + Expression: param_flowstate == "active" or param_flowstate == "inactive" + Expression: param_flowstate == "active" + SMS senden an: an {param_smsnumber} '{param_smsmessage}' (10 in 12h) + Setze Flow Status: Deaktivieren {param_flowname} + Setze Flow Status: Aktivieren {param_flowname} + Script: notification_text = "Flow '{param_flowname}' has been set {param_flowstate}" + Script: automagicState = "automagicState@@" + {notification_text}; fhemcmd = "setreading"; + Expression: flowState" + Expression: closeCall" + Audio Player steuern: Medienknopf Stopp ({pname}/{kname}) + Expression: multimediaControl" + Starte Daydream + Expression: startDaydream" + Lautstärken setzen param_volume + Expression: setNotifiVolume" + Lautstärken setzen param_notifivolume + Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*" + Expression: setRingSoundVolume" + Lautstärken setzen param_ringsoundvolume + Expression: param_button == "play/pause" + Audio Player steuern: Medienknopf Play/Pause (/{kname}) + Script: Zuordnung Mediaplayer + @@ -3415,9 +3517,9 @@ if(param_mplayer == "mediaTuneinRadio") - + - + @@ -3446,111 +3548,115 @@ if(param_mplayer == "mediaTuneinRadio") - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Update AMAD Flowset - AMAD2 Info/Control Flowset v2.6.10 + AMAD2 Info/Control Flowset v2.6.11 true QUEUE @@ -3600,7 +3706,7 @@ if(param_mplayer == "mediaTuneinRadio") VoiceControl - AMAD2 Info/Control Flowset v2.6.10 + AMAD2 Info/Control Flowset v2.6.11 true QUEUE