Umfassende erweiterung der Fehlerbehandlung, versuch der Selbstheilung der Flows bei inaktive schalten. Erweiterte Fehlerausgabe bei Problemen mit der Verbindung zu den Geräten.
This commit is contained in:
parent
6d8e6778ed
commit
e9835d7548
529
74_AMAD.pm
529
74_AMAD.pm
@ -33,7 +33,7 @@ use Time::HiRes qw(gettimeofday);
|
||||
|
||||
use HttpUtils;
|
||||
|
||||
my $version = "0.5.8";
|
||||
my $version = "0.5.9";
|
||||
|
||||
|
||||
|
||||
@ -56,15 +56,22 @@ sub AMAD_Initialize($) {
|
||||
"port ".
|
||||
"disable:1 ";
|
||||
$hash->{AttrList} .= $readingFnAttributes;
|
||||
|
||||
|
||||
foreach my $d(sort keys %defs) {
|
||||
next if($defs{$d}{TYPE} ne "AMAD");
|
||||
$defs{$d}->{VERSION} = $version;
|
||||
}
|
||||
}
|
||||
|
||||
sub AMAD_Define($$) {
|
||||
|
||||
my ( $hash, $def ) = @_;
|
||||
my ( $hash, $def ) = @_;
|
||||
my @a = split( "[ \t][ \t]*", $def );
|
||||
|
||||
return "too few parameters: define <name> AMAD <HOST>" if ( @a != 3 );
|
||||
|
||||
|
||||
my $name = $a[0];
|
||||
my $host = $a[2];
|
||||
my $port = 8090;
|
||||
@ -74,47 +81,51 @@ sub AMAD_Define($$) {
|
||||
$hash->{PORT} = $port;
|
||||
$hash->{INTERVAL} = $interval;
|
||||
$hash->{VERSION} = $version;
|
||||
$hash->{helper}{infoErrorCounter} = 0;
|
||||
$hash->{helper}{setCmdErrorCounter} = 0;
|
||||
|
||||
Log3 $name, 3, "AMAD ($name) - defined with host $hash->{HOST} on port $hash->{HOST} and interval $hash->{INTERVAL} (sec)";
|
||||
|
||||
AMAD_GetUpdateLocal($hash);
|
||||
AMAD_GetUpdateLocal( $hash );
|
||||
|
||||
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "AMAD_GetUpdateTimer", $hash, 0);
|
||||
InternalTimer( gettimeofday()+$hash->{INTERVAL}, "AMAD_GetUpdateTimer", $hash, 0 );
|
||||
|
||||
$hash->{STATE} = "initialized";
|
||||
readingsSingleUpdate ($hash,"deviceState","online",0);
|
||||
readingsSingleUpdate ( $hash, "deviceState", "online", 0 );
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub AMAD_Undef($$) {
|
||||
my ($hash, $arg) = @_;
|
||||
|
||||
RemoveInternalTimer($hash);
|
||||
my ( $hash, $arg ) = @_;
|
||||
|
||||
RemoveInternalTimer( $hash );
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub AMAD_Attr(@) {
|
||||
my ( $cmd, $name, $attrName, $attrVal) = @_;
|
||||
|
||||
my ( $cmd, $name, $attrName, $attrVal ) = @_;
|
||||
my $hash = $defs{$name};
|
||||
|
||||
if ($attrName eq "disable") {
|
||||
if($cmd eq "set") {
|
||||
if($attrVal eq "0") {
|
||||
RemoveInternalTimer($hash);
|
||||
InternalTimer(gettimeofday()+2, "AMAD_GetUpdateTimer", $hash, 0) if ($hash->{STATE} eq "disabled");
|
||||
if( $attrName eq "disable" ) {
|
||||
if( $cmd eq "set" ) {
|
||||
if( $attrVal eq "0" ) {
|
||||
RemoveInternalTimer( $hash );
|
||||
InternalTimer( gettimeofday()+2, "AMAD_GetUpdateTimer", $hash, 0 ) if( $hash->{STATE} eq "disabled" );
|
||||
$hash->{STATE}='active';
|
||||
Log3 $name, 3, "AMAD ($name) - enabled";
|
||||
} else {
|
||||
$hash->{STATE} = 'disabled';
|
||||
RemoveInternalTimer($hash);
|
||||
RemoveInternalTimer( $hash );
|
||||
Log3 $name, 3, "AMAD ($name) - disabled";
|
||||
}
|
||||
}
|
||||
elsif ($cmd eq "del") {
|
||||
RemoveInternalTimer($hash);
|
||||
InternalTimer(gettimeofday()+2, "AMAD_GetUpdateTimer", $hash, 0) if ($hash->{STATE} eq "disabled");
|
||||
elsif( $cmd eq "del" ) {
|
||||
RemoveInternalTimer( $hash );
|
||||
InternalTimer( gettimeofday()+2, "AMAD_GetUpdateTimer", $hash, 0 ) if( $hash->{STATE} eq "disabled" );
|
||||
$hash->{STATE}='active';
|
||||
Log3 $name, 3, "AMAD ($name) - enabled";
|
||||
|
||||
@ -123,14 +134,14 @@ sub AMAD_Attr(@) {
|
||||
$attr{$name}{$attrName} = $attrVal;
|
||||
Log3 $name, 3, "AMAD ($name) - $attrName : $attrVal";
|
||||
}
|
||||
elsif ($cmd eq "del") {
|
||||
elsif( $cmd eq "del" ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($attrName eq "interval") {
|
||||
if ($cmd eq "set") {
|
||||
if ($attrVal < 60) {
|
||||
if( $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 {
|
||||
@ -138,35 +149,35 @@ sub AMAD_Attr(@) {
|
||||
Log3 $name, 3, "AMAD ($name) - set interval to $attrVal";
|
||||
}
|
||||
}
|
||||
elsif ($cmd eq "del") {
|
||||
elsif( $cmd eq "del" ) {
|
||||
$hash->{INTERVAL} = 180;
|
||||
Log3 $name, 3, "AMAD ($name) - set interval to default";
|
||||
|
||||
} else {
|
||||
if($cmd eq "set") {
|
||||
if( $cmd eq "set" ) {
|
||||
$attr{$name}{$attrName} = $attrVal;
|
||||
Log3 $name, 3, "AMAD ($name) - $attrName : $attrVal";
|
||||
}
|
||||
elsif ($cmd eq "del") {
|
||||
elsif( $cmd eq "del" ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($attrName eq "port") {
|
||||
if ($cmd eq "set") {
|
||||
if( $attrName eq "port" ) {
|
||||
if( $cmd eq "set" ) {
|
||||
$hash->{PORT} = $attrVal;
|
||||
Log3 $name, 3, "AMAD ($name) - set port to $attrVal";
|
||||
}
|
||||
elsif ($cmd eq "del") {
|
||||
elsif( $cmd eq "del" ) {
|
||||
$hash->{PORT} = 8090;
|
||||
Log3 $name, 3, "AMAD ($name) - set port to default";
|
||||
|
||||
} else {
|
||||
if($cmd eq "set") {
|
||||
if( $cmd eq "set" ) {
|
||||
$attr{$name}{$attrName} = $attrVal;
|
||||
Log3 $name, 3, "AMAD ($name) - $attrName : $attrVal";
|
||||
}
|
||||
elsif ($cmd eq "del") {
|
||||
elsif( $cmd eq "del" ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -174,34 +185,33 @@ sub AMAD_Attr(@) {
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub AMAD_GetUpdateLocal($)
|
||||
{
|
||||
my ($hash) = @_;
|
||||
sub AMAD_GetUpdateLocal($) {
|
||||
|
||||
my ( $hash ) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
|
||||
AMAD_RetrieveAutomagicInfo($hash);
|
||||
|
||||
AMAD_RetrieveAutomagicInfo( $hash ) if( ReadingsVal( $name, "deviceState", "online" ) eq "online" && $hash->{STATE} ne "initialized" && AttrVal( $name, "disable", 0 ) ne "1" ); ### deviceState muß von Hand online/offline gesetzt werden z.B. über RESIDENZ Modul
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub AMAD_GetUpdateTimer($)
|
||||
{
|
||||
my ($hash) = @_;
|
||||
sub AMAD_GetUpdateTimer($) {
|
||||
|
||||
my ( $hash ) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
AMAD_RetrieveAutomagicInfo($hash) if (ReadingsVal($name,"deviceState","online") eq "online" && $hash->{STATE} ne "disabled"); # deviceState muß von Hand online/offline gesetzt werden z.B. über RESIDENZ Modul
|
||||
AMAD_RetrieveAutomagicInfo( $hash ) if( ReadingsVal( $name, "deviceState", "online" ) eq "online" && AttrVal( $name, "disable", 0 ) ne "1" ); ### deviceState muß von Hand online/offline gesetzt werden z.B. über RESIDENZ Modul
|
||||
|
||||
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "AMAD_GetUpdateTimer", $hash, 1);
|
||||
InternalTimer( gettimeofday()+$hash->{INTERVAL}, "AMAD_GetUpdateTimer", $hash, 1 );
|
||||
Log3 $name, 4, "AMAD ($name) - Call AMAD_GetUpdateTimer";
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub AMAD_Set($$@)
|
||||
{
|
||||
my ($hash, $name, $cmd, @val) = @_;
|
||||
my $apps = AttrVal("$name","setOpenApp","none");
|
||||
sub AMAD_Set($$@) {
|
||||
|
||||
my ( $hash, $name, $cmd, @val ) = @_;
|
||||
my $apps = AttrVal( $name, "setOpenApp", "none" );
|
||||
|
||||
my $list = "";
|
||||
|
||||
@ -209,48 +219,53 @@ sub AMAD_Set($$@)
|
||||
$list .= "ttsMsg ";
|
||||
$list .= "volume:slider,0,1,15 ";
|
||||
$list .= "deviceState:online,offline ";
|
||||
$list .= "mediaPlayer:play,stop,next,back " if (AttrVal("$name","fhemServerIP","none") ne "none");
|
||||
$list .= "screenBrightness:slider,0,1,255 " if (AttrVal("$name","setScreenBrightness","0") eq "1");
|
||||
$list .= "mediaPlayer:play,stop,next,back " if( AttrVal( $name, "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","0") eq "1");
|
||||
$list .= "screenFullscreen:on,off " if (AttrVal("$name","setFullscreen","0") eq "1");
|
||||
$list .= "screenOrientation:auto,landscape,portrait " if( AttrVal( $name, "setScreenOrientation", "1" ) eq "1" );
|
||||
$list .= "screenFullscreen:on,off " if( AttrVal( $name, "setFullscreen", "1" ) eq "1" );
|
||||
$list .= "openURL ";
|
||||
$list .= "openApp:$apps " if (AttrVal("$name","setOpenApp","none") ne "none");
|
||||
$list .= "openApp:$apps " if( AttrVal( $name, "setOpenApp", "none" ) ne "none" );
|
||||
$list .= "nextAlarmTime:time ";
|
||||
$list .= "statusRequest:noArg ";
|
||||
$list .= "system:reboot " if (AttrVal("$name","root","none") ne "none");
|
||||
$list .= "system:reboot " if( AttrVal( $name, "root", "1" ) eq "1" );
|
||||
|
||||
|
||||
if (lc $cmd eq 'screenmsg'
|
||||
|| lc $cmd eq 'ttsmsg'
|
||||
|| lc $cmd eq 'volume'
|
||||
|| lc $cmd eq 'mediaplayer'
|
||||
|| lc $cmd eq 'devicestate'
|
||||
|| lc $cmd eq 'screenbrightness'
|
||||
|| lc $cmd eq 'screenorientation'
|
||||
|| lc $cmd eq 'screenfullscreen'
|
||||
|| lc $cmd eq 'screen'
|
||||
|| lc $cmd eq 'openurl'
|
||||
|| lc $cmd eq 'openapp'
|
||||
|| lc $cmd eq 'nextalarmtime'
|
||||
|| lc $cmd eq 'system'
|
||||
|| lc $cmd eq 'statusrequest') {
|
||||
if (lc $cmd eq 'screenmsg'
|
||||
|| lc $cmd eq 'ttsmsg'
|
||||
|| lc $cmd eq 'volume'
|
||||
|| lc $cmd eq 'mediaplayer'
|
||||
|| lc $cmd eq 'devicestate'
|
||||
|| lc $cmd eq 'screenbrightness'
|
||||
|| lc $cmd eq 'screenorientation'
|
||||
|| lc $cmd eq 'screenfullscreen'
|
||||
|| lc $cmd eq 'screen'
|
||||
|| lc $cmd eq 'openurl'
|
||||
|| lc $cmd eq 'openapp'
|
||||
|| lc $cmd eq 'nextalarmtime'
|
||||
|| lc $cmd eq 'system'
|
||||
|| lc $cmd eq 'statusrequest') {
|
||||
|
||||
Log3 $name, 5, "AMAD ($name) - set $name $cmd ".join(" ", @val);
|
||||
return AMAD_SelectSetCmd ($hash, $cmd, @val) if (@val)
|
||||
|| (lc $cmd eq 'statusrequest');
|
||||
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( $hash->{STATE} 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 )
|
||||
|| ( lc $cmd eq 'statusrequest' );
|
||||
}
|
||||
|
||||
return "Unknown argument $cmd, bearword as argument or wrong parameter(s), choose one of $list";
|
||||
}
|
||||
|
||||
sub AMAD_RetrieveAutomagicInfo($)
|
||||
{
|
||||
sub AMAD_RetrieveAutomagicInfo($) {
|
||||
|
||||
my ($hash) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
my $host = $hash->{HOST};
|
||||
my $port = $hash->{PORT};
|
||||
my $fhemip = AttrVal("$name","fhemServerIP","none");
|
||||
my $fhemip = AttrVal( $name, "fhemServerIP", "none" );
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/deviceInfo/"; # Path muß so im Automagic als http request Trigger drin stehen
|
||||
|
||||
@ -269,8 +284,8 @@ sub AMAD_RetrieveAutomagicInfo($)
|
||||
Log3 $name, 4, "AMAD ($name) - AMAD_RetrieveAutomagicInfo: calling Host: $host";
|
||||
}
|
||||
|
||||
sub AMAD_RetrieveAutomagicInfoFinished($$$)
|
||||
{
|
||||
sub AMAD_RetrieveAutomagicInfoFinished($$$) {
|
||||
|
||||
my ( $param, $err, $data ) = @_;
|
||||
my $hash = $param->{hash};
|
||||
my $doTrigger = $param->{doTrigger};
|
||||
@ -282,62 +297,109 @@ sub AMAD_RetrieveAutomagicInfoFinished($$$)
|
||||
|
||||
|
||||
### Begin Error Handling
|
||||
if (defined($err)) {
|
||||
if ($err ne "") {
|
||||
$hash->{STATE} = $err if ($hash->{STATE} ne "initialized");
|
||||
if( $hash->{helper}{infoErrorCounter} > 2 ) {
|
||||
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";
|
||||
|
||||
readingsBulkUpdate( $hash, "deviceState", "offline" );
|
||||
$hash->{STATE} = "AMAD Flows inactive, device set offline";
|
||||
}
|
||||
elsif( $hash->{helper}{infoErrorCounter} > 4 && $hash->{helper}{setCmdErrorCounter} > 2 ) {
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestError", "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";
|
||||
|
||||
readingsBulkUpdate( $hash, "deviceState", "offline" );
|
||||
$hash->{STATE} = "To many Errors, device set offline";
|
||||
}
|
||||
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";
|
||||
}
|
||||
elsif($hash->{helper}{infoErrorCounter} > 4 && ReadingsVal( $name, "flow_Informations", "active" ) eq "active" ){
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestError", "check automagicApp on your device" );
|
||||
|
||||
Log3 $name, 4, "AMAD ($name) - Please check the AutomagicAPP on your Device";
|
||||
} else {
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestError", "unknown error, please contact the developer" );
|
||||
|
||||
Log3 $name, 4, "AMAD ($name) - UNKNOWN ERROR, PLEASE CONTACT THE DEVELOPER, DEVICE DISABLED";
|
||||
|
||||
$hash->{STATE} = "Unknown Error, device disabled";
|
||||
|
||||
$attr{$name}{disable} = 1;
|
||||
}
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
}
|
||||
|
||||
if( defined( $err ) ) {
|
||||
if( $err ne "" ) {
|
||||
$hash->{STATE} = $err if( $hash->{STATE} ne "initialized" );
|
||||
$hash->{helper}{infoErrorCounter} = ( $hash->{helper}{infoErrorCounter} + 1 );
|
||||
|
||||
readingsBeginUpdate ($hash);
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestState","statusRequest_error");
|
||||
readingsBeginUpdate( $hash );
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" );
|
||||
|
||||
if ($err =~ /timed out/) {
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestError","connect to your device is timed out. check network");
|
||||
if( $err =~ /timed out/ ) {
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestError", "connect to your device is timed out. check network ");
|
||||
}
|
||||
elsif ($err =~ /Keine Route zum Zielrechner/) {
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestError","no route to target. bad network configuration or network is down");
|
||||
elsif( ( $err =~ /Keine Route zum Zielrechner/ ) && $hash->{helper}{infoErrorCounter} > 1 ) {
|
||||
readingsBulkUpdate( $hash,"lastStatusRequestError", "no route to target. bad network configuration or network is down ");
|
||||
} else {
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestError","$err");
|
||||
readingsBulkUpdate($hash, "lastStatusRequestError", "$err" );
|
||||
}
|
||||
|
||||
readingsEndUpdate ($hash,1);
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
|
||||
Log3 $name, 5, "AMAD ($name) - AMAD_RetrieveAutomagicInfoFinished: error while requesting AutomagicInfo: $err";
|
||||
Log3 $name, 4, "AMAD ($name) - AMAD_RetrieveAutomagicInfoFinished: error while requesting AutomagicInfo: $err";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if($data eq "" and exists($param->{code})) {
|
||||
$hash->{STATE} = $param->{code} if ($hash->{STATE} ne "initialized");
|
||||
if( $data eq "" and exists( $param->{code} ) ) {
|
||||
$hash->{STATE} = $param->{code} if( $hash->{STATE} ne "initialized" );
|
||||
$hash->{helper}{infoErrorCounter} = ( $hash->{helper}{infoErrorCounter} + 1 );
|
||||
|
||||
readingsBeginUpdate ($hash);
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestState","statusRequest_error");
|
||||
readingsBeginUpdate( $hash );
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" );
|
||||
|
||||
if ($param->{code} ne 200) {
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestError","http Error ".$param->{code});
|
||||
if( $param->{code} ne 200 ) {
|
||||
readingsBulkUpdate( $hash," lastStatusRequestError", "http Error ".$param->{code} );
|
||||
}
|
||||
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestError","empty response, check automagic on your device");
|
||||
readingsEndUpdate ($hash,1);
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestError", "empty response, check automagicApp on your device" );
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
|
||||
Log3 $name, 5, "AMAD ($name) - AMAD_RetrieveAutomagicInfoFinished: received http code ".$param->{code}." without any data after requesting AMAD AutomagicInfo";
|
||||
Log3 $name, 4, "AMAD ($name) - AMAD_RetrieveAutomagicInfoFinished: received http code ".$param->{code}." without any data after requesting AMAD AutomagicInfo";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if($data =~ /\Error/i and exists($param->{code})) {
|
||||
$hash->{STATE} = $param->{code} if ($hash->{STATE} ne "initialized");
|
||||
if( ( $data =~ /Error/i ) and exists( $param->{code} ) ) {
|
||||
$hash->{STATE} = $param->{code} if( $hash->{STATE} ne "initialized" );
|
||||
$hash->{helper}{infoErrorCounter} = ( $hash->{helper}{infoErrorCounter} + 1 );
|
||||
|
||||
readingsBeginUpdate($hash);
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestState","statusRequest_error");
|
||||
readingsBeginUpdate( $hash );
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_error" );
|
||||
|
||||
if ($param->{code} eq 404) {
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestError","automagic information flow is inactive on your device!");
|
||||
if( $param->{code} eq 404 && ReadingsVal( $name, "flow_Informations", "inactive" ) eq "inactive" ) {
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestError", "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" );
|
||||
} else {
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestError","http error ".$param->{code});
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestError", "http error ".$param->{code} );
|
||||
}
|
||||
|
||||
readingsEndUpdate ($hash,1);
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
|
||||
Log3 $name, 5, "AMAD ($name) - AMAD_RetrieveAutomagicInfoFinished: received http code ".$param->{code}." receive Error after requesting AMAD AutomagicInfo";
|
||||
Log3 $name, 4, "AMAD ($name) - AMAD_RetrieveAutomagicInfoFinished: received http code ".$param->{code}." receive Error after requesting AMAD AutomagicInfo";
|
||||
|
||||
return;
|
||||
}
|
||||
@ -347,48 +409,43 @@ sub AMAD_RetrieveAutomagicInfoFinished($$$)
|
||||
|
||||
|
||||
### Begin Response Processing
|
||||
$hash->{STATE} = "active" if ($hash->{STATE} eq "initialized" || $hash->{STATE} ne "active");
|
||||
$hash->{STATE} = "active" if( $hash->{STATE} eq "initialized" || $hash->{STATE} ne "active" );
|
||||
$hash->{helper}{infoErrorCounter} = 0;
|
||||
|
||||
my @valuestring = split('@@@@', $data);
|
||||
my @valuestring = split( '@@@@', $data );
|
||||
my %buffer;
|
||||
foreach (@valuestring) {
|
||||
my @values = split('@@', $_);
|
||||
foreach( @valuestring ) {
|
||||
my @values = split( '@@' , $_ );
|
||||
$buffer{$values[0]} = $values[1];
|
||||
}
|
||||
|
||||
|
||||
readingsBeginUpdate($hash);
|
||||
readingsBeginUpdate( $hash );
|
||||
|
||||
my $t;
|
||||
my $v;
|
||||
while (($t, $v) = each %buffer) {
|
||||
while( ( $t, $v ) = each %buffer ) {
|
||||
$v =~ s/null//g;
|
||||
readingsBulkUpdate($hash, $t, $v) if (defined($v));
|
||||
readingsBulkUpdate( $hash, $t, $v ) if( defined( $v ) );
|
||||
}
|
||||
|
||||
readingsBulkUpdate ($hash,"lastStatusRequestState","statusRequest_done");
|
||||
readingsBulkUpdate( $hash, "lastStatusRequestState", "statusRequest_done" );
|
||||
|
||||
readingsEndUpdate($hash, 1);
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
### End Response Processing
|
||||
|
||||
$hash->{STATE} = "active" if ($hash->{STATE} eq "initialized");
|
||||
$hash->{STATE} = "active" if( $hash->{STATE} eq "initialized" );
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub AMAD_HTTP_POST($$)
|
||||
{
|
||||
my ($hash, $url) = @_;
|
||||
sub AMAD_HTTP_POST($$) {
|
||||
|
||||
my ( $hash, $url ) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
my $state = $hash->{STATE};
|
||||
|
||||
if ($hash->{STATE} eq "initialized")
|
||||
{
|
||||
Log3 $name, 3, "AMAD ($name) - AMAD_HTTP_POST: set command only works if STATE active, please wait for next interval run";
|
||||
return "set command only works if STATE not equal initialized, please wait for next interval run";
|
||||
}
|
||||
|
||||
$hash->{STATE} = "Send HTTP POST";
|
||||
|
||||
HttpUtils_NonblockingGet(
|
||||
@ -408,30 +465,71 @@ sub AMAD_HTTP_POST($$)
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub AMAD_HTTP_POSTerrorHandling($$$)
|
||||
{
|
||||
sub AMAD_HTTP_POSTerrorHandling($$$) {
|
||||
|
||||
my ( $param, $err, $data ) = @_;
|
||||
my $hash = $param->{hash};
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
|
||||
### Begin Error Handling
|
||||
if (defined($err)) {
|
||||
if ($err ne "") {
|
||||
$hash->{STATE} = $err if ($hash->{STATE} ne "initialized");
|
||||
if($hash->{helper}{setCmdErrorCounter} > 2 ) {
|
||||
readingsBeginUpdate( $hash );
|
||||
readingsBulkUpdate( $hash, "lastSetCommandState", "statusRequest_error" );
|
||||
|
||||
if( ReadingsVal( $name, "flow_Informations", "active" ) eq "inactive" && ReadingsVal( $name, "flow_SetCommands", "active" ) eq "inactive" ) {
|
||||
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";
|
||||
|
||||
readingsBulkUpdate( $hash, "deviceState", "offline" );
|
||||
$hash->{STATE} = "AMAD Flows inactive, device set offline";
|
||||
}
|
||||
elsif( $hash->{helper}{infoErrorCounter} > 4 && $hash->{helper}{setCmdErrorCounter} > 2 ) {
|
||||
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";
|
||||
|
||||
readingsBulkUpdate( $hash, "deviceState", "offline" );
|
||||
$hash->{STATE} = "To many Errors, device set offline";
|
||||
}
|
||||
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";
|
||||
}
|
||||
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";
|
||||
} else {
|
||||
readingsBulkUpdate( $hash, "lastSetCommandError", "unknown error, please contact the developer" );
|
||||
|
||||
Log3 $name, 4, "AMAD ($name) - UNKNOWN ERROR, PLEASE CONTACT THE DEVELOPER, DEVICE DISABLED";
|
||||
|
||||
$hash->{STATE} = "Unknown Error, device disabled";
|
||||
|
||||
$attr{$name}{disable} = 1;
|
||||
}
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
}
|
||||
|
||||
if( defined( $err ) ) {
|
||||
if( $err ne "" ) {
|
||||
$hash->{STATE} = $err if( $hash->{STATE} ne "initialized" );
|
||||
$hash->{helper}{setCmdErrorCounter} = ($hash->{helper}{setCmdErrorCounter} + 1);
|
||||
|
||||
readingsBeginUpdate ($hash);
|
||||
readingsBulkUpdate ($hash,"lastSetCommandState","cmd_error");
|
||||
readingsBeginUpdate( $hash );
|
||||
readingsBulkUpdate( $hash, "lastSetCommandState", "cmd_error" );
|
||||
|
||||
if ($err =~ /timed out/) {
|
||||
readingsBulkUpdate ($hash,"lastSetCommandError","connect to your device is timed out. check network");
|
||||
if( $err =~ /timed out/ ) {
|
||||
readingsBulkUpdate( $hash, "lastSetCommandError", "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");
|
||||
elsif( $err =~ /Keine Route zum Zielrechner/ ) {
|
||||
readingsBulkUpdate( $hash, "lastSetCommandError", "no route to target. bad network configuration or network is down" );
|
||||
} else {
|
||||
readingsBulkUpdate ($hash,"lastSetCommandError","$err");
|
||||
readingsBulkUpdate( $hash, "lastSetCommandError", "$err" );
|
||||
}
|
||||
readingsEndUpdate ($hash,1);
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
|
||||
Log3 $name, 5, "AMAD ($name) - AMAD_HTTP_POST: error while POST Command: $err";
|
||||
|
||||
@ -439,54 +537,56 @@ sub AMAD_HTTP_POSTerrorHandling($$$)
|
||||
}
|
||||
}
|
||||
|
||||
if($data eq "" and exists($param->{code})) {
|
||||
$hash->{STATE} = $param->{code} if ($hash->{STATE} ne "initialized");
|
||||
if( $data eq "" and exists( $param->{code} ) ) {
|
||||
$hash->{STATE} = $param->{code} if( $hash->{STATE} ne "initialized" );
|
||||
$hash->{helper}{setCmdErrorCounter} = ( $hash->{helper}{setCmdErrorCounter} + 1 );
|
||||
|
||||
readingsBeginUpdate ($hash);
|
||||
readingsBeginUpdate( $hash );
|
||||
|
||||
if ($param->{code} ne 200) {
|
||||
readingsBulkUpdate ($hash,"lastSetCommandState","cmd_error");
|
||||
readingsBulkUpdate ($hash,"lastSetCommandError","http Error ".$param->{code});
|
||||
if( $param->{code} ne 200 ) {
|
||||
readingsBulkUpdate($hash, "lastSetCommandState", "cmd_error" );
|
||||
readingsBulkUpdate($hash, "lastSetCommandError", "http Error ".$param->{code} );
|
||||
}
|
||||
readingsBulkUpdate ($hash,"lastSetCommandState","cmd_done");
|
||||
readingsEndUpdate ($hash,1);
|
||||
readingsBulkUpdate( $hash, "lastSetCommandState" ,"cmd_done" );
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
|
||||
Log3 $name, 5, "AMAD ($name) - AMAD_HTTP_POST: received http code ".$param->{code};
|
||||
|
||||
Log3 $name, 4, "AMAD ($name) - Starte Update GetUpdateLocal";
|
||||
AMAD_GetUpdateLocal($hash);
|
||||
AMAD_GetUpdateLocal( $hash );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if($data =~ /Error/i and exists($param->{code})) {
|
||||
$hash->{STATE} = $param->{code} if ($hash->{STATE} ne "initialized");
|
||||
if( ( $data =~ /Error/i ) and exists( $param->{code} ) ) {
|
||||
$hash->{STATE} = $param->{code} if( $hash->{STATE} ne "initialized" );
|
||||
$hash->{helper}{setCmdErrorCounter} = ( $hash->{helper}{setCmdErrorCounter} + 1 );
|
||||
|
||||
readingsBeginUpdate($hash);
|
||||
readingsBulkUpdate ($hash,"lastSetCommandState","cmd_error");
|
||||
readingsBeginUpdate( $hash );
|
||||
readingsBulkUpdate( $hash, "lastSetCommandState", "cmd_error" );
|
||||
|
||||
if ($param->{code} eq 404) {
|
||||
readingsBulkUpdate ($hash,"lastSetCommandError","automagic setcommand flow is inactive on your device!");
|
||||
if( $param->{code} eq 404 ) {
|
||||
readingsBulkUpdate( $hash, "lastSetCommandError", "setCommands flow is inactive on your device!" );
|
||||
} else {
|
||||
readingsBulkUpdate ($hash,"lastSetCommandError","http error ".$param->{code});
|
||||
readingsBulkUpdate( $hash, "lastSetCommandError", "http error ".$param->{code} );
|
||||
}
|
||||
}
|
||||
|
||||
readingsEndUpdate ($hash,1);
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
### End Error Handling
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub AMAD_SelectSetCmd($$@)
|
||||
{
|
||||
my ($hash, $cmd, @data) = @_;
|
||||
sub AMAD_SelectSetCmd($$@) {
|
||||
|
||||
my ( $hash, $cmd, @data ) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
my $host = $hash->{HOST};
|
||||
my $port = $hash->{PORT};
|
||||
|
||||
if (lc $cmd eq 'screenmsg') {
|
||||
my $msg = join(" ", @data);
|
||||
if( lc $cmd eq 'screenmsg' ) {
|
||||
my $msg = join( " ", @data );
|
||||
|
||||
$msg =~ s/%/%25/g;
|
||||
$msg =~ s/\s/%20/g;
|
||||
@ -494,116 +594,116 @@ sub AMAD_SelectSetCmd($$@)
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/screenMsg?message=$msg";
|
||||
Log3 $name, 4, "AMAD ($name) - Sub AMAD_SetScreenMsg";
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash,$url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'ttsmsg') {
|
||||
my $msg = join(" ", @data);
|
||||
elsif( lc $cmd eq 'ttsmsg' ) {
|
||||
my $msg = join( " ", @data );
|
||||
|
||||
$msg =~ s/%/%25/g;
|
||||
$msg =~ s/\s/%20/g;
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/ttsMsg?message=$msg";
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash,$url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'volume') {
|
||||
my $vol = join(" ", @data);
|
||||
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);
|
||||
readingsSingleUpdate( $hash, $cmd, $vol, 1 );
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash, $url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'mediaplayer') {
|
||||
my $btn = join(" ", @data);
|
||||
elsif( lc $cmd eq 'mediaplayer' ) {
|
||||
my $btn = join( " ", @data );
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/mediaPlayer?button=$btn";
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash,$url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'devicestate') {
|
||||
my $v = join(" ", @data);
|
||||
elsif( lc $cmd eq 'devicestate' ) {
|
||||
my $v = join( " ", @data );
|
||||
|
||||
readingsSingleUpdate ($hash,$cmd,$v,1);
|
||||
readingsSingleUpdate( $hash, $cmd, $v, 1 );
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'screenbrightness') {
|
||||
my $bri = join(" ", @data);
|
||||
elsif( lc $cmd eq 'screenbrightness' ) {
|
||||
my $bri = join( " ", @data );
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setBrightness?brightness=$bri";
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash,$url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'screen') {
|
||||
my $mod = join(" ", @data);
|
||||
elsif( lc $cmd eq 'screen' ) {
|
||||
my $mod = join( " ", @data );
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setScreenOnOff?screen=$mod";
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash,$url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'screenorientation') {
|
||||
my $mod = join(" ", @data);
|
||||
elsif( lc $cmd eq 'screenorientation' ) {
|
||||
my $mod = join( " ", @data );
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setScreenOrientation?orientation=$mod";
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash,$url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'screenfullscreen') {
|
||||
my $mod = join(" ", @data);
|
||||
elsif( lc $cmd eq 'screenfullscreen' ) {
|
||||
my $mod = join( " ", @data );
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setScreenFullscreen?fullscreen=$mod";
|
||||
|
||||
readingsSingleUpdate ($hash,$cmd,$mod,1);
|
||||
readingsSingleUpdate( $hash, $cmd, $mod, 1 );
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash, $url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'openurl') {
|
||||
my $openurl = join(" ", @data);
|
||||
elsif( lc $cmd eq 'openurl' ) {
|
||||
my $openurl = join( " ", @data );
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/openURL?url=$openurl";
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash, $url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'nextalarmtime') {
|
||||
my $alarmTime = join(" ", @data);
|
||||
my @alarm = split(":", $alarmTime);
|
||||
my $alarmTime = join( " ", @data );
|
||||
my @alarm = split( ":", $alarmTime );
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/setAlarm?hour=".$alarm[0]."&minute=".$alarm[1];
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash, $url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'statusrequest') {
|
||||
AMAD_GetUpdateLocal($hash);
|
||||
elsif( lc $cmd eq 'statusrequest' ) {
|
||||
AMAD_GetUpdateLocal( $hash );
|
||||
return undef;
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'openapp') {
|
||||
my $app = join(" ", @data);
|
||||
elsif( lc $cmd eq 'openapp' ) {
|
||||
my $app = join( " ", @data );
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/openApp?app=$app";
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash,$url );
|
||||
}
|
||||
|
||||
elsif (lc $cmd eq 'system') {
|
||||
my $systemcmd = join(" ", @data);
|
||||
elsif( lc $cmd eq 'system' ) {
|
||||
my $systemcmd = join( " ", @data );
|
||||
|
||||
my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/systemcommand?syscmd=$systemcmd";
|
||||
|
||||
return AMAD_HTTP_POST ($hash,$url);
|
||||
return AMAD_HTTP_POST( $hash,$url );
|
||||
}
|
||||
|
||||
return undef;
|
||||
@ -635,6 +735,8 @@ sub AMAD_SelectSetCmd($$@)
|
||||
Im Auslieferiungszustand werden folgende Zustände dargestellt:
|
||||
<ul>
|
||||
<li>Zustand von Automagic auf dem Gerät</li>
|
||||
<li>Bluetooth An/Aus</li>
|
||||
<li>verbundene Bluetoothgeräte</li>
|
||||
<li>aktuell abgespieltes Musikalbum des verwendeten Mediaplayers</li>
|
||||
<li>aktuell abgespielter Musikinterpret des verwendeten Mediaplayers</li>
|
||||
<li>aktuell abgespielter Musiktitel des verwendeten Mediaplayers</li>
|
||||
@ -653,7 +755,7 @@ sub AMAD_SelectSetCmd($$@)
|
||||
</ul>
|
||||
<br>
|
||||
Mit etwas Einarbeitung können jegliche Informationen welche Automagic bereit stellt in FHEM angezeigt werden. Hierzu bedarf es lediglich
|
||||
einer kleinen Anpassung des "Information" Flows
|
||||
einer kleinen Anpassung des "Informations" Flows
|
||||
<br><br>
|
||||
Das Modul gibt Dir auch die Möglichkeit Deine Androidgeräte zu steuern. So können folgende Aktionen durchgeführt werden.
|
||||
<ul>
|
||||
@ -678,11 +780,8 @@ sub AMAD_SelectSetCmd($$@)
|
||||
<br><br>
|
||||
<b>Wie genau verwendet man nun AMAD?</b>
|
||||
<ul>
|
||||
<li>Installiert Euch die App "Automagic Premium" aus dem App Store oder die Testversion von <a href="https://automagic4android.com/de/testversion">hier</a></li>
|
||||
<li>ladet Euch das AMAD Modul und die Flowfiles von <a href="https://github.com/LeonGaultier/fhem-AMAD">GitHub</a> runter</li>
|
||||
<li>installiert die zwei Flows und aktiviert erstmal nur den "Information" Flow, eventuell bei den <a href="https://github.com/LeonGaultier/fhem-AMAD/tree/master/Flow_Updates">
|
||||
FlowUpdates</a> mal schauen ob es was neueres gibt und den entsprechenden Flow auf dem Gerät löschen und den neuen Flow von GitHub installieren</li>
|
||||
<li>kopiert die Moduldatei 74_AMAD.pm nach $FHEMPATH/FHEM. Geht auf die FHEM Frontendseite und gebt dort in der Kommandozeile <i>reload 74_AMAD.pm</i> ein</li>
|
||||
<li>installiert Euch die App "Automagic Premium" aus dem App Store oder die Testversion von <a href="https://automagic4android.com/de/testversion">hier</a></li>
|
||||
<li>installiert das Flowset 74_AMADautomagicFlows$VERSION.xml aus dem Ordner $INSTALLFHEM/FHEM/lib/ auf Eurem Androidgerät und aktiviert erstmal nur den "Informations" Flow.</li>
|
||||
</ul>
|
||||
<br>
|
||||
Nun müsst Ihr nur noch ein Device in FHEM anlegen.
|
||||
@ -690,31 +789,34 @@ sub AMAD_SelectSetCmd($$@)
|
||||
<a name="AMADdefine"></a>
|
||||
<b>Define</b>
|
||||
<ul><br>
|
||||
<code>define <name> AMAD <IP-ADRESSE> <PORT> <INTERVAL></code>
|
||||
<code>define <name> AMAD <IP-ADRESSE></code>
|
||||
<br><br>
|
||||
Beispiel:
|
||||
<ul><br>
|
||||
<code>define WandTabletWohnzimmer AMAD 192.168.0.23 8090 180</code><br>
|
||||
<code>define WandTabletWohnzimmer AMAD 192.168.0.23</code><br>
|
||||
</ul>
|
||||
<br>
|
||||
Diese Anweisung erstellt ein neues AMAD-Device. Die Parameter IP-ADRESSE und PORT legen die IP Adresse des Android Gerätes
|
||||
sowie den, in den Flows des Trigger HTTP Request, angegebenen Port fest.<br>INTERVAL ist der Zeitabstand in dem ein erneuter Informationsabruf stattfinden soll. Alle x Sekunden.
|
||||
Bei mir hat sich 180 gut bewährt, also alle 3 Minuten<br>
|
||||
<u><b>Bitte gebt für sofortige Erfolge als Port 8090 ein, das ist der Port der in den mitgelieferten Automagic Flows als Trigger Port eingetragen ist.<br>
|
||||
Dieser kann später mit Erfahrung auch geändert werden</b></u>
|
||||
Diese Anweisung erstellt ein neues AMAD-Device. Der Parameter <IP-ADRESSE< legt die IP Adresse des Android Gerätes fest.<br>
|
||||
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. <b>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.</b><br>
|
||||
</ul>
|
||||
<br><br>
|
||||
Fertig! Nach anlegen des Devices sollten bereits die ersten Readings reinkommen.
|
||||
<b><u>Fertig! Nach anlegen der Geräteinstanz sollten nach spätestens 3 Minuten bereits die ersten Readings reinkommen.</u></b>
|
||||
<br><br>
|
||||
<a name="AMADreadings"></a>
|
||||
<b>Readings</b>
|
||||
<ul>
|
||||
<li>automagicState - Statusmeldungen von der AutomagicApp</li>
|
||||
<li>bluetooth on/off - ist auf dem Gerät Bluetooth an oder aus</li>
|
||||
<li>connectedBTdevices - eine Lieste der verbundenen Gerät</li>
|
||||
<li>currentMusicAlbum - aktuell abgespieltes Musikalbum des verwendeten Mediaplayers</li>
|
||||
<li>currentMusicArtist - aktuell abgespielter Musikinterpret des verwendeten Mediaplayers</li>
|
||||
<li>currentMusicTrack - aktuell abgespielter Musiktitel des verwendeten Mediaplayers</li>
|
||||
<li>deviceState - Status des Androidgerätes, muss selbst mit setreading gesetzt werden z.B. über die Anwesenheitskontrolle.<br>
|
||||
Ist Offline gesetzt, wird der Intervall zum Informationsabruf aus gesetzt.</li>
|
||||
<li>flow_SetCommands active/inactive - gibt den Status des SetCommands Flow wieder</li>
|
||||
<li>flow_informations active/inactive - gibt den Status des Informations Flow wieder</li>
|
||||
<li>lastSetCommandError - letzte Fehlermeldung vom set Befehl</li>
|
||||
<li>lastSetCommandState - letzter Status vom set Befehl, Befehl erfolgreich/nicht erfolgreich gesendet</li>
|
||||
<li>lastStatusRequestError - letzte Fehlermeldung vom statusRequest Befehl</li>
|
||||
@ -754,7 +856,7 @@ sub AMAD_SelectSetCmd($$@)
|
||||
<li>mediaPlayer - steuert den Standard Mediaplayer. play, stop, Titel zürück, Titel vor. <b>Attribut fhemServerIP</b></li>
|
||||
<li>openApp - öffnet eine ausgewählte App. <b>Attribut setOpenApp</b></li>
|
||||
<li>screenBrightness - setzt die Bildschirmhelligkeit, von 0-255 <b>Attribut setScreenBrightness</b></li>
|
||||
Wenn Ihr das "set screenBrightness" verwenden wollt, muss eine kleine Anpassung im Flow SetCommand vorgenommen werden. Öffnet die Aktion (eines der Vierecke ganz ganz unten)
|
||||
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".
|
||||
<li>screenFullscreen - Schaltet den Vollbildmodus on/off. <b>Attribut setFullscreen</b></li>
|
||||
<li>screenOrientation - Schaltet die Bildschirmausrichtung Auto/Landscape/Portait. <b>Attribut setScreenOrientation</b></li>
|
||||
@ -769,7 +871,8 @@ sub AMAD_SelectSetCmd($$@)
|
||||
<b>STATE</b>
|
||||
<ul>
|
||||
<li>initialized - Ist der Status kurz nach einem define..</li>
|
||||
<li>activ - Das Modul ist im aktiven Status.</li>
|
||||
<li>active - die Geräteinstanz ist im aktiven Status.</li>
|
||||
<li>disabled - die Geräteinstanz wurde über das Attribut disable deaktiviert</li>
|
||||
</ul>
|
||||
<br><br><br>
|
||||
<u><b>Anwendungsbeispiele:</b></u>
|
||||
|
@ -18,16 +18,16 @@ global_album = getString("album");</extras>
|
||||
<receiveInitialStickyBroadcast>false</receiveInitialStickyBroadcast>
|
||||
</trigger>
|
||||
<trigger type="http_request">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>HTTP Request: /fhem-amad/deviceInfo/, Port 8090</name>
|
||||
<useDefaultName>false</useDefaultName>
|
||||
<name>HTTP Request: /fhem-amad/deviceInfo/</name>
|
||||
<enabled>true</enabled>
|
||||
<path>/fhem-amad/deviceInfo/</path>
|
||||
<port>8090</port>
|
||||
<acquireWifiLock>true</acquireWifiLock>
|
||||
</trigger>
|
||||
<trigger type="http_request">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>HTTP Request: /fhem-amad/setCommands/*, Port 8090</name>
|
||||
<useDefaultName>false</useDefaultName>
|
||||
<name>HTTP Request: /fhem-amad/setCommands/*</name>
|
||||
<enabled>true</enabled>
|
||||
<path>/fhem-amad/setCommands/*</path>
|
||||
<port>8090</port>
|
||||
@ -79,6 +79,17 @@ global_album = getString("album");</extras>
|
||||
<ignoreRegular>false</ignoreRegular>
|
||||
<ignoreOngoing>false</ignoreOngoing>
|
||||
</condition>
|
||||
<condition type="bluetooth_enabled">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Bluetooth eingeschaltet</name>
|
||||
</condition>
|
||||
<condition type="bluetooth_device_connected">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Bluetooth Gerät verbunden: Beliebiges Geräte</name>
|
||||
<any>true</any>
|
||||
<deviceAddress></deviceAddress>
|
||||
<deviceName></deviceName>
|
||||
</condition>
|
||||
<condition type="auto_rotate_screen_enabled">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Display automatisch drehen eingeschaltet</name>
|
||||
@ -242,6 +253,11 @@ global_album = getString("album");</extras>
|
||||
<name>Expression: trigger == "com.android.music.metachanged"</name>
|
||||
<expression>trigger == "com.android.music.metachanged"</expression>
|
||||
</condition>
|
||||
<condition type="expression">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*"</name>
|
||||
<expression>trigger == "HTTP Request: /fhem-amad/setCommands/*"</expression>
|
||||
</condition>
|
||||
<condition type="expression">
|
||||
<useDefaultName>false</useDefaultName>
|
||||
<name>Expression: ttsMsg"</name>
|
||||
@ -252,6 +268,16 @@ global_album = getString("album");</extras>
|
||||
<name>Expression: tuneinradio</name>
|
||||
<expression>param_app == "tuneinradio"</expression>
|
||||
</condition>
|
||||
<condition type="flow_enabled">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Flow Aktiv: Informations</name>
|
||||
<flowName>Informations</flowName>
|
||||
</condition>
|
||||
<condition type="flow_enabled">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Flow Aktiv: SetCommands</name>
|
||||
<flowName>SetCommands</flowName>
|
||||
</condition>
|
||||
<condition type="music_active">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Musik Aktiv</name>
|
||||
@ -381,8 +407,15 @@ global_album = getString("album");</extras>
|
||||
</action>
|
||||
<action type="write_http_response_text">
|
||||
<useDefaultName>false</useDefaultName>
|
||||
<name>HTTP Response</name>
|
||||
<text>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}</text>
|
||||
<name>HTTP Response Information</name>
|
||||
<text>powerLevel@@{battery_percentage}@@@@powerPlugged@@{battery_plugged}@@@@volumeMusikBluetooth@@{volumeMusikBluetooth}@@@@volumeMusikSpeaker@@{volumeMusikSpeaker}@@@@screenBrightness@@{screenBrightness}@@@@nextAlarmTime@@{next_alarmtime}@@@@nextAlarmDay@@{next_alarmday}@@@@screen@@{screen_state}@@@@automagicState@@{notification_text}@@@@screenOrientation@@{screen_orientation}@@@@currentMusicTrack@@{global_track}@@@@currentMusicAlbum@@{global_album}@@@@currentMusicArtist@@{global_artist}@@@@bluetooth@@{bluetooth_state}@@@@connectedBTdevices@@{connected_devices_names}@@@@flow_SetCommands@@{setCommandFlow_state}</text>
|
||||
<replaceVariables>true</replaceVariables>
|
||||
<contentType>text/plain</contentType>
|
||||
</action>
|
||||
<action type="write_http_response_text">
|
||||
<useDefaultName>false</useDefaultName>
|
||||
<name>HTTP Response SetCommand</name>
|
||||
<text>flow_informations@@{informationFlow_state}@@@@</text>
|
||||
<replaceVariables>true</replaceVariables>
|
||||
<contentType>text/plain</contentType>
|
||||
</action>
|
||||
@ -452,6 +485,16 @@ global_album = getString("album");</extras>
|
||||
<duration>120s</duration>
|
||||
<resetUserActivityTimer>true</resetUserActivityTimer>
|
||||
</action>
|
||||
<action type="script">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Script: bluetooth_state = "off"</name>
|
||||
<script>bluetooth_state = "off"</script>
|
||||
</action>
|
||||
<action type="script">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Script: bluetooth_state = "on"</name>
|
||||
<script>bluetooth_state = "on"</script>
|
||||
</action>
|
||||
<action type="script">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Script: global_artist = "no soundplayer activ"; global_track = "no soundplayer activ"; global_album = "no soundplayer activ";</name>
|
||||
@ -465,6 +508,16 @@ global_album = "no soundplayer activ";</script>
|
||||
<script>global_fhemip = {header_fhemip}
|
||||
global_fhemdevice = {header_fhemdevice}</script>
|
||||
</action>
|
||||
<action type="script">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Script: informationFlow_state = "aktiv"</name>
|
||||
<script>informationFlow_state = "aktiv"</script>
|
||||
</action>
|
||||
<action type="script">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Script: informationFlow_state = "inaktiv"</name>
|
||||
<script>informationFlow_state = "inaktiv"</script>
|
||||
</action>
|
||||
<action type="script">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Script: next_alarmday = "{next_alarm,dateformat,c}"</name>
|
||||
@ -505,6 +558,16 @@ global_fhemdevice = {header_fhemdevice}</script>
|
||||
<name>Script: screen_state = "on"</name>
|
||||
<script>screen_state = "on"</script>
|
||||
</action>
|
||||
<action type="script">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Script: setCommandFlow_state = "aktiv"</name>
|
||||
<script>setCommandFlow_state = "aktiv"</script>
|
||||
</action>
|
||||
<action type="script">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Script: setCommandFlow_state = "inaktiv"</name>
|
||||
<script>setCommandFlow_state = "inaktiv"</script>
|
||||
</action>
|
||||
<action type="set_alarm">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Setze Alarm: um {param_hour}:{param_minute}</name>
|
||||
@ -530,6 +593,20 @@ global_fhemdevice = {header_fhemdevice}</script>
|
||||
<screenOrientation>PORTRAIT</screenOrientation>
|
||||
<showResetNotification>false</showResetNotification>
|
||||
</action>
|
||||
<action type="set_flow_state">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Setze Flow Status: Aktivieren Informations</name>
|
||||
<enable>true</enable>
|
||||
<includeFlowNamePatternList>Informations</includeFlowNamePatternList>
|
||||
<excludeFlowNamePatternList></excludeFlowNamePatternList>
|
||||
</action>
|
||||
<action type="set_flow_state">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Setze Flow Status: Aktivieren SetCommands</name>
|
||||
<enable>true</enable>
|
||||
<includeFlowNamePatternList>SetCommands</includeFlowNamePatternList>
|
||||
<excludeFlowNamePatternList></excludeFlowNamePatternList>
|
||||
</action>
|
||||
<action type="set_system_setting">
|
||||
<useDefaultName>true</useDefaultName>
|
||||
<name>Setze Systemeinstellung: System screen_brightness auf {param_brightness}</name>
|
||||
@ -577,207 +654,241 @@ global_fhemdevice = {header_fhemdevice}</script>
|
||||
</action>
|
||||
<flow type="flow">
|
||||
<name>Informations</name>
|
||||
<group>FHEM Info / Steuerung über AMAD Modul</group>
|
||||
<group>FHEM Info / Steuerung über AMAD Modul v0.6</group>
|
||||
<enabled>true</enabled>
|
||||
<executionPolicy>STOP</executionPolicy>
|
||||
<emergencyStopCount>120</emergencyStopCount>
|
||||
<actioncontainer id="t1" x="770.0" y="857.5">Script: next_alarmday = "{next_alarm,dateformat,c}"</actioncontainer>
|
||||
<conditioncontainer id="t2" x="1120.0" y="612.5">Display eingeschaltet</conditioncontainer>
|
||||
<actioncontainer id="t3" x="1015.0" y="857.5">Script: screen_state = "on"</actioncontainer>
|
||||
<actioncontainer id="t4" x="1890.0" y="857.50024">Script: screen_orientation = "portrait"</actioncontainer>
|
||||
<actioncontainer id="t5" x="2099.9998" y="857.5">Script: screen_orientation = "landscape"</actioncontainer>
|
||||
<conditioncontainer id="t6" x="1995.0002" y="682.4999">Display Orientierung: Portrait</conditioncontainer>
|
||||
<actioncontainer id="t7" x="-175.0" y="612.5">Initialisiere Variable Systemeinstellung: volumeMusikBluetooth</actioncontainer>
|
||||
<actioncontainer id="t8" x="70.0" y="612.5">Initialisiere Variable Systemeinstellung: volumeMusikSpeaker</actioncontainer>
|
||||
<actioncontainer id="t9" x="350.0" y="612.5">Initialisiere Variable Systemeinstellung: screenBrightness</actioncontainer>
|
||||
<actioncontainer id="t10" x="665.0" y="612.5">Initialisiere Variable Nächster Alarm: next_alarm</actioncontainer>
|
||||
<conditioncontainer id="t11" x="1680.0002" y="612.5001">Display automatisch drehen eingeschaltet</conditioncontainer>
|
||||
<actioncontainer id="t12" x="560.0" y="857.5">Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}"</actioncontainer>
|
||||
<conditioncontainer id="t13" x="1015.0" y="-822.50006">Expression: trigger == "com.android.music.metachanged"</conditioncontainer>
|
||||
<actioncontainer id="t14" x="1225.0" y="857.5">Script: screen_state = "off"</actioncontainer>
|
||||
<conditioncontainer id="t15" x="1015.0" y="-227.50002">Akku Ladestand: grösser als 0%</conditioncontainer>
|
||||
<actioncontainer id="t16" x="700.0002" y="-122.49997">Script: global_fhemip = {header_fhemip} global_fhemdevice = {header_fhemdevice}</actioncontainer>
|
||||
<conditioncontainer id="t17" x="630.0" y="-367.50003">Expression: global_fhemip == "null"</conditioncontainer>
|
||||
<conditioncontainer id="t18" x="770.0" y="-367.50003">Expression: global_fhemdevice == "null"</conditioncontainer>
|
||||
<conditioncontainer id="t19" x="-419.99997" y="612.5">Musik Aktiv</conditioncontainer>
|
||||
<triggercontainer id="t20" x="1015.0001" y="-1102.4998">
|
||||
<trigger>HTTP Request: /fhem-amad/deviceInfo/, Port 8090</trigger>
|
||||
<conditioncontainer id="t1" x="1435.0" y="612.5">Benachrichtigung in Statusbar angezeigt: Automagic</conditioncontainer>
|
||||
<actioncontainer id="t2" x="1505.0" y="857.5">Script: notification_text = "no supported from your device"</actioncontainer>
|
||||
<actioncontainer id="t3" x="1715.0" y="857.5">Script: screen_orientation = "auto"</actioncontainer>
|
||||
<conditioncontainer id="t4" x="1715.0" y="612.5">Display automatisch drehen eingeschaltet</conditioncontainer>
|
||||
<actioncontainer id="t5" x="1925.0" y="857.5">Script: screen_orientation = "portrait"</actioncontainer>
|
||||
<conditioncontainer id="t6" x="2030.0005" y="682.5">Display Orientierung: Portrait</conditioncontainer>
|
||||
<actioncontainer id="t7" x="2135.0" y="857.5">Script: screen_orientation = "landscape"</actioncontainer>
|
||||
<conditioncontainer id="t8" x="2450.0" y="612.5">Bluetooth eingeschaltet</conditioncontainer>
|
||||
<actioncontainer id="t9" x="2345.0" y="857.5">Script: bluetooth_state = "on"</actioncontainer>
|
||||
<conditioncontainer id="t10" x="2485.0" y="857.4999">Bluetooth Gerät verbunden: Beliebiges Geräte</conditioncontainer>
|
||||
<actioncontainer id="t11" x="2625.0" y="857.5">Script: bluetooth_state = "off"</actioncontainer>
|
||||
<actioncontainer id="t12" x="1295.0" y="857.5">Script: screen_state = "off"</actioncontainer>
|
||||
<actioncontainer id="t13" x="1085.0" y="857.5">Script: screen_state = "on"</actioncontainer>
|
||||
<conditioncontainer id="t14" x="1190.0" y="612.5">Display eingeschaltet</conditioncontainer>
|
||||
<actioncontainer id="t15" x="665.0" y="857.5">Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}"</actioncontainer>
|
||||
<actioncontainer id="t16" x="770.0" y="612.5">Initialisiere Variable Nächster Alarm: next_alarm</actioncontainer>
|
||||
<actioncontainer id="t17" x="875.0" y="857.5">Script: next_alarmday = "{next_alarm,dateformat,c}"</actioncontainer>
|
||||
<actioncontainer id="t18" x="490.0" y="612.5">Initialisiere Variable Systemeinstellung: screenBrightness</actioncontainer>
|
||||
<actioncontainer id="t19" x="280.0" y="612.5">Initialisiere Variable Systemeinstellung: volumeMusikSpeaker</actioncontainer>
|
||||
<actioncontainer id="t20" x="70.00001" y="612.5">Initialisiere Variable Systemeinstellung: volumeMusikBluetooth</actioncontainer>
|
||||
<actioncontainer id="t21" x="735.0" y="-682.5">HTTP Request: GET http://{global_fhemip}:8085/fhem?cmd=set%20{global_fhemdevice}%20statusRequest speichern in response</actioncontainer>
|
||||
<conditioncontainer id="t22" x="665.0" y="-332.5">Expression: global_fhemip == "null"</conditioncontainer>
|
||||
<conditioncontainer id="t23" x="805.0" y="-332.5">Expression: global_fhemdevice == "null"</conditioncontainer>
|
||||
<actioncontainer id="t24" x="735.0" y="-87.500015">Script: global_fhemip = {header_fhemip} global_fhemdevice = {header_fhemdevice}</actioncontainer>
|
||||
<actioncontainer id="t25" x="1014.9999" y="-332.5">Pause: 2s (Gerät wach halten)</actioncontainer>
|
||||
<conditioncontainer id="t26" x="-140.0" y="612.5">Musik Aktiv</conditioncontainer>
|
||||
<actioncontainer id="t27" x="-140.0" y="857.5">Script: global_artist = "no soundplayer activ"; global_track = "no soundplayer activ"; global_album = "no soundplayer activ";</actioncontainer>
|
||||
<conditioncontainer id="t28" x="1015.00024" y="-87.500015">Akku Ladestand: grösser als 0%</conditioncontainer>
|
||||
<conditioncontainer id="t29" x="-455.0" y="612.5">Flow Aktiv: SetCommands</conditioncontainer>
|
||||
<actioncontainer id="t30" x="-350.0" y="857.5">Script: setCommandFlow_state = "aktiv"</actioncontainer>
|
||||
<conditioncontainer id="t31" x="1015.0" y="-822.5">Expression: trigger == "com.android.music.metachanged"</conditioncontainer>
|
||||
<triggercontainer id="t32" x="1015.0" y="-1172.5">
|
||||
<trigger>com.android.music.metachanged</trigger>
|
||||
<trigger>HTTP Request: /fhem-amad/deviceInfo/</trigger>
|
||||
</triggercontainer>
|
||||
<actioncontainer id="t21" x="1015.00024" y="-472.5">Pause: 2s (Gerät wach halten)</actioncontainer>
|
||||
<actioncontainer id="t22" x="-420.00003" y="857.5">Script: global_artist = "no soundplayer activ"; global_track = "no soundplayer activ"; global_album = "no soundplayer activ";</actioncontainer>
|
||||
<actioncontainer id="t23" x="1680.0" y="857.50024">Script: screen_orientation = "auto"</actioncontainer>
|
||||
<actioncontainer id="t24" x="1015.0001" y="1487.5">HTTP Response</actioncontainer>
|
||||
<conditioncontainer id="t25" x="1435.0" y="612.5">Benachrichtigung in Statusbar angezeigt: Automagic</conditioncontainer>
|
||||
<actioncontainer id="t26" x="1505.0" y="857.5">Script: notification_text = "no supported from your device"</actioncontainer>
|
||||
<actioncontainer id="t27" x="699.99976" y="-717.5">HTTP Request: GET http://{global_fhemip}:8085/fhem?cmd=set%20{global_fhemdevice}%20statusRequest speichern in response</actioncontainer>
|
||||
<connection from="t1" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t2" to="t3" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t2" to="t14" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t3" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t4" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t5" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t6" to="t4" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t6" to="t5" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t7" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t8" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t9" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t10" to="t12" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t10" to="t1" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t11" to="t6" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t11" to="t23" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t12" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t13" to="t27" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t13" to="t21" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t13" to="t17" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t13" to="t18" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t14" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t15" to="t7" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t15" to="t8" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t15" to="t9" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t15" to="t10" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t15" to="t2" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t15" to="t25" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t15" to="t11" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t15" to="t19" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t17" to="t16" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t18" to="t16" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t19" to="t22" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t20" to="t13" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t21" to="t15" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t22" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t23" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t25" to="t26" type="EXCEPTION" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t25" to="t24" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t26" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<actioncontainer id="t33" x="-560.0" y="857.5">Script: setCommandFlow_state = "inaktiv"</actioncontainer>
|
||||
<actioncontainer id="t34" x="-664.99976" y="1032.4999">Setze Flow Status: Aktivieren SetCommands</actioncontainer>
|
||||
<actioncontainer id="t35" x="1015.0001" y="1487.5">HTTP Response Information</actioncontainer>
|
||||
<connection from="t1" to="t2" type="EXCEPTION" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t1" to="t35" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t2" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t3" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t4" to="t6" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t4" to="t3" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t5" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t6" to="t5" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t6" to="t7" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t7" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t8" to="t9" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t8" to="t11" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t8" to="t10" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t10" to="t35" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t11" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t12" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t13" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t14" to="t13" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t14" to="t12" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t15" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t16" to="t15" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t16" to="t17" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t17" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t18" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t19" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t20" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t22" to="t24" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t23" to="t24" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t25" to="t28" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t26" to="t27" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t27" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t28" to="t20" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t28" to="t19" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t28" to="t18" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t28" to="t16" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t28" to="t14" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t28" to="t1" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t28" to="t4" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t28" to="t26" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t28" to="t8" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t28" to="t29" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t29" to="t30" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t29" to="t33" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t30" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t31" to="t21" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t31" to="t25" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t31" to="t22" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t31" to="t23" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t32" to="t31" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t33" to="t35" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t33" to="t34" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
</flow>
|
||||
<flow type="flow">
|
||||
<name>SetCommands</name>
|
||||
<group>FHEM Info / Steuerung über AMAD Modul</group>
|
||||
<group>FHEM Info / Steuerung über AMAD Modul v0.6</group>
|
||||
<enabled>true</enabled>
|
||||
<executionPolicy>QUEUE</executionPolicy>
|
||||
<emergencyStopCount>120</emergencyStopCount>
|
||||
<conditioncontainer id="t1" x="-1610.0" y="367.5">Expression: param_screen=="off"</conditioncontainer>
|
||||
<conditioncontainer id="t2" x="-1435.0" y="367.5">Expression: param_screen=="on"</conditioncontainer>
|
||||
<actioncontainer id="t3" x="-175.0" y="892.5">Audio Player steuern: Medienknopf Stopp (Google Play Musik)</actioncontainer>
|
||||
<conditioncontainer id="t4" x="70.0" y="577.5">Expression: param_button == "play"</conditioncontainer>
|
||||
<actioncontainer id="t5" x="70.0" y="892.5">Audio Player steuern: Medienknopf Play (Google Play Musik)</actioncontainer>
|
||||
<actioncontainer id="t6" x="315.0" y="892.5">Audio Player steuern: Medienknopf Weiter (Google Play Musik)</actioncontainer>
|
||||
<conditioncontainer id="t7" x="315.0" y="577.5">Expression: param_button == "next"</conditioncontainer>
|
||||
<actioncontainer id="t8" x="560.0" y="892.5">Audio Player steuern: Medienknopf Zurück (Google Play Musik)</actioncontainer>
|
||||
<actioncontainer id="t9" x="-1225.0" y="892.5">Sprachausgabe: {param_message}</actioncontainer>
|
||||
<conditioncontainer id="t10" x="-175.0" y="577.5">Expression: param_button == "stop"</conditioncontainer>
|
||||
<conditioncontainer id="t11" x="560.0" y="577.5">Expression: param_button == "back"</conditioncontainer>
|
||||
<conditioncontainer id="t12" x="1680.0" y="577.5">Expression: param_orientation == "portrait"</conditioncontainer>
|
||||
<conditioncontainer id="t13" x="875.0" y="577.5">Expression: param_fullscreen == "on"</conditioncontainer>
|
||||
<conditioncontainer id="t14" x="1084.9999" y="577.50006">Expression: param_fullscreen == "off"</conditioncontainer>
|
||||
<actioncontainer id="t15" x="1085.0" y="892.5">Setze Vollbild Modus: Auf Default zurücksetzen</actioncontainer>
|
||||
<actioncontainer id="t16" x="-2835.0" y="892.5">App Starten: tuneinradio</actioncontainer>
|
||||
<conditioncontainer id="t17" x="-1820.0" y="-122.5">Expression: setVolume"</conditioncontainer>
|
||||
<conditioncontainer id="t18" x="-1225.0" y="-122.5">Expression: ttsMsg"</conditioncontainer>
|
||||
<conditioncontainer id="t19" x="-1015.0" y="-122.5">Expression: setBrightness"</conditioncontainer>
|
||||
<conditioncontainer id="t20" x="-805.0" y="-122.5">Expression: setAlarm"</conditioncontainer>
|
||||
<conditioncontainer id="t21" x="-595.0" y="-122.5">Expression: screenMsg"</conditioncontainer>
|
||||
<conditioncontainer id="t22" x="-385.0" y="-122.5">Expression: openURL"</conditioncontainer>
|
||||
<conditioncontainer id="t23" x="175.0" y="-122.5">Expression: mediaPlayer"</conditioncontainer>
|
||||
<conditioncontainer id="t24" x="979.9999" y="-122.49999">Expression: setScreenFullscreen"</conditioncontainer>
|
||||
<conditioncontainer id="t25" x="1680.0" y="-122.499985">Expression: setScreenOrientation"</conditioncontainer>
|
||||
<actioncontainer id="t26" x="-1820.0" y="892.5">Lautstärken setzen</actioncontainer>
|
||||
<actioncontainer id="t27" x="-1015.0" y="892.5">Setze Systemeinstellung: System screen_brightness auf {param_brightness}</actioncontainer>
|
||||
<actioncontainer id="t28" x="-805.0" y="892.5">Setze Alarm: um {param_hour}:{param_minute}</actioncontainer>
|
||||
<actioncontainer id="t29" x="-385.0" y="892.5">URL in Browser öffnen: {param_url} (mit Chrome)</actioncontainer>
|
||||
<actioncontainer id="t30" x="-595.0" y="892.5">Benachrichtigung auf Bildschirm: {param_message} (lange)</actioncontainer>
|
||||
<actioncontainer id="t31" x="875.0" y="892.5">Setze Vollbild Modus: Navigation nicht anzeigen</actioncontainer>
|
||||
<actioncontainer id="t32" x="-1610.0" y="892.5">Gerät sperren</actioncontainer>
|
||||
<actioncontainer id="t33" x="-1435.0" y="892.5">Schalte Display ein: Hell für 120s</actioncontainer>
|
||||
<actioncontainer id="t34" x="-2590.0" y="892.5">App Starten: App3</actioncontainer>
|
||||
<actioncontainer id="t35" x="-2345.0" y="892.5">App Starten: App4</actioncontainer>
|
||||
<actioncontainer id="t36" x="-2099.9998" y="892.5">App Starten: App5</actioncontainer>
|
||||
<conditioncontainer id="t37" x="-2590.0" y="367.50027">Expression: App3</conditioncontainer>
|
||||
<conditioncontainer id="t38" x="-2345.0" y="367.50027">Expression: App4</conditioncontainer>
|
||||
<conditioncontainer id="t39" x="-2100.0" y="367.50027">Expression: App5</conditioncontainer>
|
||||
<conditioncontainer id="t40" x="-2590.0" y="577.5">App Task läuft: App3 (neuster)</conditioncontainer>
|
||||
<conditioncontainer id="t41" x="-2345.0" y="577.5">App Task läuft: App4 (neuster)</conditioncontainer>
|
||||
<conditioncontainer id="t42" x="-2100.0" y="577.5">App Task läuft: App5 (neuster)</conditioncontainer>
|
||||
<conditioncontainer id="t43" x="-2590.0" y="-122.49996">Expression: openApp"</conditioncontainer>
|
||||
<conditioncontainer id="t44" x="-1610.0" y="-122.5">Expression: setScreenOnOff"</conditioncontainer>
|
||||
<conditioncontainer id="t45" x="-3815.0" y="-122.49997">Expression: System Command"</conditioncontainer>
|
||||
<actioncontainer id="t46" x="-3080.0" y="892.5">App Starten: PlayMusic</actioncontainer>
|
||||
<conditioncontainer id="t47" x="-3815.0" y="367.50027">Expression: Reboot</conditioncontainer>
|
||||
<triggercontainer id="t48" x="-1015.0002" y="-962.5001">
|
||||
<trigger>HTTP Request: /fhem-amad/setCommands/*, Port 8090</trigger>
|
||||
<conditioncontainer id="t1" x="-1435.0" y="367.5">Expression: param_screen=="on"</conditioncontainer>
|
||||
<actioncontainer id="t2" x="-1225.0" y="892.5">Sprachausgabe: {param_message}</actioncontainer>
|
||||
<conditioncontainer id="t3" x="-1225.0" y="-122.5">Expression: ttsMsg"</conditioncontainer>
|
||||
<conditioncontainer id="t4" x="-1015.0" y="-122.5">Expression: setBrightness"</conditioncontainer>
|
||||
<conditioncontainer id="t5" x="-805.0" y="-122.5">Expression: setAlarm"</conditioncontainer>
|
||||
<conditioncontainer id="t6" x="-595.0" y="-122.5">Expression: screenMsg"</conditioncontainer>
|
||||
<conditioncontainer id="t7" x="-385.0" y="-122.5">Expression: openURL"</conditioncontainer>
|
||||
<actioncontainer id="t8" x="-805.0" y="892.5">Setze Alarm: um {param_hour}:{param_minute}</actioncontainer>
|
||||
<actioncontainer id="t9" x="-385.0" y="892.5">URL in Browser öffnen: {param_url} (mit Chrome)</actioncontainer>
|
||||
<actioncontainer id="t10" x="-595.0" y="892.5">Benachrichtigung auf Bildschirm: {param_message} (lange)</actioncontainer>
|
||||
<actioncontainer id="t11" x="-1435.0" y="892.5">Schalte Display ein: Hell für 120s</actioncontainer>
|
||||
<conditioncontainer id="t12" x="770.0" y="-122.50001">Expression: setScreenFullscreen"</conditioncontainer>
|
||||
<conditioncontainer id="t13" x="1505.0" y="577.5">Expression: param_orientation == "auto"</conditioncontainer>
|
||||
<actioncontainer id="t14" x="1295.0" y="892.5">Setze Display Orientierung: Portrait</actioncontainer>
|
||||
<actioncontainer id="t15" x="1084.9999" y="892.5">Setze Display Orientierung: Landscape</actioncontainer>
|
||||
<conditioncontainer id="t16" x="1084.9999" y="577.5">Expression: param_orientation == "landscape"</conditioncontainer>
|
||||
<conditioncontainer id="t17" x="1295.0" y="577.5">Expression: param_orientation == "portrait"</conditioncontainer>
|
||||
<conditioncontainer id="t18" x="875.0" y="577.5">Expression: param_fullscreen == "off"</conditioncontainer>
|
||||
<actioncontainer id="t19" x="665.0" y="892.5">Setze Vollbild Modus: Navigation nicht anzeigen</actioncontainer>
|
||||
<conditioncontainer id="t20" x="665.0" y="577.5">Expression: param_fullscreen == "on"</conditioncontainer>
|
||||
<actioncontainer id="t21" x="875.0" y="892.5">Setze Vollbild Modus: Auf Default zurücksetzen</actioncontainer>
|
||||
<actioncontainer id="t22" x="455.0" y="892.5">Audio Player steuern: Medienknopf Zurück (Google Play Musik)</actioncontainer>
|
||||
<conditioncontainer id="t23" x="455.0" y="577.5">Expression: param_button == "back"</conditioncontainer>
|
||||
<actioncontainer id="t24" x="1190.0" y="1032.4999">Display automatisch drehen ein-/ausschalten: Aus</actioncontainer>
|
||||
<conditioncontainer id="t25" x="245.0" y="577.5">Expression: param_button == "next"</conditioncontainer>
|
||||
<actioncontainer id="t26" x="1505.0" y="892.5">Setze Display Orientierung: Auf Default zurücksetzen</actioncontainer>
|
||||
<actioncontainer id="t27" x="1505.0" y="1032.4999">Display automatisch drehen ein-/ausschalten: Ein</actioncontainer>
|
||||
<actioncontainer id="t28" x="35.0" y="892.5">Audio Player steuern: Medienknopf Play (Google Play Musik)</actioncontainer>
|
||||
<conditioncontainer id="t29" x="35.0" y="577.5">Expression: param_button == "play"</conditioncontainer>
|
||||
<conditioncontainer id="t30" x="139.99997" y="-122.5">Expression: mediaPlayer"</conditioncontainer>
|
||||
<actioncontainer id="t31" x="245.0" y="892.5">Audio Player steuern: Medienknopf Weiter (Google Play Musik)</actioncontainer>
|
||||
<actioncontainer id="t32" x="-175.0" y="892.5">Audio Player steuern: Medienknopf Stopp (Google Play Musik)</actioncontainer>
|
||||
<conditioncontainer id="t33" x="-175.0" y="577.5">Expression: param_button == "stop"</conditioncontainer>
|
||||
<conditioncontainer id="t34" x="-1645.0" y="367.5">Expression: param_screen=="off"</conditioncontainer>
|
||||
<actioncontainer id="t35" x="-1645.0" y="892.5">Gerät sperren</actioncontainer>
|
||||
<conditioncontainer id="t36" x="-1540.0" y="-122.49999">Expression: setScreenOnOff"</conditioncontainer>
|
||||
<conditioncontainer id="t37" x="-1855.0" y="-122.49998">Expression: setVolume"</conditioncontainer>
|
||||
<actioncontainer id="t38" x="-1855.0" y="892.5">Lautstärken setzen</actioncontainer>
|
||||
<conditioncontainer id="t39" x="-2065.0" y="577.50006">App Task läuft: App5 (neuster)</conditioncontainer>
|
||||
<conditioncontainer id="t40" x="-2065.0" y="367.5">Expression: App5</conditioncontainer>
|
||||
<conditioncontainer id="t41" x="-2275.0" y="367.5">Expression: App4</conditioncontainer>
|
||||
<conditioncontainer id="t42" x="-2485.0" y="577.50006">App Task läuft: App3 (neuster)</conditioncontainer>
|
||||
<conditioncontainer id="t43" x="-2485.0" y="367.5">Expression: App3</conditioncontainer>
|
||||
<actioncontainer id="t44" x="-2485.0" y="892.5">App Starten: App3</actioncontainer>
|
||||
<actioncontainer id="t45" x="-2275.0" y="892.5">App Starten: App4</actioncontainer>
|
||||
<conditioncontainer id="t46" x="-2275.0" y="577.50006">App Task läuft: App4 (neuster)</conditioncontainer>
|
||||
<conditioncontainer id="t47" x="-2695.0" y="367.5">Expression: tuneinradio</conditioncontainer>
|
||||
<conditioncontainer id="t48" x="-2695.0" y="577.50006">App Task läuft: tuneinradio (neuster)</conditioncontainer>
|
||||
<actioncontainer id="t49" x="-2695.0" y="892.5">App Starten: tuneinradio</actioncontainer>
|
||||
<actioncontainer id="t50" x="-2065.0" y="892.5">App Starten: App5</actioncontainer>
|
||||
<conditioncontainer id="t51" x="-2905.0" y="577.5">App Task läuft: gplay (neuster)</conditioncontainer>
|
||||
<conditioncontainer id="t52" x="-2905.0" y="367.5">Expression: gplay</conditioncontainer>
|
||||
<actioncontainer id="t53" x="-2905.0" y="892.5">App Starten: PlayMusic</actioncontainer>
|
||||
<conditioncontainer id="t54" x="-2485.0" y="-122.5">Expression: openApp"</conditioncontainer>
|
||||
<conditioncontainer id="t55" x="-3115.0" y="-122.499985">Expression: System Command"</conditioncontainer>
|
||||
<conditioncontainer id="t56" x="1295.0" y="-122.49999">Expression: setScreenOrientation"</conditioncontainer>
|
||||
<conditioncontainer id="t57" x="-3115.0" y="367.5">Expression: Reboot</conditioncontainer>
|
||||
<actioncontainer id="t58" x="-3115.0" y="892.5">Neustart </actioncontainer>
|
||||
<conditioncontainer id="t59" x="-1294.9995" y="-2012.4998">Flow Aktiv: Informations</conditioncontainer>
|
||||
<conditioncontainer id="t60" x="-805.0" y="-2012.5005">Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*"</conditioncontainer>
|
||||
<actioncontainer id="t61" x="-1189.9995" y="-1767.5002">Script: informationFlow_state = "aktiv"</actioncontainer>
|
||||
<actioncontainer id="t62" x="-1399.9999" y="-1767.5002">Script: informationFlow_state = "inaktiv"</actioncontainer>
|
||||
<triggercontainer id="t63" x="-805.0" y="-2327.5002">
|
||||
<trigger>HTTP Request: /fhem-amad/deviceInfo/</trigger>
|
||||
<trigger>HTTP Request: /fhem-amad/setCommands/*</trigger>
|
||||
</triggercontainer>
|
||||
<actioncontainer id="t49" x="-3430.0" y="892.5">Neustart </actioncontainer>
|
||||
<actioncontainer id="t50" x="1680.0" y="892.5">Setze Display Orientierung: Portrait</actioncontainer>
|
||||
<actioncontainer id="t51" x="1470.0" y="892.5">Setze Display Orientierung: Landscape</actioncontainer>
|
||||
<conditioncontainer id="t52" x="1470.0" y="577.5">Expression: param_orientation == "landscape"</conditioncontainer>
|
||||
<actioncontainer id="t53" x="1575.0" y="1032.4996">Display automatisch drehen ein-/ausschalten: Aus</actioncontainer>
|
||||
<actioncontainer id="t54" x="1890.0" y="892.5">Setze Display Orientierung: Auf Default zurücksetzen</actioncontainer>
|
||||
<actioncontainer id="t55" x="1890.0" y="1032.4996">Display automatisch drehen ein-/ausschalten: Ein</actioncontainer>
|
||||
<conditioncontainer id="t56" x="1890.0" y="577.5">Expression: param_orientation == "auto"</conditioncontainer>
|
||||
<conditioncontainer id="t57" x="-3080.0" y="367.50027">Expression: gplay</conditioncontainer>
|
||||
<conditioncontainer id="t58" x="-3080.0" y="577.5">App Task läuft: gplay (neuster)</conditioncontainer>
|
||||
<conditioncontainer id="t59" x="-2835.0" y="577.5">App Task läuft: tuneinradio (neuster)</conditioncontainer>
|
||||
<conditioncontainer id="t60" x="-2835.0" y="367.50027">Expression: tuneinradio</conditioncontainer>
|
||||
<connection from="t1" to="t32" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t2" to="t33" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t4" to="t5" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t7" to="t6" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t10" to="t3" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t11" to="t8" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t12" to="t50" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t13" to="t31" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t14" to="t15" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t17" to="t26" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t18" to="t9" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t19" to="t27" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t20" to="t28" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t21" to="t30" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t22" to="t29" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t23" to="t10" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t23" to="t4" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t23" to="t7" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t23" to="t11" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t24" to="t13" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t24" to="t14" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t25" to="t12" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t25" to="t52" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t25" to="t56" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t37" to="t40" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t38" to="t41" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t39" to="t42" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t40" to="t34" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t41" to="t35" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t42" to="t36" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t43" to="t37" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t43" to="t57" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t43" to="t60" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t43" to="t38" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t43" to="t39" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t44" to="t1" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t44" to="t2" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t45" to="t47" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t47" to="t49" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t43" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t17" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t44" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t18" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t19" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t20" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t21" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t22" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t23" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t25" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t45" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t50" to="t53" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t51" to="t53" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<actioncontainer id="t64" x="-1539.9998" y="-1522.5004">Setze Flow Status: Aktivieren Informations</actioncontainer>
|
||||
<actioncontainer id="t65" x="-1015.0" y="892.5">Setze Systemeinstellung: System screen_brightness auf {param_brightness}</actioncontainer>
|
||||
<actioncontainer id="t66" x="-1295.0" y="-1382.5">HTTP Response SetCommand</actioncontainer>
|
||||
<connection from="t1" to="t11" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t3" to="t2" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t4" to="t65" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t5" to="t8" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t6" to="t10" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t7" to="t9" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t12" to="t20" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t12" to="t18" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t13" to="t26" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t14" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t15" to="t24" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t16" to="t15" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t17" to="t14" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t18" to="t21" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t20" to="t19" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t23" to="t22" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t25" to="t31" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t26" to="t27" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t29" to="t28" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t30" to="t33" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t30" to="t29" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t30" to="t25" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t30" to="t23" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t33" to="t32" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t34" to="t35" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t36" to="t34" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t36" to="t1" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t37" to="t38" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t39" to="t50" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t40" to="t39" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t41" to="t46" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t42" to="t44" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t43" to="t42" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t46" to="t45" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t47" to="t48" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t48" to="t49" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t51" to="t53" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t52" to="t51" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t54" to="t55" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t56" to="t54" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t54" to="t43" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t54" to="t52" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t54" to="t47" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t54" to="t41" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t54" to="t40" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t55" to="t57" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t56" to="t17" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t56" to="t16" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t56" to="t13" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t57" to="t58" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t58" to="t46" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t59" to="t16" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t59" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t59" to="t62" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t59" to="t61" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t55" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t54" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t37" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t36" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t3" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t4" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t5" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t6" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t7" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t30" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t12" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t56" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t60" to="t59" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t61" to="t66" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t62" to="t64" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t62" to="t66" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
<connection from="t63" to="t60" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
|
||||
</flow>
|
||||
</data>
|
35
README.md
35
README.md
@ -6,6 +6,8 @@
|
||||
Im Auslieferiungszustand werden folgende Zustände dargestellt:
|
||||
<ul>
|
||||
<li>Zustand von Automagic auf dem Gerät</li>
|
||||
<li>Bluetooth An/Aus</li>
|
||||
<li>verbundene Bluetoothgeräte</li>
|
||||
<li>aktuell abgespieltes Musikalbum des verwendeten Mediaplayers</li>
|
||||
<li>aktuell abgespielter Musikinterpret des verwendeten Mediaplayers</li>
|
||||
<li>aktuell abgespielter Musiktitel des verwendeten Mediaplayers</li>
|
||||
@ -24,7 +26,7 @@
|
||||
</ul>
|
||||
<br>
|
||||
Mit etwas Einarbeitung können jegliche Informationen welche Automagic bereit stellt in FHEM angezeigt werden. Hierzu bedarf es lediglich
|
||||
einer kleinen Anpassung des "Information" Flows
|
||||
einer kleinen Anpassung des "Informations" Flows
|
||||
<br><br>
|
||||
Das Modul gibt Dir auch die Möglichkeit Deine Androidgeräte zu steuern. So können folgende Aktionen durchgeführt werden.
|
||||
<ul>
|
||||
@ -49,11 +51,8 @@
|
||||
<br><br>
|
||||
<b>Wie genau verwendet man nun AMAD?</b>
|
||||
<ul>
|
||||
<li>Installiert Euch die App "Automagic Premium" aus dem App Store oder die Testversion von <a href="https://automagic4android.com/de/testversion">hier</a></li>
|
||||
<li>ladet Euch das AMAD Modul und die Flowfiles von <a href="https://github.com/LeonGaultier/fhem-AMAD">GitHub</a> runter</li>
|
||||
<li>installiert die zwei Flows und aktiviert erstmal nur den "Information" Flow, eventuell bei den <a href="https://github.com/LeonGaultier/fhem-AMAD/tree/master/Flow_Updates">
|
||||
FlowUpdates</a> mal schauen ob es was neueres gibt und den entsprechenden Flow auf dem Gerät löschen und den neuen Flow von GitHub installieren</li>
|
||||
<li>kopiert die Moduldatei 74_AMAD.pm nach $FHEMPATH/FHEM. Geht auf die FHEM Frontendseite und gebt dort in der Kommandozeile <i>reload 74_AMAD.pm</i> ein</li>
|
||||
<li>installiert Euch die App "Automagic Premium" aus dem App Store oder die Testversion von <a href="https://automagic4android.com/de/testversion">hier</a></li>
|
||||
<li>installiert das Flowset 74_AMADautomagicFlows$VERSION.xml aus dem Ordner $INSTALLFHEM/lib/ auf Eurem Androidgerät und aktiviert erstmal nur den "Informations" Flow.</li>
|
||||
</ul>
|
||||
<br>
|
||||
Nun müsst Ihr nur noch ein Device in FHEM anlegen.
|
||||
@ -61,31 +60,34 @@
|
||||
<a name="AMADdefine"></a>
|
||||
<b>Define</b>
|
||||
<ul><br>
|
||||
<code>define <name> AMAD <IP-ADRESSE> <PORT> <INTERVAL></code>
|
||||
<code>define <name> AMAD <IP-ADRESSE></code>
|
||||
<br><br>
|
||||
Beispiel:
|
||||
<ul><br>
|
||||
<code>define WandTabletWohnzimmer AMAD 192.168.0.23 8090 180</code><br>
|
||||
<code>define WandTabletWohnzimmer AMAD 192.168.0.23</code><br>
|
||||
</ul>
|
||||
<br>
|
||||
Diese Anweisung erstellt ein neues AMAD-Device. Die Parameter IP-ADRESSE und PORT legen die IP Adresse des Android Gerätes
|
||||
sowie den, in den Flows des Trigger HTTP Request, angegebenen Port fest.<br>INTERVAL ist der Zeitabstand in dem ein erneuter Informationsabruf stattfinden soll. Alle x Sekunden.
|
||||
Bei mir hat sich 180 gut bewährt, also alle 3 Minuten<br>
|
||||
<u><b>Bitte gebt für sofortige Erfolge als Port 8090 ein, das ist der Port der in den mitgelieferten Automagic Flows als Trigger Port eingetragen ist.<br>
|
||||
Dieser kann später mit Erfahrung auch geändert werden</b></u>
|
||||
Diese Anweisung erstellt ein neues AMAD-Device. Der Parameter <IP-ADRESSE< legt die IP Adresse des Android Gerätes fest.<br>
|
||||
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. <b>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.</b><br>
|
||||
</ul>
|
||||
<br><br>
|
||||
Fertig! Nach anlegen des Devices sollten bereits die ersten Readings reinkommen.
|
||||
<b><u>Fertig! Nach anlegen der Geräteinstanz sollten nach spätestens 3 Minuten bereits die ersten Readings reinkommen.</u></b>
|
||||
<br><br>
|
||||
<a name="AMADreadings"></a>
|
||||
<b>Readings</b>
|
||||
<ul>
|
||||
<li>automagicState - Statusmeldungen von der AutomagicApp</li>
|
||||
<li>bluetooth on/off - ist auf dem Gerät Bluetooth an oder aus</li>
|
||||
<li>connectedBTdevices - eine Lieste der verbundenen Gerät</li>
|
||||
<li>currentMusicAlbum - aktuell abgespieltes Musikalbum des verwendeten Mediaplayers</li>
|
||||
<li>currentMusicArtist - aktuell abgespielter Musikinterpret des verwendeten Mediaplayers</li>
|
||||
<li>currentMusicTrack - aktuell abgespielter Musiktitel des verwendeten Mediaplayers</li>
|
||||
<li>deviceState - Status des Androidgerätes, muss selbst mit setreading gesetzt werden z.B. über die Anwesenheitskontrolle.<br>
|
||||
Ist Offline gesetzt, wird der Intervall zum Informationsabruf aus gesetzt.</li>
|
||||
<li>flow_SetCommands active/inactive - gibt den Status des SetCommands Flow wieder</li>
|
||||
<li>flow_informations active/inactive - gibt den Status des Informations Flow wieder</li>
|
||||
<li>lastSetCommandError - letzte Fehlermeldung vom set Befehl</li>
|
||||
<li>lastSetCommandState - letzter Status vom set Befehl, Befehl erfolgreich/nicht erfolgreich gesendet</li>
|
||||
<li>lastStatusRequestError - letzte Fehlermeldung vom statusRequest Befehl</li>
|
||||
@ -125,7 +127,7 @@
|
||||
<li>mediaPlayer - steuert den Standard Mediaplayer. play, stop, Titel zürück, Titel vor. <b>Attribut fhemServerIP</b></li>
|
||||
<li>openApp - öffnet eine ausgewählte App. <b>Attribut setOpenApp</b></li>
|
||||
<li>screenBrightness - setzt die Bildschirmhelligkeit, von 0-255 <b>Attribut setScreenBrightness</b></li>
|
||||
Wenn Ihr das "set screenBrightness" verwenden wollt, muss eine kleine Anpassung im Flow SetCommand vorgenommen werden. Öffnet die Aktion (eines der Vierecke ganz ganz unten)
|
||||
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".
|
||||
<li>screenFullscreen - Schaltet den Vollbildmodus on/off. <b>Attribut setFullscreen</b></li>
|
||||
<li>screenOrientation - Schaltet die Bildschirmausrichtung Auto/Landscape/Portait. <b>Attribut setScreenOrientation</b></li>
|
||||
@ -140,7 +142,8 @@
|
||||
<b>STATE</b>
|
||||
<ul>
|
||||
<li>initialized - Ist der Status kurz nach einem define..</li>
|
||||
<li>activ - Das Modul ist im aktiven Status.</li>
|
||||
<li>active - die Geräteinstanz ist im aktiven Status.</li>
|
||||
<li>disabled - die Geräteinstanz wurde über das Attribut disable deaktiviert</li>
|
||||
</ul>
|
||||
<br><br><br>
|
||||
<u><b>Anwendungsbeispiele:</b></u>
|
||||
|
Loading…
x
Reference in New Issue
Block a user