From 0f6912ff3f3cb733dcf12ca8638e2f3aca3a9ecf Mon Sep 17 00:00:00 2001 From: markooldenburg <> Date: Thu, 7 Apr 2016 20:56:23 +0000 Subject: [PATCH] 74_AMAD: New Release, 77_UWZ new Modul git-svn-id: https://svn.fhem.de/fhem/trunk@11203 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 3 + fhem/FHEM/74_AMAD.pm | 1000 +++--- fhem/FHEM/77_UWZ.pm | 1254 +++++++ fhem/FHEM/lib/74_AMADautomagicFlows_1.2.0.xml | 1796 ---------- .../lib/74_AMADautomagicFlowset_2.0.0.xml | 2909 +++++++++++++++++ fhem/MAINTAINER.txt | 2 + 6 files changed, 4647 insertions(+), 2317 deletions(-) create mode 100644 fhem/FHEM/77_UWZ.pm delete mode 100644 fhem/FHEM/lib/74_AMADautomagicFlows_1.2.0.xml create mode 100644 fhem/FHEM/lib/74_AMADautomagicFlowset_2.0.0.xml diff --git a/fhem/CHANGED b/fhem/CHANGED index 35d5d397b..a9ffe6356 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,8 @@ # 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. + - updated: 74_AMAD: New Minor Release 2.0 Please read the Wiki or Commandref + !!! ATTENTION !!! Modify Definition is necessary + - feature: 77_UWZ: new Modules to receive Information about Unwetterwarnung - bugfix: command check for set cmd's don't work completely - feature: FHEMWEB Event-Monitor: stops autoscroll when user scrolls manually. If user scrolls to the bottom end, autoscroll continues. diff --git a/fhem/FHEM/74_AMAD.pm b/fhem/FHEM/74_AMAD.pm index 0ecbeba8a..a0e5510df 100644 --- a/fhem/FHEM/74_AMAD.pm +++ b/fhem/FHEM/74_AMAD.pm @@ -37,7 +37,8 @@ use TcpServerUtils; use Encode qw(encode); -my $version = "1.2.0"; +my $modulversion = "2.0.0"; +my $flowsetversion = "2.0.0"; @@ -56,18 +57,20 @@ sub AMAD_Initialize($) { "checkActiveTask ". "setFullscreen:0,1 ". "setScreenOrientation:0,1 ". - "setScreenBrightness:0,1 ". + "setScreenBrightness:noArg ". "setBluetoothDevice ". "setScreenlockPIN ". + "setScreenOnForTimer ". + "setOpenUrlBroswer ". "root:0,1 ". - "interval ". "port ". "disable:1 ". $readingFnAttributes; foreach my $d(sort keys %{$modules{AMAD}{defptr}}) { my $hash = $modules{AMAD}{defptr}{$d}; - $hash->{VERSION} = $version; + $hash->{VERSIONMODUL} = $modulversion; + $hash->{VERSIONFLOWSET} = $flowsetversion; } } @@ -77,27 +80,33 @@ sub AMAD_Define($$) { my @a = split( "[ \t][ \t]*", $def ); - return "too few parameters: define AMAD " if( @a < 2 && @a > 3 ); + return "too few parameters: define AMAD has the ACCESPOINT-SSID a space you must space replace @@" if( ( @a < 3 || @a > 4 ) && @a != 2 ); my $name = $a[0]; - my $host = $a[2]; + my $host = $a[2] if( $a[2] ); + $a[3] =~ s/@@/ /g if( $a[3] ); + my $apssid = $a[3] if( $a[3] ); my $port = 8090; - my $interval = 180; $hash->{HOST} = $host if( $host ); $hash->{PORT} = $port; - $hash->{INTERVAL} = $interval if( $hash->{HOST} ); - $hash->{VERSION} = $version; + $hash->{APSSID} = $apssid if( $hash->{HOST} ); + $hash->{VERSIONMODUL} = $modulversion; + $hash->{VERSIONFLOWSET} = $flowsetversion; $hash->{helper}{infoErrorCounter} = 0 if( $hash->{HOST} ); $hash->{helper}{setCmdErrorCounter} = 0 if( $hash->{HOST} ); - + + + + 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 ); } else { @@ -105,16 +114,19 @@ sub AMAD_Define($$) { CommandDefine( undef, "AMADCommBridge AMAD" ); } - Log3 $name, 3, "AMAD ($name) - defined with host $hash->{HOST} on port $hash->{PORT} and interval $hash->{INTERVAL} (sec)"; + 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} ); + Log3 $name, 3, "AMAD ($name) - Attention!!! Your Device was defined without ACCESSPOINT-SSID, please modify the DEF to " if( ! $hash->{APSSID} ); $attr{$name}{room} = "AMAD" if( !defined( $attr{$name}{room} ) ); readingsSingleUpdate ( $hash, "state", "initialized", 1 ) if( $hash->{HOST} ); - readingsSingleUpdate ( $hash, "deviceState", "online", 1 ) if( $hash->{HOST} ); + #readingsSingleUpdate ( $hash, "deviceState", "online", 1 ) if( $hash->{HOST} ); - InternalTimer( gettimeofday()+$hash->{INTERVAL}, "AMAD_GetUpdateTimer", $hash, 0 ) if( $hash->{HOST} ); + RemoveInternalTimer($hash); + InternalTimer( gettimeofday()+15, "AMAD_GetUpdate", $hash, 0 ) if( ($hash->{HOST}) && ($hash->{APSSID}) ); $modules{AMAD}{defptr}{$hash->{HOST}} = $hash; - + return undef; } } @@ -128,7 +140,8 @@ sub AMAD_Undef($$) { TcpServer_Close( $hash ); } else { - delete $modules{AMAD}{defptr}{$hash->{HOST}}; + + delete $modules{AMAD}{defptr}{$hash->{HOST}} if( defined($modules{AMAD}{defptr}{$hash->{HOST}}) ); RemoveInternalTimer( $hash ); foreach my $d(sort keys %{$modules{AMAD}{defptr}}) { @@ -140,6 +153,8 @@ sub AMAD_Undef($$) { CommandDelete( undef, $name ); } } + + return undef; } sub AMAD_Attr(@) { @@ -153,7 +168,7 @@ my ( $cmd, $name, $attrName, $attrVal ) = @_; if( $cmd eq "set" ) { if( $attrVal eq "0" ) { RemoveInternalTimer( $hash ); - InternalTimer( gettimeofday()+2, "AMAD_GetUpdateTimer", $hash, 0 ) if( ReadingsVal( $hash->{NAME}, "state", 0 ) eq "disabled" ); + 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 { @@ -164,36 +179,41 @@ my ( $cmd, $name, $attrName, $attrVal ) = @_; } else { RemoveInternalTimer( $hash ); - InternalTimer( gettimeofday()+2, "AMAD_GetUpdateTimer", $hash, 0 ) if( ReadingsVal( $hash->{NAME}, "state", 0 ) eq "disabled" ); + 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"; } } - elsif( $attrName eq "interval" ) { - if( $cmd eq "set" ) { - if( $attrVal < 60 ) { - Log3 $name, 3, "AMAD ($name) - interval too small, please use something > 60 (sec), default is 180 (sec)"; - return "interval too small, please use something > 60 (sec), default is 180 (sec)"; - } else { - $hash->{INTERVAL} = $attrVal; - Log3 $name, 3, "AMAD ($name) - set interval to $attrVal"; - } - - } else { - $hash->{INTERVAL} = 180; - Log3 $name, 3, "AMAD ($name) - set interval to default"; - } + elsif( $attrName eq "setScreenBrightness" ) { + Log3 $name, 1, "AMAD ($name) - !!!The Attribut \"setScreenBrightness\" is obsolete and will be remove in the future!!! Please delete the attribut description in your AMAD Device"; + Log3 $name, 1, "AMAD ($name) - !!!Das Attribut \"setScreenBrightness\" wird nicht mehr benötigt und in zukünftigen Versionen entfernt!!! Bitte lösche die Attributszuweisung aus Deinem AMAD Device"; } elsif( $attrName eq "port" ) { 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} ) { + 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 ); + } } } @@ -211,34 +231,34 @@ my ( $cmd, $name, $attrName, $attrVal ) = @_; return $attrName ." set to ". $attrVal if( $init_done ); } } - - return; + + return undef; } -sub AMAD_GetUpdateLocal($) { +sub AMAD_GetUpdate($) { my ( $hash ) = @_; my $name = $hash->{NAME}; - - AMAD_RetrieveAutomagicInfo( $hash ) if( ReadingsVal( $name, "deviceState", "online" ) eq "online" && ReadingsVal( $hash->{NAME}, "state", 0 ) ne "initialized" && AttrVal( $name, "disable", 0 ) ne "1" ); ### deviceState muß von Hand online/offline gesetzt werden z.B. ueber RESIDENZ Modul + my $bhash = $modules{AMAD}{defptr}{BRIDGE}; + my $bname = $bhash->{NAME}; - return 1; + RemoveInternalTimer( $hash ); + + if( $init_done && ReadingsVal( $name, "deviceState", "online" ) eq "online" && AttrVal( $name, "disable", 0 ) ne "1" && ReadingsVal( $bname, "fhemServerIP", "not set" ) ne "not set" && $hash->{APSSID} ) { + + AMAD_statusRequest( $hash ); + + } else { + + Log3 $name, 4, "AMAD ($name) - GetUpdate, FHEM or Device not ready yet"; + Log3 $name, 3, "AMAD ($bname) - GetUpdate, Please set $bname fhemServerIP NOW!" if( ReadingsVal( $bname, "fhemServerIP", "none" ) eq "none" ); + Log3 $name, 3, "AMAD ($name) - Attention!!! Your Device was defined without ACCESSPOINT-SSID, please modify the DEF to " if( ! $hash->{APSSID} ); + + InternalTimer( gettimeofday()+15, "AMAD_GetUpdate", $hash, 0 ); + } } -sub AMAD_GetUpdateTimer($) { - - my ( $hash ) = @_; - my $name = $hash->{NAME}; - - AMAD_RetrieveAutomagicInfo( $hash ) if( ReadingsVal( $name, "deviceState", "online" ) eq "online" && AttrVal( $name, "disable", 0 ) ne "1" ); ### deviceState muss von Hand online/offline gesetzt werden z.B. ueber RESIDENZ Modul - - InternalTimer( gettimeofday()+$hash->{INTERVAL}, "AMAD_GetUpdateTimer", $hash, 1 ); - Log3 $name, 4, "AMAD ($name) - Call AMAD_GetUpdateTimer"; - - return 1; -} - -sub AMAD_RetrieveAutomagicInfo($) { +sub AMAD_statusRequest($) { my ($hash) = @_; my $bhash = $modules{AMAD}{defptr}{BRIDGE}; @@ -246,6 +266,8 @@ sub AMAD_RetrieveAutomagicInfo($) { my $name = $hash->{NAME}; my $host = $hash->{HOST}; my $port = $hash->{PORT}; + my $bport = $bhash->{PORT}; + my $apssid = $hash->{APSSID}; my $fhemip = ReadingsVal( $bname, "fhemServerIP", "none" ); my $activetask = AttrVal( $name, "checkActiveTask", "none" ); @@ -255,47 +277,43 @@ sub AMAD_RetrieveAutomagicInfo($) { HttpUtils_NonblockingGet( { url => $url, - timeout => 60, + timeout => 30, hash => $hash, method => "GET", - header => "fhemIP: $fhemip\r\nfhemDevice: $name\r\nactiveTask: $activetask", + header => "fhemip: $fhemip\r\nfhemdevice: $name\r\nactivetask: $activetask\r\napssid: $apssid\r\nbport: $bport", doTrigger => 1, - callback => \&AMAD_RetrieveAutomagicInfoFinished, + callback => \&AMAD_statusRequestErrorHandling, } ); - Log3 $name, 4, "AMAD ($name) - NonblockingGet get URL"; - Log3 $name, 4, "AMAD ($name) - AMAD_RetrieveAutomagicInfo: calling Host: $host"; + + Log3 $name, 5, "AMAD ($name) - Send statusRequest with URL: \"$url\" and Header: \"fhemIP: $fhemip\r\nfhemDevice: $name\r\nactiveTask: $activetask\r\napSSID: $apssid\""; } -sub AMAD_RetrieveAutomagicInfoFinished($$$) { +sub AMAD_statusRequestErrorHandling($$$) { my ( $param, $err, $data ) = @_; my $hash = $param->{hash}; my $doTrigger = $param->{doTrigger}; my $name = $hash->{NAME}; my $host = $hash->{HOST}; - - Log3 $name, 4, "AMAD ($name) - AMAD_RetrieveAutomagicInfoFinished: processed request data"; - ### Begin Error Handling - if( $hash->{helper}{infoErrorCounter} > 2 ) { + 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" ) { - readingsBulkUpdate( $hash, "lastStatusRequestError", "AMAD flows on your device inactive, please check your device" ); - Log3 $name, 5, "AMAD ($name) - CHECK THE LAST ERROR READINGS FOR MORE INFO, DEVICE IS SET OFFLINE"; + 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} > 9 && $hash->{helper}{setCmdErrorCounter} > 4 ) { - readingsBulkUpdate( $hash, "lastStatusRequestError", "unknown error, please contact the developer" ); + + elsif( $hash->{helper}{infoErrorCounter} > 7 && $hash->{helper}{setCmdErrorCounter} > 4 ) { - Log3 $name, 4, "AMAD ($name) - UNKNOWN ERROR, PLEASE CONTACT THE DEVELOPER, DEVICE DISABLED"; + 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"); @@ -305,24 +323,24 @@ sub AMAD_RetrieveAutomagicInfoFinished($$$) { return; } + elsif( ReadingsVal( $name, "flow_Informations", "active" ) eq "inactive" ) { - readingsBulkUpdate( $hash, "lastStatusRequestError", "informations flow on your device is inactive, will try to reactivate" ); - Log3 $name, 4, "AMAD ($name) - Informations Flow on your Device is inactive, will try to reactivate"; + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: Informations Flow on your Device is inactive, will try to reactivate"; } - elsif( $hash->{helper}{infoErrorCounter} > 9 ) { - readingsBulkUpdate( $hash, "lastStatusRequestError", "to many errors, check your network or device configuration" ); + + elsif( $hash->{helper}{infoErrorCounter} > 7 ) { - Log3 $name, 4, "AMAD ($name) - To many Errors please check your Network or Device Configuration, DEVICE IS SET OFFLINE"; + 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} > 4 && ReadingsVal( $name, "flow_Informations", "active" ) eq "active" ){ - readingsBulkUpdate( $hash, "lastStatusRequestError", "check automagicApp on your device" ); + + elsif($hash->{helper}{infoErrorCounter} > 2 && ReadingsVal( $name, "flow_Informations", "active" ) eq "active" ){ - Log3 $name, 4, "AMAD ($name) - Please check the AutomagicAPP on your Device"; + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: Please check the AutomagicAPP on your Device"; } readingsEndUpdate( $hash, 1 ); @@ -337,22 +355,28 @@ sub AMAD_RetrieveAutomagicInfoFinished($$$) { readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); if( $err =~ /timed out/ ) { - readingsBulkUpdate( $hash, "lastStatusRequestError", "connect to your device is timed out. check network "); + + 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 ) { - readingsBulkUpdate( $hash,"lastStatusRequestError", "no route to target. bad network configuration or network is down "); + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: no route to target. bad network configuration or network is down"; + } else { - readingsBulkUpdate($hash, "lastStatusRequestError", $err ); + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: $err"; } readingsEndUpdate( $hash, 1 ); - Log3 $name, 4, "AMAD ($name) - AMAD_RetrieveAutomagicInfoFinished: error while requesting AutomagicInfo: $err"; + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: AMAD_statusRequestErrorHandling: error while requesting AutomagicInfo: $err"; + return; } } - if( $data eq "" and exists( $param->{code} ) ) { + 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 ); @@ -360,13 +384,13 @@ sub AMAD_RetrieveAutomagicInfoFinished($$$) { readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); if( $param->{code} ne 200 ) { - readingsBulkUpdate( $hash," lastStatusRequestError", "http Error ".$param->{code} ); + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: ".$param->{code}; } - - readingsBulkUpdate( $hash, "lastStatusRequestError", "empty response, check automagicApp on your device" ); + readingsEndUpdate( $hash, 1 ); - Log3 $name, 4, "AMAD ($name) - AMAD_RetrieveAutomagicInfoFinished: 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; } @@ -379,17 +403,22 @@ sub AMAD_RetrieveAutomagicInfoFinished($$$) { readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" ); if( $param->{code} eq 404 && ReadingsVal( $name, "flow_Informations", "inactive" ) eq "inactive" ) { - readingsBulkUpdate( $hash, "lastStatusRequestError", "check the informations flow on your device" ); + + 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" ) { - readingsBulkUpdate( $hash, "lastStatusRequestError", "check the automagicApp on your device" ); + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: check the automagicApp on your device"; + } else { - readingsBulkUpdate( $hash, "lastStatusRequestError", "http error ".$param->{code} ); + + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: http error ".$param->{code}; } readingsEndUpdate( $hash, 1 ); - Log3 $name, 4, "AMAD ($name) - AMAD_RetrieveAutomagicInfoFinished: received http code ".$param->{code}." receive Error after requesting AMAD AutomagicInfo"; + Log3 $name, 5, "AMAD ($name) - statusRequestERROR: received http code ".$param->{code}." receive Error after requesting AMAD AutomagicInfo"; return; } @@ -397,11 +426,20 @@ sub AMAD_RetrieveAutomagicInfoFinished($$$) { ### End Error Handling $hash->{helper}{infoErrorCounter} = 0; - +} + +sub AMAD_ResponseProcessing($$) { + + my ( $hash, $data ) = @_; + + my $name = $hash->{NAME}; + my $host = $hash->{HOST}; + ### Begin Response Processing + Log3 $name, 5, "AMAD ($name) - Processing data: $data"; readingsSingleUpdate( $hash, "state", "active", 1) if( ReadingsVal( $name, "state", 0 ) ne "initialized" or ReadingsVal( $name, "state", 0 ) ne "active" ); - my @valuestring = split( '@@@@', $data ); + my @valuestring = split( '@@@@', $data ); my %buffer; foreach( @valuestring ) { my @values = split( '@@' , $_ ); @@ -414,8 +452,17 @@ sub AMAD_RetrieveAutomagicInfoFinished($$$) { my $t; my $v; while( ( $t, $v ) = each %buffer ) { - $v =~ s/null//g; - readingsBulkUpdate( $hash, $t, $v ) if( defined( $v ) ); + if( defined( $v ) ) { + + readingsBulkUpdate( $hash, "deviceState", "offline" ) if( $t eq "airplanemode" && $v eq "on" ); + readingsBulkUpdate( $hash, "deviceState", "online" ) if( $t eq "airplanemode" && $v eq "off" ); + $v =~ s/\bnull\b/off/g if( ($t eq "nextAlarmDay" || $t eq "nextAlarmTime") && $v eq "null" ); + + + $v =~ s/\bnull\b//g; + + readingsBulkUpdate( $hash, $t, $v ); + } } readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_done" ); @@ -449,23 +496,26 @@ sub AMAD_Set($$@) { $list .= "volume:slider,0,1,15 "; $list .= "deviceState:online,offline "; $list .= "mediaPlayer:play,stop,next,back " if( ReadingsVal( $bname, "fhemServerIP", "none" ) ne "none"); - $list .= "screenBrightness:slider,0,1,255 " if( AttrVal( $name, "setScreenBrightness", "1" ) eq "1" ); - $list .= "screen:on,off "; - $list .= "screenOrientation:auto,landscape,portrait " if( AttrVal( $name, "setScreenOrientation", "1" ) eq "1" ); - $list .= "screenFullscreen:on,off " if( AttrVal( $name, "setFullscreen", "1" ) eq "1" ); + $list .= "screenBrightness:slider,0,1,255 "; + $list .= "screen:on,off,lock,unlock "; + $list .= "screenOrientation:auto,landscape,portrait " if( AttrVal( $name, "setScreenOrientation", "0" ) eq "1" ); + $list .= "screenFullscreen:on,off " if( AttrVal( $name, "setFullscreen", "0" ) eq "1" ); $list .= "openURL "; $list .= "openApp:$apps " if( AttrVal( $name, "setOpenApp", "none" ) ne "none" ); $list .= "nextAlarmTime:time "; + $list .= "timer:slider,1,1,60 "; $list .= "statusRequest:noArg "; - $list .= "system:reboot,shutdown,airplanemodeON " if( AttrVal( $name, "root", "1" ) eq "1" ); + $list .= "system:reboot,shutdown,airplanemodeON " if( AttrVal( $name, "root", "0" ) eq "1" ); $list .= "bluetooth:on,off "; $list .= "notifySndFile "; $list .= "clearNotificationBar:All,Automagic "; $list .= "changetoBTDevice:$btdev " if( AttrVal( $name, "setBluetoothDevice", "none" ) ne "none" ); $list .= "activateVoiceInput:noArg "; - $list .= "screenLock:on,off " if( AttrVal( $name, "setScreenlockPIN", "none" ) ne "none" ); $list .= "volumeNotification:slider,0,1,7 "; - $list .= "vibrate:noArg"; + $list .= "vibrate:noArg "; + $list .= "sendIntent "; + $list .= "currentFlowsetUpdate:noArg "; + $list .= "installFlowSource "; if( lc $cmd eq 'screenmsg' || lc $cmd eq 'ttsmsg' @@ -479,6 +529,7 @@ sub AMAD_Set($$@) { || lc $cmd eq 'openurl' || lc $cmd eq 'openapp' || lc $cmd eq 'nextalarmtime' + || lc $cmd eq 'timer' || lc $cmd eq 'bluetooth' || lc $cmd eq 'system' || lc $cmd eq 'notifysndfile' @@ -488,23 +539,25 @@ sub AMAD_Set($$@) { || lc $cmd eq 'volumenotification' || lc $cmd eq 'screenlock' || lc $cmd eq 'statusrequest' + || lc $cmd eq 'sendintent' + || lc $cmd eq 'currentflowsetupdate' + || lc $cmd eq 'installflowsource' || lc $cmd eq 'vibrate') { Log3 $name, 5, "AMAD ($name) - set $name $cmd ".join(" ", @val); - return "set command only works if state not equal initialized, please wait for next interval run" if( ReadingsVal( $hash->{NAME}, "state", 0 ) eq "initialized"); + return "set command only works if state not equal initialized" if( ReadingsVal( $hash->{NAME}, "state", 0 ) eq "initialized"); return "Cannot set command, FHEM Device is disabled" if( AttrVal( $name, "disable", "0" ) eq "1" ); return AMAD_SelectSetCmd( $hash, $cmd, @val ) if( @val ) && ( ReadingsVal( $name, "deviceState", "online" ) eq "offline" ) && ( lc $cmd eq 'devicestate' ); 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 'statusrequest' ) || ( lc $cmd eq 'activatevoiceinput' ) || ( lc $cmd eq 'vibrate' ); + return AMAD_SelectSetCmd( $hash, $cmd, @val ) if( @val ) || ( lc $cmd eq 'statusrequest' ) || ( lc $cmd eq 'activatevoiceinput' ) || ( lc $cmd eq 'vibrate' ) || ( lc $cmd eq 'currentflowsetupdate' ); } return "Unknown argument $cmd, bearword as argument or wrong parameter(s), choose one of $list"; } - - #elsif( $name eq "$bname" ) { + elsif( $modules{AMAD}{defptr}{BRIDGE} ) { my $list = ""; @@ -545,6 +598,7 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'ttsmsg' ) { + my $msg = join( " ", @data ); $msg =~ s/%/%25/g; @@ -556,26 +610,25 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'volume' ) { + my $vol = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setVolume?volume=$vol"; - - readingsSingleUpdate( $hash, $cmd, $vol, 1 ); return AMAD_HTTP_POST( $hash, $url ); } elsif( lc $cmd eq 'volumenotification' ) { + my $vol = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setNotifiVolume?notifivolume=$vol"; - - readingsSingleUpdate( $hash, $cmd, $vol, 1 ); return AMAD_HTTP_POST( $hash, $url ); } elsif( lc $cmd eq 'mediaplayer' ) { + my $btn = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/mediaPlayer?button=$btn"; @@ -584,6 +637,7 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'devicestate' ) { + my $v = join( " ", @data ); readingsSingleUpdate( $hash, $cmd, $v, 1 ); @@ -592,6 +646,7 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'screenbrightness' ) { + my $bri = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setBrightness?brightness=$bri"; @@ -600,14 +655,32 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'screen' ) { + 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); - my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setScreenOnOff?screen=$mod"; + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/screenlock?lockmod=".$mod."&lockPIN=".$PIN; - return AMAD_HTTP_POST( $hash,$url ); + return AMAD_HTTP_POST( $hash,$url ); + } } elsif( lc $cmd eq 'screenorientation' ) { + my $mod = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setScreenOrientation?orientation=$mod"; @@ -623,6 +696,7 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'screenfullscreen' ) { + my $mod = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setScreenFullscreen?fullscreen=$mod"; @@ -633,28 +707,43 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'openurl' ) { + my $openurl = join( " ", @data ); + my $browser = AttrVal( $name, "setOpenUrlBroswer", "com.android.chrome|com.google.android.apps.chrome.Main" ); + my @browserapp = split( /\|/, $browser ); - my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/openURL?url=$openurl"; + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/openURL?url=".$openurl."&browserapp=".$browserapp[0]."&browserappclass=".$browserapp[1]; return AMAD_HTTP_POST( $hash, $url ); } elsif (lc $cmd eq 'nextalarmtime') { - my $alarmTime = join( " ", @data ); - my @alarm = split( ":", $alarmTime ); + + my $value = join( " ", @data ); + 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 ); } + elsif (lc $cmd eq 'timer') { + + my $timer = join( " ", @data ); + + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setTimer?minute=$timer"; + + return AMAD_HTTP_POST( $hash, $url ); + } + elsif( lc $cmd eq 'statusrequest' ) { - AMAD_GetUpdateLocal( $hash ); + + AMAD_GetUpdate( $hash ); return undef; } elsif( lc $cmd eq 'openapp' ) { + my $app = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/openApp?app=$app"; @@ -663,17 +752,19 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'system' ) { + my $systemcmd = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/systemcommand?syscmd=$systemcmd"; - readingsSingleUpdate( $hash, $systemcmd, "on", 1 ) if( $systemcmd eq "airplanemodeON" ); + readingsSingleUpdate( $hash, "airplanemode", "on", 1 ) if( $systemcmd eq "airplanemodeON" ); readingsSingleUpdate( $hash, "deviceState", "offline", 1 ) if( $systemcmd eq "airplanemodeON" || $systemcmd eq "shutdown" ); return AMAD_HTTP_POST( $hash,$url ); } elsif( lc $cmd eq 'bluetooth' ) { + my $mod = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setbluetooth?bluetooth=$mod"; @@ -682,6 +773,7 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'notifysndfile' ) { + my $notify = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/playnotifysnd?notifyfile=$notify"; @@ -690,6 +782,7 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'changetobtdevice' ) { + my $swToBtDevice = join( " ", @data ); my @swToBtMac = split( /\|/, $swToBtDevice ); my $btDevices = AttrVal( $name, "setBluetoothDevice", "none" ) if( AttrVal( $name, "setBluetoothDevice", "none" ) ne "none" ); @@ -703,6 +796,7 @@ sub AMAD_SelectSetCmd($$@) { } elsif( lc $cmd eq 'clearnotificationbar' ) { + my $appname = join( " ", @data ); my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/clearnotificationbar?app=$appname"; @@ -710,23 +804,42 @@ sub AMAD_SelectSetCmd($$@) { return AMAD_HTTP_POST( $hash,$url ); } - elsif( lc $cmd eq 'screenlock' ) { - my $lockmod = join( " ", @data ); - my $PIN = AttrVal( $name, "setScreenlockPIN", undef ); - $PIN = AMAD_decrypt($PIN); - - my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/screenlock?lockmod=".$lockmod."&lockPIN=".$PIN; - - readingsSingleUpdate( $hash, $cmd, $lockmod, 1 ); - return AMAD_HTTP_POST( $hash,$url ); - } - elsif( lc $cmd eq 'vibrate' ) { my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setvibrate"; return AMAD_HTTP_POST( $hash,$url ); } + + elsif( lc $cmd eq 'sendintent' ) { + + my $intentstring = join( " ", @data ); + my ( $action, $exkey1, $exval1, $exkey2, $exval2 ) = split( "[ \t][ \t]*", $intentstring ); + $exkey1 = "" if( !$exkey1 ); + $exval1 = "" if( !$exval1 ); + $exkey2 = "" if( !$exkey2 ); + $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 ); + } + + elsif( lc $cmd eq 'installflowsource' ) { + + my $flowname = join( " ", @data ); + + my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/installFlow?flowname=$flowname"; + + 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 ); + } return undef; } @@ -770,16 +883,15 @@ sub AMAD_HTTP_POSTerrorHandling($$$) { readingsBulkUpdate( $hash, "lastSetCommandState", "statusRequest_error" ); if( ReadingsVal( $name, "flow_Informations", "active" ) eq "inactive" && ReadingsVal( $name, "flow_SetCommands", "active" ) eq "inactive" ) { - readingsBulkUpdate( $hash, "lastSetCommandError", "AMAD flows on your device inactive, please check your device" ); - Log3 $name, 5, "AMAD ($name) - CHECK THE LAST ERROR READINGS FOR MORE INFO, DEVICE IS SET OFFLINE"; + 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} > 9 && $hash->{helper}{setCmdErrorCounter} > 4 ) { - readingsBulkUpdate($hash, "lastSetCommandError", "unknown error, please contact the developer" ); + + elsif( $hash->{helper}{infoErrorCounter} > 7 && $hash->{helper}{setCmdErrorCounter} > 4 ) { - Log3 $name, 4, "AMAD ($name) - UNKNOWN ERROR, PLEASE CONTACT THE DEVELOPER, DEVICE DISABLED"; + 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" ); @@ -788,24 +900,24 @@ sub AMAD_HTTP_POSTerrorHandling($$$) { return; } + elsif( ReadingsVal( $name, "flow_SetCommands", "active" ) eq "inactive" ) { - readingsBulkUpdate( $hash, "lastSetCommandError", "setCommands flow on your device is inactive, will try to reactivate" ); - Log3 $name, 4, "AMAD ($name) - Flow SetCommands on your Device is inactive, will try to reactivate"; + Log3 $name, 5, "AMAD ($name) - setCommandERROR: Flow SetCommands on your Device is inactive, will try to reactivate"; } + elsif( $hash->{helper}{setCmdErrorCounter} > 9 ) { - readingsBulkUpdate( $hash, "lastSetCommandError", "to many errors, check your network or device configuration" ); - Log3 $name, 4, "AMAD ($name) - To many Errors please check your Network or Device Configuration, DEVICE IS SET OFFLINE"; + 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" ){ - readingsBulkUpdate( $hash, "lastSetCommandError", "check automagicApp on your device" ); - Log3 $name, 4, "AMAD ($name) - Please check the AutomagicAPP on your Device"; + Log3 $name, 5, "AMAD ($name) - setCommandERROR: Please check the AutomagicAPP on your Device"; } readingsEndUpdate( $hash, 1 ); @@ -817,19 +929,25 @@ sub AMAD_HTTP_POSTerrorHandling($$$) { readingsBulkUpdate( $hash, "state", $err ) if( ReadingsVal( $name, "state", 0 ) ne "initialized" ); $hash->{helper}{setCmdErrorCounter} = ($hash->{helper}{setCmdErrorCounter} + 1); - readingsBulkUpdate( $hash, "lastSetCommandState", "cmd_error" ); + readingsBulkUpdate( $hash, "lastSetCommandState", "setCmd_error" ); if( $err =~ /timed out/ ) { - readingsBulkUpdate( $hash, "lastSetCommandError", "connect to your device is timed out. check network" ); + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: connect to your device is timed out. check network"; } + elsif( $err =~ /Keine Route zum Zielrechner/ ) { - readingsBulkUpdate( $hash, "lastSetCommandError", "no route to target. bad network configuration or network is down" ); + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: no route to target. bad network configuration or network is down"; + } else { - readingsBulkUpdate( $hash, "lastSetCommandError", "$err" ); + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: $err"; } + readingsEndUpdate( $hash, 1 ); - Log3 $name, 5, "AMAD ($name) - AMAD_HTTP_POST: error while POST Command: $err"; + Log3 $name, 5, "AMAD ($name) - setCommandERROR: error while POST Command: $err"; return; } @@ -841,11 +959,11 @@ sub AMAD_HTTP_POSTerrorHandling($$$) { $hash->{helper}{setCmdErrorCounter} = ( $hash->{helper}{setCmdErrorCounter} + 1 ); - readingsBulkUpdate($hash, "lastSetCommandState", "cmd_error" ); - readingsBulkUpdate($hash, "lastSetCommandError", "http Error ".$param->{code} ); + readingsBulkUpdate($hash, "lastSetCommandState", "setCmd_error" ); + readingsEndUpdate( $hash, 1 ); - Log3 $name, 5, "AMAD ($name) - AMAD_HTTP_POST: received http code ".$param->{code}; + Log3 $name, 5, "AMAD ($name) - setCommandERROR: received http code ".$param->{code}; return; } @@ -856,12 +974,16 @@ sub AMAD_HTTP_POSTerrorHandling($$$) { $hash->{helper}{setCmdErrorCounter} = ( $hash->{helper}{setCmdErrorCounter} + 1 ); - readingsBulkUpdate( $hash, "lastSetCommandState", "cmd_error" ); + readingsBulkUpdate( $hash, "lastSetCommandState", "setCmd_error" ); if( $param->{code} eq 404 ) { - readingsBulkUpdate( $hash, "lastSetCommandError", "setCommands flow is inactive on your device!" ); + + readingsBulkUpdate( $hash, "lastSetCommandError", "" ); + Log3 $name, 5, "AMAD ($name) - setCommandERROR: setCommands flow is inactive on your device!"; + } else { - readingsBulkUpdate( $hash, "lastSetCommandError", "http error ".$param->{code} ); + + Log3 $name, 5, "AMAD ($name) - setCommandERROR: http error ".$param->{code}; } return; @@ -869,7 +991,7 @@ sub AMAD_HTTP_POSTerrorHandling($$$) { ### End Error Handling - readingsSingleUpdate( $hash, "lastSetCommandState", "cmd_done", 1 ); + readingsSingleUpdate( $hash, "lastSetCommandState", "setCmd_done", 1 ); $hash->{helper}{setCmdErrorCounter} = 0; return undef; @@ -877,21 +999,23 @@ sub AMAD_HTTP_POSTerrorHandling($$$) { sub AMAD_CommBridge_Open($) { - my ( $bhash ) = @_; - my $bname = $bhash->{NAME}; + my ( $hash ) = @_; + my $name = $hash->{NAME}; + my $port = $hash->{PORT}; + # Oeffnen des TCP Sockets - my $bret = TcpServer_Open( $bhash, "8090", "global" ); + my $ret = TcpServer_Open( $hash, $port, "global" ); - if( $bret && !$init_done ) { - Log3 $bname, 3, "$bret. Exiting."; + if( $ret && !$init_done ) { + Log3 $name, 3, "$ret. Exiting."; exit(1); } - readingsSingleUpdate ( $bhash, "state", "opened", 1 ); - Log3 $bname, 5, "Socket wird geöffnet."; + readingsSingleUpdate ( $hash, "state", "opened", 1 ); + Log3 $name, 5, "Socket wird geöffnet."; - return $bret; + return $ret; } sub AMAD_CommBridge_Read($) { @@ -920,12 +1044,13 @@ sub AMAD_CommBridge_Read($) { #### Verarbeitung der Daten welche über die AMADCommBridge kommen #### + Log3 $bname, 5, "AMAD ($bname) - Receive RAW Message in Debugging Mode: $buf"; ### ## Consume Content ### - my @data = split( '\R\R', $buf ); + my @data = split( '\R\R', $buf ); my $header = AMAD_Header2Hash( $data[0] ); my $device = $header->{FHEMDEVICE}; @@ -934,38 +1059,41 @@ sub AMAD_CommBridge_Read($) { my $c; my $fhemcmd = $header->{FHEMCMD}; + - if ( $fhemcmd =~ /setreading\b/ ) { + if ( $data[0] =~ /currentFlowsetUpdate.xml/ ) { + + $response = qx(cat /opt/fhem/FHEM/lib/74_AMADautomagicFlowset_$flowsetversion.xml); + $c = $hash->{CD}; + print $c "HTTP/1.1 200 OK\r\n", + "Content-Type: text/plain\r\n", + "Content-Length: ".length($response)."\r\n\r\n", + $response; + + return; + } + + elsif ( $data[0] =~ /installFlow_([^.]*.xml)/ ) { + + if( defined($1) ){ + $response = qx(cat /tmp/$1); + $c = $hash->{CD}; + print $c "HTTP/1.1 200 OK\r\n", + "Content-Type: text/plain\r\n", + "Content-Length: ".length($response)."\r\n\r\n", + $response; + + return; + } + } + + elsif ( $fhemcmd =~ /setreading\b/ ) { my $tv = $data[1]; - - @data = split( '\R', $data[0] ); - ### Begin Response Processing - Log3 $name, 4, "AMAD ($name) - AMAD_CommBridge: processing receive reading values"; + Log3 $bname, 4, "AMAD ($bname) - AMAD_CommBridge: processing receive reading values - Device: $device Data: $tv"; - my @valuestring = split( '@@@@', $tv ); - my %buffer; - - foreach( @valuestring ) { - my @values = split( '@@' , $_ ); - $buffer{$values[0]} = $values[1]; - } - - my $t; - my $v; - - while( ( $t, $v ) = each %buffer ) { - $v =~ s/null//g; - - readingsBeginUpdate( $dhash ); - readingsBulkUpdate( $dhash, $t, $v ) if( defined( $v ) ); - } - - readingsBulkUpdate( $dhash, "lastStatusRequestState", "statusRequest_done" ); - readingsEndUpdate( $dhash, 1 ); - - ### End Response Processing - + AMAD_ResponseProcessing($dhash,$tv); + $response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM was processes\r\n"; $c = $hash->{CD}; print $c "HTTP/1.1 200 OK\r\n", @@ -981,7 +1109,7 @@ sub AMAD_CommBridge_Read($) { fhem ("set $fhemCmd") if( ReadingsVal( $bname, "expertMode", 0 ) eq "1" ); readingsSingleUpdate( $bhash, "receiveFhemCommand", "set ".$fhemCmd, 0 ); - Log3 $name, 4, "AMAD ($name) - AMAD_CommBridge: set reading receive fhem command"; + Log3 $bname, 4, "AMAD ($bname) - AMAD_CommBridge: set reading receive fhem command"; $response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM execute set command now\r\n"; $c = $hash->{CD}; @@ -994,13 +1122,13 @@ sub AMAD_CommBridge_Read($) { } elsif ( $fhemcmd =~ /voiceinputvalue\b/ ) { - my $fhemCmd = $data[1]; + my $fhemCmd = lc $data[1]; readingsBeginUpdate( $bhash); readingsBulkUpdate( $bhash, "receiveVoiceCommand", $fhemCmd ); readingsBulkUpdate( $bhash, "receiveVoiceDevice", $device ); readingsEndUpdate( $bhash, 1 ); - Log3 $name, 4, "AMAD ($name) - AMAD_CommBridge: set reading receive voice command"; + Log3 $bname, 4, "AMAD ($bname) - AMAD_CommBridge: set reading receive voice command"; $response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM was processes\r\n"; $c = $hash->{CD}; @@ -1012,19 +1140,6 @@ sub AMAD_CommBridge_Read($) { return; } - elsif ( $fhemcmd eq "statusrequest" ) { - - $response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM was processes\r\n"; - $c = $hash->{CD}; - print $c "HTTP/1.1 200 OK\r\n", - "Content-Type: text/plain\r\n", - "Content-Length: ".length($response)."\r\n\r\n", - $response; - - Log3 $name, 4, "AMAD ($name) - AMAD_CommBridge: Call statusRequest"; - return AMAD_GetUpdateLocal( $dhash ); - } - elsif ( $fhemcmd =~ /readingsval\b/ ) { my $fhemCmd = $data[1]; my @datavalue = split( ' ', $data[1] ); @@ -1036,14 +1151,14 @@ sub AMAD_CommBridge_Read($) { "Content-Length: ".length($response)."\r\n\r\n", $response; - Log3 $name, 4, "AMAD ($name) - AMAD_CommBridge: response ReadingsVal Value to Automagic Device"; + Log3 $bname, 4, "AMAD ($bname) - AMAD_CommBridge: response ReadingsVal Value to Automagic Device"; return; } elsif ( $fhemcmd =~ /fhemfunc\b/ ) { my $fhemCmd = $data[1]; - Log3 $name, 4, "AMAD ($name) - AMAD_CommBridge: receive fhem-function command"; + Log3 $bname, 4, "AMAD ($bname) - AMAD_CommBridge: receive fhem-function command"; if( $fhemcmd =~ /^{.*}$/ ) { @@ -1133,222 +1248,145 @@ sub AMAD_decrypt($) {

AMAD

    - AMAD - Auto Magic Android Device + AMAD - Automagic Android Device
    - This module provides, combination with the Android APP Auto Magic, a variety of information from Android devices. - The AndroidAPP Auto Magic (this 3rd party app costs 2.90Euro) works better than Tasker and is more user-friendly.
    - The following information can be displayed: -
      -
    • Android Version
    • -
    • State of Automagic on the device
    • -
    • Bluetooth on / off
    • -
    • Connected Bluetooth devices
    • -
    • Current music album that is played my the media player
    • -
    • Current music artist that is played my the media player
    • -
    • Current music title that is played my the media player
    • -
    • State of the Android device - Online / Offline
    • -
    • Next alarm (day)
    • -
    • Next alarm (time)
    • -
    • Battery state in %
    • -
    • Charging state - charger connected / disconnected
    • -
    • Screen state on / off
    • -
    • Screen brightness
    • -
    • Full screen mode on / off
    • -
    • Screen orientation auto / landscape / portrait
    • -
    • Default volume
    • -
    • Media volume device speaker
    • -
    • Media volume Bluetooth speaker
    • -
    • ...
    • -
    + This module integrates Android devices into FHEM and displays several settings using the Android app "Automagic". + Automagic is comparable to the "Tasker" app for automating tasks and configuration settings. But Automagic is more user-friendly. The "Automagic Premium" app currently costs EUR 2.90.
    - With some experience lots of information from the Android device can be shown in FHEM. This requires only small adjustments of the "Informations" flow -

    - With this module it is also possible to control an Android device as follows. -
      -
    • Activate Voice Input
    • -
    • Switch Bluetooth on/off
    • -
    • Set or change the connection to a specific Bluetooth device
    • -
    • State of the device (online, offline)
    • -
    • Media Player control ( play / stop / next track / previous track)
    • -
    • Set next alarm time
    • -
    • Play a notification sound
    • -
    • Open an app on the device
    • -
    • Open a URL in the browser on the device
    • -
    • Set Screen on/off
    • -
    • Adjust the screen brightness
    • -
    • Switch to fullscreen mode
    • -
    • Send a message which appears on the screen
    • -
    • Set screen orientation (auto / landscape / portrait)
    • -
    • Request new status report of the device
    • -
    • Set system commands (reboot)
    • -
    • Send a message which will be announced (TTS)
    • -
    • Default media volume
    • -
    • ...
    • -
    -

    - To trigger actions and to obtain information you need the Android App Automagic and a matching Flow. The App you need to get from the app store (google play), - but the modul and the corresponding flow you get from me. + Any information retrievable by Automagic can be displayed in FHEM by this module. Just define your own Automagic-"flow" and send the data to the AMADCommBridge. One even can control several actions on Android devices. +
    + To be able to make use of all these functions the Automagic app and additional flows need to be installed on the Android device. The flows can be retrieved from the FHEM directory, the app can be bought in Google Play Store.

    How to use AMAD?
      -
    • installed the app "Auto Magic Premium" from the App Store or the trial version from here
    • -
    • installed the Flowset 74_AMADautomagicFlows$VERSION.xml from the folder $INSTALLFHEM/FHEM/lib/ to your Android device and first activates only the "information" flow.
    • +
    • install the "Automagic Premium" app from the Google Play store or use the test version from here
    • +
    • install the flowset 74_AMADautomagicFlowset$VERSION.xml from the directory $INSTALLFHEM/FHEM/lib/ on your Android device. Do not yet activate the flows.

    - Next you need to define a FHEM device. + Now you need to define a device in FHEM.

    Define

      - define <name> AMAD <IP-ADDRESS> + define <name> AMAD <IP-ADDRESS> <WLANAP-SSID(s)>

      Example:

        - define TabletLivingRoom AMAD 192.168.0.23
        + define WandTabletWohnzimmer AMAD 192.168.0.23 TuxNetAP@@OpaZuHause

      - This statement creates a new AMAD device. The parameter <IP-ADRESSE< specifies the ip-address of the Android device. - The default communication interval is set to 180 seconds and can be changed via attribute "interval". If you want to change the port, - you can do this via the attribute "port". - You should know what you are doing, because this port is set in the HTTP response trigger of the 2 flows. Consequently, - this must also be changed there.
      + With this command two new AMAD devices in a room called AMAD are created. The parameter <IP-ADDRESS< defines the IP address of your Android device, parameter WLANAP-SSID defines the SSID(s) of the WLAN(s) from which the FHEM server can be reached. More than one SSID can be defined which need to be joined by two consequent "@". The second device created is the AMADCommBridge which serves as a communication device from each Android device to FHEM.
      + !!!Coming Soon!!! The communication port of each AMAD device may be set by the definition of the "port" attribute. One needs background knowledge of Automagic and HTTP requests as this port will be set in the HTTP request trigger of both flows, therefore the port also needs to be set there. +
      + The communication port of the AMADCommBridge device can easily be changed within the attribut "port".
    -

    - Done! After connecting the device instance should already come in the first Readings within 3 minutes. -


    - +
    AMAD Communication Bridge
      - When you define the first AMAD device instance another device named AMADCommBridge will also be defined. Its room attribute is AMAD. - You need this device for the communication fom the Andoid unit to FHEM without having received any query from FHEM. The Android unit must know the IP address of FHEM, so you must enter the set command for the corresponding reading immediately after the definition of the bridge. This is extremly important to get the functionality working properly! - The command is - set AMADCommBridge fhemServerIP . - There is another reading expertMode which allows a direct communication with FHEM without haviung to use a notify or being limited to set commands. -
    -

    + Creating your first AMAD device automatically creates the AMADCommBridge device in the room AMAD. With the help of the AMADCommBridge any Android device communicates initially to FHEM.To make the IP addresse of the FHEM server known to the Android device, the FHEM server IP address needs to be configured in the AMADCommBridge. WITHOUT THIS STEP THE AMADCommBridge WILL NOT WORK PROPERLY.
    + Please us the following command for configuration of the FHEM server IP address in the AMADCommBridge: set AMADCommBridge fhemServerIP <FHEM-IP>.
    + Additionally the expertMode may be configured. By this setting a direct communication with FHEM will be established without the restriction of needing to make use of a notify to execute set commands. +

+ NOW please activate the flows in Automagic!!!
+
+ You are finished now! After 15 seconds latest the readings of your AMAD Android device should be updated. Consequently each 15 seconds a status request will be sent. If the state of your AMAD Android device does not change to "active" over a longer period of time one should take a look into the log file for error messages. +


Readings
    -
  • airplanemode - state of Airplane
  • -
  • androidVersion - installed Android Version
  • -
  • automagic state - status messages from the AutomagicApp
  • -
  • bluetooth on / off - is Bluetooth switched on or off on the device
  • -
  • checkActiveTask - state of an app being defined before, 1=activ in the foreground, see the hint further down
  • -
  • connectedBTdevices - a list of the connected devices
  • -
  • connectedBTdevicesMAC – list f the MAC addresses of all connected BT devices
  • -
  • current Music Album - currently played music album of the media player used
  • -
  • current music artist - currently played music artist of the media player used
  • -
  • current Music Track - currently played music title of the media player used
  • -
  • deviceState - State of the Android device, must itself be set with setreading e.g. about the attendance check. When offline is set, the interval is set off for information retrieval.
  • -
  • flow_SetCommands active / inactive - indicates the status of SetCommands flow again
  • -
  • flow_informations active / inactive - indicates the status of the information flow again
  • -
  • lastSetCommandError - last error message from the set command successfully / not sent last status from the set command, command is successful - lastSetCommandState
  • -
  • lastSetCommandState cmd_done / cmd_error - state of last SetCommand command
  • -
  • lastStatusRequestError - last error message from the status request command successfully / not sent last status from the status request command, command is successful - load status RequestStateChange
  • -
  • lastStatusRequestState statusRequest_done / statusRequest_error - state of last statusRequest command
  • -
  • nextAlarmDay - active alarm day
  • -
  • next alarmTime - active alarm time
  • -
  • powerlevel - state of the battery in %
  • -
  • powerPlugged - connected power supply? 0=NO, 1|2=YES
  • -
  • screen - screen on/off
  • -
  • screenBrightness - Screen Brightness from 0-255
  • -
  • screenFullscreen - fullscreen mode (On, Off)
  • -
  • screenLock - Pin-Lock (On,Off)
  • -
  • screenOrientation - screen orientation (Auto, Landscape, Portrait)
  • -
  • state - state off Devices
  • -
  • volume - volume value which was set on "Set volume".
  • -
  • volumeMusicBluetooth - Media volume of the Bluetooth speakers
  • -
  • volumeMusicSpeaker - Media volume of the internal speakers
  • -
  • volumeNotification - Notification volume of Device
  • +
  • airplanemode - on/off, state of the aeroplane mode
  • +
  • androidVersion - currently installed version of Android
  • +
  • automagicState - state of the Automagic App (prerequisite Android >4.3). In case you have Android >4.3 and the reading says "not supported", you need to enable Automagic inside Android / Settings / Sound & notification / Notification access
  • +
  • bluetooth - on/off, bluetooth state
  • +
  • checkActiveTask - state of an app (needs to be defined beforehand). 0=not active or not active in foreground, 1=active in foreground, see note below
  • +
  • connectedBTdevices - list of all devices connected via bluetooth
  • +
  • connectedBTdevicesMAC - list of MAC addresses of all devices connected via bluetooth
  • +
  • currentMusicAlbum - currently playing album of mediaplayer
  • +
  • currentMusicArtist - currently playing artist of mediaplayer
  • +
  • currentMusicTrack - currently playing song title of mediaplayer
  • +
  • daydream - on/off, daydream currently active
  • +
  • deviceState - state of Android devices. !!!It does not show the real state!!! deviceState must be set manually by the command "set DEVICE deviceState" e.g. by your PRESENCE function.
    In case deviceState is set to "offline" no set commands can be issued.
  • +
  • dockingState - undocked/docked, Android device in docking station
  • +
  • flow_SetCommands - active/inactive, state of SetCommands flow
  • +
  • flow_informations - active/inactive, state of Informations flow
  • +
  • flowsetVersionAtDevice - currently installed version of the flowsets on the Android device
  • +
  • intentRadioName - name of the most-recent streamed intent radio
  • +
  • intentRadioState - state of intent radio player
  • +
  • keyguardSet - 0/1 keyguard set, 0=no 1=yes, does not indicate whether it is currently active
  • +
  • lastSetCommandError - last error message of a set command
  • +
  • lastSetCommandState - last state of a set command, command send successful/command send unsuccessful
  • +
  • lastStatusRequestError - last error message of a statusRequest command
  • +
  • lastStatusRequestState - ast state of a statusRequest command, command send successful/command send unsuccessful
  • +
  • nextAlarmDay - currently set day of alarm
  • +
  • nextAlarmState - alert/done, current state of "Clock" stock-app
  • +
  • nextAlarmTime - currently set time of alarm
  • +
  • powerLevel - state of battery in %
  • +
  • powerPlugged - 0=no/1,2=yes, power supply connected
  • +
  • screen - on locked,unlocked/off locked,unlocked, state of display
  • +
  • screenBrightness - 0-255, level of screen-brightness
  • +
  • screenFullscreen - on/off, full screen mode
  • +
  • screenOrientation - Landscape/Portrait, screen orientation (horizontal,vertical)
  • +
  • screenOrientationMode - auto/manual, mode for screen orientation
  • +
  • state - current state of AMAD device
  • +
  • volume - media volume setting
  • +
  • volumeNotification - notification volume setting

  • - The Readings volume Music Bluetooth and music speaker volume reflect the respective media volume of the closed border is Bluetooth speakers or the internal speaker again. - Unless one the respective volumes relies exclusively on the Set command, one of the two will always agree with the "volume" Reading a.

    - Before using the Reading checkActivTask you must set the nme of the package name of te app to be checked innthe attribute checkActiveTask. Eample: - attr Nexus10Wohnzimmer checkActiveTask com.android.chrome for the Chrome browser. -


- Define user specific Readings in the AMAD device -
    - You can specify your own reaqdings in the AMAD device and use them in combination with your Automagic flow. The transmission takes place immediately by means of the AMADCommBridge - so you should not update it too often. This is how you can do it: -
      -
      -
    • first you need to define an Automagic flow for the information for the reading
    • -
    • diese Information speichert man nun mittels Automagic Action Script in eine globale Variable namens global_reading_ (beim auf Groß- und Kleinschreibung achten):
    • -
      - - this information needs to be stored with the help of an Automagic action in a global variable (case sensitiv!). Example: - The Reading Touch should get the value "yes" - Action Script: global_reading_Touch="yes" - + Prerequisite for using the reading checkActivTask the package name of the application to be checked needs to be defined in the attribute checkActiveTask. Example: attr Nexus10Wohnzimmer + checkActiveTask com.android.chrome für den Chrome Browser.

      -
    • abschließend muss noch die Übertragung des Wertes initiiert werden. Dies erfolgt, indem der Wert der Variable global_own_reading auf den Wert _ gesetzt wird (auch hier auf Groß- und Kleinschreibung achten):
    • -
      - - Finally you need to trigger the transmission of the value. This is dne by setting the the value of the variable global_own_reading to _ gesetzt wird (again: case sensitiv!): - Example: The Reading Touch should be transfered
      - Action Script: global_own_reading="{getDate()}_Touch"
      - Hint: you can put both actions in one script: -
        - global_reading_Touch="ja";global_own_reading="{getDate()}_Touch" -
      -
      -
      -
    • Asume you want to get an immediate information when the display of your tablet has been switched on or off then you can define the following flows: -
      - - Action Script when the display is activated: global_reading_Display="on";global_own_reading="{getDate()}_Display" - Action Script when the display is deactivated: global_reading_Display="off";global_own_reading="{getDate()}_Display"
    • - -


Set
    -
  • activateVoiceInput - activat Voice Input on Android Device
  • -
  • bluetooth - set bluetooth on/off
  • -
  • clearNotificationBar - clear the notification on bar. All or Automagic Notofication only
  • -
  • Device State - sets the Device Status Online / Offline. See Readings
  • -
  • mediaPlayer - controls the default media player. Play, Stop, Back Route title, ahead of title.
  • -
  • NextAlarm time - sets the alarm time. only within the next 24hrs.
  • -
  • notifySndFile - plays the specified media file on the Android device. The file to be played must be in the folder /storage/emulated/0/Notifications/.
  • -
  • openURL - opens a URL in your default browser
  • -
  • screen - are sets the screen on / off with barrier in the car Magic settings must "Admin Function" set will not work "Screen off".
  • -
  • screenMsg - sends a message screen
  • -
  • Status Request - calls for a new Status Report in Device to
  • -
  • ttsMsg - sends a message which is output as a voice message
  • -
  • vibrate - vibrates the device
  • -
  • volume - sets the media volume. Either the internal speakers or when connected the Bluetooth speaker
  • -
  • volumeNotification - sets the notification volume.
  • +
  • activateVoiceInput - start voice input on Android device
  • +
  • bluetooth - on/off, switch bluetooth on/off
  • +
  • clearNotificationBar - All/Automagic, deletes all or only Automagic notifications in status bar
  • +
  • currentFlowsetUpdate - start flowset update on Android device
  • +
  • deviceState - online/offline, sets device state . For more information see section Readings
  • +
  • installFlowSource - install a Automagic flow on device, XML file must be stored in /tmp/ with extension xml. Example: set TabletWohnzimmer installFlowSource WlanUebwerwachen.xml
  • +
  • mediaPlayer - play/stop/next/back , controlling the standard media player
  • +
  • nextAlarmTime - sets the alarm time. Only valid for the next 24 hours.
  • +
  • notifySndFile - start playing the defined media file on the Android device The media file must be stored in /storage/emulated/0/Notifications/
  • +
  • screenBrightness - 0-255, set screen brighness
  • +
  • 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.
  • +
  • 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
  • +
  • vibrate - vibrate Android device
  • +
  • volume - set media volume. Works on internal speaker or, if connected, bluetooth speaker or speaker connected via stereo jack
  • +
  • volumeNotification - set notifications volume

- Set depending on set attributes + Set (depending on attribute values)
    -
  • changetoBtDevice - changes to another Bluetooth device. The attribute setBluetoothDevice must be set. See hint below!
  • -
  • openapp - opens a selected app. Attribute setOpenApp
  • -
  • screen Brightness - sets the screen brightness, 0-255 Attribute setScreenBrightness
  • - If you want to use the "set screen brightness", a small adjustment in the flow SetCommands must be made. Opens the action (one of the squares very bottom) Set System Settings: System and makes a check "I have checked the settings, I know what I'm doing". -
  • screen fullscreen - Switches to full screen mode on / off. Attribute SetFullscreen
  • -
  • screenLock - locked Screen by set Pinlock. Attribute setScreenlockPIN - There are only allowed numbers and it must be more than 4 and less as 16 character
  • -
  • screenOrientation - Switches the screen orientation Auto / Landscape / Portrait. Attribute setScreenOrientation
  • -
  • system - set system commands from (only rooted devices). reboot,shutdown,airplanemodeON (activate only) Attribut root, in the Auto Magic Settings "root function" must be set
  • - In order to use openApp you need an attribute where separated by a comma, several app names are set in order to use openapp. The app name is arbitrary and only required for recognition. The same app name must be used in the flow in SetCommands on the left below the hash expression: "openapp" be in one of the 5 paths (one app per path) entered in both diamonds. Thereafter, in the quadrangle selected the app which app through the attribute names should be started.

    - To switch between different Bluetooth devices, you need set the attribute setBluetoothDevice accordingly. - attr BTdeviceName1|MAC,BTDeviceName2|MAC - There may never be a sapce in BTdeviceName. There must also be the colon(:) in the MAC address after every second sign! - Example: attr Nexus10Wohnzimmer setBluetoothDevice Logitech_BT_Adapter|AB:12:CD:34:EF:32,Anker_A3565|GH:56:IJ:78:KL:76 +
  • changetoBtDevice - switch to another bluetooth device. Attribute setBluetoothDevice needs to be set. See note below!
  • +
  • openApp - start an app. attribute setOpenApp
  • +
  • openURL - opens a URLS in the standard browser as long as no other browser is set by the attribute setOpenUrlBrowser.Example: attr Tablet setOpenUrlBrowser de.ozerov.fully|de.ozerov.fully.MainActivity, first parameter: package name, second parameter: Class Name
  • +
  • screen - on/off/lock/unlock, switch screen on/off or lock/unlock screen. In Automagic "Preferences" the "Device admin functions" need to be enabled, otherwise "Screen off" does not work. attribute setScreenOnForTimer changes the time the display remains switched on!
  • +
  • screenFullscreen - on/off, activates/deactivates full screen mode. attribute setFullscreen
  • +
  • screenLock - Locks screen with request for PIN. attribute setScreenlockPIN - enter PIN here. Only use numbers, 4-16 numbers required.
  • +
  • screenOrientation - Auto,Landscape,Portait, set screen orientation (automatic, horizontal, vertical). attribute setScreenOrientation
  • +
  • system - issue system command (only with rooted Android devices). reboot,shutdown,airplanemodeON (can only be switched ON) attribute root, in Automagic "Preferences" "Root functions" need to be enabled.
  • +
    + To be able to use "openApp" the corresponding attribute "setOpenApp" needs to contain the app package name. +

    + To be able to switch between bluetooth devices the attribute "setBluetoothDevice" needs to contain (a list of) bluetooth devices defined as follows: attr <DEVICE> BTdeviceName1|MAC,BTDeviceName2|MAC No spaces are allowed in any BTdeviceName. Defining MAC please make sure to use the character : (colon) after each second digit/character.
    + Example: attr Nexus10Wohnzimmer setBluetoothDevice Logitech_BT_Adapter|AB:12:CD:34:EF:32,Anker_A3565|GH:56:IJ:78:KL:76


state
    -
  • initialized - If the status shortly after a define.
  • -
  • active - the device instance is in active status.
  • -
  • disabled - the device instance has been disabled via the disable attribute
  • +
  • initialized - shown after initial define.
  • +
  • active - device is active.
  • +
  • disabled - device is disabled by the attribute "disable".



- Application examples: + Further examples and reading:


@@ -1362,190 +1400,112 @@ sub AMAD_decrypt($) { AMAD - Automagic Android Device
Dieses Modul liefert, in Verbindung mit der Android APP Automagic, diverse Informationen von Android Geräten. - Die AndroidAPP Automagic (welche nicht von mir stammt und 2.90Euro kostet) funktioniert wie Tasker, ist aber bei weitem User freundlicher. - Im Auslieferungszustand werden folgende Zustände dargestellt: -
    -
  • Android Version
  • -
  • Zustand von Automagic auf dem Gerät
  • -
  • Bluetooth An/Aus
  • -
  • Zustand einer definierten App (läuft aktiv im Vordergrund oder nicht?)
  • -
  • verbundene Bluetoothgeräte, inklusive deren MAC Adresse
  • -
  • aktuell abgespieltes Musikalbum des verwendeten Mediaplayers
  • -
  • aktuell abgespielter Musikinterpret des verwendeten Mediaplayers
  • -
  • aktuell abgespielter Musiktitel des verwendeten Mediaplayers
  • -
  • Status des Androidgerätes - Online/Offline
  • -
  • nächster Alarmtag
  • -
  • nächste Alarmzeit
  • -
  • Batteriestatus in %
  • -
  • Ladestatus - Netztei angeschlossen / nicht angeschlossen
  • -
  • Bildschirmstatus An/Aus
  • -
  • Bildschirmhelligkeit
  • -
  • Vollbildmodus An/Aus
  • -
  • Bildschirmausrichtung Auto/Landscape/Portrait
  • -
  • Standardlautstärke
  • -
  • Media Lautstärke des Lautsprechers am Gerät
  • -
  • Media Lautstärke des Bluetooth Lautsprechers
  • -
  • ...
  • -
+ Die AndroidAPP Automagic (welche nicht von mir stammt und 2.90 Euro kostet) funktioniert wie Tasker, ist aber bei weitem User freundlicher.
- Mit etwas Einarbeitung können jegliche Informationen welche Automagic bereit stellt in FHEM angezeigt werden. Hierzu bedarf es lediglich - einer kleinen Anpassung des "Informations" Flows -

- Das Modul gibt Dir auch die Möglichkeit Deine Androidgeräte zu steuern. So können folgende Aktionen durchgeführt werden. -
    -
  • aktiviert Spracheingabe
  • -
  • Bluetooth Ein/Aus schalten
  • -
  • zu einem bestimmten Bluetoothgerät wechseln/verbinden
  • -
  • Status des Gerätes (Online,Offline)
  • -
  • Mediaplayer steuern (Play, Stop, nächster Titel, vorheriger Titel)
  • -
  • nächste Alarmzeit setzen
  • -
  • ein Benachrichtigungston abspielen (Notificationsound)
  • -
  • eine App auf dem Gerät öffnen
  • -
  • eine URL im Browser öffnen
  • -
  • Bildschirm An/Aus machen
  • -
  • Bildschirmhelligkeit einstellen
  • -
  • Vollbildmodus einschalten
  • -
  • eine Nachricht senden welche am Bildschirm angezeigt wird
  • -
  • Bildschirmausrichtung einstellen (Auto,Landscape,Portrait)
  • -
  • neuen Statusreport des Gerätes anfordern
  • -
  • Systembefehle setzen (Reboot)
  • -
  • eine Nachricht senden welche angesagt wird (TTS)
  • -
  • Medienlautstärke regeln
  • -
  • ...
  • -
-

- Für all diese Aktionen und Informationen wird auf dem Androidgerät Automagic und ein so genannter Flow benötigt. Die App ist über den Google PlayStore zu beziehen. Das benötigte Flowset bekommt Ihr aus dem FHEM Update. + Mit etwas Einarbeitung können jegliche Informationen welche Automagic bereit stellt in FHEM angezeigt werden. Hierzu bedarf es lediglich eines eigenen Flows welcher seine Daten an die AMADCommBridge sendet. Das Modul gibt auch die Möglichkeit Androidgeräte zu steuern. +
+ Für all diese Aktionen und Informationen wird auf dem Androidgerät "Automagic" und ein so genannter Flow benötigt. Die App ist über den Google PlayStore zu beziehen. Das benötigte Flowset bekommt man aus dem FHEM Verzeichnis.

Wie genau verwendet man nun AMAD?
    -
  • installiert Euch die App "Automagic Premium" aus dem App Store oder die Testversion von hier
  • -
  • installiert das Flowset 74_AMADautomagicFlows$VERSION.xml aus dem Ordner $INSTALLFHEM/FHEM/lib/ auf Eurem Androidgerät und aktiviert erstmal nur den "Informations" Flow.
  • +
  • man installiert die App "Automagic Premium" aus dem PlayStore oder die Testversion von hier
  • +
  • dann installiert man das Flowset 74_AMADautomagicFlowset$VERSION.xml aus dem Ordner $INSTALLFHEM/FHEM/lib/ auf dem Androidgerät. NOCH NICHT die Flows aktivieren

- Nun müsst Ihr nur noch ein Device in FHEM anlegen. + Es muß noch ein Device in FHEM anlegt werden.

Define

    - define <name> AMAD <IP-ADRESSE> + define <name> AMAD <IP-ADRESSE> <WLANAP-SSID('s)>

    Beispiel:

      - define WandTabletWohnzimmer AMAD 192.168.0.23
      + define WandTabletWohnzimmer AMAD 192.168.0.23 TuxNetAP@@OpaZuHause

    - Diese Anweisung erstellt ein neues AMAD-Device im Raum AMAD.Der Parameter <IP-ADRESSE< legt die IP Adresse des Android Gerätes fest.
    - Das Standard Abfrageinterval ist 180 Sekunden und kann über das Attribut intervall geändert werden. Wer den Port ändern möchte, kann dies über - das Attribut port tun. Ihr solltet aber wissen was Ihr tut, da dieser Port im HTTP Response Trigger der beiden Flows eingestellt ist. Demzufolge muß dieser dort - auch verädert werden.
    + Diese Anweisung erstellt zwei neue AMAD-Devices im Raum AMAD.Der Parameter <IP-ADRESSE< legt die IP Adresse des Android Gerätes fest und der Parameter WLANAP-SSID die SSID des WLAN's welches sich zum FHEM Server verbindet. Es können mehrere SSID's mit angegeben werden, welche dann getrennt durch zwei @ eingetragen werden. Das zweite Device ist die AMADCommBridge welche als Kommunikationsbrücke vom Androidgerät zu FHEM diehnt.
    + !!!Comming Soon!!! Der Port eines jeden AMAD Devices kann über das Attribut "port" geändert werden. Hier sollte Hintergrundwissen zu Automagic und HTTP Request vorhanden sein, da dieser Port im HTTP Request Trigger der beiden Flows eingestellt ist. Demzufolge muß der Port dort auch verädert werden. +
    + Der Port für die Bridge kann ohne Probleme im Bridge Device mittels dem Attribut "port" verändert werden.
-

- Fertig! Nach anlegen der Geräteinstanz sollten nach spätestens 3 Minuten bereits die ersten Readings reinkommen. -


- +
AMAD Communication Bridge
    - Beim ersten anlegen einer AMAD Deviceinstanz wird automatisch ein Gerät Namens AMADCommBridge im Raum AMAD angelegt. - Alle anderen Eigenschaften können geändert werden. Dieses Gerät diehnt zur Kommunikation - vom Androidgerät zu FHEM ohne das zuvor eine Anfrage von FHEM aus ging. Damit das Androidgerät die IP von FHEM kennt, muss diese sofort nach dem anlegen der Bridge - über den set Befehl in ein entsprechendes Reading in die Bridge geschrieben werden. DAS IST SUPER WICHTIG UND FÜR DIE FUNKTION DER BRIDGE NOTWENDIG.
    - Bitte führt hierzu folgenden Befehl aus. set AMADCommBridge fhemServerIP <FHEM-IP>.
    - Als zweites Reading könnt Ihr expertModesetzen. Mit diesem Reading wird eine unmittelbare Komminikation mit FHEM erreicht ohne die Einschränkung über ein + Beim ersten anlegen einer AMAD Deviceinstanz wird automatisch ein Gerät Namens AMADCommBridge im Raum AMAD mit angelegt. Dieses Gerät diehnt zur Kommunikation vom Androidgerät zu FHEM ohne das zuvor eine Anfrage von FHEM aus ging. Damit das Androidgerät die IP von FHEM kennt, muss diese sofort nach dem anlegen der Bridge über den set Befehl in ein entsprechendes Reading in die Bridge geschrieben werden. DAS IST SUPER WICHTIG UND FÜR DIE FUNKTION DER BRIDGE NOTWENDIG.
    + Hierfür muß folgender Befehl ausgeführt werden. set AMADCommBridge fhemServerIP <FHEM-IP>.
    + Als zweites Reading kann expertMode gesetzen werden. Mit diesem Reading wird eine unmittelbare Komminikation mit FHEM erreicht ohne die Einschränkung über ein Notify gehen zu müssen und nur reine set Befehle ausführen zu können. -
-

+
+ NUN bitte die Flows AKTIVIEREN!!!
+
+ Fertig! Nach anlegen der Geräteinstanz und dem eintragen der fhemServerIP in der CommBridge sollten nach spätestens 15 Sekunden bereits die ersten Readings reinkommen. Nun wird alle 15 Sekunden probiert einen Status Request erfolgreich ab zu schließen. Wenn der Status sich über einen längeren Zeitraum nicht auf "activ" ändert, sollte man im Log nach eventuellen Fehlern suchen. +


Readings
  • airplanemode - Status des Flugmodus
  • androidVersion - aktuell installierte Androidversion
  • -
  • automagicState - Statusmeldungen von der AutomagicApp (Voraussetzung Android >4.3). Wer ein Android >4.3 hat und im Reading steht "wird nicht unterstützt", muß in den Androideinstellungen unter Ton und Benachrichtigungen -> Benachrichtigungszugriff ein Haken setzen für Automagic
  • -
  • bluetooth on/off - ist auf dem Gerät Bluetooth an oder aus
  • +
  • automagicState - Statusmeldungen von der AutomagicApp (Voraussetzung Android >4.3). Ist Android größer 4.3 vorhanden und im Reading steht "wird nicht unterstützt", muß in den Androideinstellungen unter Ton und Benachrichtigungen -> Benachrichtigungszugriff ein Haken für Automagic gesetzt werden
  • +
  • bluetooth - on/off, Bluetooth Status an oder aus
  • checkActiveTask - Zustand einer zuvor definierten APP. 0=nicht aktiv oder nicht aktiv im Vordergrund, 1=aktiv im Vordergrund, siehe Hinweis unten
  • connectedBTdevices - eine Liste der verbundenen Gerät
  • connectedBTdevicesMAC - eine Liste der MAC Adressen aller verbundender BT Geräte
  • currentMusicAlbum - aktuell abgespieltes Musikalbum des verwendeten Mediaplayers
  • currentMusicArtist - aktuell abgespielter Musikinterpret des verwendeten Mediaplayers
  • currentMusicTrack - aktuell abgespielter Musiktitel des verwendeten Mediaplayers
  • -
  • deviceState - Status des Androidgerätes, muss selbst mit setreading gesetzt werden z.B. über die Anwesenheitskontrolle.
    - Ist Offline gesetzt, wird der Intervall zum Informationsabruf aus gesetzt.
  • -
  • flow_SetCommands active/inactive - gibt den Status des SetCommands Flow wieder
  • -
  • flow_informations active/inactive - gibt den Status des Informations Flow wieder
  • +
  • daydream - on/off, Daydream gestartet oder nicht
  • +
  • deviceState - Status des Androidgerätes. !!!Gibt nicht den tatsächlichen Status des Gerätes wieder!!! deviceState muss von Hand selbst gesetzt werden. (set DEVICE deviceState) z.B. über die Anwesenheitskontrolle.
    Ist Offline gesetzt, können keine set Befehle abgesetzt werden.
  • +
  • dockingState - undocked/docked Status ob sich das Gerät in einer Dockinstation befindet.
  • +
  • flow_SetCommands - active/inactive, Status des SetCommands Flow
  • +
  • flow_informations - active/inactive, Status des Informations Flow
  • +
  • flowsetVersionAtDevice - aktuell installierte Flowsetversion auf dem Device
  • +
  • intentRadioName - zuletzt gesrreamter Intent Radio Name
  • +
  • intentRadioState - Status des IntentRadio Players
  • +
  • keyguardSet - 0/1 Displaysperre gesetzt 0=nein 1=ja, bedeutet nicht das sie gerade aktiv ist
  • lastSetCommandError - letzte Fehlermeldung vom set Befehl
  • lastSetCommandState - letzter Status vom set Befehl, Befehl erfolgreich/nicht erfolgreich gesendet
  • lastStatusRequestError - letzte Fehlermeldung vom statusRequest Befehl
  • lastStatusRequestState - letzter Status vom statusRequest Befehl, Befehl erfolgreich/nicht erfolgreich gesendet
  • nextAlarmDay - aktiver Alarmtag
  • +
  • nextAlarmState - aktueller Status des "Androidinternen" Weckers
  • nextAlarmTime - aktive Alarmzeit
  • powerLevel - Status der Batterie in %
  • powerPlugged - Netzteil angeschlossen? 0=NEIN, 1|2=JA
  • -
  • screen - Bildschirm An oderAus
  • +
  • screen - on locked/unlocked, off locked/unlocked gibt an ob der Bildschirm an oder aus ist und gleichzeitig gesperrt oder nicht gesperrt
  • screenBrightness - Bildschirmhelligkeit von 0-255
  • -
  • screenFullscreen - Vollbildmodus (On,Off)
  • -
  • screenLock - Pin-Sperre (On,Off)
  • -
  • screenOrientation - Bildschirmausrichtung (Auto,Landscape,Portrait)
  • -
  • state - aktueller Status des Devices
  • -
  • volume - Lautstärkewert welcher über "set volume" gesetzt wurde.
  • -
  • volumeMusikBluetooth - Media Lautstärke von angeschlossenden Bluetooth Lautsprechern
  • -
  • volumeMusikSpeaker - Media Lautstärke der internen Lautsprecher
  • +
  • screenFullscreen - on/off, Vollbildmodus (An,Aus)
  • +
  • screenOrientation - Landscape,Portrait, Bildschirmausrichtung (Horizontal,Vertikal)
  • +
  • screenOrientationMode - auto/manual, Modus für die Ausrichtung (Automatisch, Manuell)
  • +
  • state - aktueller Status
  • +
  • volume - Media Lautstärkewert
  • volumeNotification - Benachrichtigungs Lautstärke

  • - Die Readings volumeMusikBluetooth und volumeMusikSpeaker spiegeln die jeweilige Medialautstärke der angeschlossenden Bluetoothlautsprecher oder der internen Lautsprecher wieder. - Sofern man die jeweiligen Lautstärken ausschließlich über den Set Befehl setzt, wird eine der beiden immer mit dem "volume" Reading über ein stimmen.

    Beim Reading checkActivTask muß zuvor der Packagename der zu prüfenden App als Attribut checkActiveTask angegeben werden. Beispiel: attr Nexus10Wohnzimmer checkActiveTask com.android.chrome für den Chrome Browser.

- Eigene Readings im AMAD-Device erstellen -
    - Es ist möglich, aus beliebigen eigenen Automagic-Flows eigene Readings im AMAD-Device zu erstellen und zu füllen. Die Übertragung zum FHEM AMAD-Device erfolgt umgehend über die AMADCommBridge - daher sollte auf eine zu häufige Aktualisierung verzichtet werden. Die Vorgehensweise in Automagic hierfür ist folgende: -
      -
      -
    • zunächst erstellt man sich, soweit nicht bereits geschehen, einen Automagic-Flow der die Information, die in ein Reading übernommen werden soll zur Verfügung stellt
    • -
    • diese Information speichert man nun mittels Automagic Action Script in eine globale Variable namens global_reading_ (beim auf Groß- und Kleinschreibung achten):
    • -
      - - Beispiel: Das Reading Touch soll den Wert "ja" erhalten - Action Script: global_reading_Touch="ja" - -

      -
    • abschließend muss noch die Übertragung des Wertes initiiert werden. Dies erfolgt, indem der Wert der Variable global_own_reading auf den Wert _ gesetzt wird (auch hier auf Groß- und Kleinschreibung achten):
    • -
      - - Beispiel: Das Reading Touch soll übertragen werden
      - Action Script: global_own_reading="{getDate()}_Touch"
      - Hinweis: man kann auch beide Aktionen in ein Script packen: -
        - global_reading_Touch="ja";global_own_reading="{getDate()}_Touch" -
      -
      -
      -
    • Möchte man nun als nächstes z.B. eine sofortige Benachrichtigung, wenn das Display des Tablets an- oder ausgeschaltet wird, könnte man sich Flows bauen, welche beim De-/Aktivieren des Display ausgeführt werden:
    • -
      - - Action Script beim Aktivieren des Displays: global_reading_Display="an";global_own_reading="{getDate()}_Display" - Action Script beim Deaktivieren des Displays: global_reading_Display="aus";global_own_reading="{getDate()}_Display" - -
    -


Set
    -
  • activateVoiceInput - schaltet die Spracheingabe ein
  • -
  • bluetooth - Schaltet Bluetooth on/off
  • -
  • clearNotificationBar - (All,Automagic) löscht alle Meldungen oder nur die Automagic Meldungen in der Statusleiste
  • -
  • deviceState - setzt den Device Status Online/Offline. Siehe Readings
  • -
  • mediaPlayer - steuert den Standard Mediaplayer. play, stop, Titel zürück, Titel vor.
  • -
  • nextAlarmTime - setzt die Alarmzeit. Geht aber nur innerhalb der nächsten 24Std.
  • -
  • notifySndFile - spielt die angegebende Mediadatei auf dem Androidgerät ab. Die aufzurufende Mediadatei muß sich im Ordner /storage/emulated/0/Notifications/ befinden.
  • -
  • openURL - öffnet eine URL im Standardbrowser
  • -
  • screen - setzt den Bildschirm on/off mit Sperre, in den Automagic Einstellungen muss "Admin Funktion" gesetzt werden sonst funktioniert "Screen off" nicht.
  • +
  • activateVoiceInput - aktiviert die Spracheingabe
  • +
  • bluetooth - on/off, aktiviert/deaktiviert Bluetooth
  • +
  • clearNotificationBar - All,Automagic, löscht alle Meldungen oder nur die Automagic Meldungen in der Statusleiste
  • +
  • currentFlowsetUpdate - fürt ein Flowsetupdate auf dem Device durch
  • +
  • deviceState - online/offline, setzt den Device Status . mehr Info unter Readings
  • +
  • installFlowSource - installiert einen Flow auf dem Device, das XML File muss unter /tmp/ liegen und die Endung xml haben. Bsp: set TabletWohnzimmer installFlowSource WlanUebwerwachen.xml
  • +
  • mediaPlayer - play, stop, next, back ,steuert den Standard Mediaplayer
  • +
  • nextAlarmTime - setzt die Alarmzeit. gilt aber nur innerhalb der nächsten 24Std.
  • +
  • notifySndFile - spielt die angegebene Mediadatei auf dem Androidgerät ab. Die aufzurufende Mediadatei muß sich im Ordner /storage/emulated/0/Notifications/ befinden.
  • +
  • screenBrightness - setzt die Bildschirmhelligkeit, von 0-255.
  • screenMsg - versendet eine Bildschirmnachricht
  • -
  • statusRequest - Fordert einen neuen Statusreport beim Device an
  • +
  • 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.
  • +
  • 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
  • vibrate - lässt das Androidgerät vibrieren
  • -
  • volume - setzt die Medialautstärke. Entweder die internen Lautsprecher oder sofern angeschlossen die Bluetoothlautsprecher
  • +
  • volume - setzt die Medialautstärke. Entweder die internen Lautsprecher oder sofern angeschlossen die Bluetoothlautsprecher und per Klinkenstecker angeschlossene Lautsprecher
  • volumeNotification - setzt die Benachrichtigungslautstärke.

@@ -1553,17 +1513,15 @@ sub AMAD_decrypt($) {
  • changetoBtDevice - wechselt zu einem anderen Bluetooth Gerät. Attribut setBluetoothDevice muß gesetzt sein. Siehe Hinweis unten!
  • openApp - öffnet eine ausgewählte App. Attribut setOpenApp
  • -
  • screenBrightness - setzt die Bildschirmhelligkeit, von 0-255 Attribut setScreenBrightness
  • - Wenn Ihr das "set screenBrightness" verwenden wollt, muss eine kleine Anpassung im Flow SetCommands vorgenommen werden. Öffnet die Aktion (eines der Vierecke ganz ganz unten) - SetzeSystemeinstellung:System und macht einen Haken bei "Ich habe die Einstellungen überprüft, ich weiss was ich tue". -
  • screenFullscreen - Schaltet den Vollbildmodus on/off. Attribut setFullscreen
  • -
  • screenLock - Sperrt den Bildschirm mit Pinabfrage. Attribut setScreenlockPIN - hier die Pin dafür eingeben. Erlaubt sind nur Zahlen. Es müßen mindestens 4 bis max 16 Zeichen sein.
  • -
  • screenOrientation - Schaltet die Bildschirmausrichtung Auto/Landscape/Portait. Attribut setScreenOrientation
  • +
  • openURL - öffnet eine URL im Standardbrowser, sofern kein anderer Browser über das Attribut setOpenUrlBrowser ausgewählt wurde. Bsp: attr Tablet setOpenUrlBrowser de.ozerov.fully|de.ozerov.fully.MainActivity, das erste ist der Package Name und das zweite der Class Name
  • +
  • screen - on/off/lock/unlock schaltet den Bildschirm ein/aus oder sperrt/entsperrt ihn, in den Automagic Einstellungen muss "Admin Funktion" gesetzt werden sonst funktioniert "Screen off" nicht. Attribut setScreenOnForTimer ändert die Zeit wie lange das Display an bleiben soll!
  • +
  • screenFullscreen - on/off, (aktiviert/deaktiviert) den Vollbildmodus. Attribut setFullscreen
  • +
  • screenLock - Sperrt den Bildschirm mit Pinabfrage. Attribut setScreenlockPIN - hier die Pin dafür eingeben. Erlaubt sind nur Zahlen. Es müßen mindestens 4, bis max 16 Zeichen verwendet werden.
  • +
  • screenOrientation - Auto,Landscape,Portait, aktiviert die Bildschirmausrichtung (Automatisch,Horizontal,Vertikal). Attribut setScreenOrientation
  • system - setzt Systembefehle ab (nur bei gerootetet Geräen). reboot,shutdown,airplanemodeON (kann nur aktiviert werden) Attribut root, in den Automagic Einstellungen muss "Root Funktion" gesetzt werden

  • - Um openApp verwenden zu können, muss als Attribut ein, oder durch Komma getrennt, mehrere App Namen gesetzt werden. Der App Name ist frei wählbar und nur zur Wiedererkennung notwendig. - Der selbe App Name muß im Flow SetCommands auf der linken Seite unterhalb der Raute Expression:"openApp" in einen der 5 Stränge (eine App pro Strang) in beide Rauten eingetragen werden. Danach wird - in das Viereck die App ausgewält welche durch den Attribut App Namen gestartet werden soll.

    + Um openApp verwenden zu können, muss als Attribut der Package Name der App angegeben werden. +

    Um zwischen Bluetoothgeräten wechseln zu können, muß das Attribut setBluetoothDevice mit folgender Syntax gesetzt werden. attr <DEVICE> BTdeviceName1|MAC,BTDeviceName2|MAC Es muss zwingend darauf geachtet werden das beim BTdeviceName kein Leerzeichen vorhanden ist. Am besten zusammen oder mit Unterstrich. Achtet bei der MAC darauf das Ihr wirklich nach jeder zweiten Zahl auch einen : drin habt
    @@ -1586,4 +1544,4 @@ sub AMAD_decrypt($) {
=end html_DE -=cut \ No newline at end of file +=cut diff --git a/fhem/FHEM/77_UWZ.pm b/fhem/FHEM/77_UWZ.pm new file mode 100644 index 000000000..730c95b76 --- /dev/null +++ b/fhem/FHEM/77_UWZ.pm @@ -0,0 +1,1254 @@ +#################################################################################################### +# +# 77_UWZ.pm +# +# (c) 2015 Tobias D. Oestreicher +# +# Special thanks goes to comitters: +# - Marko Oldenburg (leongaultier at gmail dot com) +# +# Storm warnings from unwetterzentrale.de +# inspired by 59_PROPLANTA.pm +# +# Copyright notice +# +# This script is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# The GNU General Public License can be found at +# http://www.gnu.org/copyleft/gpl.html. +# A copy is found in the text file GPL.txt and important notices to the license +# from the author is found in LICENSE.txt distributed with these scripts. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# This copyright notice MUST APPEAR in all copies of the script! +# +# +# +# $Id$ +# +#################################################################################################### +# also a thanks goes to hexenmeister +############################################## + + + +package main; +use strict; +use feature qw/say switch/; +use warnings; +#no warnings 'experimental::lexical_subs','experimental::smartmatch'; + +my $missingModul; +eval "use LWP::UserAgent;1" or $missingModul .= "LWP::UserAgent "; +eval "use LWP::Simple;1" or $missingModul .= "LWP::Simple "; +eval "use HTTP::Request;1" or $missingModul .= "HTTP::Request "; +eval "use HTML::Parser;1" or $missingModul .= "HTML::Parser "; +eval "use JSON;1" or $missingModul .= "JSON "; +eval "use Encode::Guess;1" or $missingModul .= "Encode::Guess "; +eval "use Text::Iconv;1" or $missingModul .= "Text::Iconv "; + +require 'Blocking.pm'; +require 'HttpUtils.pm'; +use vars qw($readingFnAttributes); + +use vars qw(%defs); +my $MODUL = "UWZ"; +my $version = "1.0.0"; + +my $countrycode = "DE"; +my $plz = "77777"; +my $uwz_alert_url = "http://feed.alertspro.meteogroup.com/AlertsPro/AlertsProPollService.php?method=getWarning&language=de&areaID=UWZ" . $countrycode . $plz; + + + +######################################## +sub UWZ_Log($$$) { + + my ( $hash, $loglevel, $text ) = @_; + my $xline = ( caller(0) )[2]; + + my $xsubroutine = ( caller(1) )[3]; + my $sub = ( split( ':', $xsubroutine ) )[2]; + $sub =~ s/UWZ_//; + + my $instName = ( ref($hash) eq "HASH" ) ? $hash->{NAME} : $hash; + Log3 $instName, $loglevel, "$MODUL $instName: $sub.$xline " . $text; +} + +######################################## +sub UWZ_Map2Image($$) { + + my $uwz_de_url = "http://www.unwetterzentrale.de/images/map/"; + my $uwz_at_url = "http://unwetter.wetteralarm.at/images/map/"; + my ( $hash, $smap ) = @_; + my $lmap; + + $smap=lc($smap); + $lmap->{'europa'}=$uwz_de_url.'europe_index.png'; + $lmap->{'deutschland'}=$uwz_de_url.'deutschland_index.png'; + $lmap->{'deutschland-small'}=$uwz_de_url.'deutschland_preview.png'; + $lmap->{'niedersachsen'}=$uwz_de_url.'niedersachsen_index.png'; + $lmap->{'bremen'}=$uwz_de_url.'niedersachsen_index.png'; + $lmap->{'bayern'}=$uwz_de_url.'bayern_index.png'; + $lmap->{'schleswig-holstein'}=$uwz_de_url.'schleswig_index.png'; + $lmap->{'hamburg'}=$uwz_de_url.'schleswig_index.png'; + $lmap->{'mecklenburg-vorpommern'}=$uwz_de_url.'meckpom_index.png'; + $lmap->{'sachsen'}=$uwz_de_url.'sachsen_index.png'; + $lmap->{'sachsen-anhalt'}=$uwz_de_url.'sachsenanhalt_index.png'; + $lmap->{'nordrhein-westfalen'}=$uwz_de_url.'nrw_index.png'; + $lmap->{'thueringen'}=$uwz_de_url.'thueringen_index.png'; + $lmap->{'rheinland-pfalz'}=$uwz_de_url.'rlp_index.png'; + $lmap->{'saarland'}=$uwz_de_url.'rlp_index.png'; + $lmap->{'baden-wuerttemberg'}=$uwz_de_url.'badenwuerttemberg_index.png'; + $lmap->{'hessen'}=$uwz_de_url.'hessen_index.png'; + $lmap->{'brandenburg'}=$uwz_de_url.'brandenburg_index.png'; + $lmap->{'berlin'}=$uwz_de_url.'brandenburg_index.png'; + $lmap->{'oesterreich'}=$uwz_at_url.'oesterreich_index.png'; + $lmap->{'burgenland'}=$uwz_at_url.'burgenland_index.png'; + $lmap->{'kaernten'}=$uwz_at_url.'kaernten_index.png'; + $lmap->{'niederoesterreich'}=$uwz_at_url.'niederoesterreich_index.png'; + $lmap->{'oberoesterreich'}=$uwz_at_url.'oberoesterreich_index.png'; + $lmap->{'salzburg'}=$uwz_at_url.'salzburg_index.png'; + $lmap->{'steiermark'}=$uwz_at_url.'steiermark_index.png'; + $lmap->{'tirol'}=$uwz_at_url.'tirol_index.png'; + $lmap->{'vorarlberg'}=$uwz_at_url.'vorarlberg_index.png'; + $lmap->{'wien'}=$uwz_at_url.'wien_index.png'; + $lmap->{'isobaren1'}="http://www.unwetterzentrale.de/images/icons/UWZ_ISO_00.jpg"; + $lmap->{'isobaren2'}="http://www.wetteralarm.at/uploads/pics/UWZ_EURO_ISO_GER_00.jpg"; + return $lmap->{$smap}; +} + +################################### +sub UWZ_Initialize($) { + + my ($hash) = @_; + $hash->{DefFn} = "UWZ_Define"; + $hash->{UndefFn} = "UWZ_Undef"; + $hash->{SetFn} = "UWZ_Set"; + $hash->{GetFn} = "UWZ_Get"; + $hash->{AttrList} = "INTERVAL ". + "URL ". + "PLZ ". + "download:0,1 ". + "savepath ". + "maps ". + "humanreadable:0,1 ". + $readingFnAttributes; + + foreach my $d(sort keys %{$modules{UWZ}{defptr}}) { + my $hash = $modules{UWZ}{defptr}{$d}; + $hash->{VERSION} = $version; + } +} + +################################### +sub UWZ_Define($$) { + + my ( $hash, $def ) = @_; + my $name = $hash->{NAME}; + my $lang = ""; + my @a = split( "[ \t][ \t]*", $def ); + + return "Error: Perl moduls ".$missingModul."are missing on this system" if( $missingModul ); + return "Wrong syntax: use define UWZ [CountryCode] [PLZ] [Interval] " if int(@a) > 6; + + $hash->{STATE} = "Initializing"; + $hash->{CountryCode} = $a[2]; + $hash->{PLZ} = $a[3]; + $hash->{URL} = "http://feed.alertspro.meteogroup.com/AlertsPro/AlertsProPollService.php?method=getWarning&language=de&areaID=UWZ" . $a[2] . $a[3]; + $hash->{fhem}{LOCAL} = 0; + $hash->{INTERVAL} = $a[4]; + $hash->{VERSION} = $version; + + RemoveInternalTimer($hash); + + #Get first data after 12 seconds + InternalTimer( gettimeofday() + 12, "UWZ_Start", $hash, 0 ); + + return undef; +} + +##################################### +sub UWZ_Undef($$) { + + my ( $hash, $arg ) = @_; + + RemoveInternalTimer( $hash ); + BlockingKill( $hash->{helper}{RUNNING_PID} ) if ( defined( $hash->{helper}{RUNNING_PID} ) ); + + return undef; +} + +##################################### +sub UWZ_Set($@) { + + my ( $hash, @a ) = @_; + my $name = $hash->{NAME}; + my $reUINT = '^([\\+]?\\d+)$'; + my $usage = "Unknown argument $a[1], choose one of update:noArg "; + + return $usage if ( @a < 2 ); + + my $cmd = lc( $a[1] ); + + given ($cmd) + { + when ("?") + { + return $usage; + } + + when ("update") + { + UWZ_Log $hash, 4, "set command: " . $a[1]; + $hash->{fhem}{LOCAL} = 1; + UWZ_Start($hash); + $hash->{fhem}{LOCAL} = 0; + } + + default + { + return $usage; + } + } + + return; +} + +##################################### +sub UWZ_Get($@) { + + my ( $hash, @a ) = @_; + my $name = $hash->{NAME}; + my $usage = "Unknown argument $a[1], choose one of Sturm:noArg Schneefall:noArg Regen:noArg Extremfrost:noArg Waldbrand:noArg Gewitter:noArg Glaette:noArg Hitze:noArg Glatteisregen:noArg Bodenfrost:noArg Hagel:noArg "; + + return $usage if ( @a < 2 ); + + if ($a[1] =~ /^Sturm/) { UWZ_GetCurrent($hash,2); } + elsif ($a[1] =~ /^Schneefall/) { UWZ_GetCurrent($hash,3); } + elsif ($a[1] =~ /^Regen/) { UWZ_GetCurrent($hash,4); } + elsif ($a[1] =~ /^Extremfrost/) { UWZ_GetCurrent($hash,5); } + elsif ($a[1] =~ /^Waldbrand/) { UWZ_GetCurrent($hash,6); } + elsif ($a[1] =~ /^Gewitter/) { UWZ_GetCurrent($hash,7); } + elsif ($a[1] =~ /^Glaette/) { UWZ_GetCurrent($hash,8); } + elsif ($a[1] =~ /^Hitze/) { UWZ_GetCurrent($hash,9); } + elsif ($a[1] =~ /^Glatteisregen/) { UWZ_GetCurrent($hash,10); } + elsif ($a[1] =~ /^Bodenfrost/) { UWZ_GetCurrent($hash,11); } + elsif ($a[1] =~ /^Hagel/) { UWZ_GetCurrentHail($hash); } + else { return $usage; } +} + +##################################### +sub UWZ_GetCurrent($@) { + + my ( $hash, @a ) = @_; + my $name = $hash->{NAME}; + my $out; + my $curTimestamp = time(); + if ( ReadingsVal($name,"WarnCount", 0) eq 0 ) { + $out = "inactive"; + } else { + for(my $i= 0;$i < ReadingsVal($name,"WarnCount", 0);$i++) { + if ( (ReadingsVal($name,"Warn_".$i."_Start","") le $curTimestamp) && (ReadingsVal($name,"Warn_".$i."_End","") ge $curTimestamp) && (ReadingsVal($name,"Warn_".$i."_Type","") eq $a[0]) ) { + $out= "active"; + last; + } else { + $out = "inactive"; + } + } + } + return $out; +} + +##################################### +sub UWZ_GetCurrentHail($) { + + my ( $hash ) = @_; + my $name = $hash->{NAME}; + my $out; + my $curTimestamp = time(); + + if ( ReadingsVal($name,"WarnCount", 0) eq 0 ) { + $out = "inactive"; + } else { + for(my $i= 0;$i < ReadingsVal($name,"WarnCount", 0);$i++) { + if ( (ReadingsVal($name,"Warn_".$i."_Start","") le $curTimestamp) && (ReadingsVal($name,"Warn_".$i."_End","") ge $curTimestamp) && (ReadingsVal($name,"Warn_".$i."_Hail","") eq 1) ) { + $out= "active"; + last; + } else { + $out= "inactive"; + } + } + } + + return $out; +} + +##################################### +sub UWZ_JSONAcquire($$) { + + my ($hash, $URL) = @_; + my $name = $hash->{NAME}; + + return unless (defined($hash->{NAME})); + + UWZ_Log $hash, 4, "Start capturing of $URL"; + + my $err_log = ""; + my $agent = LWP::UserAgent->new( env_proxy => 1, keep_alive => 1, protocols_allowed => ['http'], timeout => 10 ); + my $request = HTTP::Request->new( GET => $URL ); + my $response = $agent->request($request); + $err_log = "Can't get $URL -- " . $response->status_line unless( $response->is_success ); + + if ( $err_log ne "" ) { + readingsSingleUpdate($hash, "lastConnection", $response->status_line, 1); + UWZ_Log $hash, 1, "Error: $err_log"; + return "Error|Error " . $response->status_line; + } + + UWZ_Log $hash, 4, length($response->content)." characters captured"; + return $response->content; +} + + +##################################### +sub UWZ_Start($) { + + my ($hash) = @_; + my $name = $hash->{NAME}; + + return unless (defined($hash->{NAME})); + + $hash->{INTERVAL} = AttrVal( $name, "INTERVAL", $hash->{INTERVAL} ); + if(!$hash->{fhem}{LOCAL} && $hash->{INTERVAL} > 0) { # set up timer if automatically call + + RemoveInternalTimer( $hash ); + InternalTimer(gettimeofday() + $hash->{INTERVAL}, "UWZ_Start", $hash, 1 ); + return undef if( AttrVal($name, "disable", 0 ) == 1 ); + } + + if ( AttrVal( $name, 'URL', '') eq '' && not defined( $hash->{URL} ) ) { + + UWZ_Log $hash, 3, "missing URL"; + return; + } + + $hash->{helper}{RUNNING_PID} = + BlockingCall( + "UWZ_Run", # callback worker task + $name, # name of the device + "UWZ_Done", # callback result method + 120, # timeout seconds + "UWZ_Aborted", # callback for abortion + $hash ); # parameter for abortion +} + +##################################### +sub UWZ_Aborted($) { + + my ($hash) = @_; + delete( $hash->{helper}{RUNNING_PID} ); +} + +##################################### +# asyncronous callback by blocking +sub UWZ_Done($) { + + my ($string) = @_; + return unless ( defined($string) ); + + # all term are separated by "|" , the first is the name of the instance + my ( $name, %values ) = split( "\\|", $string ); + my $hash = $defs{$name}; + return unless ( defined($hash->{NAME}) ); + + # delete the marker for RUNNING_PID process + delete( $hash->{helper}{RUNNING_PID} ); + + + +## alter Code sollte gelöscht werden +# +# fhem("deletereading ".$hash->{NAME}." .*"); +# +# foreach my $skey (grep /^(Warn_?_|WarnCount)/ ,sort keys %{ $hash->{READINGS} }) { +# UWZ_Log $hash, 3, "Delete Reading:$skey"; +# delete $hash->{READINGS}{$skey}; +# } + + + + UWZ_Log $hash, 4, "Delete old Readings"; + CommandDeleteReading(undef, "$hash->{NAME} Warn_?_.*"); + + + # UnWetterdaten speichern + readingsBeginUpdate($hash); + + if ( defined $values{Error} ) { + + readingsBulkUpdate( $hash, "lastConnection", $values{Error} ); + + } else { + + while (my ($rName, $rValue) = each(%values) ) { + readingsBulkUpdate( $hash, $rName, $rValue ); + UWZ_Log $hash, 5, "reading:$rName value:$rValue"; + } + + if (keys %values > 0) { + my $newState; + if (defined $values{WarnCount}) { + $newState = "Warnungen: " . $values{WarnCount}; + + } else { + $newState = "Error: Could not capture all data. Please check CountryCode and PLZ."; + } + + readingsBulkUpdate($hash, "state", $newState); + readingsBulkUpdate( $hash, "lastConnection", keys( %values )." values captured in ".$values{durationFetchReadings}." s" ); + UWZ_Log $hash, 4, keys( %values )." values captured"; + + } else { + + readingsBulkUpdate( $hash, "lastConnection", "no data found" ); + UWZ_Log $hash, 1, "No data found. Check city name or URL."; + + } + } + + readingsEndUpdate( $hash, 1 ); +} + + +##################################### +sub UWZ_Run($) { + + my ($name) = @_; + my $ptext=$name; + my $UWZ_CC; + my $UWZ_INT; + my $UWZ_download; + my $UWZ_savepath; + my $UWZ_humanreadable; + + return unless ( defined($name) ); + + my $hash = $defs{$name}; + return unless (defined($hash->{NAME})); + + my $readingStartTime = time(); + my $attrCountryCode = AttrVal( $name, 'CountryCode', '' ); + my $attrPLZ = AttrVal( $name, 'PLZ', "" ); + my $attrINTERVAL = AttrVal( $name, 'INTERVAL',''); + my $attrdownload = AttrVal( $name, 'download',''); + my $attrsavepath = AttrVal( $name, 'savepath',''); + my $maps2fetch = AttrVal( $name, 'maps',''); + + ## begin redundant Reading switch + my $attrhumanreadable = AttrVal( $name, 'humanreadable',''); + ## end redundant Reading switch + + # preset CountryCode + if ($attrCountryCode eq "") { + + $UWZ_CC = "DE"; + } else { + + $UWZ_CC = $attrCountryCode; + } + + # preset INTERVAL + if ($attrINTERVAL eq "") { + + $UWZ_INT = 3600; + } else { + + $UWZ_INT = $attrINTERVAL; + } + + # preset download + if ($attrdownload eq "") { + + $UWZ_download = 0; + } else { + + $UWZ_download = $attrdownload; + } + + # preset savepath + if ($attrsavepath eq "") { + + $UWZ_savepath = "/tmp/"; + } else { + + $UWZ_savepath = $attrsavepath; + } + + # preset humanreadable + if ($attrhumanreadable eq "") { + + $UWZ_humanreadable = 0; + } else { + + $UWZ_humanreadable = $attrhumanreadable; + } + + if ( $UWZ_download == 1 ) { + if ( ! defined($maps2fetch) ) { $maps2fetch = "deutschland"; } + UWZ_Log $hash, 4, "Maps2Fetch : ".$maps2fetch; + my @maps = split(' ', $maps2fetch); + my $uwz_de_url = "http://www.unwetterzentrale.de/images/map/"; + + foreach my $smap (@maps) { + UWZ_Log $hash, 4, "Download map : ".$smap; + my $img = UWZ_Map2Image($hash,$smap); + + if (!defined($img) ) { $img=$uwz_de_url.'deutschland_index.png'; } + my $code = getstore($img, $UWZ_savepath.$smap.".png"); + + if($code == 200) { + UWZ_Log $hash, 4, "Successfully downloaded map ".$smap; + + } else { + + UWZ_Log $hash, 3, "Failed to download map (".$img.")"; + } + } + + } + + # acquire the json-response + my $response = UWZ_JSONAcquire($hash,$hash->{URL}); + + UWZ_Log $hash, 5, length($response)." characters captured"; + my $converter = Text::Iconv->new("windows-1252","UTF-8"); + my $uwz_warnings = JSON->new->ascii->decode($response); + my $enc = guess_encoding($uwz_warnings); + + my $uwz_warncount = scalar(@{ $uwz_warnings->{'results'} }); + UWZ_Log $hash, 4, "There are ".$uwz_warncount." warnings active"; + + my $message; + my $i=0; + + my %typenames = ( "1" => "unknown", # <===== FIX HERE + "2" => "sturm", + "3" => "schnee", + "4" => "regen", + "5" => "temperatur", + "6" => "waldbrand", + "7" => "gewitter", + "8" => "strassenglaette", + "9" => "temperatur", # 9 = hitzewarnung + "10" => "glatteisregen", + "11" => "temperatur" ); # 11 = bodenfrost + + my %severitycolor = ( "0" => "green", + "1" => "unknown", # <===== FIX HERE + "2" => "unknown", # <===== FIX HERE + "3" => "unknown", # <===== FIX HERE + "4" => "orange", + "5" => "unknown", # <===== FIX HERE + "6" => "unknown", # <===== FIX HERE + "7" => "orange", + "8" => "gelb", + "9" => "gelb", # <===== FIX HERE + "10" => "orange", + "11" => "rot", + "12" => "violet" ); + + foreach my $single_warning (@{ $uwz_warnings->{'results'} }) { + + UWZ_Log $hash, 4, "Warn_".$i."_Type: ".$single_warning->{'type'}; + $message .= "Warn_".$i."_Type|".$single_warning->{'type'}."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_uwzLevel: ".$single_warning->{'payload'}{'uwzLevel'}; + $message .= "Warn_".$i."_uwzLevel|".$single_warning->{'payload'}{'uwzLevel'}."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_Severity: ".$single_warning->{'severity'}; + $message .= "Warn_".$i."_Severity|".$single_warning->{'severity'}."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_Start: ".$single_warning->{'dtgStart'}; + $message .= "Warn_".$i."_Start|".$single_warning->{'dtgStart'}."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_End: ".$single_warning->{'dtgEnd'}; + $message .= "Warn_".$i."_End|".$single_warning->{'dtgEnd'}."|"; + + ## Begin of redundant Reading + if ( $UWZ_humanreadable eq 1 ) { + UWZ_Log $hash, 4, "Warn_".$i."_Start_Date: ".strftime("%d.%m.%Y", localtime($single_warning->{'dtgStart'})); + $message .= "Warn_".$i."_Start_Date|".strftime("%d.%m.%Y", localtime($single_warning->{'dtgStart'}))."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_Start_Time: ".strftime("%H:%M", localtime($single_warning->{'dtgStart'})); + $message .= "Warn_".$i."_Start_Time|".strftime("%H:%M", localtime($single_warning->{'dtgStart'}))."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_End_Date: ".strftime("%d.%m.%Y", localtime($single_warning->{'dtgEnd'})); + $message .= "Warn_".$i."_End_Date|".strftime("%d.%m.%Y", localtime($single_warning->{'dtgEnd'}))."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_End_Time: ".strftime("%H:%M", localtime($single_warning->{'dtgEnd'})); + $message .= "Warn_".$i."_End_Time|".strftime("%H:%M", localtime($single_warning->{'dtgEnd'}))."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_Type_Str: ".ucfirst($typenames{ $single_warning->{'type'} }); + $message .= "Warn_".$i."_Type_Str|".ucfirst($typenames{ $single_warning->{'type'} })."|"; + } + ## End of redundant Reading + + UWZ_Log $hash, 4, "Warn_".$i."_levelName: ".$single_warning->{'payload'}{'levelName'}; + $message .= "Warn_".$i."_levelName|".$single_warning->{'payload'}{'levelName'}."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_LongText: ".$enc->decode($single_warning->{'payload'}{'translationsLongText'}{'DE'}); + $message .= "Warn_".$i."_LongText|".$converter->convert($single_warning->{'payload'}{'translationsLongText'}{'DE'})."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_ShortText: ".$enc->decode($single_warning->{'payload'}{'translationsShortText'}{'DE'}); + $message .= "Warn_".$i."_ShortText|".$converter->convert($single_warning->{'payload'}{'translationsShortText'}{'DE'})."|"; + + UWZ_Log $hash, 4, "Warn_".$i."_IconURL: http://www.unwetterzentrale.de/images/icons/".$typenames{ $single_warning->{'type'} }."-".$single_warning->{'severity'}.".gif"; + $message .= "Warn_".$i."_IconURL|http://www.unwetterzentrale.de/images/icons/".$typenames{ $single_warning->{'type'} }."-".$severitycolor{ $single_warning->{'severity'} }.".gif|"; + + + ## Hagel start + my $hagelcount = my @hagelmatch = $single_warning->{'payload'}{'translationsLongText'}{'DE'} =~ /Hagel/g; + if ( $hagelcount ne 0 ) { + + UWZ_Log $hash, 4, "Warn_".$i."_Hail: 1"; + $message .= "Warn_".$i."_Hail|1|"; + + } else { + + UWZ_Log $hash, 4, "Warn_".$i."_Hail: 0"; + $message .= "Warn_".$i."_Hail|0|"; + } + ## Hagel end + + $i++; + } + + $message .= "durationFetchReadings|"; + $message .= sprintf "%.2f", time() - $readingStartTime; + + UWZ_Log $hash, 3, "Done fetching data"; + UWZ_Log $hash, 4, "Will return : "."$name|$message|WarnCount|$uwz_warncount" ; + + return "$name|$message|WarnCount|$uwz_warncount" ; +} + + +##################################### +sub UWZAsHtml($;$) { + + my ($hash,$items) = @_; + my $ret = ''; + + if (ReadingsVal($hash, "WarnCount", "") != 0 ) { + + $ret .= ''; + $ret .= '
'; + $ret .= ''; + + for ( my $i=0; $i'; + $ret .= ''; + } + + $ret .= '
'.ReadingsVal($hash, "Warn_".$i."_ShortText", "").'

'; + $ret .= ReadingsVal($hash, "Warn_".$i."_LongText", "").'

'; + + $ret .= ''; + + $ret .= ''; + $ret .= '
Start:'.localtime(ReadingsVal($hash, "Warn_".$i."_Start", "")).'Ende:'.localtime(ReadingsVal($hash, "Warn_".$i."_End", "")).'
'; + $ret .= '
'; + $ret .= '
'; + + } else { + + $ret .= ''; + $ret .= '
'; + $ret .= ''; + $ret .= ''; + $ret .= '
'; + $ret .='Keine Warnungen'; + $ret .= '
'; + $ret .= '
'; + } + + return $ret; +} + +##################################### +sub UWZAsHtmlLite($;$) { + + my ($hash,$items) = @_; + my $ret = ''; + + if (ReadingsVal($hash, "WarnCount", "") != 0 ) { + + $ret .= ''; + $ret .= '
'; + $ret .= ''; + + for ( my $i=0; $i'; + $ret .= ''; + + } + + $ret .= '
'.ReadingsVal($hash, "Warn_".$i."_ShortText", "").'

'; + $ret .= ''; + + $ret .= ''; + $ret .= '
Start:'.localtime(ReadingsVal($hash, "Warn_".$i."_Start", "")).'Ende:'.localtime(ReadingsVal($hash, "Warn_".$i."_End", "")).'
'; + $ret .= '
'; + $ret .= '
'; + + } else { + + $ret .= ''; + $ret .= '
'; + $ret .= ''; + $ret .= ''; + $ret .= '
'; + $ret .='Keine Warnungen'; + $ret .= '
'; + $ret .= '
'; + } + + return $ret; +} + +##################################### +sub UWZAsHtmlFP($;$) { + + my ($hash,$items) = @_; + my $tablewidth = ReadingsVal($hash, "WarnCount", "") * 80; + my $ret = ''; + + $ret .= ''; + $ret .= ""; + + for ( my $i=0; $i'; + } + + $ret .= ""; + $ret .= '
'; + + return $ret; +} + + +##################################### +sub UWZAsHtmlKarteLand($$) { + + my ($hash,$land) = @_; + # my $uwz_de_url = "http://www.unwetterzentrale.de/images/map/"; + # my $uwz_at_url = "http://unwetter.wetteralarm.at/images/map/"; + my $url = UWZ_Map2Image($hash,$land); + my $ret = ''; + $ret .= '
'; + + $ret .= ''; + $ret .= '
'; + + if(defined($url)) { + $ret .= ''; + + } else { + + $ret .= 'unbekannte Landbezeichnung'; + } + + $ret .= '
'; + + return $ret; +} + +##################################### +1; + + + + + +=pod +=begin html + + +

UWZ

+
    + + This modul extracts thunderstorm warnings from www.unwetterzentrale.de. +
    + Therefore the same interface is used as the Android App Alerts Pro does. + A maximum of 10 thunderstorm warnings will be served. + Additional the module provides a few functions to create HTML-Templates which can be used with weblink. +
    + The following Perl-Modules are used within this module: HTTP::Request, LWP::UserAgent, JSON, Encode::Guess, Text::Iconv und HTML::Parse. +

    + Define +
      +
      + define <Name> UWZ [CountryCode] [postalcode] [INTERVAL] +


      + Example: +
      + define Unwetterzentrale UWZ DE 86405 3600 +
        + +
    • [CountryCode] +
      + Possible values: DE, AT, CH,...
      + (for other countries than germany see fhem-forum) +

    • +
    • [postalcode] +
      + The postalcode for the city to get warnings for. +
      +

    • +
    • [INTERVAL] +
      + Defines the refresh interval. The interval is defined in seconds, so an interval of 3600 means that every hour a refresh will be triggered onetimes. +
      +

    • +
    +
    + + + Get +
      +
      +
    • get <name> Bodenfrost +
      + give info about current soil frost (active|inactive). +

    • +
    • get <name> Extremfrost +
      + give info about current frost (active|inactive). +

    • +
    • get <name> Gewitter +
      + give info about current thunderstorm (active|inactive). +

    • +
    • get <name> Glaette +
      + give info about current glaze (active|inactive). +

    • +
    • get <name> Glatteisregen +
      + give info about current freezing rain (active|inactive). +

    • +
    • get <name> Hagel +
      + give info about current hail (active|inactive). +

    • +
    • get <name> Hitze +
      + give info about current heat (active|inactive). +

    • +
    • get <name> Regen +
      + give info about current rain (active|inactive). +

    • +
    • get <name> Schneefall +
      + give info about current snow (active|inactive). +

    • +
    • get <name> Sturm +
      + give info about current storm (active|inactive). +

    • +
    • get <name> Waldbrand +
      + give info about current forest fire (active|inactive). +

    • + +
    + +
    + + + Set +
      +
      +
    • set <name> update +
      + Executes an imediate update of thunderstorm warnings. +

    • +
    + +
    + + Attributes +
      +
      +
    • download +
      + Download maps during update (0|1). +
      +
    • +
    • savepath +
      + Define where to store the map png files (default: /tmp/). +
      +
    • +
    • maps +
      + Define the maps to download space seperated. For possible values see UWZAsHtmlKarteLand. +
      +
    • +
    • humanreadable +
      + Add additional Readings Warn_?_Start_Date, Warn_?_Start_Time, Warn_?_End_Date and Warn_?_End_Time containing the coresponding timetamp in a human readable manner. (0|1). +
      +
    • + + +
      +
    + +
    + + + Readings +
      +
      +
    • Warn_0|1|2|3...|9_... - active warnings
    • +
    • WarnCount - warnings count
    • +
    • Warn_0_Start - begin of warnperiod
    • +
    • Warn_0_Start_Date - start date of warnperiod
    • +
    • Warn_0_Start_Time - start time of warnperiod
    • +
    • Warn_0_End - end of warnperiod
    • +
    • Warn_0_End_Date - end date of warnperiod
    • +
    • Warn_0_End_Time - end time of warnperiod
    • +
    • Warn_0_Severity - Severity of thunderstorm (0 no thunderstorm, 4, 7, 11, .. heavy thunderstorm)
    • +
    • Warn_0_Hail - warning contains hail
    • +
    • Warn_0_Type - kind of thunderstorm
    • +
        +
      • 1 - unknown
      • +
      • 2 - storm
      • +
      • 3 - snow
      • +
      • 4 - rain
      • +
      • 5 - frost
      • +
      • 6 - thunderstorm
      • +
      • 7 - forest fire
      • +
      • 8 - glaze
      • +
      • 9 - heat
      • +
      • 10 - freezing rain
      • +
      • 11 - soil frost
      • +
      +
    • Warn_0_uwzLevel - Severity of thunderstorm (like Severity)
    • +
    • Warn_0_levelName - Level Warn Name
    • +
    • Warn_0_ShortText - short warn text
    • +
    • Warn_0_LongText - detailed warn text
    • +
    • Warn_0_IconURL - cumulated URL to display warn-icons from www.unwetterzentrale.de
    • +
    +
    + + + Weblinks +
      +
      + + With the additional implemented functions UWZAsHtml, UWZAsHtmlLite, UWZAsHtmlFP and UWZAsHtmlKarteLand HTML-Code will be created to display warnings, using weblinks. +


      + Example: +
      +
    • define UnwetterDetailiert weblink htmlCode {UWZAsHtml("Unwetterzentrale")}
    • +
      +
    • define UnwetterLite weblink htmlCode {UWZAsHtmlLite("Unwetterzentrale")}
    • +
      +
    • define UnwetterFloorplan weblink htmlCode {UWZAsHtmlFP("Unwetterzentrale")}
    • +
      +
    • define UnwetterKarteLand weblink htmlCode {UWZAsHtmlKarteLand("Unwetterzentrale","Bayern")}
    • +
        +
      • The second parameter should be one of: +
          +
        • deutschland
        • +
        • deutschland-small
        • +
        • bayern
        • +
        • bremen
        • +
        • baden-wuerttemberg
        • +
        • brandenburg
        • +
        • berlin
        • +
        • hessen
        • +
        • niedersachsen
        • +
        • rheinland-pfalz
        • +
        • saarland
        • +
        • sachsen
        • +
        • sachsen-anhalt
        • +
        • thueringen
        • +
        • nordrhein-westfale
        • +
        • mecklenburg-vorpommern
        • +
        • schleswig-holstein
        • +
        • hamburg
        • +
          +
        • oesterreich
        • +
        • burgenland
        • +
        • kaernten
        • +
        • niederoesterreich
        • +
        • oberoesterreich
        • +
        • salzburg
        • +
        • steiermark
        • +
        • tirol
        • +
        • vorarlberg
        • +
        • wien
        • +
        +
      • +
      +

      +
    +
    + + +
+ + + +=end html + +=begin html_DE + + +

UWZ

+
    + + Das Modul extrahiert Unwetterwarnungen von www.unwetterzentrale.de. +
    + Hierfür wird die selbe Schnittstelle verwendet die auch die Android App Alerts Pro nutzt. + Es werden maximal 10 Standortbezogene Unwetterwarnungen zur Verfügung gestellt. + Weiterhin verfügt das Modul über HTML-Templates welche als weblink verwendet werden können. +
    + Es nutzt die Perl-Module HTTP::Request, LWP::UserAgent, JSON, Encode::Guess, Text::Iconv und HTML::Parse. +

    + Define +
      +
      + define <Name> UWZ [Ländercode] [Postleitzahl] [INTERVAL] +


      + Beispiel: +
      + define Unwetterzentrale UWZ DE 86405 3600 +
        + +
    • [Ländercode] +
      + Mögliche Werte: DE, AT, CH,...
      + (für ander Länder als Deutschland werfen Sie einen Blick in das fhem-forum. +

    • +
    • [Postleitzahl] +
      + Die Postleitzahl des Ortes für den Unwetterinformationen abgefragt werden sollen. +
      +

    • +
    • [INTERVAL] +
      + Definiert das Interval zur aktualisierung der Unwetterwarnungen. Das Interval wird in Sekunden angegeben, somit aktualisiert das Modul bei einem Interval von 3600 jede Stunde 1 mal. +
      +

    • +
    +
    + + + Get +
      +
      +
    • get <name> Bodenfrost +
      + Gibt aus ob aktuell eine Bodenfrostwarnung besteht (active|inactive). +

    • +
    • get <name> Extremfrost +
      + Gibt aus ob aktuell eine Extremfrostwarnung besteht (active|inactive). +

    • +
    • get <name> Gewitter +
      + Gibt aus ob aktuell eine Gewitter Warnung besteht (active|inactive). +

    • +
    • get <name> Glaette +
      + Gibt aus ob aktuell eine Glaettewarnung besteht (active|inactive). +

    • +
    • get <name> Glatteisregen +
      + Gibt aus ob aktuell eine Glatteisregen Warnung besteht (active|inactive). +

    • +
    • get <name> Hagel +
      + Gibt aus ob aktuell eine Hagel Warnung besteht (active|inactive). +

    • +
    • get <name> Hitze +
      + Gibt aus ob aktuell eine Hitze Warnung besteht (active|inactive). +

    • +
    • get <name> Regen +
      + Gibt aus ob aktuell eine Regen Warnung besteht (active|inactive). +

    • +
    • get <name> Schneefall +
      + Gibt aus ob aktuell eine Schneefall Warnung besteht (active|inactive). +

    • +
    • get <name> Sturm +
      + Gibt aus ob aktuell eine Sturm Warnung besteht (active|inactive). +

    • +
    • get <name> Waldbrand +
      + Gibt aus ob aktuell eine Waldbrand Warnung besteht (active|inactive). +

    • + + +
    + +
    + + + Set +
      +
      +
    • set <name> update +
      + Startet sofort ein neues Auslesen der Unwetterinformationen. +

    • +
    + +
    + + + Attribute +
      +
      +
    • download +
      + Download Unwetterkarten während des updates (0|1). +
      +
    • +
    • savepath +
      + Pfad zum speichern der Karten (default: /tmp/). +
      +
    • +
    • maps +
      + Leerzeichen separierte Liste der zu speichernden Karten. Für mögliche Karten siehe UWZAsHtmlKarteLand. +
      +
    • +
    • humanreadable +
      + Anzeige weiterer Readings Warn_?_Start_Date, Warn_?_Start_Time, Warn_?_End_Date und Warn_?_End_Time. Diese Readings enthalten aus dem Timestamp kalkulierte Datums/Zeit Angaben. (0|1) +
      +
    • + +
      +
    + +
    + + + Readings +
      +
      +
    • Warn_0|1|2|3...|9_... - aktive Warnmeldungen
    • +
    • WarnCount - Anzahl der aktiven Warnmeldungen
    • +
    • Warn_0_Start - Begin der Warnung
    • +
    • Warn_0_Start_Date - Startdatum der Warnung
    • +
    • Warn_0_Start_Time - Startzeit der Warnung
    • +
    • Warn_0_End - Warn Ende
    • +
    • Warn_0_End_Date - Enddatum der Warnung
    • +
    • Warn_0_End_Time - Endzeit der Warnung
    • +
    • Warn_0_Severity - Schwere des Unwetters (0 kein Unwetter, 12 massives Unwetter)
    • +
    • Warn_0_Hail - Hagelwarnung (1|0)
    • +
    • Warn_0_Type - Art des Unwetters
    • +
        +
      • 1 - unbekannt
      • +
      • 2 - Sturm/Orkan
      • +
      • 3 - Schneefall
      • +
      • 4 - Regen
      • +
      • 5 - Extremfrost
      • +
      • 6 - Gewitter
      • +
      • 7 - Waldbrandgefahr
      • +
      • 8 - Glätte
      • +
      • 9 - Hitze
      • +
      • 10 - Glatteisregen
      • +
      • 11 - Bodenfrost
      • +
      +
    • Warn_0_uwzLevel - Schwere des Unwetters (wie Severity)
    • +
    • Warn_0_levelName - Level Warn Name
    • +
    • Warn_0_ShortText - Kurzbeschreibung der Warnung
    • +
    • Warn_0_LongText - Ausführliche Unwetterbeschreibung
    • +
    • Warn_0_IconURL - Kumulierte URL um Warnungs-Icon von www.unwetterzentrale.de anzuzeigen
    • +
    +
    + + + Weblinks +
      +
      + + Über die Funktionen UWZAsHtml, UWZAsHtmlLite, UWZAsHtmlFP und UWZAsHtmlKarteLand wird HTML-Code zur Warnanzeige über weblinks erzeugt. +


      + Beispiele: +
      +
    • define UnwetterDetailiert weblink htmlCode {UWZAsHtml("Unwetterzentrale")}
    • +
      +
    • define UnwetterLite weblink htmlCode {UWZAsHtmlLite("Unwetterzentrale")}
    • +
      +
    • define UnwetterFloorplan weblink htmlCode {UWZAsHtmlFP("Unwetterzentrale")}
    • +
      +
    • define UnwetterKarteLand weblink htmlCode {UWZAsHtmlKarteLand("Unwetterzentrale","Bayern")}
    • +
        +
      • The second parameter should be one of: +
          +
        • deutschland
        • +
        • deutschland-small
        • +
        • bayern
        • +
        • bremen
        • +
        • baden-wuerttemberg
        • +
        • brandenburg
        • +
        • berlin
        • +
        • hessen
        • +
        • niedersachsen
        • +
        • rheinland-pfalz
        • +
        • saarland
        • +
        • sachsen
        • +
        • sachsen-anhalt
        • +
        • thueringen
        • +
        • nordrhein-westfale
        • +
        • mecklenburg-vorpommern
        • +
        • schleswig-holstein
        • +
        • hamburg
        • +
          +
        • oesterreich
        • +
        • burgenland
        • +
        • kaernten
        • +
        • niederoesterreich
        • +
        • oberoesterreich
        • +
        • salzburg
        • +
        • steiermark
        • +
        • tirol
        • +
        • vorarlberg
        • +
        • wien
        • +
        +
      • +
      + + +

      +
    +
    + + +
+ +=end html_DE +=cut \ No newline at end of file diff --git a/fhem/FHEM/lib/74_AMADautomagicFlows_1.2.0.xml b/fhem/FHEM/lib/74_AMADautomagicFlows_1.2.0.xml deleted file mode 100644 index 65bfeb09c..000000000 --- a/fhem/FHEM/lib/74_AMADautomagicFlows_1.2.0.xml +++ /dev/null @@ -1,1796 +0,0 @@ - - - - false - com.android.music.metachanged - true - com.android.music.metachanged - - - - - - - - global_artist = getString("artist"); -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_own_reading - true - global_own_reading - - - true - Globale Variable: global_touched - false - global_touched - - - false - HTTP Request: /fhem-amad/deviceInfo/ - true - /fhem-amad/deviceInfo/ - 8090 - true - - - false - HTTP Request: /fhem-amad/setCommands/* - true - /fhem-amad/setCommands/* - 8090 - true - - - true - Periodischer Timer: alle 4m - false - 240000 - true - false - false - Mon - Tue - Wed - Thu - Fri - Sat - Sun - 8 - 0 - 17 - 0 - false - - - true - Sprachbefehl angefordert - true - - - false - App Task läuft: App3 (neuster) - - true - - - false - App Task läuft: App4 (neuster) - - true - - - false - App Task läuft: App5 (neuster) - - true - - - false - App Task läuft: gplay (neuster) - com.google.android.music - true - - - false - App Task läuft: tuneinradio (neuster) - tunein.player - true - - - true - App Task läuft: {header_activetask} (neuster) - {header_activetask} - true - - - false - Benachrichtigung in Statusbar angezeigt: Automagic - ch.gridvision.ppam.androidautomagic - true - 1 - TEXT - CONTAINS_TEXT - - false - false - - - true - Bluetooth eingeschaltet - - - true - Bluetooth Gerät verbunden: Beliebiges Geräte - true - - - ANY - - - true - Display automatisch drehen eingeschaltet - - - true - Display eingeschaltet - - - true - Display Orientierung: Portrait - true - - - false - Expression: Airplanemode - param_syscmd == "airplanemodeON" - - - false - Expression: All - param_app == "All" - - - false - Expression: App3 - param_app == "" - - - false - Expression: App4 - param_app == "" - - - false - Expression: App5 - param_app == "" - - - false - Expression: Automagic - param_app == "Automagic" - - - false - Expression: Clear Automagic Meldungen" - request_path == "/fhem-amad/setCommands/clearnotificationbar" - - - true - Expression: getAndroidSDKVersion() >= "19" - getAndroidSDKVersion() >= "19" - - - true - Expression: global_touched=="ja" - global_touched=="ja" - - - true - Expression: global_touched=="wait" - global_touched=="wait" - - - false - Expression: gplay - param_app == "gplay" - - - true - Expression: header_activetask != "none" - header_activetask != "none" - - - false - Expression: mediaPlayer" - request_path == "/fhem-amad/setCommands/mediaPlayer" - - - false - Expression: notifysnd" - request_path == "/fhem-amad/setCommands/playnotifysnd" - - - false - Expression: openApp" - request_path == "/fhem-amad/setCommands/openApp" - - - false - Expression: openURL" - request_path == "/fhem-amad/setCommands/openURL" - - - true - Expression: param_bluetooth == "off" - param_bluetooth == "off" - - - true - Expression: param_bluetooth == "on" - param_bluetooth == "on" - - - true - Expression: param_button == "back" - param_button == "back" - - - true - Expression: param_button == "next" - param_button == "next" - - - true - Expression: param_button == "play" - param_button == "play" - - - true - Expression: param_button == "stop" - param_button == "stop" - - - true - Expression: param_fullscreen == "off" - param_fullscreen == "off" - - - true - Expression: param_fullscreen == "on" - param_fullscreen == "on" - - - true - Expression: param_lockmod == "on" - param_lockmod == "on" - - - true - Expression: param_notifyfile == "RedAlert.mp3" - param_notifyfile == "RedAlert.mp3" - - - true - Expression: param_orientation == "auto" - param_orientation == "auto" - - - true - Expression: param_orientation == "landscape" - param_orientation == "landscape" - - - true - Expression: param_orientation == "portrait" - param_orientation == "portrait" - - - true - Expression: param_screen=="off" - param_screen=="off" - - - true - Expression: param_screen=="on" - param_screen=="on" - - - false - Expression: Reboot - param_syscmd == "reboot" - - - false - Expression: screenMsg" - request_path == "/fhem-amad/setCommands/screenMsg" - - - false - Expression: setAlarm" - request_path == "/fhem-amad/setCommands/setAlarm" - - - false - Expression: setBluetooth" - request_path == "/fhem-amad/setCommands/setbluetooth" - - - false - Expression: setBrightness" - request_path == "/fhem-amad/setCommands/setBrightness" - - - false - Expression: setBTDevice" - request_path == "/fhem-amad/setCommands/setbtdevice" - - - false - Expression: setNotifiVolume" - request_path == "/fhem-amad/setCommands/setNotifiVolume" - - - false - Expression: setScreenFullscreen" - request_path == "/fhem-amad/setCommands/setScreenFullscreen" - - - false - Expression: setScreenlock" - request_path == "/fhem-amad/setCommands/screenlock" - - - false - Expression: setScreenOnOff" - request_path == "/fhem-amad/setCommands/setScreenOnOff" - - - false - Expression: setScreenOrientation" - request_path == "/fhem-amad/setCommands/setScreenOrientation" - - - false - Expression: setVibrate" - request_path == "/fhem-amad/setCommands/setvibrate" - - - false - Expression: setVoiceCommand" - request_path == "/fhem-amad/setCommands/setvoicecmd" - - - false - Expression: setVolume" - request_path == "/fhem-amad/setCommands/setVolume" - - - false - Expression: Shutdown - param_syscmd == "shutdown" - - - false - Expression: System Command" - request_path == "/fhem-amad/setCommands/systemcommand" - - - true - Expression: trigger == "com.android.music.metachanged" - trigger == "com.android.music.metachanged" - - - true - Expression: trigger == "Globale Variable: global_own_reading" - trigger == "Globale Variable: global_own_reading" - - - true - Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*" - trigger == "HTTP Request: /fhem-amad/setCommands/*" - - - true - Expression: trigger == "Sprachbefehl angefordert" - trigger == "Sprachbefehl angefordert" - - - false - Expression: ttsMsg" - request_path == "/fhem-amad/setCommands/ttsMsg" - - - false - Expression: tuneinradio - param_app == "tuneinradio" - - - true - Expression: value != "" - value != "" - - - true - Flow Aktiv: Informations - Informations - - - true - Flow Aktiv: SetCommands - SetCommands - - - true - Flugmodus eingeschaltet - - - true - Musik Aktiv - - - true - Stromversorgung: Angeschlossen - true - true - true - true - - - true - WLAN Verbunden: Alle SSIDs - true - - - - false - AMAD Voice Control - true - - true - de-DE - false - - - false - App Starten: App3 - - - - - false - App Starten: App4 - - - - - false - App Starten: App5 - - - - - false - App Starten: PlayMusic - com.google.android.music - - - - false - App Starten: tuneinradio - tunein.player - - - - true - Audio Player steuern: Medienknopf Play (Google Play Musik) - true - TOGGLE_PAUSE - KEYCODE_MEDIA_PLAY - true - com.google.android.music - com.google.android.music.playback.MediaButtonIntentReceiver - Google Play Musik - - - true - Audio Player steuern: Medienknopf Stopp (Google Play Musik) - true - STOP - KEYCODE_MEDIA_STOP - true - com.google.android.music - com.google.android.music.playback.MediaButtonIntentReceiver - Google Play Musik - - - true - Audio Player steuern: Medienknopf Weiter (Google Play Musik) - true - LAUNCH - KEYCODE_MEDIA_NEXT - true - com.google.android.music - com.google.android.music.playback.MediaButtonIntentReceiver - Google Play Musik - - - true - Audio Player steuern: Medienknopf Zurück (Google Play Musik) - true - LAUNCH - KEYCODE_MEDIA_PREVIOUS - true - com.google.android.music - com.google.android.music.playback.MediaButtonIntentReceiver - Google Play Musik - - - true - Benachrichtigung auf Bildschirm: {param_message} (lange) - true - {param_message} - - 200 - 250 - false - 1.0 - true - false - TOP_LEFT - 0 - 0 - - - true - Benachrichtigung auf Bildschirm: {value} (lange) - true - {value} - - 200 - 250 - false - 1.0 - true - false - TOP_LEFT - 0 - 0 - - - true - Benachrichtigung aus Statusbar entfernen: Alle - false - true - 1 - true - - true - {id} - TEXT - CONTAINS_TEXT - - - - true - Benachrichtigung aus Statusbar entfernen: Alle (Automagic) - true - true - 1 - false - - true - {id} - TEXT - CONTAINS_TEXT - - - - true - Bluetooth ein-/ausschalten: Aus - false - - - true - Bluetooth ein-/ausschalten: Ein - true - - - true - 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: Trennen Eingabegerät {param_btdeviceone} - INPUT_DEVICE - {param_btdeviceone} - - false - - - true - Bluetooth Gerät verbinden/trennen: Trennen Eingabegerät {param_btdevicetwo} - INPUT_DEVICE - {param_btdevicetwo} - - false - - - true - Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdeviceone} - HEADSET - {param_btdeviceone} - - false - - - true - Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdevicetwo} - HEADSET - {param_btdevicetwo} - - false - - - true - Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdeviceone} - PAN - {param_btdeviceone} - - false - - - true - Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdevicetwo} - PAN - {param_btdevicetwo} - - false - - - true - Bluetooth Gerät verbinden/trennen: Verbinden Advanced Audio Distribution {param_swtobtdevicemac} - A2DP - {param_swtobtdevicemac} - - true - - - true - Display automatisch drehen ein-/ausschalten: Aus - false - - - true - Display automatisch drehen ein-/ausschalten: Ein - true - - - true - Flows ausführen: VoiceControl - VoiceControl - - true - false - false - - - true - Flugmodus ein-/ausschalten: Ein - SYSTEM_SETTING - true - - - true - Gerät sperren - - - false - Get Android Version - - - - true - Herunterfahren - - - false - HTTP Response Information - powerLevel@@{battery_percentage}@@@@powerPlugged@@{battery_plugged}@@@@volumeMusikBluetooth@@{volumeMusikBluetooth}@@@@volumeMusikSpeaker@@{volumeMusikSpeaker}@@@@screenBrightness@@{screenBrightness}@@@@nextAlarmTime@@{next_alarmtime}@@@@nextAlarmDay@@{next_alarmday}@@@@screen@@{screen_state}@@@@automagicState@@{notification_text}@@@@screenOrientation@@{screen_orientation}@@@@currentMusicTrack@@{global_track}@@@@currentMusicAlbum@@{global_album}@@@@currentMusicArtist@@{global_artist}@@@@bluetooth@@{bluetooth_state}@@@@connectedBTdevices@@{connected_devices_names}@@@@connectedBTdevicesMAC@@{connected_devices_addresses}@@@@flow_SetCommands@@{setCommandFlow_state}@@@@checkActiveTask@@{runTask}@@@@androidVersion@@{androidVersion}@@@@volumeNotification@@{volumeNotification}@@@@airplanemode@@{airplanemode} - true - text/plain - - - false - HTTP Response SetCommand - flow_informations@@{informationFlow_state}@@@@ - true - text/plain - - - false - Initialisiere Variable Nächster Alarm: next_alarm - next_alarm - - - false - Initialisiere Variable Systemeinstellung: screenBrightness - SYSTEM - screen_brightness - screenBrightness - - - false - Initialisiere Variable Systemeinstellung: volumeMusikBluetooth - SYSTEM - volume_music_bt_a2dp - volumeMusikBluetooth - - - false - Initialisiere Variable Systemeinstellung: volumeMusikSpeaker - SYSTEM - volume_music_speaker - volumeMusikSpeaker - - - false - Initialisiere Variable Systemeinstellung: volumeNotification - SYSTEM - volume_ring_speaker - volumeNotification - - - true - Kommandozeilenbefehl als Root ausführen: getevent -c 1 in - getevent -c 1 - - - stdout - stderr - exit_code - - - false - Lautstärken setzen param_notifivolume - false - global_volume_alarm - false - global_volume_dtmf - false - param_volume - true - param_notifivolume - false - global_volume_ring - false - global_volume_system - false - global_volume_voice_call - false - global_ringer_mode - false - global_interruptions_mode - - - false - Lautstärken setzen param_volume - false - global_volume_alarm - false - global_volume_dtmf - true - param_volume - false - global_volume_notification - false - global_volume_ring - false - global_volume_system - false - global_volume_voice_call - false - global_ringer_mode - false - global_interruptions_mode - - - true - Neustart - - - - false - Notification Lautstärke Speichern - false - global_volume_alarm - false - global_volume_dtmf - false - global_volume_music - true - global_volume_notification - false - global_volume_ring - false - global_volume_system - false - global_volume_voice_call - false - global_ringer_mode - false - global_interruptions_mode - - - false - Notification Lautstärke Wiederherstellen - false - global_volume_alarm - false - global_volume_dtmf - false - param_volume - true - global_volume_notification - false - global_volume_ring - false - global_volume_system - false - global_volume_voice_call - false - global_ringer_mode - false - global_interruptions_mode - - - false - NotificationLautstärke auf Level 7 - NOTIFICATION - 7 - false - false - - - false - Own Reading - http://{global_fhemip}:8090 - false - false - - POST - GENERAL_TEXT - text/plain - {substring(getValue("global_own_reading",""),14)}@@{getValue("global_{substring(getValue('global_own_reading',''),14)}","nicht gefunden")}@@@@ - @@@@readingsNameXYZ@@readingsValueABC - 60000 - true - FHEMDEVICE: {global_fhemdevice} -FHEMCMD: setreading - true - response - /storage/emulated/0/Download/file.bin - true - - - true - Pause: 10s (Schlafmodus zulassen) - 10s - false - false - - - true - Pause: 15s (Gerät wach halten) - 15s - true - false - - - true - Pause: 2s (Gerät wach halten) - 2s - true - false - - - true - Pause: 3s (Gerät wach halten) - 3s - true - false - - - false - Reading Music Metachanged - http://{global_fhemip}:8090 - false - false - - POST - GENERAL_TEXT - text/plain - currentMusicTrack@@{global_track}@@@@currentMusicAlbum@@{global_album}@@@@currentMusicArtist@@{global_artist}@@@@ - @@@@readingsNameXYZ@@readingsValueABC - 60000 - true - FHEMDEVICE: {global_fhemdevice} -FHEMCMD: setreading - true - response - /storage/emulated/0/Download/file.bin - true - - - true - Schalte Display ein: Hell für 120s - true - 120s - true - - - true - Script: airplanemode = "off" - - - - true - Script: bluetooth_state = "off" - - - - true - Script: bluetooth_state = "on" - - - - true - Script: global_artist = "no soundplayer activ"; 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" - - - - true - Script: informationFlow_state = "inaktiv" - - - - true - Script: next_alarmday = "{next_alarm,dateformat,c}" - - - - true - Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}" - - - - true - Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" - - - - true - Script: notification_text = "not supported from your device" - - - - true - Script: runTask = "0" - - - - true - Script: runTask = "1" - - - - true - Script: runTask = "not supported android version" - - - - true - Script: runTask = "null" - - - - true - Script: screen_orientation = "auto" - - - - true - Script: screen_orientation = "landscape" - - - - true - Script: screen_orientation = "portrait" - - - - true - Script: screen_state = "off" - - - - true - Script: screen_state = "on" - - - - true - Script: setCommandFlow_state = "aktiv" - - - - true - Script: setCommandFlow_state = "inaktiv" - - - - false - Send Voice Input Value to AMADCommBridge - http://{global_fhemip}:8090 - false - false - - POST - GENERAL_TEXT - text/plain - {value} - @@@@readingsNameXYZ@@readingsValueABC - 60000 - true - FHEMDEVICE: {global_fhemdevice} -FHEMCMD: voiceinputvalue - true - response - /storage/emulated/0/Download/file.bin - true - - - true - Setze Alarm: um {param_hour}:{param_minute} - - {param_hour} - {param_minute} - - - true - Setze Display Helligkeit: {param_brightness} - false - {param_brightness} - false - 50 - - - true - Setze Display Orientierung: Auf Default zurücksetzen - UNSPECIFIED - false - - - true - Setze Display Orientierung: Landscape - LANDSCAPE - false - - - true - Setze Display Orientierung: Portrait - PORTRAIT - false - - - true - Setze Flow Status: Aktivieren Informations - true - Informations - - - - true - Setze Flow Status: Aktivieren SetCommands - true - SetCommands - - - - true - Setze Lock PIN/Passwort: PIN/Passwort zurücksetzen - true - PIN - false - param_lockPIN - - - true - Setze Lock PIN/Passwort: Setze PIN von Variable param_lockpin - false - PIN - false - param_lockpin - - - true - Setze Vollbild Modus: Auf Default zurücksetzen - UNSPECIFIED - false - - - true - Setze Vollbild Modus: Navigation nicht anzeigen - HIDE_NAVIGATION - false - - - true - Sound: /storage/emulated/0/Notifications/{param_notifyfile} als Benachrichtigung - FILE - Lautlos - /storage/emulated/0/Notifications/{param_notifyfile} - NOTIFICATION - false - true - true - TRANSIENT - - - true - Sprachausgabe: {param_message} - MUSIC - {param_message} - de_DE - true - 1.0 - true - 1.0 - true - false - false - true - TRANSIENT - - - false - Spracheingabe wurde nicht erkannt - NOTIFICATION - Ihre Eingabe wurde nicht verstanden - de_DE - true - 1.0 - true - 1.0 - true - false - false - true - TRANSIENT - - - false - StatusRequest - http://{global_fhemip}:8090 - false - false - - POST - GENERAL_TEXT - text/plain - - @@@@readingsNameXYZ@@readingsValueABC - 60000 - true - FHEMDEVICE: {global_fhemdevice} -FHEMCMD: statusrequest - true - response - /storage/emulated/0/Download/file.bin - true - - - true - URL in Browser öffnen: {param_url} (mit Chrome) - {param_url} - true - com.android.chrome - com.google.android.apps.chrome.Main - Chrome - - - true - Vibrieren: Pattern 2 (-- --) - false - vibrate_pattern_2 - 0,500 - - - Informations - FHEM Info / Steuerung über AMAD Modul v1.2.0 - true - QUEUE - 240 - - HTTP Request: /fhem-amad/deviceInfo/ - com.android.music.metachanged - Globale Variable: global_own_reading - - Initialisiere Variable Nächster Alarm: next_alarm - Initialisiere Variable Systemeinstellung: screenBrightness - Initialisiere Variable Systemeinstellung: volumeMusikSpeaker - Initialisiere Variable Systemeinstellung: volumeMusikBluetooth - Flow Aktiv: SetCommands - Musik Aktiv - Pause: 2s (Gerät wach halten) - Expression: trigger == "com.android.music.metachanged" - WLAN Verbunden: Alle SSIDs - WLAN Verbunden: Alle SSIDs - Reading Music Metachanged - Display automatisch drehen eingeschaltet - Script: runTask = "1" - Setze Flow Status: Aktivieren SetCommands - Script: setCommandFlow_state = "inaktiv" - Script: setCommandFlow_state = "aktiv" - Script: global_artist = "no soundplayer activ"; global_track = "no soundplayer activ"; global_album = "no soundplayer activ"; - Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}" - Script: next_alarmday = "{next_alarm,dateformat,c}" - Script: screen_orientation = "auto" - Script: screen_orientation = "portrait" - Script: screen_orientation = "landscape" - Display Orientierung: Portrait - Script: runTask = "0" - App Task läuft: {header_activetask} (neuster) - Expression: getAndroidSDKVersion() >= "19" - Expression: header_activetask != "none" - Script: runTask = "null" - Script: runTask = "not supported android version" - Script: notification_text = "not supported from your device" - Benachrichtigung in Statusbar angezeigt: Automagic - Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" - Script: screen_state = "off" - Script: screen_state = "on" - Display eingeschaltet - Expression: getAndroidSDKVersion() >= "19" - Bluetooth Gerät verbunden: Beliebiges Geräte - Script: bluetooth_state = "on" - Bluetooth eingeschaltet - Script: bluetooth_state = "off" - Own Reading - Expression: trigger == "Globale Variable: global_own_reading" - Script: global_fhemip = {header_fhemip} global_fhemdevice = {header_fhemdevice} - Initialisiere Variable Systemeinstellung: volumeNotification - Flugmodus eingeschaltet - Stromversorgung: Angeschlossen - Script: airplanemode = "off" - HTTP Response Information - Get Android Version - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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" - Pause: 10s (Schlafmodus zulassen) - Script: global_touch="ja";global_own_reading="{getDate()}_touch";global_touched="ja" - - - - - - - - SetCommands - FHEM Info / Steuerung über AMAD Modul v1.2.0 - true - QUEUE - 240 - - HTTP Request: /fhem-amad/deviceInfo/ - HTTP Request: /fhem-amad/setCommands/* - Sprachbefehl angefordert - - Expression: param_screen=="on" - Expression: setBrightness" - Expression: setAlarm" - Expression: screenMsg" - URL in Browser öffnen: {param_url} (mit Chrome) - Benachrichtigung auf Bildschirm: {param_message} (lange) - Expression: setScreenFullscreen" - Expression: param_orientation == "auto" - Setze Display Orientierung: Portrait - Setze Display Orientierung: Landscape - Expression: param_orientation == "landscape" - Setze Vollbild Modus: Navigation nicht anzeigen - Setze Vollbild Modus: Auf Default zurücksetzen - Expression: param_button == "back" - Expression: param_button == "next" - Setze Display Orientierung: Auf Default zurücksetzen - Expression: param_button == "play" - Expression: mediaPlayer" - Expression: param_button == "stop" - Expression: param_screen=="off" - Expression: setScreenOnOff" - App Task läuft: App5 (neuster) - Expression: App5 - Expression: App4 - App Task läuft: App3 (neuster) - Expression: App3 - App Starten: App3 - App Starten: App4 - App Task läuft: App4 (neuster) - Expression: tuneinradio - App Task läuft: tuneinradio (neuster) - App Starten: tuneinradio - App Starten: App5 - App Task läuft: gplay (neuster) - Expression: gplay - App Starten: PlayMusic - Flow Aktiv: Informations - Expression: ttsMsg" - Schalte Display ein: Hell für 120s - Display automatisch drehen ein-/ausschalten: Aus - Display automatisch drehen ein-/ausschalten: Ein - Setze Alarm: um {param_hour}:{param_minute} - Expression: setScreenOrientation" - Expression: param_fullscreen == "off" - Expression: param_fullscreen == "on" - Expression: setBluetooth" - Sprachausgabe: {param_message} - Expression: param_bluetooth == "off" - Expression: param_bluetooth == "on" - Bluetooth ein-/ausschalten: Ein - Expression: openApp" - Setze Flow Status: Aktivieren Informations - Script: informationFlow_state = "inaktiv" - Bluetooth eingeschaltet - Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdeviceone} - Bluetooth Gerät verbinden/trennen: Trennen Eingabegerät {param_btdeviceone} - Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdeviceone} - Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdevicetwo} - Bluetooth Gerät verbinden/trennen: Trennen Eingabegerät {param_btdevicetwo} - Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdeviceone} - Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdevicetwo} - Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdevicetwo} - Pause: 3s (Gerät wach halten) - Bluetooth Gerät verbinden/trennen: Verbinden Advanced Audio Distribution {param_swtobtdevicemac} - Pause: 2s (Gerät wach halten) - Gerät sperren - Script: informationFlow_state = "aktiv" - Expression: setBTDevice" - Expression: openURL" - Audio Player steuern: Medienknopf Play (Google Play Musik) - Audio Player steuern: Medienknopf Weiter (Google Play Musik) - Audio Player steuern: Medienknopf Zurück (Google Play Musik) - StatusRequest - Bluetooth ein-/ausschalten: Aus - Audio Player steuern: Medienknopf Stopp (Google Play Musik) - HTTP Response SetCommand - Expression: setVolume" - Lautstärken setzen param_volume - Expression: trigger == "Sprachbefehl angefordert" - Expression: param_orientation == "portrait" - Setze Lock PIN/Passwort: PIN/Passwort zurücksetzen - Expression: param_lockmod == "on" - Expression: setScreenlock" - Setze Lock PIN/Passwort: Setze PIN von Variable param_lockpin - Expression: Reboot - Expression: System Command" - Neustart - Expression: Shutdown - Herunterfahren - Sound: /storage/emulated/0/Notifications/{param_notifyfile} als Benachrichtigung - Benachrichtigung aus Statusbar entfernen: Alle - Benachrichtigung aus Statusbar entfernen: Alle (Automagic) - Expression: Automagic - Expression: All - Lautstärken setzen param_notifivolume - Expression: setNotifiVolume" - Expression: notifysnd" - NotificationLautstärke auf Level 7 - Notification Lautstärke Speichern - Expression: param_notifyfile == "RedAlert.mp3" - Notification Lautstärke Wiederherstellen - Expression: setVoiceCommand" - Flows ausführen: VoiceControl - Expression: setVibrate" - Vibrieren: Pattern 2 (-- --) - Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*" - Expression: Clear Automagic Meldungen" - Flugmodus ein-/ausschalten: Ein - Expression: Airplanemode - Setze Display Helligkeit: {param_brightness} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VoiceControl - FHEM Info / Steuerung über AMAD Modul v1.2.0 - true - QUEUE - - Expression: value != "" - Spracheingabe wurde nicht erkannt - Benachrichtigung auf Bildschirm: {value} (lange) - Send Voice Input Value to AMADCommBridge - AMAD Voice Control - - - - - - - \ No newline at end of file diff --git a/fhem/FHEM/lib/74_AMADautomagicFlowset_2.0.0.xml b/fhem/FHEM/lib/74_AMADautomagicFlowset_2.0.0.xml new file mode 100644 index 000000000..392200796 --- /dev/null +++ b/fhem/FHEM/lib/74_AMADautomagicFlowset_2.0.0.xml @@ -0,0 +1,2909 @@ + + + + true + Akku Ladestand: grösser als 0% + true + 0 + HIGHER_THAN + true + true + + + true + App Task Beendet: {global_activetask} + true + {global_activetask} + + + true + App Task Gestartet: {global_activetask} + true + {global_activetask} + + + true + Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic + true + ch.gridvision.ppam.androidautomagic + TEXT + CONTAINS_TEXT + + false + false + + + true + Benachrichtigung in Statusbar angezeigt: com.whatsapp + true + com.whatsapp + TEXT + CONTAINS_TEXT + + false + true + + + true + Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic + true + ch.gridvision.ppam.androidautomagic + TEXT + CONTAINS_TEXT + + false + false + + + true + Bluetooth Status: Schaltet aus, Aus + true + false + false + true + true + + + true + Bluetooth Status: Schaltet ein, Ein + true + true + true + false + false + + + false + com.android.music.metachanged + true + com.android.music.metachanged + + + + + + + + global_artist = getString("artist"); +global_track = getString("track"); +global_album = getString("album"); + false + + + false + com.android.music.playstatechanged + true + com.android.music.playstatechanged + + + + + + + + global_artist = getString("artist"); +global_track = getString("track"); +global_album = getString("album"); + false + + + true + Daydream Status: Gestartet + true + true + + + true + Daydream Status: Gestoppt + true + false + + + true + Display Orientierung: Landscape + true + false + + + true + Display Orientierung: Portrait + true + true + + + true + Display Status: Aus + true + false + + + true + Display Status: Ein + true + true + + + true + Dock Event: Docked + true + true + + + true + Dock Event: Undocked + true + false + + + true + Eingehender Anruf. Status: Klingelt, Nummern: Alle + true + true + + true + true + false + false + false + + + true + Flugmodus: Aus + true + false + + + true + Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT + true + com.android.deskclock.ALARM_ALERT + + + + + + + + + false + + + true + Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS + true + com.android.deskclock.ALARM_DISMISS + + + + + + + + + false + + + true + Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE + true + com.android.deskclock.ALARM_DONE + + + + + + + + + false + + + true + Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE + true + com.android.deskclock.ALARM_SNOOZE + + + + + + + + + false + + + true + Genereller Broadcast: wenn org.smblott.intentradio.STATE + true + org.smblott.intentradio.STATE + + + + + + + + irstate=getString("state"); +irname=getString("name") + false + + + false + HTTP Request: /fhem-amad/currentFlowsetUpdate + true + /fhem-amad/currentFlowsetUpdate + 8090 + true + + + false + HTTP Request: /fhem-amad/deviceInfo/ + true + /fhem-amad/deviceInfo/ + 8090 + true + + + false + HTTP Request: /fhem-amad/setCommands/* + true + /fhem-amad/setCommands/* + 8090 + true + + + true + Sprachbefehl angefordert + true + + + true + Stromversorgung: Angeschlossen + true + true + true + true + true + + + true + Stromversorgung: Entfernt + true + false + true + true + true + + + false + Systemeinstellung verändert: System next_alarm + true + SYSTEM + next_alarm_formatted + setting + + + true + Systemeinstellung verändert: System screen_brightness + true + SYSTEM + screen_brightness + screenBrightness + + + true + Systemeinstellung verändert: System volume_music_bt_a2dp + true + SYSTEM + volume_music_bt_a2dp + volume + + + true + Systemeinstellung verändert: System volume_music_headphone + true + SYSTEM + volume_music_headphone + volume + + + true + Systemeinstellung verändert: System volume_music_speaker + true + SYSTEM + volume_music_speaker + volume + + + true + Systemeinstellung verändert: System volume_ring_speaker + true + SYSTEM + volume_ring_speaker + volumeNotification + + + false + App Task läuft: App (neuster) + {param_app} + true + + + true + App Task läuft: {global_activetask} (neuster) + {global_activetask} + true + + + false + Benachrichtigung in Statusbar angezeigt: Automagic + ch.gridvision.ppam.androidautomagic + true + 1 + TEXT + CONTAINS_TEXT + + false + false + + + false + Benachrichtigung in Statusbar angezeigt: WhatsApp + com.whatsapp + true + 1 + TEXT + CONTAINS_TEXT + + false + false + + + true + Bluetooth eingeschaltet + + + true + Bluetooth Gerät verbunden: Beliebiges Geräte + true + + + ANY + + + true + Bluetooth Gerät verbunden: Beliebiges Geräte (Advanced Audio Distribution) + true + + + A2DP + + + true + Display automatisch drehen eingeschaltet + + + true + Display eingeschaltet + + + true + Display Orientierung: Portrait + true + + + true + Dock Status: Docked + true + true + true + true + true + false + + + true + Expression: airpcount < 11 + airpcount < 11 + + + false + Expression: Airplanemode + param_syscmd == "airplanemodeON" + + + false + Expression: All + param_app == "All" + + + false + Expression: Automagic + param_app == "Automagic" + + + false + Expression: Clear Automagic Meldungen" + request_path == "/fhem-amad/setCommands/clearnotificationbar" + + + true + Expression: contains(value, " und ") + contains(value, " und ") + + + true + Expression: getAndroidSDKVersion() >= "19" + getAndroidSDKVersion() >= "19" + + + true + Expression: global_activetask != "none" + global_activetask != "none" + + + true + Expression: global_bridgeport == null or global_fhemip == null or global_fhemdevice == null or global_activetask == null or global_apssid == null + global_bridgeport == null +or global_fhemip == null +or global_fhemdevice == null +or global_activetask == null +or global_apssid == null + + + true + Expression: global_fhemip != null + global_fhemip != null + + + false + Expression: installFlow" + request_path == "/fhem-amad/setCommands/installFlow" + + + true + Expression: keyguard == "locked" + keyguard == "locked" + + + false + Expression: mediaPlayer" + request_path == "/fhem-amad/setCommands/mediaPlayer" + + + false + Expression: notifysnd" + request_path == "/fhem-amad/setCommands/playnotifysnd" + + + false + Expression: openApp" + request_path == "/fhem-amad/setCommands/openApp" + + + false + Expression: openURL" + request_path == "/fhem-amad/setCommands/openURL" + + + true + Expression: param_bluetooth == "off" + param_bluetooth == "off" + + + true + Expression: param_bluetooth == "on" + param_bluetooth == "on" + + + true + Expression: param_button == "back" + param_button == "back" + + + true + Expression: param_button == "next" + param_button == "next" + + + true + Expression: param_button == "play" + param_button == "play" + + + true + Expression: param_button == "stop" + param_button == "stop" + + + true + Expression: param_fullscreen == "off" + param_fullscreen == "off" + + + true + Expression: param_fullscreen == "on" + param_fullscreen == "on" + + + true + Expression: param_lockmod == "lock" + param_lockmod == "lock" + + + true + Expression: param_notifyfile == "RedAlert.mp3" + param_notifyfile == "RedAlert.mp3" + + + true + Expression: param_orientation == "auto" + param_orientation == "auto" + + + true + Expression: param_orientation == "landscape" + param_orientation == "landscape" + + + true + Expression: param_orientation == "portrait" + param_orientation == "portrait" + + + true + Expression: param_screen=="off" + param_screen=="off" + + + true + Expression: param_screen=="on" + param_screen=="on" + + + false + Expression: Reboot + param_syscmd == "reboot" + + + true + Expression: scrcount < 5 + scrcount < 5 + + + false + Expression: screenMsg" + request_path == "/fhem-amad/setCommands/screenMsg" + + + false + Expression: sendIntent" + request_path == "/fhem-amad/setCommands/sendIntent" + + + false + Expression: setAlarm" + request_path == "/fhem-amad/setCommands/setAlarm" + + + false + Expression: setBluetooth" + request_path == "/fhem-amad/setCommands/setbluetooth" + + + false + Expression: setBrightness" + request_path == "/fhem-amad/setCommands/setBrightness" + + + false + Expression: setBTDevice" + request_path == "/fhem-amad/setCommands/setbtdevice" + + + false + Expression: setNotifiVolume" + request_path == "/fhem-amad/setCommands/setNotifiVolume" + + + false + Expression: setScreenFullscreen" + request_path == "/fhem-amad/setCommands/setScreenFullscreen" + + + false + Expression: setScreenlock" + request_path == "/fhem-amad/setCommands/screenlock" + + + false + Expression: setScreenOnOff" + request_path == "/fhem-amad/setCommands/setScreenOnOff" + + + false + Expression: setScreenOrientation" + request_path == "/fhem-amad/setCommands/setScreenOrientation" + + + false + Expression: setTimer" + request_path == "/fhem-amad/setCommands/setTimer" + + + false + Expression: setVibrate" + request_path == "/fhem-amad/setCommands/setvibrate" + + + false + Expression: setVoiceCommand" + request_path == "/fhem-amad/setCommands/setvoicecmd" + + + false + Expression: setVolume" + request_path == "/fhem-amad/setCommands/setVolume" + + + false + Expression: Shutdown + param_syscmd == "shutdown" + + + false + Expression: System Command" + request_path == "/fhem-amad/setCommands/systemcommand" + + + true + Expression: trigger == "Akku Ladestand: grösser als 0%" + trigger == "Akku Ladestand: grösser als 0%" + + + true + Expression: trigger == "Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic" or trigger == "Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic" + trigger == "Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic" or trigger == "Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic" + + + true + Expression: trigger == "Benachrichtigung in Statusbar angezeigt: com.whatsapp" + trigger == "Benachrichtigung in Statusbar angezeigt: com.whatsapp" + + + true + Expression: trigger == "Bluetooth Status: Schaltet aus, Aus" or trigger == "Bluetooth Status: Schaltet ein, Ein" + trigger == "Bluetooth Status: Schaltet aus, Aus" or trigger == "Bluetooth Status: Schaltet ein, Ein" + + + true + Expression: trigger == "com.android.music.playstatechanged" or trigger == "com.android.music.metachanged" + trigger == "com.android.music.playstatechanged" or trigger == "com.android.music.metachanged" + + + true + Expression: trigger == "Daydream Status: Gestartet" + trigger == "Daydream Status: Gestartet" + + + true + Expression: trigger == "Daydream Status: Gestartet" or trigger == "Daydream Status: Gestoppt" + trigger == "Daydream Status: Gestartet" or trigger == "Daydream Status: Gestoppt" + + + true + Expression: trigger == "Display Orientierung: Landscape" or trigger == "Display Orientierung: Portrait" or trigger == "Display Status: Ein" or trigger == "Display Status: Aus" + trigger == "Display Orientierung: Landscape" or trigger == "Display Orientierung: Portrait" or trigger == "Display Status: Ein" or trigger == "Display Status: Aus" + + + true + Expression: trigger == "Display Status: Aus" or trigger == "Display Status: Ein" or udef_trigger == "setLockPin" + trigger == "Display Status: Aus" or trigger == "Display Status: Ein" or udef_trigger == "setLockPin" + + + true + Expression: trigger == "Eingehender Anruf. Status: Klingelt, Nummern: Alle" + trigger == "Eingehender Anruf. Status: Klingelt, Nummern: Alle" + + + true + Expression: trigger == "Flugmodus: Aus" + trigger == "Flugmodus: Aus" + + + true + 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" + 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" + + + true + Expression: trigger == "Genereller Broadcast: wenn org.smblott.intentradio.STATE" + trigger == "Genereller Broadcast: wenn org.smblott.intentradio.STATE" + + + true + Expression: trigger == "HTTP Request: /fhem-amad/deviceInfo/" + trigger == "HTTP Request: /fhem-amad/deviceInfo/" + + + true + Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*" + trigger == "HTTP Request: /fhem-amad/setCommands/*" + + + true + Expression: trigger == "Sprachbefehl angefordert" + trigger == "Sprachbefehl angefordert" + + + true + Expression: trigger == "Systemeinstellung verändert: System next_alarm" + trigger == "Systemeinstellung verändert: System next_alarm" + + + true + Expression: trigger == "Systemeinstellung verändert: System screen_brightness" + trigger == "Systemeinstellung verändert: System screen_brightness" + + + true + 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" + 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" + + + true + Expression: trigger == "Systemeinstellung verändert: System volume_ring_speaker" + trigger == "Systemeinstellung verändert: System volume_ring_speaker" + + + false + Expression: ttsMsg" + request_path == "/fhem-amad/setCommands/ttsMsg" + + + true + Expression: udef_trigger == "setLockPin" + udef_trigger == "setLockPin" + + + true + Expression: value != "" + value != "" + + + true + Flow Aktiv: Informations + Informations + + + true + Flow Aktiv: SetCommands + SetCommands + + + true + Keyguard gesperrt + + + true + Keyguard mit Sicherheit + + + true + Musik Aktiv + + + true + Stromversorgung: Angeschlossen + true + true + true + true + + + true + WLAN Verbunden: {global_apssid} + false + {global_apssid} + + + false + Airplainemode + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + airplanemode@@{airplanemode}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + Airplainemode ON + http://{global_fhemip}:8090 + false + false + + POST + GENERAL_TEXT + text/plain + airplanemode@@on@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + AMAD Voice Control + true + + true + de-DE + false + + + false + Android Version + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + androidVersion@@{androidVersion}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + App Starten: App + {param_app} + + + + true + Audio Player steuern: Medienknopf Play (Google Play Musik) + true + TOGGLE_PAUSE + KEYCODE_MEDIA_PLAY + true + com.google.android.music + com.google.android.music.playback.MediaButtonIntentReceiver + Google Play Musik + + + true + Audio Player steuern: Medienknopf Stopp (Google Play Musik) + true + STOP + KEYCODE_MEDIA_STOP + true + com.google.android.music + com.google.android.music.playback.MediaButtonIntentReceiver + Google Play Musik + + + true + Audio Player steuern: Medienknopf Weiter (Google Play Musik) + true + LAUNCH + KEYCODE_MEDIA_NEXT + true + com.google.android.music + com.google.android.music.playback.MediaButtonIntentReceiver + Google Play Musik + + + true + Audio Player steuern: Medienknopf Zurück (Google Play Musik) + true + LAUNCH + KEYCODE_MEDIA_PREVIOUS + true + com.google.android.music + com.google.android.music.playback.MediaButtonIntentReceiver + Google Play Musik + + + false + Automagic State + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + automagicState@@{notification_text}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + Benachrichtigung auf Bildschirm: {param_message} (lange) + true + {param_message} + + 200 + 250 + false + 1.0 + true + false + TOP_LEFT + 0 + 0 + + + true + Benachrichtigung auf Bildschirm: {value} (lange) + true + {value} + + 200 + 250 + false + 1.0 + true + false + TOP_LEFT + 0 + 0 + + + true + Benachrichtigung aus Statusbar entfernen: Alle + false + true + 1 + true + + true + {id} + TEXT + CONTAINS_TEXT + + + + true + Benachrichtigung aus Statusbar entfernen: Alle (Automagic) + true + true + 1 + false + + true + {id} + TEXT + CONTAINS_TEXT + + + + false + Bluetooth Device Status + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + connectedBTdevices@@{connected_devices_names}@@@@connectedBTdevicesMAC@@{connected_devices_addresses}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + Bluetooth ein-/ausschalten: Aus + false + + + true + Bluetooth ein-/ausschalten: Ein + true + + + true + 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: Trennen Eingabegerät {param_btdeviceone} + INPUT_DEVICE + {param_btdeviceone} + + false + + + true + Bluetooth Gerät verbinden/trennen: Trennen Eingabegerät {param_btdevicetwo} + INPUT_DEVICE + {param_btdevicetwo} + + false + + + true + Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdeviceone} + HEADSET + {param_btdeviceone} + + false + + + true + Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdevicetwo} + HEADSET + {param_btdevicetwo} + + false + + + true + Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdeviceone} + PAN + {param_btdeviceone} + + false + + + true + Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdevicetwo} + PAN + {param_btdevicetwo} + + false + + + true + Bluetooth Gerät verbinden/trennen: Verbinden Advanced Audio Distribution {param_swtobtdevicemac} + A2DP + {param_swtobtdevicemac} + + true + + + false + Bluetooth Status + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + bluetooth@@{bluetooth_state}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + Broadcast senden: {param_action} + {param_action} + false + android.intent.category.DEFAULT + false + + false + text/plain + false + + + FLAG_ACTIVITY_NEW_TASK + putString("{param_exkey1}", "{param_exval1}"); +putString("{param_exkey2}", "{param_exval2}"); + false + + + + false + Check run Task + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + checkActiveTask@@{runTask}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + Dateien löschen: /storage/emulated/0/Download/currentFlowsetUpdate.xml + /storage/emulated/0/Download/currentFlowsetUpdate.xml + true + + + false + Daydream State + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + daydream@@{daydream_state}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + Display automatisch drehen ein-/ausschalten: Aus + false + + + true + Display automatisch drehen ein-/ausschalten: Ein + true + + + false + Dock State + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + dockingState@@{dock_state}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + Download URL: http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml to /storage/emulated/0/Download + http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml + /storage/emulated/0/Download + true + + + true + Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/emulated/0/Download + http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} + /storage/emulated/0/Download + true + + + false + Flow Status Informations + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + flow_informations@@{informationFlow_state}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + Flow Status SetCommands + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + flow_SetCommands@@{setCommandFlow_state}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + Flows ausführen: udef_trigger setLockPin + Informations + + false + true + false + + + true + Flows ausführen: VoiceControl + VoiceControl + + true + false + false + + + true + Flows/Widgets importieren: /storage/emulated/0/Download/currentFlowsetUpdate.xml + /storage/emulated/0/Download/currentFlowsetUpdate.xml + true + + + false + Flowsetversion + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + flowsetVersionAtDevice@@{amad_flowset_version}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + Flugmodus ein-/ausschalten: Ein + SYSTEM_SETTING + true + + + true + Gerät sperren + + + false + Get Android Version + + + + true + Herunterfahren + + + false + Incoming Call + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + incomingCallerName@@{contact_name}@@@@incomingCallerNumber@@{incoming_number}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + Incoming WhatsApp Message + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + incommingWhatsAppMessageFrom@@{notification_text}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + Initialisiere Variable Nächster Alarm: next_alarm + next_alarm + + + false + Initialisiere Variable Systemeinstellung: screenBrightness + SYSTEM + screen_brightness + screenBrightness + + + false + Initialisiere Variable Systemeinstellung: volumeMusikBluetooth.2 + SYSTEM + volume_music_bt_a2dp + volumeBT + + + false + Initialisiere Variable Systemeinstellung: volumeMusikSpeaker.2 + SYSTEM + volume_music_speaker + volumeSP + + + false + Initialisiere Variable Systemeinstellung: volumeNotification + SYSTEM + volume_ring_speaker + volumeNotification + + + false + IntentRadio Status + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + intentRadioState@@{irstate}@@@@intentRadioName@@{irname}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + KeyGuard Set + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + keyguardSet@@{keyguardSet}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + Lautstärke / Volume + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + volume@@{volume}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + Lautstärken setzen param_notifivolume + false + global_volume_alarm + false + global_volume_dtmf + false + param_volume + true + param_notifivolume + false + global_volume_ring + false + global_volume_system + false + global_volume_voice_call + false + global_ringer_mode + false + global_interruptions_mode + + + false + Lautstärken setzen param_volume + false + global_volume_alarm + false + global_volume_dtmf + true + param_volume + false + global_volume_notification + false + global_volume_ring + false + global_volume_system + false + global_volume_voice_call + false + global_ringer_mode + false + global_interruptions_mode + + + true + Neustart + + + + false + Next Alarm State + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + nextAlarmState@@{nextalarmstate}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + Notification Lautstärke Speichern + false + global_volume_alarm + false + global_volume_dtmf + false + global_volume_music + true + global_volume_notification + false + global_volume_ring + false + global_volume_system + false + global_volume_voice_call + false + global_ringer_mode + false + global_interruptions_mode + + + false + Notification Lautstärke Wiederherstellen + false + global_volume_alarm + false + global_volume_dtmf + false + param_volume + true + global_volume_notification + false + global_volume_ring + false + global_volume_system + false + global_volume_voice_call + false + global_ringer_mode + false + global_interruptions_mode + + + false + Notification Volume + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + volumeNotification@@{volumeNotification}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + NotificationLautstärke auf Level 7 + NOTIFICATION + 7 + false + false + + + false + Nächster Alarm + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + nextAlarmTime@@{next_alarmtime}@@@@nextAlarmDay@@{next_alarmday}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + Pause: 1s (Gerät wach halten) + 1s + true + false + + + true + Pause: 2s (Gerät wach halten) + 2s + true + false + + + true + Pause: 3s (Gerät wach halten) + 3s + true + false + + + false + Prüfe und setze Bridgeport Variable + + + + false + Prüfe und setze globale Variablen + + + + false + Reading Music Metachanged.2 + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + currentMusicTrack@@{global_track}@@@@currentMusicAlbum@@{global_album}@@@@currentMusicArtist@@{global_artist}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + Schalte Display ein: Hell für {param_screenontime}s + true + {param_screenontime}s + true + + + false + Screen Brightness + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + screenBrightness@@{screenBrightness}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + Screen Orientation + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + screenOrientation@@{screen_orientation}@@@@screenOrientationMode@@{screen_orientation_mode}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + false + Screen State + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + screen@@{screen_state}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + Script: airpcount = 0 + + + + true + Script: airpcount = airpcount + 1 + + + + true + Script: airplanemode = "off" + + + + true + Script: amad_flowset_version = "2.0.0" + + + + true + Script: androidVersion = "not supported funktion" + + + + true + Script: bluetooth_state = "off" + + + + true + Script: bluetooth_state = "on" + + + + true + Script: connected_devices_names = "null"; connected_devices_addresses = "null" + + + + true + Script: daydream_state = "off" + + + + true + Script: daydream_state = "on" + + + + true + Script: dock_state = "docked" + + + + true + Script: dock_state = "undocked" + + + + true + Script: global_artist = "no soundplayer activ"; global_track = "no soundplayer activ"; global_album = "no soundplayer activ"; + + + + true + 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" } + + + + true + Script: informationFlow_state = "aktiv" + + + + true + Script: informationFlow_state = "inaktiv" + + + + true + Script: keyguard = "locked" + + + + true + Script: keyguard = "unlocked" + + + + true + Script: keyguardSet = "0" + + + + true + Script: keyguardSet = "1" + + + + true + Script: next_alarmday = "{next_alarm,dateformat,c}" + + + + true + Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}" + + + + true + Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" + + + + true + Script: notification_text = "not supported from your device" + + + + true + Script: runTask = "0" + + + + true + Script: runTask = "1" + + + + true + Script: runTask = "not supported android version" + + + + true + Script: runTask = "null" + + + + true + Script: scrcount = 0 + + + + true + Script: scrcount = scrcount + 1 + + + + true + Script: screen_orientation = "landscape" + + + + true + Script: screen_orientation = "portrait" + + + + true + Script: screen_orientation_mode = "auto" + + + + true + Script: screen_orientation_mode = "manual" + + + + true + Script: screen_state = "off {keyguard}" + + + + true + Script: screen_state = "on {keyguard}" + + + + true + Script: setCommandFlow_state = "aktiv" + + + + true + Script: setCommandFlow_state = "inaktiv" + + + + true + Script: udef_trigger = "setLockPin" + + + + true + Script: volume = {volumeBT} + + + + true + Script: volume = {volumeSP} + + + + false + Send Voice Input Value to AMADCommBridge + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + {value} + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: voiceinputvalue + true + response + /storage/emulated/0/Download/file.bin + true + + + false + Send Voice Input Value to AMADCommBridge left + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + {left(value, (indexOf(value, " und ")))} + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: voiceinputvalue + true + response + /storage/emulated/0/Download/file.bin + true + + + true + Setze Alarm: um {param_hour}:{param_minute} + + {param_hour} + {param_minute} + + + false + true + + + true + Setze Display Helligkeit: {param_brightness} + false + {param_brightness} + false + 50 + + + true + Setze Display Orientierung: Auf Default zurücksetzen + UNSPECIFIED + false + + + true + Setze Display Orientierung: Landscape + LANDSCAPE + false + + + true + Setze Display Orientierung: Portrait + PORTRAIT + false + + + true + Setze Flow Status: Aktivieren Informations + true + Informations + + + + true + Setze Flow Status: Aktivieren SetCommands + true + SetCommands + + + + true + Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma} + true + {imported_flow_names,listformat,comma} + + + + true + Setze Lock PIN/Passwort: PIN/Passwort zurücksetzen + true + PIN + false + param_lockPIN + + + true + Setze Lock PIN/Passwort: Setze PIN von Variable param_lockpin + false + PIN + false + param_lockpin + + + false + Setze Timer + + {param_minute}m + true + + + false + Setze voice Variablen + + + + true + Setze Vollbild Modus: Auf Default zurücksetzen + UNSPECIFIED + false + + + true + Setze Vollbild Modus: Navigation nicht anzeigen + HIDE_NAVIGATION + false + + + true + Sound: /storage/emulated/0/Notifications/{param_notifyfile} als Benachrichtigung + FILE + Lautlos + /storage/emulated/0/Notifications/{param_notifyfile} + NOTIFICATION + false + true + true + TRANSIENT + + + true + Sprachausgabe: {param_message} + MUSIC + {param_message} + de_DE + true + 1.0 + true + 1.0 + true + false + false + true + TRANSIENT + + + false + Spracheingabe wurde nicht erkannt + NOTIFICATION + Ihre Eingabe wurde nicht verstanden + de_DE + true + 1.0 + true + 1.0 + true + false + false + true + TRANSIENT + + + false + Stromversorgung und Akkustand + http://{global_fhemip}:{global_bridgeport} + false + false + + POST + GENERAL_TEXT + text/plain + powerLevel@@{battery_percentage}@@@@powerPlugged@@{battery_plugged}@@@@ + @@@@readingsNameXYZ@@readingsValueABC + 60000 + true + FHEMDEVICE: {global_fhemdevice} +FHEMCMD: setreading + true + response + /storage/emulated/0/Download/file.bin + false + + + true + URL in Browser öffnen: {param_url} (mit {param_browserapp}/{param_browserappclass}) + {param_url} + true + {param_browserapp} + {param_browserappclass} + + + + true + Vibrieren: Pattern 2 (-- --) + false + vibrate_pattern_2 + 0,500 + + + Informations + AMAD2 Info/Control Flowset v2.0.0 + true + PARALLEL + 500 + Stromversorgung: Angeschlossen + Expression: trigger == "Daydream Status: Gestartet" + Script: setCommandFlow_state = "inaktiv" + Initialisiere Variable Systemeinstellung: screenBrightness + Script: volume = {volumeBT} + Script: volume = {volumeSP} + Bluetooth Gerät verbunden: Beliebiges Geräte (Advanced Audio Distribution) + Initialisiere Variable Systemeinstellung: volumeMusikSpeaker.2 + Initialisiere Variable Systemeinstellung: volumeMusikBluetooth.2 + Script: daydream_state = "on" + Script: daydream_state = "off" + Script: next_alarmday = "{next_alarm,dateformat,c}" + Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}" + Initialisiere Variable Nächster Alarm: next_alarm + App Task läuft: {global_activetask} (neuster) + Expression: getAndroidSDKVersion() >= "19" + Script: runTask = "1" + Script: runTask = "0" + Script: runTask = "not supported android version" + Script: runTask = "null" + Expression: global_activetask != "none" + Expression: trigger == "Systemeinstellung verändert: System volume_ring_speaker" + Expression: trigger == "Systemeinstellung verändert: System next_alarm" + Expression: trigger == "Systemeinstellung verändert: System screen_brightness" + WLAN Verbunden: {global_apssid} + Script: airplanemode = "off" + Expression: trigger == "Flugmodus: Aus" + Script: airpcount = 0 + Expression: airpcount < 11 + Pause: 2s (Gerät wach halten) + Script: keyguard = "unlocked" + Script: screen_state = "off {keyguard}" + Expression: global_activetask != "none" + Keyguard mit Sicherheit + Dock Status: Docked + Display Orientierung: Portrait + Script: screen_orientation = "portrait" + Script: screen_orientation = "landscape" + Display automatisch drehen eingeschaltet + Script: dock_state = "docked" + Script: dock_state = "undocked" + Script: keyguardSet = "1" + Script: keyguardSet = "0" + Script: screen_orientation_mode = "auto" + Script: screen_orientation_mode = "manual" + Expression: trigger == "Display Orientierung: Landscape" or trigger == "Display Orientierung: Portrait" or trigger == "Display Status: Ein" or trigger == "Display Status: Aus" + Script: setCommandFlow_state = "aktiv" + Flow Aktiv: SetCommands + Setze Flow Status: Aktivieren SetCommands + Script: screen_state = "on {keyguard}" + Script: scrcount = 0 + Script: keyguard = "locked" + Display eingeschaltet + Keyguard gesperrt + Expression: scrcount < 5 + Script: scrcount = scrcount + 1 + Pause: 2s (Gerät wach halten) + Expression: keyguard == "locked" + Expression: trigger == "Akku Ladestand: grösser als 0%" + Initialisiere Variable Systemeinstellung: volumeNotification + 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" + Expression: trigger == "com.android.music.playstatechanged" or trigger == "com.android.music.metachanged" + Pause: 1s (Gerät wach halten) + Musik Aktiv + Script: global_artist = "no soundplayer activ"; global_track = "no soundplayer activ"; global_album = "no soundplayer activ"; + Expression: trigger == "Bluetooth Status: Schaltet aus, Aus" or trigger == "Bluetooth Status: Schaltet ein, Ein" + Bluetooth eingeschaltet + Script: bluetooth_state = "off" + Script: bluetooth_state = "on" + Bluetooth Gerät verbunden: Beliebiges Geräte + Script: connected_devices_names = "null"; connected_devices_addresses = "null" + Expression: udef_trigger == "setLockPin" + Expression: trigger == "Daydream Status: Gestartet" or trigger == "Daydream Status: Gestoppt" + Expression: trigger == "HTTP Request: /fhem-amad/deviceInfo/" + Expression: trigger == "Eingehender Anruf. Status: Klingelt, Nummern: Alle" + Expression: trigger == "Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic" or trigger == "Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic" + Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" + Benachrichtigung in Statusbar angezeigt: Automagic + Expression: getAndroidSDKVersion() >= "19" + Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff" + Script: notification_text = "not supported from your device" + Benachrichtigung in Statusbar angezeigt: WhatsApp + Expression: trigger == "Genereller Broadcast: wenn org.smblott.intentradio.STATE" + Expression: trigger == "Benachrichtigung in Statusbar angezeigt: com.whatsapp" + Check run Task + Screen State + Reading Music Metachanged.2 + Bluetooth Status + Bluetooth Device Status + Notification Volume + Lautstärke / Volume + Nächster Alarm + Stromversorgung und Akkustand + Daydream State + Screen Brightness + Screen Orientation + Automagic State + Dock State + KeyGuard Set + Incoming Call + Incoming WhatsApp Message + IntentRadio Status + Flowsetversion + Flow Status SetCommands + Android Version + Script: androidVersion = "not supported funktion" + Get Android Version + Script: notification_text = "not supported from your device" + Expression: getAndroidSDKVersion() >= "19" + Expression: trigger == "Display Status: Aus" or trigger == "Display Status: Ein" or udef_trigger == "setLockPin" + Airplainemode + Script: airpcount = airpcount + 1 + 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" + 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" } + WLAN Verbunden: {global_apssid} + Next Alarm State + Script: amad_flowset_version = "2.0.0" + + Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE + Stromversorgung: Angeschlossen + Genereller Broadcast: wenn org.smblott.intentradio.STATE + Systemeinstellung verändert: System volume_music_headphone + App Task Gestartet: {global_activetask} + Bluetooth Status: Schaltet ein, Ein + Stromversorgung: Entfernt + Display Status: Aus + Display Orientierung: Portrait + Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS + Bluetooth Status: Schaltet aus, Aus + Daydream Status: Gestoppt + Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic + Eingehender Anruf. Status: Klingelt, Nummern: Alle + Systemeinstellung verändert: System volume_music_speaker + Systemeinstellung verändert: System screen_brightness + Display Status: Ein + Daydream Status: Gestartet + Akku Ladestand: grösser als 0% + Dock Event: Docked + com.android.music.playstatechanged + Systemeinstellung verändert: System volume_music_bt_a2dp + HTTP Request: /fhem-amad/deviceInfo/ + Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT + com.android.music.metachanged + Systemeinstellung verändert: System next_alarm + App Task Beendet: {global_activetask} + Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic + Dock Event: Undocked + Display Orientierung: Landscape + Flugmodus: Aus + Systemeinstellung verändert: System volume_ring_speaker + Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE + Benachrichtigung in Statusbar angezeigt: com.whatsapp + + Expression: global_fhemip != null + Expression: global_bridgeport == null or global_fhemip == null or global_fhemdevice == null or global_activetask == null or global_apssid == null + Prüfe und setze globale Variablen + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SetCommands + AMAD2 Info/Control Flowset v2.0.0 + true + QUEUE + 500 + + Akku Ladestand: grösser als 0% + HTTP Request: /fhem-amad/deviceInfo/ + Sprachbefehl angefordert + Display Status: Ein + HTTP Request: /fhem-amad/setCommands/* + + Expression: param_screen=="on" + Expression: setBrightness" + Expression: setScreenFullscreen" + Expression: param_orientation == "auto" + Setze Display Orientierung: Portrait + Setze Display Orientierung: Landscape + Expression: param_orientation == "landscape" + Setze Vollbild Modus: Navigation nicht anzeigen + Setze Vollbild Modus: Auf Default zurücksetzen + Expression: param_button == "back" + Expression: param_button == "next" + Setze Display Orientierung: Auf Default zurücksetzen + Expression: param_button == "play" + Expression: mediaPlayer" + Expression: param_button == "stop" + Expression: param_screen=="off" + Expression: setScreenOnOff" + Flow Aktiv: Informations + Expression: ttsMsg" + Display automatisch drehen ein-/ausschalten: Aus + Display automatisch drehen ein-/ausschalten: Ein + Expression: setScreenOrientation" + Expression: param_fullscreen == "off" + Expression: param_fullscreen == "on" + Expression: setBluetooth" + Sprachausgabe: {param_message} + Expression: param_bluetooth == "off" + Expression: param_bluetooth == "on" + Bluetooth ein-/ausschalten: Ein + Script: informationFlow_state = "inaktiv" + Bluetooth eingeschaltet + Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdeviceone} + Bluetooth Gerät verbinden/trennen: Trennen Eingabegerät {param_btdeviceone} + Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdeviceone} + Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdevicetwo} + Bluetooth Gerät verbinden/trennen: Trennen Eingabegerät {param_btdevicetwo} + Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdeviceone} + Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdevicetwo} + Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdevicetwo} + Pause: 3s (Gerät wach halten) + Bluetooth Gerät verbinden/trennen: Verbinden Advanced Audio Distribution {param_swtobtdevicemac} + Pause: 2s (Gerät wach halten) + Gerät sperren + Expression: setBTDevice" + Audio Player steuern: Medienknopf Play (Google Play Musik) + Audio Player steuern: Medienknopf Zurück (Google Play Musik) + Bluetooth ein-/ausschalten: Aus + Audio Player steuern: Medienknopf Stopp (Google Play Musik) + Expression: setVolume" + Expression: param_orientation == "portrait" + Expression: Reboot + Expression: System Command" + Neustart + Expression: Shutdown + Herunterfahren + Sound: /storage/emulated/0/Notifications/{param_notifyfile} als Benachrichtigung + Benachrichtigung aus Statusbar entfernen: Alle + Benachrichtigung aus Statusbar entfernen: Alle (Automagic) + Expression: Automagic + Expression: All + Expression: setNotifiVolume" + Expression: notifysnd" + NotificationLautstärke auf Level 7 + Notification Lautstärke Speichern + Expression: param_notifyfile == "RedAlert.mp3" + Notification Lautstärke Wiederherstellen + Expression: setVoiceCommand" + Flows ausführen: VoiceControl + Vibrieren: Pattern 2 (-- --) + Expression: Clear Automagic Meldungen" + Flugmodus ein-/ausschalten: Ein + Setze Display Helligkeit: {param_brightness} + Expression: setScreenlock" + Broadcast senden: {param_action} + Expression: sendIntent" + Setze Flow Status: Aktivieren Informations + Script: informationFlow_state = "aktiv" + Expression: Airplanemode + Pause: 1s (Gerät wach halten) + Airplainemode ON + Expression: param_lockmod == "lock" + Setze Lock PIN/Passwort: PIN/Passwort zurücksetzen + Setze Lock PIN/Passwort: Setze PIN von Variable param_lockpin + Script: udef_trigger = "setLockPin" + Flows ausführen: udef_trigger setLockPin + Lautstärken setzen param_volume + Expression: trigger == "Sprachbefehl angefordert" + WLAN Verbunden: {global_apssid} + Lautstärken setzen param_notifivolume + Setze Alarm: um {param_hour}:{param_minute} + Expression: setAlarm" + Expression: setTimer" + Setze Timer + Expression: setVibrate" + Expression: openApp" + App Starten: App + Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma} + Dateien löschen: /storage/emulated/0/Download/currentFlowsetUpdate.xml + Flows/Widgets importieren: /storage/emulated/0/Download/currentFlowsetUpdate.xml + Schalte Display ein: Hell für {param_screenontime}s + Flow Status Informations + Expression: installFlow" + App Task läuft: App (neuster) + Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*" + Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/emulated/0/Download + Expression: screenMsg" + Benachrichtigung auf Bildschirm: {param_message} (lange) + Audio Player steuern: Medienknopf Weiter (Google Play Musik) + Expression: openURL" + URL in Browser öffnen: {param_url} (mit {param_browserapp}/{param_browserappclass}) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Update AMAD Flowset + AMAD2 Flowset Updater v1.0.6 + true + PARALLEL + + HTTP Request: /fhem-amad/currentFlowsetUpdate + + Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma} + Flows/Widgets importieren: /storage/emulated/0/Download/currentFlowsetUpdate.xml + Dateien löschen: /storage/emulated/0/Download/currentFlowsetUpdate.xml + Download URL: http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml to /storage/emulated/0/Download + Prüfe und setze Bridgeport Variable + + + + + + + + VoiceControl + AMAD2 Info/Control Flowset v2.0.0 + true + QUEUE + 60 + + AMAD Voice Control + Expression: contains(value, " und ") + Benachrichtigung auf Bildschirm: {value} (lange) + Expression: value != "" + Spracheingabe wurde nicht erkannt + Setze voice Variablen + Send Voice Input Value to AMADCommBridge left + Send Voice Input Value to AMADCommBridge + + + + + + + + + + + \ No newline at end of file diff --git a/fhem/MAINTAINER.txt b/fhem/MAINTAINER.txt index d286a4aec..b0c333352 100644 --- a/fhem/MAINTAINER.txt +++ b/fhem/MAINTAINER.txt @@ -258,11 +258,13 @@ FHEM/73_km200.pm sailor http://forum.fhem.de Heizungss FHEM/73_PRESENCE.pm markusbloch http://forum.fhem.de Unterstuetzende Dienste FHEM/73_MPD.pm Wzut http://forum.fhem.de Multimedia FHEM/74_AMAD.pm CoolTux http://forum.fhem.de Unterstuetzende Dienste +FHEM/74_HOMBOT.pm CoolTux http://forum.fhem.de Unterstuetzende Dienste FHEM/74_Unifi.pm rapster http://forum.fhem.de Automatisierung FHEM/75_MSG.pm loredo http://forum.fhem.de Automatisierung FHEM/75_msgConfig.pm loredo http://forum.fhem.de Automatisierung FHEM/76_MSGFile.pm gandy http://forum.fhem.de Automatisierung FHEM/76_MSGMail.pm gandy http://forum.fhem.de Automatisierung +FHEM/77_UWZ.pm CoolTux http://forum.fhem.de Unterstuetzende Dienste FHEM/79_BDKM.pm arnoaugustin http://forum.fhem.de Heizungssteuerung/Raumklima (bitte auch PM) FHEM/80_M232.pm borisneubert http://forum.fhem.de Sonstige Systeme FHEM/80_xxLG7000.pm markusbloch http://forum.fhem.de Multimedia