From 04fa75c4ea1832e285ec0378a4d529548c68ef97 Mon Sep 17 00:00:00 2001
From: LeonGaultier
Date: Mon, 24 Jul 2017 09:07:44 +0000
Subject: [PATCH] 73_AMADCommBridge: 74_AMADDevice new Version of AMAD. AMADNG
AMAD Version 4.0
git-svn-id: https://svn.fhem.de/fhem/trunk@14775 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/FHEM/73_AMADCommBridge.pm | 1100 ++++
fhem/FHEM/74_AMADDevice.pm | 1220 +++++
.../lib/74_AMADautomagicFlowset_4.0.0.xml | 4618 +++++++++++++++++
3 files changed, 6938 insertions(+)
create mode 100644 fhem/FHEM/73_AMADCommBridge.pm
create mode 100644 fhem/FHEM/74_AMADDevice.pm
create mode 100644 fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.0.xml
diff --git a/fhem/FHEM/73_AMADCommBridge.pm b/fhem/FHEM/73_AMADCommBridge.pm
new file mode 100644
index 000000000..46315e0ca
--- /dev/null
+++ b/fhem/FHEM/73_AMADCommBridge.pm
@@ -0,0 +1,1100 @@
+###############################################################################
+#
+# Developed with Kate
+#
+# (c) 2015-2017 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
+# All rights reserved
+#
+# This script is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# any later version.
+#
+# The GNU General Public License can be found at
+# http://www.gnu.org/copyleft/gpl.html.
+# A copy is found in the textfile GPL.txt and important notices to the license
+# from the author is found in LICENSE.txt distributed with these scripts.
+#
+# This script is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+#
+# $Id$
+#
+###############################################################################
+##
+##
+## Das JSON Modul immer in einem eval aufrufen
+# $data = eval{decode_json($data)};
+#
+# if($@){
+# Log3($SELF, 2, "$TYPE ($SELF) - error while request: $@");
+#
+# readingsSingleUpdate($hash, "state", "error", 1);
+#
+# return;
+# }
+#
+#
+###### Möglicher Aufbau eines JSON Strings für die AMADCommBridge
+#
+# first initial String
+# {"amad": {"amad_id": "1495827100156","fhemcmd": "setreading"},"firstrun": {"fhemdevice": "TabletWohnzimmer","fhemserverip": "fhem02.tuxnet.local","amaddevice_ip": "10.6.9.35"}}
+# {"amad": {"amad_id": "1495827100156","fhemcmd": "setreading"},"firstrun": {"fhemdevice": "TabletWohnzimmer","fhemserverip": "fhem02.tuxnet.local","amaddevice_ip": "10.6.9.35"}}
+#
+# default String
+# {"amad": {"amad_id": "37836534","fhemcmd": "setreading"},"payload": {"reading0": "value0","reading1": "value1","readingX": "valueX"}}
+# Aufruf zum testens
+# curl --data '{"amad": {"amad_id": "37836534","fhemcmd": "setreading"},"payload": {"reading0": "value0","reading1": "value1","readingX": "valueX"}}' localhost:8090
+#
+#
+##
+##
+
+
+
+package main;
+
+
+my $missingModul = "";
+
+use strict;
+use warnings;
+
+use HttpUtils;
+use TcpServerUtils;
+
+eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode ";
+eval "use JSON;1" or $missingModul .= "JSON ";
+
+
+my $modulversion = "4.0.0";
+my $flowsetversion = "4.0.0";
+
+
+
+
+# Declare functions
+sub AMADCommBridge_Attr(@);
+sub AMADCommBridge_Open($);
+sub AMADCommBridge_Read($);
+sub AMADCommBridge_Define($$);
+sub AMADCommBridge_Initialize($);
+sub AMADCommBridge_Set($@);
+sub AMADCommBridge_Write($@);
+sub AMADCommBridge_Undef($$);
+sub AMADCommBridge_ResponseProcessing($$);
+sub AMADCommBridge_Close($);
+sub AMADCommBridge_ErrorHandling($$$);
+sub AMADCommBridge_ProcessRead($$);
+sub AMADCommBridge_ParseMsg($$);
+
+
+
+
+sub AMADCommBridge_Initialize($) {
+
+ my ($hash) = @_;
+
+
+ # Provider
+ $hash->{ReadFn} = "AMADCommBridge_Read";
+ $hash->{WriteFn} = "AMADCommBridge_Write";
+ $hash->{Clients} = ":AMADDevice:";
+ $hash->{MatchList} = { "1:AMADDevice" => '{"amad": \{"amad_id":.+}}' };
+
+
+ # Consumer
+ $hash->{SetFn} = "AMADCommBridge_Set";
+ $hash->{DefFn} = "AMADCommBridge_Define";
+ $hash->{UndefFn} = "AMADCommBridge_Undef";
+
+ $hash->{AttrFn} = "AMADCommBridge_Attr";
+ $hash->{AttrList} = "fhemControlMode:trigger,setControl,thirdPartControl ".
+ "debugJSON:0,1 ".
+ "disable:1 ".
+ "allowFrom ".
+ $readingFnAttributes;
+
+ foreach my $d(sort keys %{$modules{AMADCommBridge}{defptr}}) {
+
+ my $hash = $modules{AMADCommBridge}{defptr}{$d};
+ $hash->{VERSIONMODUL} = $modulversion;
+ $hash->{VERSIONFLOWSET} = $flowsetversion;
+ }
+}
+
+sub AMADCommBridge_Define($$) {
+
+ my ( $hash, $def ) = @_;
+
+ my @a = split( "[ \t][ \t]*", $def );
+
+
+ return "too few parameters: define AMADCommBridge ''" if( @a < 2 and @a > 3 );
+ return "Cannot define a HEOS device. Perl modul $missingModul is missing." if ( $missingModul );
+
+ my $name = $a[0];
+
+ my $port;
+ $port = $a[2] if($a[2]);
+ $port = 8090 if( not defined($port) and (!$port) );
+
+ $hash->{BRIDGE} = 1;
+ $hash->{PORT} = $port;
+ $hash->{VERSIONMODUL} = $modulversion;
+ $hash->{VERSIONFLOWSET} = $flowsetversion;
+
+
+ $attr{$name}{room} = "AMAD" if( !defined( $attr{$name}{room} ) );
+
+ Log3 $name, 3, "AMADCommBridge ($name) - defined AMADCommBridge with Socketport $port";
+
+ AMADCommBridge_Open( $hash );
+
+ $modules{AMADCommBridge}{defptr}{BRIDGE} = $hash;
+
+ return undef;
+}
+
+sub AMADCommBridge_Undef($$) {
+
+ my ( $hash, $arg ) = @_;
+
+
+ delete $modules{AMADCommBridge}{defptr}{BRIDGE} if( defined($modules{AMADCommBridge}{defptr}{BRIDGE}) and $hash->{BRIDGE} );
+ TcpServer_Close( $hash );
+
+ return undef;
+}
+
+sub AMADCommBridge_Attr(@) {
+
+ my ( $cmd, $name, $attrName, $attrVal ) = @_;
+ my $hash = $defs{$name};
+
+ my $orig = $attrVal;
+
+ if( $attrName eq "disable" ) {
+ if( $cmd eq "set" ) {
+ if( $attrVal eq "0" ) {
+
+ readingsSingleUpdate ( $hash, "state", "enabled", 1 );
+ AMADCommBridge_Open($hash);
+ Log3 $name, 3, "AMADCommBridge ($name) - enabled";
+ } else {
+
+ AMADCommBridge_Close($hash);
+ readingsSingleUpdate ( $hash, "state", "disabled", 1 ) if( not defined($hash->{FD}) );
+ Log3 $name, 3, "AMADCommBridge ($name) - disabled";
+ }
+
+ } else {
+
+ readingsSingleUpdate ( $hash, "state", "enabled", 1 );
+ AMADCommBridge_Open($hash);
+ Log3 $name, 3, "AMADCommBridge ($name) - enabled";
+ }
+ }
+
+ elsif( $attrName eq "fhemControlMode" ) {
+ if( $cmd eq "set" ) {
+
+ CommandSet(undef,'set TYPE=AMADDevice:FILTER=deviceState=online statusRequest');
+ Log3 $name, 3, "AMADCommBridge ($name) - set fhemControlMode global Variable at Device";
+
+ } else {
+
+ CommandSet(undef,'set TYPE=AMADDevice:FILTER=deviceState=online statusRequest');
+ Log3 $name, 3, "AMADCommBridge ($name) - set fhemControlMode global Variable NONE at Device";
+ }
+ }
+
+ return undef;
+}
+
+sub AMADCommBridge_Set($@) {
+
+ my ($hash, $name, $cmd, @args) = @_;
+ my ($arg, @params) = @args;
+
+
+ if( $cmd eq 'open' ) {
+
+ AMADCommBridge_Open($hash);
+
+ } elsif( $cmd eq 'close' ) {
+
+ AMADCommBridge_Close($hash);
+
+ } elsif( $cmd eq 'fhemServerIP' ) {
+
+ readingsSingleUpdate($hash,$cmd,$arg,1);
+
+ } else {
+ my $list = "open:noArg close:noArg fhemServerIP";
+ return "Unknown argument $cmd, choose one of $list";
+ }
+}
+
+sub AMADCommBridge_Write($@) {
+
+ my ($hash,$amad_id,$uri,$header,$method) = @_;
+ my $name = $hash->{NAME};
+
+
+ HttpUtils_NonblockingGet(
+ {
+ url => "http://" . $uri,
+ timeout => 15,
+ hash => $hash,
+ amad_id => $amad_id,
+ method => $method,
+ header => $header,
+ doTrigger => 1,
+ callback => \&AMADCommBridge_ErrorHandling,
+ }
+ );
+
+ Log3 $name, 5, "AMADCommBridge ($name) - Send with URI: $uri, HEADER: $header, METHOD: $method";
+}
+
+sub AMADCommBridge_ErrorHandling($$$) {
+
+ my ($param,$err,$data) = @_;
+
+ my $hash = $param->{hash};
+ #my $name = $hash->{NAME};
+ my $dhash = $modules{AMADDevice}{defptr}{$param->{'amad_id'}};
+ my $dname = $dhash->{NAME};
+
+
+
+
+ if( $param->{method} eq 'GET' ) {
+
+ ### Begin Error Handling
+ if( $dhash->{helper}{infoErrorCounter} > 0 ) {
+
+ readingsBeginUpdate( $dhash );
+ readingsBulkUpdateIfChanged( $dhash, "lastStatusRequestState", "statusRequest_error", 1 );
+
+ if( ReadingsVal( $dname, "flow_Informations", "active" ) eq "inactive" && ReadingsVal( $dname, "flow_SetCommands", "active" ) eq "inactive" ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: CHECK THE LAST ERROR READINGS FOR MORE INFO, DEVICE IS SET OFFLINE";
+
+ readingsBulkUpdateIfChanged( $dhash, "deviceState", "offline", 1 );
+ readingsBulkUpdateIfChanged ( $dhash, "state", "AMAD Flows inactive, device set offline",1);
+ }
+
+ elsif( $dhash->{helper}{infoErrorCounter} > 7 && $dhash->{helper}{setCmdErrorCounter} > 4 ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: UNKNOWN ERROR, PLEASE CONTACT THE DEVELOPER, DEVICE DISABLED";
+
+ $attr{$dname}{disable} = 1;
+ readingsBulkUpdateIfChanged ( $dhash, "state", "Unknown Error, device disabled", 1);
+
+ $dhash->{helper}{infoErrorCounter} = 0;
+ $dhash->{helper}{setCmdErrorCounter} = 0;
+
+ return;
+ }
+
+ elsif( ReadingsVal( $dname, "flow_Informations", "active" ) eq "inactive" ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: Informations Flow on your Device is inactive, will try to reactivate";
+ }
+
+ elsif( $dhash->{helper}{infoErrorCounter} > 7 ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: To many Errors please check your Network or Device Configuration, DEVICE IS SET OFFLINE";
+
+ readingsBulkUpdateIfChanged( $dhash, "deviceState", "offline", 1 );
+ readingsBulkUpdateIfChanged ( $dhash, "state", "To many Errors, device set offline", 1);
+ $dhash->{helper}{infoErrorCounter} = 0;
+ }
+
+ elsif($dhash->{helper}{infoErrorCounter} > 2 && ReadingsVal( $dname, "flow_Informations", "active" ) eq "active" ){
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: Please check the AutomagicAPP on your Device";
+ }
+
+ readingsEndUpdate( $dhash, 1 );
+ }
+
+ if( defined( $err ) ) {
+ if( $err ne "" ) {
+
+ readingsBeginUpdate( $dhash );
+ readingsBulkUpdateIfChanged ( $dhash, "state", "$err") if( ReadingsVal( $dname, "state", 1 ) ne "initialized" );
+ $dhash->{helper}{infoErrorCounter} = ( $dhash->{helper}{infoErrorCounter} + 1 );
+
+ readingsBulkUpdateIfChanged( $dhash, "lastStatusRequestState", "statusRequest_error", 1 );
+
+ if( $err =~ /timed out/ ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: connect to your device is timed out. check network";
+ }
+
+ elsif( ( $err =~ /Keine Route zum Zielrechner/ ) && $dhash->{helper}{infoErrorCounter} > 1 ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: no route to target. bad network configuration or network is down";
+
+ } else {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: $err";
+ }
+
+ readingsEndUpdate( $dhash, 1 );
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: AMADCommBridge_statusRequestErrorHandling: error while requesting AutomagicInfo: $err";
+
+ return;
+ }
+ }
+
+ if( $data eq "" and exists( $param->{code} ) && $param->{code} ne 200 ) {
+
+ readingsBeginUpdate( $dhash );
+ readingsBulkUpdateIfChanged ( $dhash, "state", $param->{code}, 1 ) if( ReadingsVal( $dname, "state", 1 ) ne "initialized" );
+ $dhash->{helper}{infoErrorCounter} = ( $dhash->{helper}{infoErrorCounter} + 1 );
+
+ readingsBulkUpdateIfChanged( $dhash, "lastStatusRequestState", "statusRequest_error", 1 );
+
+ if( $param->{code} ne 200 ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: ".$param->{code};
+ }
+
+ readingsEndUpdate( $dhash, 1 );
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: received http code ".$param->{code}." without any data after requesting AMAD AutomagicInfo";
+
+ return;
+ }
+
+ if( ( $data =~ /Error/i ) and exists( $param->{code} ) ) {
+ readingsBeginUpdate( $dhash );
+ readingsBulkUpdateIfChanged( $dhash, "state", $param->{code}, 1 ) if( ReadingsVal( $dname, "state" ,0) ne "initialized" );
+ $dhash->{helper}{infoErrorCounter} = ( $dhash->{helper}{infoErrorCounter} + 1 );
+
+ readingsBulkUpdateIfChanged( $dhash, "lastStatusRequestState", "statusRequest_error", 1 );
+
+ if( $param->{code} eq 404 && ReadingsVal( $dname, "flow_Informations", "inactive" ) eq "inactive" ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: check the informations flow on your device";
+ }
+
+ elsif( $param->{code} eq 404 && ReadingsVal( $dname, "flow_Informations", "active" ) eq "active" ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: check the automagicApp on your device";
+
+ } else {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: http error ".$param->{code};
+ }
+
+ readingsEndUpdate( $dhash, 1 );
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - statusRequestERROR: received http code ".$param->{code}." receive Error after requesting AMAD AutomagicInfo";
+
+ return;
+ }
+
+ ### End Error Handling
+
+ $dhash->{helper}{infoErrorCounter} = 0;
+ }
+
+ elsif( $param->{method} eq 'POST' ) {
+
+ ### Begin Error Handling
+ if( $dhash->{helper}{setCmdErrorCounter} > 2 ) {
+
+ readingsBeginUpdate( $dhash );
+ readingsBulkUpdateIfChanged( $dhash, "lastSetCommandState", "statusRequest_error", 1 );
+
+ if( ReadingsVal( $dname, "flow_Informations", "active" ) eq "inactive" && ReadingsVal( $dname, "flow_SetCommands", "active" ) eq "inactive" ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: CHECK THE LAST ERROR READINGS FOR MORE INFO, DEVICE IS SET OFFLINE";
+
+ readingsBulkUpdateIfChanged( $dhash, "deviceState", "offline", 1 );
+ readingsBulkUpdateIfChanged( $dhash, "state", "AMAD Flows inactive, device set offline", 1 );
+ }
+
+ elsif( $dhash->{helper}{infoErrorCounter} > 7 && $dhash->{helper}{setCmdErrorCounter} > 4 ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: UNKNOWN ERROR, PLEASE CONTACT THE DEVELOPER, DEVICE DISABLED";
+
+ $attr{$dname}{disable} = 1;
+ readingsBulkUpdateIfChanged( $dhash, "state", "Unknown Error, device disabled", 1 );
+ $dhash->{helper}{infoErrorCounter} = 0;
+ $dhash->{helper}{setCmdErrorCounter} = 0;
+
+ return;
+ }
+
+ elsif( ReadingsVal( $dname, "flow_SetCommands", "active" ) eq "inactive" ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: Flow SetCommands on your Device is inactive, will try to reactivate";
+ }
+
+ elsif( $dhash->{helper}{setCmdErrorCounter} > 9 ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: To many Errors please check your Network or Device Configuration, DEVICE IS SET OFFLINE";
+
+ readingsBulkUpdateIfChanged( $dhash, "deviceState", "offline", 1 );
+ readingsBulkUpdateIfChanged( $dhash, "state", "To many Errors, device set offline", 1 );
+ $dhash->{helper}{setCmdErrorCounter} = 0;
+ }
+
+ elsif( $dhash->{helper}{setCmdErrorCounter} > 4 && ReadingsVal( $dname, "flow_SetCommands", "active" ) eq "active" ){
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: Please check the AutomagicAPP on your Device";
+ }
+
+ readingsEndUpdate( $dhash, 1 );
+ }
+
+ if( defined( $err ) ) {
+ if( $err ne "" ) {
+ readingsBeginUpdate( $dhash );
+ readingsBulkUpdateIfChanged( $dhash, "state", $err, 1 ) if( ReadingsVal( $dname, "state", 0 ) ne "initialized" );
+ $dhash->{helper}{setCmdErrorCounter} = ($dhash->{helper}{setCmdErrorCounter} + 1);
+
+ readingsBulkUpdateIfChanged( $dhash, "lastSetCommandState", "setCmd_error", 1 );
+
+ if( $err =~ /timed out/ ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: connect to your device is timed out. check network";
+ }
+
+ elsif( $err =~ /Keine Route zum Zielrechner/ ) {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: no route to target. bad network configuration or network is down";
+
+ } else {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: $err";
+ }
+
+ readingsEndUpdate( $dhash, 1 );
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: error while POST Command: $err";
+
+ return;
+ }
+ }
+
+ if( $data eq "" and exists( $param->{code} ) && $param->{code} ne 200 ) {
+
+ readingsBeginUpdate( $dhash );
+ readingsBulkUpdateIfChanged( $dhash, "state", $param->{code}, 1 ) if( ReadingsVal( $dhash, "state", 0 ) ne "initialized" );
+
+ $dhash->{helper}{setCmdErrorCounter} = ( $dhash->{helper}{setCmdErrorCounter} + 1 );
+
+ readingsBulkUpdateIfChanged($dhash, "lastSetCommandState", "setCmd_error", 1 );
+
+ readingsEndUpdate( $dhash, 1 );
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: received http code ".$param->{code};
+
+ return;
+ }
+
+ if( ( $data =~ /Error/i ) and exists( $param->{code} ) ) {
+
+ readingsBeginUpdate( $dhash );
+ readingsBulkUpdateIfChanged( $dhash, "state", $param->{code}, 1 ) if( ReadingsVal( $dname, "state", 0 ) ne "initialized" );
+
+ $dhash->{helper}{setCmdErrorCounter} = ( $dhash->{helper}{setCmdErrorCounter} + 1 );
+
+ readingsBulkUpdateIfChanged( $dhash, "lastSetCommandState", "setCmd_error", 1 );
+
+ if( $param->{code} eq 404 ) {
+
+ readingsBulkUpdateIfChanged( $dhash, "lastSetCommandError", "", 1 );
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: setCommands flow is inactive on your device!";
+
+ } else {
+
+ Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: http error ".$param->{code};
+ }
+
+ return;
+ }
+
+ ### End Error Handling
+
+ readingsSingleUpdate( $dhash, "lastSetCommandState", "setCmd_done", 1 );
+ $dhash->{helper}{setCmdErrorCounter} = 0;
+
+ return undef;
+ }
+
+
+}
+
+sub AMADCommBridge_Open($) {
+
+ my $hash = shift;
+ my $name = $hash->{NAME};
+ my $port = $hash->{PORT};
+
+
+ if( not defined($hash->{FD}) and (! $hash->{FD}) ) {
+ # Oeffnen des TCP Sockets
+ my $ret = TcpServer_Open( $hash, $port, "global" );
+
+ if( $ret && !$init_done ) {
+
+ Log3 $name, 3, "AMADCommBridge ($name) - $ret. Exiting.";
+ exit(1);
+ }
+
+ readingsSingleUpdate ( $hash, "state", "opened", 1 ) if( defined($hash->{FD}) );
+ Log3 $name, 3, "AMADCommBridge ($name) - Socket opened.";
+
+ return $ret;
+
+ } else {
+
+ Log3 $name, 3, "AMADCommBridge ($name) - Socket already opened";
+ }
+
+ return;
+}
+
+sub AMADCommBridge_Close($) {
+
+ my $hash = shift;
+
+ my $name = $hash->{NAME};
+
+ delete $modules{AMADCommBridge}{defptr}{BRIDGE};
+ TcpServer_Close( $hash );
+
+ if( not defined($hash->{FD}) ) {
+ readingsSingleUpdate ( $hash, "state", "closed", 1 );
+ Log3 $name, 3, "AMADCommBridge ($name) - Socket closed.";
+
+ } else {
+ Log3 $name, 3, "AMADCommBridge ($name) - can't close Socket.";
+ }
+
+ return;
+}
+
+sub AMADCommBridge_Read($) {
+
+ my $hash = shift;
+ my $name = $hash->{NAME};
+
+
+ if( $hash->{SERVERSOCKET} ) { # Accept and create a child
+ TcpServer_Accept( $hash, "AMADCommBridge" );
+ return;
+ }
+
+ # Read 1024 byte of data
+ my $buf;
+ my $ret = sysread($hash->{CD}, $buf, 2048);
+
+
+ # When there is an error in connection return
+ if( !defined($ret ) or $ret <= 0 ) {
+ CommandDelete( undef, $name );
+ Log3 $name, 5, "AMADCommBridge ($name) - Connection closed for $name";
+ return;
+ }
+
+ AMADCommBridge_ProcessRead($hash,$buf);
+}
+
+sub AMADCommBridge_ProcessRead($$) {
+
+ my ($hash, $buf) = @_;
+ my $name = $hash->{NAME};
+
+ my @data = split( '\R\R', $buf );
+ my $data = $data[0];
+ my $json = $data[1];
+ my $buffer = '';
+
+
+
+
+ Log3 $name, 4, "AMADCommBridge ($name) - process read";
+
+
+ my $response;
+ my $c;
+
+ if ( $data =~ /currentFlowsetUpdate.xml/ ) {
+
+ my $fhempath = $attr{global}{modpath};
+ $response = qx(cat $fhempath/FHEM/lib/74_AMADautomagicFlowset_$flowsetversion.xml);
+ $c = $hash->{CD};
+ print $c "HTTP/1.1 200 OK\r\n",
+ "Content-Type: text/plain\r\n",
+ "Connection: close\r\n",
+ "Content-Length: ".length($response)."\r\n\r\n",
+ $response;
+
+ return;
+ }
+
+ elsif ( $data =~ /installFlow_([^.]*.xml)/ ) {
+
+ if( defined($1) ){
+ $response = qx(cat /tmp/$1);
+ $c = $hash->{CD};
+ print $c "HTTP/1.1 200 OK\r\n",
+ "Content-Type: text/plain\r\n",
+ "Connection: close\r\n",
+ "Content-Length: ".length($response)."\r\n\r\n",
+ $response;
+
+ return;
+ }
+ }
+
+
+ if(defined($hash->{PARTIAL}) and $hash->{PARTIAL}) {
+
+ Log3 $name, 5, "AMADCommBridge ($name) - PARTIAL: " . $hash->{PARTIAL};
+ $buffer = $hash->{PARTIAL};
+
+ } else {
+
+ Log3 $name, 4, "AMADCommBridge ($name) - No PARTIAL buffer";
+ }
+
+ Log3 $name, 5, "AMADCommBridge ($name) - Incoming data: " . $json;
+
+ $buffer = $buffer . $json;
+ Log3 $name, 4, "AMADCommBridge ($name) - Current processing buffer (PARTIAL + incoming data): " . $buffer;
+
+ my ($correct_json,$tail) = AMADCommBridge_ParseMsg($hash, $buffer);
+
+
+ while($correct_json) {
+
+ $hash->{LAST_RECV} = time();
+
+ Log3 $name, 5, "AMADCommBridge ($name) - Decoding JSON message. Length: " . length($correct_json) . " Content: " . $correct_json;
+ Log3 $name, 5, "AMADCommBridge ($name) - Vor Sub: Laenge JSON: " . length($correct_json) . " Content: " . $correct_json . " Tail: " . $tail;
+
+ AMADCommBridge_ResponseProcessing($hash,$correct_json)
+ unless(not defined($tail) and not ($tail));
+
+ ($correct_json,$tail) = AMADCommBridge_ParseMsg($hash, $tail);
+
+ Log3 $name, 5, "AMADCommBridge ($name) - Nach Sub: Laenge JSON: " . length($correct_json) . " Content: " . $correct_json . " Tail: " . $tail;
+ }
+
+
+ $hash->{PARTIAL} = $tail;
+ Log3 $name, 4, "AMADCommBridge ($name) - PARTIAL lenght: " . length($tail);
+
+
+ Log3 $name, 5, "AMADCommBridge ($name) - Tail: " . $tail;
+ Log3 $name, 5, "AMADCommBridge ($name) - PARTIAL: " . $hash->{PARTIAL};
+
+}
+
+sub AMADCommBridge_ResponseProcessing($$) {
+
+ my ($hash,$json) = @_;
+
+ my $name = $hash->{NAME};
+ my $bhash = $modules{AMADCommBridge}{defptr}{BRIDGE};
+ my $bname = $bhash->{NAME};
+
+
+
+
+ #### Verarbeitung der Daten welche über die AMADCommBridge kommen ####
+
+ Log3 $bname, 4, "AMADCommBridge ($name) - Receive RAW Message in Debugging Mode: $json";
+
+
+ my $response;
+ my $c;
+
+
+ my $decode_json = eval{decode_json($json)};
+ if($@){
+ Log3 $bname, 4, "AMADCommBridge ($name) - JSON error while request: $@";
+
+ if( AttrVal( $bname, 'debugJSON', 0 ) == 1 ) {
+ readingsBeginUpdate($bhash);
+ readingsBulkUpdate($bhash, 'JSON_ERROR', $@, 1);
+ readingsBulkUpdate($bhash, 'JSON_ERROR_STRING', $json, 1);
+ readingsEndUpdate($bhash, 1);
+ }
+
+ $response = "header lines: \r\n AMADCommBridge receive a JSON error\r\n AMADCommBridge to do nothing\r\n";
+ $c = $hash->{CD};
+ print $c "HTTP/1.1 200 OK\r\n",
+ "Content-Type: text/plain\r\n",
+ "Connection: close\r\n",
+ "Content-Length: ".length($response)."\r\n\r\n",
+ $response;
+ return;
+ }
+
+ my $amad_id = $decode_json->{amad}{amad_id};
+ my $fhemcmd = $decode_json->{amad}{fhemcmd};
+ my $fhemDevice;
+
+ if( defined($decode_json->{firstrun}) and ($decode_json->{firstrun}) ) {
+
+ $fhemDevice = $decode_json->{firstrun}{fhemdevice} if( defined($decode_json->{firstrun}{fhemdevice}) );
+
+ } else {
+
+ $fhemDevice = $modules{AMADDevice}{defptr}{$amad_id}->{NAME};
+ }
+
+
+
+
+ if( !defined($amad_id) ) {
+ readingsSingleUpdate( $bhash, "transmitterERROR", $hash->{NAME}." has no device name sends", 1 ) if( AttrVal( $bname, "expertMode", 0 ) eq "1" );
+ Log3 $bname, 4, "AMADCommBridge ($name) - ERROR - no device name given. please check your global variable in automagic";
+
+ $response = "header lines: \r\n AMADCommBridge receive no device name. please check your global variable in automagic\r\n FHEM to do nothing\r\n";
+ $c = $hash->{CD};
+ print $c "HTTP/1.1 200 OK\r\n",
+ "Content-Type: text/plain\r\n",
+ "Connection: close\r\n",
+ "Content-Length: ".length($response)."\r\n\r\n",
+ $response;
+
+ return;
+ }
+
+
+ if( defined($fhemcmd) and ($fhemcmd) ) {
+ if ( $fhemcmd eq 'setreading' ) {
+ return Log3 $bname, 3, "AMADCommBridge ($name) - AMADCommBridge: processing receive no reading values from Device: $fhemDevice"
+ unless( (defined($decode_json->{payload}) and ($decode_json->{payload})) or (defined($decode_json->{firstrun}) and ($decode_json->{firstrun})) );
+
+ Log3 $bname, 4, "AMADCommBridge ($bname) - AMADCommBridge: processing receive reading values - Device: $fhemDevice Data: $decode_json->{payload}" unless( defined($decode_json->{payload}) and ($decode_json->{payload}) );
+
+ Dispatch($bhash,$json,undef);
+ Log3 $bname, 4, "AMADCommBridge ($bname) - call Dispatcher";
+ readingsSingleUpdate($bhash,'fhemServerIP',$decode_json->{firstrun}{'fhemserverip'},1) if( defined($decode_json->{firstrun}{'fhemserverip'}));
+
+ $response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM was processes\r\n";
+ $c = $hash->{CD};
+ print $c "HTTP/1.1 200 OK\r\n",
+ "Content-Type: text/plain\r\n",
+ "Connection: close\r\n",
+ "Content-Length: ".length($response)."\r\n\r\n",
+ $response;
+
+ return;
+ }
+
+ elsif ( $fhemcmd eq 'set' ) {
+ my $fhemCmd = $decode_json->{payload}{setcmd};
+
+ fhem ("set $fhemCmd") if( AttrVal( $bname, 'fhemControlMode', 'trigger' ) eq 'setControl' );
+ readingsSingleUpdate( $bhash, "receiveFhemCommand", "set ".$fhemCmd, 1 ) if( AttrVal( $bname, 'fhemControlMode', 'trigger' ) eq 'trigger' );;
+ Log3 $bname, 4, "AMADCommBridge ($name) - AMADCommBridge_CommBridge: set reading receive fhem command";
+
+ $response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM execute set command now\r\n";
+ $c = $hash->{CD};
+ print $c "HTTP/1.1 200 OK\r\n",
+ "Content-Type: text/plain\r\n",
+ "Connection: close\r\n",
+ "Content-Length: ".length($response)."\r\n\r\n",
+ $response;
+
+ return;
+ }
+
+ elsif ( $fhemcmd eq 'voiceinputvalue' ) {
+ my $fhemCmd = lc(encode_utf8($decode_json->{payload}{voiceinputdata}));
+
+ readingsBeginUpdate( $bhash);
+ readingsBulkUpdate( $bhash, "receiveVoiceCommand", $fhemCmd, 1 );
+ readingsBulkUpdate( $bhash, "receiveVoiceDevice", $fhemDevice, 1 );
+ readingsEndUpdate( $bhash, 1 );
+ Log3 $bname, 4, "AMADCommBridge ($name) - AMADCommBridge_CommBridge: set reading receive voice command: $fhemCmd from Device $fhemDevice";
+
+ $response = "header lines: \r\n AMADCommBridge receive Data complete\r\n FHEM was processes\r\n";
+ $c = $hash->{CD};
+ print $c "HTTP/1.1 200 OK\r\n",
+ "Content-Type: text/plain\r\n",
+ "Connection: close\r\n",
+ "Content-Length: ".length($response)."\r\n\r\n",
+ $response;
+
+ return;
+ }
+
+ elsif ( $fhemcmd eq 'readingsval' ) {
+ my $fhemCmd = $decode_json->{payload}{readingsvalcmd};
+ my @datavalue = split( ' ', $fhemCmd );
+
+ $response = ReadingsVal( $datavalue[0], $datavalue[1], $datavalue[2] );
+ $c = $hash->{CD};
+ print $c "HTTP/1.1 200 OK\r\n",
+ "Content-Type: text/plain\r\n",
+ "Connection: close\r\n",
+ "Content-Length: ".length($response)."\r\n\r\n",
+ $response;
+
+ return;
+ }
+
+
+# elsif ( $fhemcmd =~ /fhemfunc\b/ ) {
+# my $fhemCmd = $data[1];
+#
+# Log3 $bname, 4, "AMADCommBridge ($name) - AMADCommBridge_CommBridge: receive fhem-function command";
+#
+# if( $fhemCmd =~ /^{.*}$/ ) {
+#
+# $response = $fhemCmd if( ReadingsVal( $name, "expertMode", 0 ) eq "1" );
+#
+# } else {
+#
+# $response = "header lines: \r\n AMADCommBridge receive no typical FHEM function\r\n FHEM to do nothing\r\n";
+# }
+#
+# $c = $hash->{CD};
+# print $c "HTTP/1.1 200 OK\r\n",
+# "Content-Type: text/plain\r\n",
+# "Connection: close\r\n",
+# "Content-Length: ".length($response)."\r\n\r\n",
+# $response;
+#
+# return;
+# }
+
+ }
+
+
+ $response = "header lines: \r\n AMADCommBridge receive incomplete or corrupt Data\r\n FHEM to do nothing\r\n";
+ $c = $hash->{CD};
+ print $c "HTTP/1.1 200 OK\r\n",
+ "Content-Type: text/plain\r\n",
+ "Connection: close\r\n",
+ "Content-Length: ".length($response)."\r\n\r\n",
+ $response;
+}
+
+
+##################
+### my little helper
+##################
+
+sub AMADCommBridge_ParseMsg($$) {
+
+ my ($hash, $buffer) = @_;
+
+ my $name = $hash->{NAME};
+ my $open = 0;
+ my $close = 0;
+ my $msg = '';
+ my $tail = '';
+
+
+ if($buffer) {
+ foreach my $c (split //, $buffer) {
+ if($open == $close && $open > 0) {
+ $tail .= $c;
+ Log3 $name, 5, "AMADCommBridge ($name) - $open == $close && $open > 0";
+
+ } elsif(($open == $close) && ($c ne '{')) {
+
+ Log3 $name, 5, "AMADCommBridge ($name) - Garbage character before message: " . $c;
+
+ } else {
+
+ if($c eq '{') {
+
+ $open++;
+
+ } elsif($c eq '}') {
+
+ $close++;
+ }
+
+ $msg .= $c;
+ }
+ }
+
+ if($open != $close) {
+
+ $tail = $msg;
+ $msg = '';
+ }
+ }
+
+ Log3 $name, 5, "AMADCommBridge ($name) - return msg: $msg and tail: $tail";
+ return ($msg,$tail);
+}
+
+##### bleibt zu Anschauungszwecken erhalten
+#sub AMADCommBridge_Header2Hash($) {
+#
+# my $string = shift;
+# my %hash = ();
+#
+# foreach my $line (split("\r\n", $string)) {
+# my ($key,$value) = split( ": ", $line );
+# next if( !$value );
+#
+# $value =~ s/^ //;
+# $hash{$key} = $value;
+# }
+#
+# return \%hash;
+#}
+
+
+
+
+
+
+
+
+
+1;
+
+=pod
+
+=item device
+=item summary Integrates Android devices into FHEM and displays several settings.
+=item summary_DE Integriert Android-Geräte in FHEM und zeigt verschiedene Einstellungen an.
+
+=begin html
+
+
+AMADCommBridge
+
+ AMAD - Automagic Android Device
+ AMADCommBridge - Communication bridge for all AMAD devices
+
+ This module is the central point for the successful integration of Android devices in FHEM. It also provides a link level between AMAD supported devices and FHEM. All communication between AMAD Android and FHEM runs through this interface.
+ Therefore, the initial setup of an AMAD device is also performed exactly via this module instance.
+
+ In order to successfully establish an Android device in FHEM, an AMADCommBridge device must be created in the first step.
+
+
+ Define
+
+ define <name> AMADCommBridge
+
+ Example:
+
+ define AMADBridge AMADCommBridge
+
+
+ This statement creates a new AMADCommBridge device named AMADBridge.
+
+ In the following, only the Flowset has to be installed on the Android device and the Flow 'First Run Assistant' run. (Simply press the Homebutton)
+ The wizard then guides you through the setup of your AMAD device and ensures that at the end of the installation process the Android device is created as an AMAD device in FHEM.
+
+
+
+ Readings
+
+ JSON_ERROR - JSON Error message reported by Perl
+ JSON_ERROR_STRING - The string that caused the JSON error message
+ fhemServerIP - The IP address of the FHEM server, is set by the module based on the JSON string from the installation wizard. Can also be set by user using set command
+ receiveFhemCommand - is set the fhemControlMode attribute to trigger, the reading is set as soon as an FHEM command is sent. A notification can then be triggered.
+ If set instead of trigger setControl as value for fhemControlMode, the reading is not executed but the set command executed immediately.
+ receiveVoiceCommand - The speech control is activated by AMAD (set DEVICE activateVoiceInput), the last recognized voice command is written into this reading.
+ receiveVoiceDevice - Name of the device from where the last recognized voice command was sent
+ state - state of the Bridge, open, closed
+
+
+
+ Attributes
+
+ allowFrom - Regexp the allowed IP addresses or hostnames. If this attribute is set, only connections from these addresses are accepted.
+ Attention: If allowfrom is not set, and no kind allowed instance is defined, and the remote has a non-local address, then the connection is rejected. The following addresses are considered local:
+ IPV4: 127/8, 10/8, 192.168/16, 172.16/10, 169.254/16
+ IPV6: ::1, fe80/10
+ debugJSON - If set to 1, JSON error messages are written in readings. See JSON_ERROR * under Readings
+ fhemControlMode - Controls the permissible type of control of FHEM devices. You can control the bridge in two ways FHEM devices. Either by direct FHEM command from a flow, or as a voice command by means of voice control (set DEVICE activateVoiceInput)
+ trigger - If the value trigger is set, all FHEM set commands sent to the bridge are written to the reading receiveFhemCommand and can be executed using notify. Voice control is possible; readings receiveVoice * are set. On the Android device several voice commands can be linked by means of "and". Example: turn on the light scene in the evening and turn on the TV
+ setControl - All set commands sent via the flow are automatically executed. The triggering of a reading is not necessary. The control by means of language behaves like the value trigger
+ thirdPartControl - Behaves as triggered, but in the case of voice control, a series of voice commands by means of "and" is not possible. Used for voice control via modules of other module authors ((z.B. 39_TEERKO.pm)
+
+
+
+ If you have problems with the wizard, an Android device can also be applied manually, you will find in the Commandref to the AMADDevice module.
+
+
+=end html
+=begin html_DE
+
+
+AMADCommBridge
+
+ AMAD - Automagic Android Device
+ AMADCommBridge - Kommunikationsbrücke für alle AMAD Geräte
+
+ Dieses Modul ist das Ausgangsmodul zur erfolgreichen Integration von Androidgeräten in FHEM. Es stellt ferner eine Verbindungsebene zwischen AMAD unterstützten Geräten und FHEM zur Verfügung. Alle Kommunikation zwischen AMAD Android und FHEM läuft über diese Schnittstelle.
+ Daher erfolgt die Ersteinrichtung eines AMAD Devices auch genau über diese Modulinstanz.
+
+ Damit erfolgreich ein Androidgerät in FHEM eingerichtet werden kann, muss im ersten Schritt ein AMADCommBridge Device angelegt werden.
+
+
+ Define
+
+ define <name> AMADCommBridge
+
+ Beispiel:
+
+ define AMADBridge AMADCommBridge
+
+
+ Diese Anweisung erstellt ein neues AMADCommBridge Device Namens AMADBridge.
+
+ Im folgenden muß lediglich das Flowset auf dem Android Gerät installiert werden und der Flow 'First Run Assistent' ausgeführt werden. (einfach den Homebutton drücken)
+ Der Assistent geleitet Dich dann durch die Einrichtung Deines AMAD Gerätes und sorgt dafür das am Ende des Installationsprozess das Androidgerät als AMAD Device in FHEM angelegt wird.
+
+
+
+ Readings
+
+ JSON_ERROR - JSON Fehlermeldung welche von Perl gemeldet wird
+ JSON_ERROR_STRING - der String welcher die JSON Fehlermeldung verursacht hat
+ fhemServerIP - die Ip-Adresse des FHEM Servers, wird vom Modul auf Basis des JSON Strings vom Installationsassistenten gesetzt. Kann aber auch mittels set Befehles vom User gesetzt werden
+ receiveFhemCommand - ist das Attribut fhemControlMode auf trigger gestellt, wird das Reading gesetzt sobald ein FHEM Befehl übersendet wird. Hierauf kann dann ein Notify triggern.
+ Wird anstelle von trigger setControl als Wert für fhemControlMode eingestellt, wird das Reading nicht gestzt sondern der set Befehl sofort ausgeführt.
+ receiveVoiceCommand - wird die Sprachsteuerung von AMAD aktiviert (set DEVICE activateVoiceInput) so wird der letzte erkannten Sprachbefehle in dieses Reading geschrieben.
+ receiveVoiceDevice - Name des Devices von wo aus der letzte erkannte Sprachbefehl gesendet wurde
+ state - Status der Bridge, open, closed
+
+
+
+ Attribute
+
+ allowFrom - Regexp der erlaubten IP-Adressen oder Hostnamen. Wenn dieses Attribut gesetzt wurde, werden ausschließlich Verbindungen von diesen Adressen akzeptiert.
+ Achtung: falls allowfrom nicht gesetzt ist, und keine gütige allowed Instanz definiert ist, und die Gegenstelle eine nicht lokale Adresse hat, dann wird die Verbindung abgewiesen. Folgende Adressen werden als local betrachtet:
+ IPV4: 127/8, 10/8, 192.168/16, 172.16/10, 169.254/16
+ IPV6: ::1, fe80/10
+ debugJSON - wenn auf 1 gesetzt, werden JSON Fehlermeldungen in Readings geschrieben. Siehe hierzu JSON_ERROR* unter Readings
+ fhemControlMode - steuert die zulässige Art der Kontrolle von FHEM Devices. Du kannst über die Bridge auf 2 Arten FHEM Devices steuern. Entweder per direktem FHEM Befehl aus einem Flow heraus, oder als Sprachbefehl mittels Sprachsteuerung (set DEVICE activateVoiceInput)
+ trigger - ist der Wert trigger gesetzt, werden alle an die Bridge gesendeten FHEM set Befehle in das Reading receiveFhemCommand geschrieben und können so mittels notify ausgeführt werden. Sprachsteuerung ist möglich, es werden Readings receiveVoice* gesetzt. Auf dem Androidgerät können bei Sprachsteuerung mehrere Sprachbefehle mittels "und" verknüpft/aneinander gereiht werden. Bsp: schalte die Lichtszene Abends an und schalte den Fernsehr an
+ setControl - alle set Befehle welche mittels eines Flows über die Bridge gesendet werden, werden automatisch ausgeführt. Das triggern eines Readings ist nicht nötig. Die Steuerung mittels Sprache verhält sich wie beim Wert trigger
+ thirdPartControl - verhält sich wie trigger, bei der Sprachsteuerung ist jedoch ein anreihen von Sprachbefehlen mittels "und" nicht möglich. Dient der Sprachsteuerung über Module anderer Modulautoren ((z.B. 39_TEERKO.pm)
+
+
+
+ Wie man bei Problemen mit dem Assistenten ein Androidgerät auch von Hand anlegen kann, erfährst Du in der Commandref zum AMADDevice Modul.
+
+
+=end html_DE
+=cut
diff --git a/fhem/FHEM/74_AMADDevice.pm b/fhem/FHEM/74_AMADDevice.pm
new file mode 100644
index 000000000..6410b4631
--- /dev/null
+++ b/fhem/FHEM/74_AMADDevice.pm
@@ -0,0 +1,1220 @@
+###############################################################################
+#
+# Developed with Kate
+#
+# (c) 2015-2017 Copyright: Marko Oldenburg (leongaultier at gmail dot com)
+# All rights reserved
+#
+# This script is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# any later version.
+#
+# The GNU General Public License can be found at
+# http://www.gnu.org/copyleft/gpl.html.
+# A copy is found in the textfile GPL.txt and important notices to the license
+# from the author is found in LICENSE.txt distributed with these scripts.
+#
+# This script is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+#
+# $Id$
+#
+###############################################################################
+##
+##
+## Das JSON Modul immer in einem eval aufrufen
+# $data = eval{decode_json($data)};
+#
+# if($@){
+# Log3($SELF, 2, "$TYPE ($SELF) - error while request: $@");
+#
+# readingsSingleUpdate($hash, "state", "error", 1);
+#
+# return;
+# }
+#
+#
+
+
+
+
+package main;
+
+
+my $missingModul = "";
+
+use strict;
+use warnings;
+
+eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode ";
+eval "use JSON;1" or $missingModul .= "JSON ";
+
+
+my $modulversion = "4.0.0";
+my $flowsetversion = "4.0.0";
+
+
+
+
+# Declare functions
+sub AMADDevice_Attr(@);
+sub AMADDevice_checkDeviceState($);
+sub AMADDevice_decrypt($);
+sub AMADDevice_Define($$);
+sub AMADDevice_encrypt($);
+sub AMADDevice_GetUpdate($);
+sub AMADDevice_Initialize($);
+sub AMADDevice_WriteReadings($$);
+sub AMADDevice_Set($$@);
+sub AMADDevice_Undef($$);
+sub AMADDevice_Parse($$);
+sub AMADDevice_statusRequest($);
+
+
+
+
+sub AMADDevice_Initialize($) {
+
+ my ($hash) = @_;
+
+ $hash->{Match} = '{"amad": \{"amad_id":.+}}';
+
+
+ $hash->{SetFn} = "AMADDevice_Set";
+ $hash->{DefFn} = "AMADDevice_Define";
+ $hash->{UndefFn} = "AMADDevice_Undef";
+ $hash->{AttrFn} = "AMADDevice_Attr";
+ $hash->{ParseFn} = "AMADDevice_Parse";
+
+ $hash->{AttrList} = "setOpenApp ".
+ "checkActiveTask ".
+ "setFullscreen:0,1 ".
+ "setScreenOrientation:0,1 ".
+ "setScreenBrightness:noArg ".
+ "setBluetoothDevice ".
+ "setScreenlockPIN ".
+ "setScreenOnForTimer ".
+ "setOpenUrlBrowser ".
+ "setNotifySndFilePath ".
+ "setTtsMsgSpeed ".
+ "setUserFlowState ".
+ "setTtsMsgLang:de,en ".
+ "setVolUpDownStep:1,2,4,5 ".
+ "setVolMax ".
+ "setVolFactor:2,3,4,5 ".
+ "setNotifyVolMax ".
+ "setRingSoundVolMax ".
+ "setAPSSID ".
+ "root:0,1 ".
+ "disable:1 ".
+ $readingFnAttributes;
+
+ foreach my $d(sort keys %{$modules{AMADDevice}{defptr}}) {
+
+ my $hash = $modules{AMADDevice}{defptr}{$d};
+ $hash->{VERSIONMODUL} = $modulversion;
+ $hash->{VERSIONFLOWSET} = $flowsetversion;
+ }
+}
+
+sub AMADDevice_Define($$) {
+
+ my ( $hash, $def ) = @_;
+ my @a = split( "[ \t]+", $def );
+ splice( @a, 1, 1 );
+ my $iodev;
+ my $i = 0;
+
+
+ foreach my $param ( @a ) {
+ if( $param =~ m/IODev=([^\s]*)/ ) {
+
+ $iodev = $1;
+ splice( @a, $i, 3 );
+ last;
+ }
+
+ $i++;
+ }
+
+ return "too few parameters: define AMADDevice " if( @a != 3 );
+ return "Cannot define a AMAD device. Perl modul $missingModul is missing." if ( $missingModul );
+
+
+ my ($name,$host,$amad_id) = @a;
+
+ $hash->{HOST} = $host;
+ $hash->{AMAD_ID} = $amad_id;
+ $hash->{PORT} = 8090;
+ $hash->{VERSIONMODUL} = $modulversion;
+ $hash->{VERSIONFLOWSET} = $flowsetversion;
+ $hash->{helper}{infoErrorCounter} = 0;
+ $hash->{helper}{setCmdErrorCounter} = 0;
+ $hash->{helper}{deviceStateErrorCounter} = 0;
+
+
+
+
+ AssignIoPort($hash,$iodev) if( !$hash->{IODev} );
+
+ if(defined($hash->{IODev}->{NAME})) {
+
+ Log3 $name, 3, "AMADDevice ($name) - I/O device is " . $hash->{IODev}->{NAME};
+
+ } else {
+
+ Log3 $name, 1, "AMADDevice ($name) - no I/O device";
+ }
+
+
+ $iodev = $hash->{IODev}->{NAME};
+
+ my $d = $modules{AMADDevice}{defptr}{$amad_id};
+
+ return "AMADDevice device $name on AMADCommBridge $iodev already defined."
+ if( defined($d) && $d->{IODev} == $hash->{IODev} && $d->{NAME} ne $name );
+
+ Log3 $name, 3, "AMADDevice ($name) - defined with AMAD_ID: $amad_id on port $hash->{PORT}";
+
+ $attr{$name}{room} = "AMAD" if( !defined( $attr{$name}{room} ) );
+
+ readingsBeginUpdate($hash);
+ readingsBulkUpdateIfChanged( $hash, "state", "initialized",1);
+ readingsBulkUpdateIfChanged( $hash, "deviceState", "unknown",1);
+ readingsEndUpdate($hash,1);
+
+
+ if( $init_done ) {
+
+ InternalTimer( gettimeofday()+3, "AMADDevice_GetUpdate", $hash, 0 ) if( ($hash->{HOST}) );
+
+ } else {
+
+ InternalTimer( gettimeofday()+15, "AMADDevice_GetUpdate", $hash, 0 ) if( ($hash->{HOST}) );
+ }
+
+ $modules{AMADDevice}{defptr}{$amad_id} = $hash;
+
+ return undef;
+}
+
+sub AMADDevice_Undef($$) {
+
+ my ( $hash, $arg ) = @_;
+ my $name = $hash->{NAME};
+ my $amad_id = $hash->{AMAD_ID};
+
+
+ RemoveInternalTimer( $hash );
+ delete $modules{AMADDevice}{defptr}{$amad_id};
+
+ return undef;
+}
+
+sub AMADDevice_Attr(@) {
+
+ my ( $cmd, $name, $attrName, $attrVal ) = @_;
+ my $hash = $defs{$name};
+
+ my $orig = $attrVal;
+
+ if( $attrName eq "disable" ) {
+ if( $cmd eq "set" ) {
+ if( $attrVal eq "0" ) {
+
+ RemoveInternalTimer( $hash );
+ InternalTimer( gettimeofday()+2, "AMADDevice_GetUpdate", $hash, 0 ) if( ReadingsVal( $hash->{NAME}, "state", 0 ) eq "disabled" );
+ readingsSingleUpdate ( $hash, "state", "active", 1 );
+ Log3 $name, 3, "AMADDevice ($name) - enabled";
+ } else {
+
+ readingsSingleUpdate ( $hash, "state", "disabled", 1 );
+ RemoveInternalTimer( $hash );
+ Log3 $name, 3, "AMADDevice ($name) - disabled";
+ }
+
+ } else {
+
+ RemoveInternalTimer( $hash );
+ InternalTimer( gettimeofday()+2, "AMADDevice_GetUpdate", $hash, 0 ) if( ReadingsVal( $hash->{NAME}, "state", 0 ) eq "disabled" );
+ readingsSingleUpdate ( $hash, "state", "active", 1 );
+ Log3 $name, 3, "AMADDevice ($name) - enabled";
+ }
+ }
+
+ elsif( $attrName eq "checkActiveTask" ) {
+ if( $cmd eq "del" ) {
+ CommandDeleteReading( undef, "$name checkActiveTask" );
+ }
+
+ Log3 $name, 3, "AMADDevice ($name) - $cmd $attrName $attrVal and run statusRequest";
+ RemoveInternalTimer( $hash );
+ InternalTimer( gettimeofday(), "AMADDevice_GetUpdate", $hash, 0 )
+ }
+
+ elsif( $attrName eq "setScreenlockPIN" ) {
+ if( $cmd eq "set" && $attrVal ) {
+
+ $attrVal = AMADDevice_encrypt($attrVal);
+
+ } else {
+
+ CommandDeleteReading( undef, "$name screenLock" );
+ }
+ }
+
+ elsif( $attrName eq "setAPSSID" ) {
+ if( $cmd eq "set" && $attrVal ) {
+
+ AMADDevice_statusRequest($hash);
+
+ } else {
+
+ AMADDevice_statusRequest($hash);
+ }
+ }
+
+ elsif( $attrName eq "setUserFlowState" ) {
+ if( $cmd eq "del" ) {
+
+ CommandDeleteReading( undef, "$name userFlowState" );
+ }
+
+ Log3 $name, 3, "AMADDevice ($name) - $cmd $attrName $attrVal and run statusRequest";
+ RemoveInternalTimer( $hash );
+ InternalTimer( gettimeofday(), "AMADDevice_GetUpdate", $hash, 0 )
+ }
+
+
+
+ if( $cmd eq "set" ) {
+ if( $attrVal && $orig ne $attrVal ) {
+
+ $attr{$name}{$attrName} = $attrVal;
+ return $attrName ." set to ". $attrVal if( $init_done );
+ }
+ }
+
+ return undef;
+}
+
+sub AMADDevice_GetUpdate($) {
+
+ my ( $hash ) = @_;
+ my $name = $hash->{NAME};
+ my $bname = $hash->{IODev}->{NAME};
+
+
+ if( $init_done && ( ReadingsVal( $name, "deviceState", "unknown" ) eq "unknown" or ReadingsVal( $name, "deviceState", "online" ) eq "online" ) && AttrVal( $name, "disable", 0 ) ne "1" && ReadingsVal( $bname, "fhemServerIP", "not set" ) ne "not set" ) {
+
+ AMADDevice_statusRequest($hash);
+ AMADDevice_checkDeviceState( $hash );
+
+ } else {
+
+ Log3 $name, 4, "AMADDevice ($name) - GetUpdate, FHEM or Device not ready yet";
+ Log3 $name, 3, "AMADDevice ($bname) - GetUpdate, Please set $bname fhemServerIP NOW!" if( ReadingsVal( $bname, "fhemServerIP", "none" ) eq "none" );
+
+ InternalTimer( gettimeofday()+15, "AMADDevice_GetUpdate", $hash, 0 );
+ }
+}
+
+sub AMADDevice_statusRequest($) {
+
+ my $hash = shift;
+ my $name = $hash->{NAME};
+
+ my $host = $hash->{HOST};
+ my $port = $hash->{PORT};
+ my $amad_id = $hash->{AMAD_ID};
+ my $uri;
+ my $header = 'Connection: close';
+ my $method;
+
+
+ my $activetask = AttrVal( $name, "checkActiveTask", "none" );
+ my $userFlowState = AttrVal( $name, "setUserFlowState", "none" );
+ my $apssid = AttrVal( $name, "setAPSSID", "none" );
+ my $fhemip = ReadingsVal($hash->{IODev}->{NAME}, "fhemServerIP", "none");
+ my $fhemCtlMode = AttrVal($hash->{IODev}->{NAME},'fhemControlMode','none' );
+ my $bport = $hash->{IODev}->{PORT};
+
+
+ $uri = $host . ":" . $port . "/fhem-amad/deviceInfo/"; # Pfad muß so im Automagic als http request Trigger drin stehen
+ $header .= "\r\nfhemip: $fhemip\r\nfhemdevice: $name\r\nactivetask: $activetask\r\napssid: $apssid\r\nbport: $bport\r\nuserflowstate: $userFlowState\r\namadid: $amad_id\r\nfhemctlmode: $fhemCtlMode";
+ $method = "GET";
+
+
+ IOWrite($hash,$amad_id,$uri,$header,$method);
+ Log3 $name, 5, "AMADDevice ($name) - IOWrite: $uri $method IODevHash=$hash->{IODev}";
+}
+
+sub AMADDevice_WriteReadings($$) {
+
+ my ( $hash, $decode_json ) = @_;
+
+ my $name = $hash->{NAME};
+
+
+ ############################
+ #### schreiben der Readings
+
+ Log3 $name, 5, "AMADDevice ($name) - Processing data: $decode_json";
+ readingsSingleUpdate( $hash, "state", "active", 1) if( ReadingsVal( $name, "state", 0 ) ne "initialized" and ReadingsVal( $name, "state", 0 ) ne "active" );
+
+ ### Event Readings
+ my $t;
+ my $v;
+
+
+ readingsBeginUpdate($hash);
+
+ while( ( $t, $v ) = each %{$decode_json->{payload}} ) {
+
+ $v =~ s/\bnull\b/off/g if( ($t eq "nextAlarmDay" or $t eq "nextAlarmTime") and $v eq "null" );
+ $v =~ s/\bnull\b//g;
+
+ readingsBulkUpdateIfChanged($hash, $t, $v, 1) if( defined( $v ) and ($t ne 'deviceState'
+ or $t ne 'incomingCallerName'
+ or $t ne 'incomingCallerNumber')
+ );
+
+ readingsBulkUpdateIfChanged( $hash, $t, ($v / AttrVal($name,'setVolFactor',1)) ) if( $t eq 'volume' and AttrVal($name,'setVolFactor',1) > 1 );
+ readingsBulkUpdate( $hash, '.'.$t, $v ) if( $t eq 'deviceState' );
+ readingsBulkUpdate( $hash, $t, $v ) if( $t eq 'incomingCallerName' );
+ readingsBulkUpdate( $hash, $t, $v ) if( $t eq 'incomingCallerNumber' );
+ }
+
+ readingsBulkUpdateIfChanged( $hash, "deviceState", "offline", 1 ) if( $decode_json->{payload}{airplanemode} && $decode_json->{payload}{airplanemode} eq "on" );
+ readingsBulkUpdateIfChanged( $hash, "deviceState", "online", 1 ) if( $decode_json->{payload}{airplanemode} && $decode_json->{payload}{airplanemode} eq "off" );
+
+ readingsBulkUpdateIfChanged( $hash, "lastStatusRequestState", "statusRequest_done", 1 );
+
+ if( ReadingsVal($name,'volume',1) > 0 ) {
+ readingsBulkUpdateIfChanged( $hash, "mute", "off", 1 );
+ } else {
+ readingsBulkUpdateIfChanged( $hash, "mute", "on", 1 );
+ }
+
+ $hash->{helper}{infoErrorCounter} = 0;
+ ### End Response Processing
+
+ readingsBulkUpdateIfChanged( $hash, "state", "active", 1 ) if( ReadingsVal( $name, "state", 0 ) eq "initialized" );
+ readingsEndUpdate( $hash, 1 );
+
+ $hash->{helper}{deviceStateErrorCounter} = 0 if( $hash->{helper}{deviceStateErrorCounter} > 0 and ReadingsVal( $name, "deviceState", "offline") eq "online" );
+
+ return undef;
+}
+
+sub AMADDevice_Set($$@) {
+
+ my ($hash, $name, @aa) = @_;
+ my ($cmd, @args) = @aa;
+
+ my $host = $hash->{HOST};
+ my $port = $hash->{PORT};
+ my $amad_id = $hash->{AMAD_ID};
+ my $uri;
+ my $header = 'Connection: close';
+ my $method;
+
+ my $volMax = AttrVal($name,'setVolMax',15);
+ my $notifyVolMax = AttrVal($name,'setNotifyVolMax',7);
+ my $ringSoundVolMax = AttrVal($name,'setRingSoundVolMax',7);
+
+
+ if( lc $cmd eq 'screenmsg' ) {
+ my $msg = join( " ", @args );
+
+ $msg =~ s/%/%25/g;
+ $msg =~ s/\s/%20/g;
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/screenMsg?message=$msg";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'ttsmsg' ) {
+
+ my $msg = join( " ", @args );
+ my $speed = AttrVal( $name, "setTtsMsgSpeed", "1.0" );
+ my $lang = AttrVal( $name, "setTtsMsgLang","de" );
+
+ $msg =~ s/%/%25/g;
+ $msg =~ s/\s/%20/g;
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/ttsMsg?message=".$msg."&msgspeed=".$speed."&msglang=".$lang;
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'userflowstate' ) {
+
+ my $datas = join( " ", @args );
+ my ($flow,$state) = split( ":", $datas);
+
+ $flow =~ s/\s/%20/g;
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/flowState?flowstate=".$state."&flowname=".$flow;
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'volume' or $cmd eq 'mute' or $cmd =~ 'volume[Down|Up]' ) {
+
+ my $vol;
+
+ if( $cmd eq 'volume' ) {
+ $vol = join( " ", @args );
+
+ if( $vol =~ /^\+(.*)/ or $vol =~ /^-(.*)/ ) {
+
+ if( $vol =~ /^\+(.*)/ ) {
+
+ $vol =~ s/^\+//g;
+ $vol = ReadingsVal( $name, "volume", 0 ) + $vol;
+ }
+
+ elsif( $vol =~ /^-(.*)/ ) {
+
+ $vol =~ s/^-//g;
+ printf $vol;
+ $vol = ReadingsVal( $name, "volume", 15 ) - $vol;
+ }
+ }
+
+ } elsif( $cmd eq 'mute') {
+ if($args[0] eq 'on') {
+ $vol = 0;
+ readingsSingleUpdate($hash,'.volume',ReadingsVal($name,'volume',0),0);
+ } else {
+ $vol = ReadingsVal($name,'.volume',0);
+ }
+
+ } elsif( $cmd =~ 'volume[Down|Up]') {
+ if( $cmd eq 'volumeUp' ) {
+ $vol = ReadingsVal( $name, "volume", 0 ) + AttrVal($name,'setVolUpDownStep',3);
+ } else {
+ $vol = ReadingsVal( $name, "volume", 0 ) - AttrVal($name,'setVolUpDownStep',3);
+ }
+ }
+
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setVolume?volume=$vol";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'volumenotification' ) {
+
+ my $vol = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setNotifiVolume?notifivolume=$vol";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'volumeringsound' ) {
+
+ my $vol = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setRingSoundVolume?ringsoundvolume=$vol";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd =~ /^media/ ) {
+
+ my $btn = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/multimediaControl?mplayer=".$cmd."&button=".$btn;
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'screenbrightness' ) {
+
+ my $bri = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setBrightness?brightness=$bri";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'screen' ) {
+
+ my $mod = join( " ", @args );
+ my $scot = AttrVal( $name, "setScreenOnForTimer", undef );
+ $scot = 60 if( !$scot );
+
+ if ($mod eq "on" || $mod eq "off") {
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setScreenOnOff?screen=".$mod."&screenontime=".$scot if ($mod eq "on" || $mod eq "off");
+ $method = "POST";
+ }
+
+ elsif ($mod eq "lock" || $mod eq "unlock") {
+
+ return "Please set \"setScreenlockPIN\" Attribut first" if( AttrVal( $name, "setScreenlockPIN", "none" ) eq "none" );
+ my $PIN = AttrVal( $name, "setScreenlockPIN", undef );
+ $PIN = AMADDevice_decrypt($PIN);
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/screenlock?lockmod=".$mod."&lockPIN=".$PIN;
+ $method = "POST";
+ }
+ }
+
+ elsif( lc $cmd eq 'screenorientation' ) {
+
+ my $mod = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setScreenOrientation?orientation=$mod";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'activatevoiceinput' ) {
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setvoicecmd";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'screenfullscreen' ) {
+
+ my $mod = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setScreenFullscreen?fullscreen=$mod";
+ $method = "POST";
+ readingsSingleUpdate( $hash, $cmd, $mod, 1 );
+ }
+
+ elsif( lc $cmd eq 'openurl' ) {
+
+ my $openurl = join( " ", @args );
+ my $browser = AttrVal( $name, "setOpenUrlBrowser", "com.android.chrome|com.google.android.apps.chrome.Main" );
+ my @browserapp = split( /\|/, $browser );
+
+ my $uri = $host . ":" . $port . "/fhem-amad/setCommands/openURL?url=".$openurl."&browserapp=".$browserapp[0]."&browserappclass=".$browserapp[1];
+ $method = "POST";
+ }
+
+ elsif (lc $cmd eq 'nextalarmtime') {
+
+ my $value = join( " ", @args );
+ my @alarm = split( ":", $value );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setAlarm?hour=".$alarm[0]."&minute=".$alarm[1];
+ $method = "POST";
+ }
+
+ elsif (lc $cmd eq 'timer') {
+
+ my $timer = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setTimer?minute=$timer";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'statusrequest' ) {
+
+ AMADDevice_statusRequest($hash);
+ return;
+ }
+
+ elsif( lc $cmd eq 'openapp' ) {
+
+ my $app = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/openApp?app=$app";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'system' ) {
+
+ my $systemcmd = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/systemcommand?syscmd=$systemcmd";
+ $method = "POST";
+ readingsSingleUpdate( $hash, "airplanemode", "on", 1 ) if( $systemcmd eq "airplanemodeON" );
+ readingsSingleUpdate( $hash, "deviceState", "offline", 1 ) if( $systemcmd eq "airplanemodeON" || $systemcmd eq "shutdown" );
+ }
+
+ elsif( lc $cmd eq 'donotdisturb' ) {
+
+ my $disturbmod = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/donotdisturb?disturbmod=$disturbmod";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'bluetooth' ) {
+
+ my $mod = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setbluetooth?bluetooth=$mod";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'notifysndfile' ) {
+
+ my $notify = join( " ", @args );
+ my $filepath = AttrVal( $name, "setNotifySndFilePath", "/storage/emulated/0/Notifications/" );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/playnotifysnd?notifyfile=".$notify."¬ifypath=".$filepath;
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'changetobtdevice' ) {
+
+ my $swToBtDevice = join( " ", @args );
+ my @swToBtMac = split( /\|/, $swToBtDevice );
+ my $btDevices = AttrVal( $name, "setBluetoothDevice", "none" ) if( AttrVal( $name, "setBluetoothDevice", "none" ) ne "none" );
+ my @btDevice = split( ',', $btDevices );
+ my @btDeviceOne = split( /\|/, $btDevice[0] );
+ my @btDeviceTwo = split( /\|/, $btDevice[1] );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setbtdevice?swToBtDeviceMac=".$swToBtMac[1]."&btDeviceOne=".$btDeviceOne[1]."&btDeviceTwo=".$btDeviceTwo[1];
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'clearnotificationbar' ) {
+
+ my $appname = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/clearnotificationbar?app=$appname";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'vibrate' ) {
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/setvibrate";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'sendintent' ) {
+
+ my $intentstring = join( " ", @args );
+ my ( $action, $exkey1, $exval1, $exkey2, $exval2 ) = split( "[ \t][ \t]*", $intentstring );
+ $exkey1 = "" if( !$exkey1 );
+ $exval1 = "" if( !$exval1 );
+ $exkey2 = "" if( !$exkey2 );
+ $exval2 = "" if( !$exval2 );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/sendIntent?action=".$action."&exkey1=".$exkey1."&exval1=".$exval1."&exkey2=".$exkey2."&exval2=".$exval2;
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'installflowsource' ) {
+
+ my $flowname = join( " ", @args );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/installFlow?flowname=$flowname";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'opencall' ) {
+
+ my $string = join( " ", @args );
+ my ($callnumber, $time) = split( "[ \t][ \t]*", $string );
+ $time = "none" if( !$time );
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/openCall?callnumber=".$callnumber."&hanguptime=".$time;
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'closecall' ) {
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/closeCall";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'startdaydream' ) {
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/startDaydream";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'currentflowsetupdate' ) {
+
+ $uri = $host . ":" . $port . "/fhem-amad/currentFlowsetUpdate";
+ $method = "POST";
+ }
+
+ elsif( lc $cmd eq 'sendsms' ) {
+ my $string = join( " ", @args );
+ my ($smsmessage, $smsnumber) = split( "\\|", $string );
+
+ $smsmessage =~ s/%/%25/g;
+ $smsmessage =~ s/\s/%20/g;
+
+ $uri = $host . ":" . $port . "/fhem-amad/setCommands/sendSms?smsmessage=".$smsmessage."&smsnumber=".$smsnumber;
+ $method = "POST";
+
+ } else {
+
+ my $apps = AttrVal( $name, "setOpenApp", "none" );
+ my $btdev = AttrVal( $name, "setBluetoothDevice", "none" );
+
+
+ my $list = "screenMsg ttsMsg mediaGoogleMusic:play/pause,stop,next,back mediaSamsungMusic:play/pause,stop,next,back mediaAmazonMusic:play/pause,stop,next,back mediaSpotifyMusic:play/pause,stop,next,back mediaTuneinRadio:play/pause,stop,next,back mediaAldiMusic:play/pause,stop,next,back mediaYouTube:play/pause,stop,next,back mediaVlcPlayer:play/pause,stop,next,back mediaAudible:play/pause,stop,next,back screenBrightness:slider,0,1,255 screen:on,off,lock,unlock openURL nextAlarmTime:time timer:slider,1,1,60 statusRequest:noArg bluetooth:on,off notifySndFile clearNotificationBar:All,Automagic activateVoiceInput:noArg vibrate:noArg sendIntent openCall closeCall:noArg currentFlowsetUpdate:noArg installFlowSource doNotDisturb:never,always,alarmClockOnly,onlyImportant userFlowState sendSMS startDaydream:noArg volumeUp:noArg volumeDown:noArg mute: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 .= " openApp:$apps" if( AttrVal( $name, "setOpenApp", "none" ) ne "none" );
+ $list .= " system:reboot,shutdown,airplanemodeON" if( AttrVal( $name, "root", "0" ) eq "1" );
+ $list .= " changetoBTDevice:$btdev" if( AttrVal( $name, "setBluetoothDevice", "none" ) ne "none" );
+ $list .= " volume:slider,0,1,$volMax";
+ $list .= " volumeNotification:slider,0,1,$notifyVolMax";
+ $list .= " volumeRingSound:slider,0,1,$ringSoundVolMax";
+
+
+
+ return "Unknown argument $cmd, choose one of $list";
+ }
+
+
+ IOWrite($hash,$amad_id,$uri,$header,$method);
+ Log3 $name, 5, "AMADDevice ($name) - IOWrite: $uri $method IODevHash=$hash->{IODev}";
+
+ return undef;
+}
+
+sub AMADDevice_Parse($$) {
+
+ my ($io_hash,$json) = @_;
+ my $name = $io_hash->{NAME};
+
+
+ my $decode_json = eval{decode_json(encode_utf8($json))};
+ if($@){
+ Log3 $name, 3, "AMADDevice ($name) - JSON error while request: $@";
+ return;
+ }
+
+ Log3 $name, 4, "AMADDevice ($name) - ParseFn was called";
+ Log3 $name, 5, "AMADDevice ($name) - ParseFn was called, !!! AMAD_ID: $decode_json->{amad}{amad_id}";
+
+
+ my $fhemDevice = $decode_json->{firstrun}{fhemdevice} if( defined($decode_json->{firstrun}) and defined($decode_json->{firstrun}{fhemdevice}) );
+ my $amad_id = $decode_json->{amad}{amad_id};
+
+ if( my $hash = $modules{AMADDevice}{defptr}{$amad_id} ) {
+ my $name = $hash->{NAME};
+
+ AMADDevice_WriteReadings($hash,$decode_json);
+ Log3 $name, 4, "AMADDevice ($name) - find logical device: $hash->{NAME}";
+
+ return $hash->{NAME};
+
+ } else {
+
+ return "UNDEFINED $fhemDevice AMADDevice $decode_json->{firstrun}{'amaddevice_ip'} $decode_json->{amad}{'amad_id'} IODev=$name";
+ }
+}
+
+##################################
+##################################
+#### my little helpers ###########
+
+sub AMADDevice_checkDeviceState($) {
+
+ my ( $hash ) = @_;
+ my $name = $hash->{NAME};
+
+ Log3 $name, 4, "AMADDevice ($name) - AMADDevice_checkDeviceState: run Check";
+
+
+ if( ReadingsAge( $name, ".deviceState", 240 ) > 240 ) {
+
+ AMADDevice_statusRequest( $hash ) if( $hash->{helper}{deviceStateErrorCounter} == 0 );
+ readingsSingleUpdate( $hash, "deviceState", "offline", 1 ) if( ReadingsAge( $name, ".deviceState", 300) > 300 and $hash->{helper}{deviceStateErrorCounter} > 0 and ReadingsVal($name,'deviceState','online') ne 'offline' );
+ $hash->{helper}{deviceStateErrorCounter} = ( $hash->{helper}{deviceStateErrorCounter} + 1 );
+ }
+
+ InternalTimer( gettimeofday()+240, "AMADDevice_checkDeviceState", $hash, 0 );
+
+ Log3 $name, 4, "AMADDevice ($name) - AMADDevice_checkDeviceState: set new Timer";
+}
+
+sub AMADDevice_encrypt($) {
+
+ my ($decodedPIN) = @_;
+ my $key = getUniqueId();
+ my $encodedPIN;
+
+ return $decodedPIN if( $decodedPIN =~ /^crypt:(.*)/ );
+
+ for my $char (split //, $decodedPIN) {
+ my $encode = chop($key);
+ $encodedPIN .= sprintf("%.2x",ord($char)^ord($encode));
+ $key = $encode.$key;
+ }
+
+ return 'crypt:'. $encodedPIN;
+}
+
+sub AMADDevice_decrypt($) {
+
+ my ($encodedPIN) = @_;
+ my $key = getUniqueId();
+ my $decodedPIN;
+
+ $encodedPIN = $1 if( $encodedPIN =~ /^crypt:(.*)/ );
+
+ for my $char (map { pack('C', hex($_)) } ($encodedPIN =~ /(..)/g)) {
+ my $decode = chop($key);
+ $decodedPIN .= chr(ord($char)^ord($decode));
+ $key = $decode.$key;
+ }
+
+ return $decodedPIN;
+}
+
+
+
+
+1;
+
+=pod
+
+=item device
+=item summary Integrates Android devices into FHEM and displays several settings.
+=item summary_DE Integriert Android-Geräte in FHEM und zeigt verschiedene Einstellungen an.
+
+=begin html
+
+
+AMADDevice
+
+ AMAD - Automagic Android Device
+
+ This module integrates Android devices into FHEM and displays several settings using the Android app "Automagic" .
+ Automagic is comparable to the "Tasker" app for automating tasks and configuration settings. But Automagic is more user-friendly. The "Automagic Premium" app currently costs EUR 2.90.
+
+ Any information retrievable by Automagic can be displayed in FHEM by this module. Just define your own Automagic-"flow" and send the data to the AMADCommBridge. One even can control several actions on Android devices.
+
+ To be able to make use of all these functions the Automagic app and additional flows need to be installed on the Android device. The flows can be retrieved from the FHEM directory, the app can be bought in Google Play Store.
+
+ How to use AMADDevice?
+
+ first, make sure that the AMADCommBridge in FHEM was defined
+ install the "Automagic Premium" app from the PlayStore
+ install the flowset 74_AMADDeviceautomagicFlowset$VERSION.xml file from the $INSTALLFHEM/FHEM/lib/ directory on the Android device
+ activate the "installation assistant" Flow in Automagic. If one now sends Automagic into the background, e.g. Homebutton, the assistant starts and creates automatically a FHEM device for the android device
+
+
+ Define a AMADDevice device by hand.
+
+
+ Define
+
+ 10.6.9.10 1496497380000 IODev=AMADBridge
+ define <name> AMADDevice <IP-ADRESSE> <AMAD_ID> IODev=<IODEVICE>
+
+ Example:
+
+ define WandTabletWohnzimmer AMADDevice 192.168.0.23 123456 IODev=NAME_des_AMADCommBridge_Devices
+
+
+ In this case, an AMADDevice is created by hand. The AMAD_ID, here 123456, must also be entered exactly as a global variable in Automagic.
+
+
+
+ Readings
+
+ airplanemode - on/off, state of the aeroplane mode
+ androidVersion - currently installed version of Android
+ automagicState - state of the Automagic App (prerequisite Android >4.3). In case you have Android >4.3 and the reading says "not supported", you need to enable Automagic inside Android / Settings / Sound & notification / Notification access
+ batteryHealth - the health of the battery (1=unknown, 2=good, 3=overheat, 4=dead, 5=over voltage, 6=unspecified failure, 7=cold)
+ batterytemperature - the temperature of the battery
+ bluetooth - on/off, bluetooth state
+ checkActiveTask - state of an app (needs to be defined beforehand). 0=not active or not active in foreground, 1=active in foreground, see note below
+ connectedBTdevices - list of all devices connected via bluetooth
+ connectedBTdevicesMAC - list of MAC addresses of all devices connected via bluetooth
+ currentMusicAlbum - currently playing album of mediaplayer
+ currentMusicApp - currently playing player app (Amazon Music, Google Play Music, Google Play Video, Spotify, YouTube, TuneIn Player, Aldi Life Music)
+ currentMusicArtist - currently playing artist of mediaplayer
+ currentMusicIcon - cover of currently play albumNoch nicht fertig implementiert
+ currentMusicState - state of currently/last used mediaplayer
+ currentMusicTrack - currently playing song title of mediaplayer
+ daydream - on/off, daydream currently active
+ deviceState - state of Android devices. unknown, online, offline.
+ doNotDisturb - state of do not Disturb Mode
+ dockingState - undocked/docked, Android device in docking station
+ flow_SetCommands - active/inactive, state of SetCommands flow
+ flow_informations - active/inactive, state of Informations flow
+ flowsetVersionAtDevice - currently installed version of the flowsets on the Android device
+ incomingCallerName - Callername from last Call
+ incomingCallerNumber - Callernumber from last Call
+ incommingWhatsAppMessageFrom - last WhatsApp message
+ incommingWhatsTelegramMessageFrom - last telegram message
+ intentRadioName - name of the most-recent streamed intent radio
+ intentRadioState - state of intent radio player
+ keyguardSet - 0/1 keyguard set, 0=no 1=yes, does not indicate whether it is currently active
+ lastSetCommandError - last error message of a set command
+ lastSetCommandState - last state of a set command, command send successful/command send unsuccessful
+ lastStatusRequestError - last error message of a statusRequest command
+ lastStatusRequestState - ast state of a statusRequest command, command send successful/command send unsuccessful
+ nextAlarmDay - currently set day of alarm
+ nextAlarmState - alert/done, current state of "Clock" stock-app
+ nextAlarmTime - currently set time of alarm
+ powerLevel - state of battery in %
+ powerPlugged - 0=no/1,2=yes, power supply connected
+ screen - on locked,unlocked/off locked,unlocked, state of display
+ screenBrightness - 0-255, level of screen-brightness
+ screenFullscreen - on/off, full screen mode
+ screenOrientation - Landscape/Portrait, screen orientation (horizontal,vertical)
+ screenOrientationMode - auto/manual, mode for screen orientation
+ state - current state of AMAD device
+ userFlowState - current state of a Flow, established under setUserFlowState Attribut
+ volume - media volume setting
+ volumeNotification - notification volume setting
+
+ Prerequisite for using the reading checkActivTask the package name of the application to be checked needs to be defined in the attribute checkActiveTask . Example: attr Nexus10Wohnzimmer
+ checkActiveTask com.android.chrome für den Chrome Browser.
+
+
+
+
+ Set
+
+ activateVoiceInput - start voice input on Android device
+ bluetooth - on/off, switch bluetooth on/off
+ clearNotificationBar - All/Automagic, deletes all or only Automagic notifications in status bar
+ closeCall - hang up a running call
+ currentFlowsetUpdate - start flowset update on Android device
+ installFlowSource - install a Automagic flow on device, XML file must be stored in /tmp/ with extension xml . Example: set TabletWohnzimmer installFlowSource WlanUebwerwachen.xml
+ doNotDisturb - sets the do not Disturb Mode, always Disturb, never Disturb, alarmClockOnly alarm Clock only, onlyImportant only important Disturbs
+ mediaAmazonMusic - play/stop/next/back , controlling the amazon music media player
+ mediaGoogleMusic - play/stop/next/back , controlling the google play music media player
+ mediaSpotifyMusic - play/stop/next/back , controlling the spotify media player
+ mediaTuneinRadio - play/stop/next/back , controlling the TuneinRadio media player
+ mediaAldiMusic - play/stop/next/back , controlling the Aldi music media player
+ mediaAudible - play/stop/next/back , controlling the Audible media player
+ mediaYouTube - play/stop/next/back , controlling the YouTube media player
+ mediaVlcPlayer - play/stop/next/back , controlling the VLC media player
+ nextAlarmTime - sets the alarm time. Only valid for the next 24 hours.
+ notifySndFile - plays a media-file which by default needs to be stored in the folder "/storage/emulated/0/Notifications/" of the Android device. You may use the attribute setNotifySndFilePath for defining a different folder.
+ openCall - initial a call and hang up after optional time / set DEVICE openCall 0176354 10 call this number and hang up after 10s
+ screenBrightness - 0-255, set screen brighness
+ screenMsg - display message on screen of Android device
+ sendintent - send intent string Example: set $AMADDEVICE sendIntent org.smblott.intentradio.PLAY url http://stream.klassikradio.de/live/mp3-192/stream.klassikradio.de/play.m3u name Klassikradio , first parameter contains the action, second parameter contains the extra. At most two extras can be used.
+ sendSMS - Sends an SMS to a specific phone number. Bsp.: sendSMS Dies ist ein Test|555487263
+ startDaydream - start Daydream
+ statusRequest - Get a new status report of Android device. Not all readings can be updated using a statusRequest as some readings are only updated if the value of the reading changes.
+ timer - set a countdown timer in the "Clock" stock app. Only seconds are allowed as parameter.
+ ttsMsg - send a message which will be played as voice message
+ userFlowState - set Flow/s active or inactive,set Nexus7Wohnzimmer Badezimmer:inactive vorheizen or set Nexus7Wohnzimmer Badezimmer vorheizen,Nachtlicht Steven:inactive
+ vibrate - vibrate Android device
+ volume - set media volume. Works on internal speaker or, if connected, bluetooth speaker or speaker connected via stereo jack
+ volumeNotification - set notifications volume
+
+
+ Set (depending on attribute values)
+
+ changetoBtDevice - switch to another bluetooth device. Attribute setBluetoothDevice needs to be set. See note below!
+ openApp - start an app. attribute setOpenApp
+ openURL - opens a URLS in the standard browser as long as no other browser is set by the attribute setOpenUrlBrowser .Example: attr Tablet setOpenUrlBrowser de.ozerov.fully|de.ozerov.fully.MainActivity, first parameter: package name, second parameter: Class Name
+ screen - on/off/lock/unlock, switch screen on/off or lock/unlock screen. In Automagic "Preferences" the "Device admin functions" need to be enabled, otherwise "Screen off" does not work. attribute setScreenOnForTimer changes the time the display remains switched on!
+ screenFullscreen - on/off, activates/deactivates full screen mode. attribute setFullscreen
+ screenLock - Locks screen with request for PIN. attribute setScreenlockPIN - enter PIN here. Only use numbers, 4-16 numbers required.
+ screenOrientation - Auto,Landscape,Portait, set screen orientation (automatic, horizontal, vertical). attribute setScreenOrientation
+ system - issue system command (only with rooted Android devices). reboot,shutdown,airplanemodeON (can only be switched ON) attribute root , in Automagic "Preferences" "Root functions" need to be enabled.
+ setAPSSID - set WLAN AccesPoint SSID to prevent WLAN sleeps
+ setNotifySndFilePath - set systempath to notifyfile (default /storage/emulated/0/Notifications/
+ setTtsMsgSpeed - set speaking speed for TTS (Value between 0.5 - 4.0, 0.5 Step) default is 1.0
+ setTtsMsgLang - set speaking language for TTS, de or en (default is de)
+
+ To be able to use "openApp" the corresponding attribute "setOpenApp" needs to contain the app package name.
+
+ To be able to switch between bluetooth devices the attribute "setBluetoothDevice" needs to contain (a list of) bluetooth devices defined as follows: attr <DEVICE> BTdeviceName1|MAC,BTDeviceName2|MAC No spaces are allowed in any BTdeviceName. Defining MAC please make sure to use the character : (colon) after each second digit/character.
+ Example: attr Nexus10Wohnzimmer setBluetoothDevice Logitech_BT_Adapter|AB:12:CD:34:EF:32,Anker_A3565|GH:56:IJ:78:KL:76
+
+
+
+ state
+
+ initialized - shown after initial define.
+ active - device is active.
+ disabled - device is disabled by the attribute "disable".
+
+
+ Further examples and reading:
+
+
+
+
+=end html
+=begin html_DE
+
+
+AMADDevice
+
+ AMADDevice - Automagic Android Device
+
+ Dieses Modul liefert, in Verbindung mit der Android APP Automagic , diverse Informationen von Android Geräten.
+ Die AndroidAPP Automagic (welche nicht von mir stammt und 2.90 Euro kostet) funktioniert wie Tasker, ist aber bei weitem User freundlicher.
+
+ Mit etwas Einarbeitung können jegliche Informationen welche Automagic bereit stellt in FHEM angezeigt werden. Hierzu bedarf es lediglich eines eigenen Flows welcher seine Daten an die AMADDeviceCommBridge sendet. Das Modul gibt auch die Möglichkeit Androidgeräte zu steuern.
+
+ Für all diese Aktionen und Informationen wird auf dem Androidgerät "Automagic" und ein so genannter Flow benötigt. Die App ist über den Google PlayStore zu beziehen. Das benötigte Flowset bekommt man aus dem FHEM Verzeichnis.
+
+ Wie genau verwendet man nun AMADDevice?
+
+ stelle sicher das als aller erstes die AMADCommBridge in FHEM definiert wurde
+ installiere die App "Automagic Premium" aus dem PlayStore.
+ installiere das Flowset 74_AMADDeviceautomagicFlowset$VERSION.xml aus dem Ordner $INSTALLFHEM/FHEM/lib/ auf dem Androidgerät
+ aktiviere den Installationsassistanten Flow in Automagic. Wenn man nun Automagic in den Hintergrund schickt, z.B. Hometaste drücken, startet der Assistant und legt automatisch ein Device für das Androidgerät an.
+
+
+ Ein AMADDevice Gerät von Hand anlegen.
+
+
+ Define
+
+ 10.6.9.10 1496497380000 IODev=AMADBridge
+ define <name> AMADDevice <IP-ADRESSE> <AMAD_ID> IODev=<IODEVICE>
+
+ Beispiel:
+
+ define WandTabletWohnzimmer AMADDevice 192.168.0.23 123456 IODev=NAME_des_AMADCommBridge_Devices
+
+
+ In diesem Fall wird ein AMADDevice von Hand angelegt. Die AMAD_ID, hier 123456, muß auch exakt so als globale Variable in Automagic eingetragen sein.
+
+
+
+ Readings
+
+ airplanemode - Status des Flugmodus
+ androidVersion - aktuell installierte Androidversion
+ automagicState - Statusmeldungen von der AutomagicApp (Voraussetzung Android >4.3). Ist Android größer 4.3 vorhanden und im Reading steht "wird nicht unterstützt", muß in den Androideinstellungen unter Ton und Benachrichtigungen -> Benachrichtigungszugriff ein Haken für Automagic gesetzt werden
+ batteryHealth - Zustand der Battery (1=unbekannt, 2=gut, 3=Überhitzt, 4=tot, 5=Überspannung, 6=unbekannter Fehler, 7=kalt)
+ batterytemperature - Temperatur der Batterie
+ bluetooth - on/off, Bluetooth Status an oder aus
+ checkActiveTask - Zustand einer zuvor definierten APP. 0=nicht aktiv oder nicht aktiv im Vordergrund, 1=aktiv im Vordergrund, siehe Hinweis unten
+ connectedBTdevices - eine Liste der verbundenen Gerät
+ connectedBTdevicesMAC - eine Liste der MAC Adressen aller verbundender BT Geräte
+ currentMusicAlbum - aktuell abgespieltes Musikalbum des verwendeten Mediaplayers
+ currentMusicApp - aktuell verwendeter Mediaplayer (Amazon Music, Google Play Music, Google Play Video, Spotify, YouTube, TuneIn Player, Aldi Life Music)
+ currentMusicArtist - aktuell abgespielter Musikinterpret des verwendeten Mediaplayers
+ currentMusicIcon - Cover vom aktuell abgespielten Album Noch nicht fertig implementiert
+ currentMusicState - Status des aktuellen/zuletzt verwendeten Mediaplayers
+ currentMusicTrack - aktuell abgespielter Musiktitel des verwendeten Mediaplayers
+ daydream - on/off, Daydream gestartet oder nicht
+ deviceState - Status des Androidgerätes. unknown, online, offline.
+ doNotDisturb - aktueller Status des nicht stören Modus
+ dockingState - undocked/docked Status ob sich das Gerät in einer Dockinstation befindet.
+ flow_SetCommands - active/inactive, Status des SetCommands Flow
+ flow_informations - active/inactive, Status des Informations Flow
+ flowsetVersionAtDevice - aktuell installierte Flowsetversion auf dem Device
+ incomingCallerName - Anrufername des eingehenden Anrufes
+ incomingCallerNumber - Anrufernummer des eingehenden Anrufes
+ incommingWhatsAppMessageFrom - letzte WhatsApp Nachricht
+ incommingWhatsTelegramMessageFrom - letzte Telegram Nachricht
+ intentRadioName - zuletzt gesrreamter Intent Radio Name
+ intentRadioState - Status des IntentRadio Players
+ keyguardSet - 0/1 Displaysperre gesetzt 0=nein 1=ja, bedeutet nicht das sie gerade aktiv ist
+ lastSetCommandError - letzte Fehlermeldung vom set Befehl
+ lastSetCommandState - letzter Status vom set Befehl, Befehl erfolgreich/nicht erfolgreich gesendet
+ lastStatusRequestError - letzte Fehlermeldung vom statusRequest Befehl
+ lastStatusRequestState - letzter Status vom statusRequest Befehl, Befehl erfolgreich/nicht erfolgreich gesendet
+ nextAlarmDay - aktiver Alarmtag
+ nextAlarmState - aktueller Status des "Androidinternen" Weckers
+ nextAlarmTime - aktive Alarmzeit
+ powerLevel - Status der Batterie in %
+ powerPlugged - Netzteil angeschlossen? 0=NEIN, 1|2=JA
+ screen - on locked/unlocked, off locked/unlocked gibt an ob der Bildschirm an oder aus ist und gleichzeitig gesperrt oder nicht gesperrt
+ screenBrightness - Bildschirmhelligkeit von 0-255
+ screenFullscreen - on/off, Vollbildmodus (An,Aus)
+ screenOrientation - Landscape,Portrait, Bildschirmausrichtung (Horizontal,Vertikal)
+ screenOrientationMode - auto/manual, Modus für die Ausrichtung (Automatisch, Manuell)
+ state - aktueller Status
+ userFlowState - aktueller Status eines Flows, festgelegt unter dem setUserFlowState Attribut
+ volume - Media Lautstärkewert
+ volumeNotification - Benachrichtigungs Lautstärke
+
+ Beim Reading checkActivTask muß zuvor der Packagename der zu prüfenden App als Attribut checkActiveTask angegeben werden. Beispiel: attr Nexus10Wohnzimmer
+ checkActiveTask com.android.chrome für den Chrome Browser.
+
+
+
+
+ Set
+
+ activateVoiceInput - aktiviert die Spracheingabe
+ bluetooth - on/off, aktiviert/deaktiviert Bluetooth
+ clearNotificationBar - All,Automagic, löscht alle Meldungen oder nur die Automagic Meldungen in der Statusleiste
+ closeCall - beendet einen laufenden Anruf
+ currentFlowsetUpdate - fürt ein Flowsetupdate auf dem Device durch
+ doNotDisturb - schaltet den nicht stören Modus, always immer stören, never niemals stören, alarmClockOnly nur Wecker darf stören, onlyImportant nur wichtige Störungen
+ installFlowSource - installiert einen Flow auf dem Device, das XML File muss unter /tmp/ liegen und die Endung xml haben . Bsp: set TabletWohnzimmer installFlowSource WlanUebwerwachen.xml
+ mediaAmazonMusic - play, stop, next, back ,steuert den Amazon Musik Mediaplayer
+ mediaGoogleMusic - play, stop, next, back ,steuert den Google Play Musik Mediaplayer
+ mediaSpotifyMusic - play, stop, next, back ,steuert den Spotify Mediaplayer
+ mediaTuneinRadio - play, stop, next, back ,steuert den TuneIn Radio Mediaplayer
+ mediaAldiMusic - play, stop, next, back ,steuert den Aldi Musik Mediaplayer
+ mediaAudible - play, stop, next, back ,steuert den Audible Mediaplayer
+ mediaYouTube - play, stop, next, back ,steuert den YouTube Mediaplayer
+ mediaVlcPlayer - play, stop, next, back ,steuert den VLC Mediaplayer
+ nextAlarmTime - setzt die Alarmzeit. gilt aber nur innerhalb der nächsten 24Std.
+ openCall - ruft eine Nummer an und legt optional nach X Sekunden auf / set DEVICE openCall 01736458 10 / ruft die Nummer an und beendet den Anruf nach 10s
+ screenBrightness - setzt die Bildschirmhelligkeit, von 0-255.
+ screenMsg - versendet eine Bildschirmnachricht
+ sendintent - sendet einen Intentstring Bsp: set $AMADDeviceDEVICE sendIntent org.smblott.intentradio.PLAY url http://stream.klassikradio.de/live/mp3-192/stream.klassikradio.de/play.m3u name Klassikradio , der erste Befehl ist die Aktion und der zweite das Extra. Es können immer zwei Extras mitgegeben werden.
+ sendSMS - sendet eine SMS an eine bestimmte Telefonnummer. Bsp.: sendSMS Dies ist ein Test|555487263
+ startDaydream - startet den Daydream
+ statusRequest - Fordert einen neuen Statusreport beim Device an. Es können nicht von allen Readings per statusRequest die Daten geholt werden. Einige wenige geben nur bei Statusänderung ihren Status wieder.
+ timer - setzt einen Timer innerhalb der als Standard definierten ClockAPP auf dem Device. Es können nur Sekunden angegeben werden.
+ ttsMsg - versendet eine Nachricht welche als Sprachnachricht ausgegeben wird
+ userFlowState - aktiviert oder deaktiviert einen oder mehrere Flows,set Nexus7Wohnzimmer Badezimmer vorheizen:inactive oder set Nexus7Wohnzimmer Badezimmer vorheizen,Nachtlicht Steven:inactive
+ vibrate - lässt das Androidgerät vibrieren
+ volume - setzt die Medialautstärke. Entweder die internen Lautsprecher oder sofern angeschlossen die Bluetoothlautsprecher und per Klinkenstecker angeschlossene Lautsprecher, + oder - vor dem Wert reduziert die aktuelle Lautstärke um den Wert. Der maximale Sliderwert kann über das Attribut setVolMax geregelt werden.
+ volumeUp - erhöh;t die Lautstärke um den angegeben Wert im entsprechenden Attribut. Ist kein Attribut angegeben wird per default 2 genommen.
+ volumeDown - reduziert die Lautstärke um den angegeben Wert im entsprechenden Attribut. Ist kein Attribut angegeben wird per default 2 genommen.
+ volumeNotification - setzt die Benachrichtigungslautstärke.
+
+
+ Set abhängig von gesetzten Attributen
+
+ changetoBtDevice - wechselt zu einem anderen Bluetooth Gerät. Attribut setBluetoothDevice muß gesetzt sein. Siehe Hinweis unten!
+ notifySndFile - spielt die angegebene Mediadatei auf dem Androidgerät ab. Die aufzurufende Mediadatei sollte sich im Ordner /storage/emulated/0/Notifications/ befinden. Ist dies nicht der Fall kann man über das Attribut setNotifySndFilePath einen Pfad vorgeben.
+ openApp - öffnet eine ausgewählte App. Attribut setOpenApp
+ openURL - öffnet eine URL im Standardbrowser, sofern kein anderer Browser über das Attribut setOpenUrlBrowser ausgewählt wurde. Bsp: attr Tablet setOpenUrlBrowser de.ozerov.fully|de.ozerov.fully.MainActivity, das erste ist der Package Name und das zweite der Class Name
+ setAPSSID - setzt die AccessPoint SSID um ein WLAN sleep zu verhindern
+ screen - on/off/lock/unlock schaltet den Bildschirm ein/aus oder sperrt/entsperrt ihn, in den Automagic Einstellungen muss "Admin Funktion" gesetzt werden sonst funktioniert "Screen off" nicht. Attribut setScreenOnForTimer ändert die Zeit wie lange das Display an bleiben soll!
+ screenFullscreen - on/off, (aktiviert/deaktiviert) den Vollbildmodus. Attribut setFullscreen
+ screenLock - Sperrt den Bildschirm mit Pinabfrage. Attribut setScreenlockPIN - hier die Pin dafür eingeben. Erlaubt sind nur Zahlen. Es müßen mindestens 4, bis max 16 Zeichen verwendet werden.
+ screenOrientation - Auto,Landscape,Portait, aktiviert die Bildschirmausrichtung (Automatisch,Horizontal,Vertikal). Attribut setScreenOrientation
+ system - setzt Systembefehle ab (nur bei gerootetet Geräen). reboot,shutdown,airplanemodeON (kann nur aktiviert werden) Attribut root , in den Automagic Einstellungen muss "Root Funktion" gesetzt werden
+ setNotifySndFilePath - setzt den korrekten Systempfad zur Notifydatei (default ist /storage/emulated/0/Notifications/
+ setTtsMsgSpeed - setzt die Sprachgeschwindigkeit bei der Sprachausgabe(Werte zwischen 0.5 bis 4.0 in 0.5er Schritten) default ist 1.0
+ setTtsMsgSpeed - setzt die Sprache bei der Sprachausgabe, de oder en (default ist de)
+ setVolUpDownStep - setzt den Step für volumeUp und volumeDown
+ setVolMax - setzt die maximale Volume Gr&uoml;e für den Slider
+ setNotifyVolMax - setzt den maximalen Lautstärkewert für Benachrichtigungslautstärke für den Slider
+ setRingSoundVolMax - setzt den maximalen Lautstärkewert für Klingellautstärke für den Slider
+
+ Um openApp verwenden zu können, muss als Attribut der Package Name der App angegeben werden.
+
+ Um zwischen Bluetoothgeräten wechseln zu können, muß das Attribut setBluetoothDevice mit folgender Syntax gesetzt werden. attr <DEVICE> BTdeviceName1|MAC,BTDeviceName2|MAC Es muss
+ zwingend darauf geachtet werden das beim BTdeviceName kein Leerzeichen vorhanden ist. Am besten zusammen oder mit Unterstrich. Achtet bei der MAC darauf das Ihr wirklich nach jeder zweiten Zahl auch
+ einen : drin habt
+ Beispiel: attr Nexus10Wohnzimmer setBluetoothDevice Logitech_BT_Adapter|AB:12:CD:34:EF:32,Anker_A3565|GH:56:IJ:78:KL:76
+
+
+
+ state
+
+ initialized - Ist der Status kurz nach einem define.
+ active - die Geräteinstanz ist im aktiven Status.
+ disabled - die Geräteinstanz wurde über das Attribut disable deaktiviert
+
+
+ Anwendungsbeispiele:
+
+
+
+
+=end html_DE
+=cut
diff --git a/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.0.xml b/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.0.xml
new file mode 100644
index 000000000..92f5f813f
--- /dev/null
+++ b/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.0.xml
@@ -0,0 +1,4618 @@
+
+
+
+ true
+ Akku Ladestand: grösser als 0%
+ false
+ 0
+ HIGHER_THAN
+ true
+ true
+
+
+ false
+ App Task Beendet
+ false
+ CLASSIC
+ *
+
+
+ true
+ App Task Beendet: ch.gridvision.ppam.androidautomagic
+ false
+ CLASSIC
+ ch.gridvision.ppam.androidautomagic
+
+
+ true
+ Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic
+ false
+ ch.gridvision.ppam.androidautomagic
+ TEXT
+ CONTAINS_TEXT
+
+ false
+ false
+
+
+ true
+ Benachrichtigung in Statusbar angezeigt: com.whatsapp
+ false
+ com.whatsapp
+ TEXT
+ CONTAINS_TEXT
+
+ false
+ true
+
+
+ true
+ Benachrichtigung in Statusbar angezeigt: org.telegram.messenger
+ false
+ org.telegram.messenger
+ TEXT
+ CONTAINS_TEXT
+
+ false
+ true
+
+
+ true
+ Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic
+ false
+ ch.gridvision.ppam.androidautomagic
+ TEXT
+ CONTAINS_TEXT
+
+ false
+ false
+
+
+ true
+ Bluetooth Gerät getrennt: Alle Geräte
+ false
+ true
+
+
+
+
+ true
+ Bluetooth Gerät verbunden: Alle Geräte
+ false
+ true
+
+
+
+
+ true
+ Bluetooth Status: Schaltet aus, Aus
+ false
+ false
+ false
+ true
+ true
+
+
+ true
+ Bluetooth Status: Schaltet ein, Ein
+ false
+ true
+ true
+ false
+ false
+
+
+ true
+ Daydream Status: Gestartet
+ false
+ true
+
+
+ true
+ Daydream Status: Gestoppt
+ false
+ false
+
+
+ true
+ Display Orientierung: Landscape
+ false
+ false
+
+
+ true
+ Display Orientierung: Portrait
+ false
+ true
+
+
+ true
+ Display Status: Aus
+ false
+ false
+
+
+ true
+ Display Status: Ein
+ false
+ true
+
+
+ true
+ Dock Event: Docked
+ false
+ true
+
+
+ true
+ Dock Event: Undocked
+ false
+ false
+
+
+ true
+ Eingehender Anruf. Status: Klingelt, Nummern: Alle
+ false
+ true
+
+ true
+ true
+ false
+ false
+ false
+
+
+ true
+ Flugmodus: Aus
+ false
+ false
+
+
+ true
+ Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT
+ false
+ com.android.deskclock.ALARM_ALERT
+
+
+
+
+
+
+
+
+ false
+
+
+ true
+ Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS
+ false
+ com.android.deskclock.ALARM_DISMISS
+
+
+
+
+
+
+
+
+ false
+
+
+ true
+ Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE
+ false
+ com.android.deskclock.ALARM_DONE
+
+
+
+
+
+
+
+
+ false
+
+
+ true
+ Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE
+ false
+ com.android.deskclock.ALARM_SNOOZE
+
+
+
+
+
+
+
+
+ false
+
+
+ true
+ Genereller Broadcast: wenn org.smblott.intentradio.STATE
+ false
+ org.smblott.intentradio.STATE
+
+
+
+
+
+
+
+ irstate=getString("state");
+irname=getString("name")
+ false
+
+
+ false
+ HTTP Request: /fhem-amad/currentFlowsetUpdate
+ true
+ /fhem-amad/currentFlowsetUpdate
+ 8090
+ true
+
+
+ false
+ HTTP Request: /fhem-amad/deviceInfo/
+ false
+ /fhem-amad/deviceInfo/
+ 8090
+ true
+
+
+ false
+ HTTP Request: /fhem-amad/setCommands/*
+ false
+ /fhem-amad/setCommands/*
+ 8090
+ true
+
+
+ false
+ Medien Session verändert
+ false
+ com.amazon.mp3,com.amazon.avod.thirdpartyclient,com.audible.application,com.rhapsody.alditalk,com.spotify.music,com.google.android.videos,com.google.android.music,org.smblott.intentradioio,de.maxdome.app.android,tunein.player,org.videolan.vlc,com.google.android.youtube,com.sec.android.app.music
+
+
+ false
+ Periodischer Timer: alle 120s
+ false
+ 120000
+ true
+ false
+ false
+ Mon
+ Tue
+ Wed
+ Thu
+ Fri
+ Sat
+ Sun
+ 8
+ 0
+ 17
+ 0
+ true
+ false
+
+
+ true
+ Sprachbefehl angefordert
+ false
+
+
+ true
+ Stromversorgung: Angeschlossen
+ false
+ true
+ true
+ true
+ true
+
+
+ true
+ Stromversorgung: Entfernt
+ false
+ false
+ true
+ true
+ true
+
+
+ false
+ Systemeinstellung verändert: System next_alarm
+ false
+ SYSTEM
+ next_alarm_formatted
+ setting
+
+
+ true
+ Systemeinstellung verändert: System screen_brightness
+ false
+ SYSTEM
+ screen_brightness
+ screenBrightness
+
+
+ true
+ Systemeinstellung verändert: System volume_music_bt_a2dp
+ false
+ SYSTEM
+ volume_music_bt_a2dp
+ volume
+
+
+ true
+ Systemeinstellung verändert: System volume_music_headphone
+ false
+ SYSTEM
+ volume_music_headphone
+ volume
+
+
+ false
+ Systemeinstellung verändert: System volume_music_headset
+ false
+ SYSTEM
+ volume_music_headset
+ volume
+
+
+ true
+ Systemeinstellung verändert: System volume_music_speaker
+ false
+ SYSTEM
+ volume_music_speaker
+ volume
+
+
+ true
+ Systemeinstellung verändert: System volume_ring
+ false
+ SYSTEM
+ volume_ring
+ volumeRingSound
+
+
+ true
+ Systemeinstellung verändert: System volume_ring_speaker
+ false
+ SYSTEM
+ volume_ring_speaker
+ volumeNotification
+
+
+ true
+ Unterbrechnungen-Modus: Alle / Immer unterbrechen
+ false
+ OFF
+
+
+ true
+ Unterbrechnungen-Modus: Keine / Nicht unterbrechen
+ false
+ NO_INTERRUPTIONS
+
+
+ true
+ Unterbrechnungen-Modus: Nur Wecker (Android 6+)
+ false
+ ALARMS_ONLY
+
+
+ true
+ Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen
+ false
+ IMPORTANT_INTERRUPTIONS
+
+
+ false
+ WLAN Getrennt: toGo
+ true
+ false
+ {global_apssid}
+
+
+ false
+ WLAN Verbunden: toGo
+ true
+ false
+ {global_apssid}
+
+
+ false
+ App Task läuft: App (neuster)
+ CLASSIC
+ {param_app}
+ true
+
+
+ true
+ App Task läuft: {global_activetask} (neuster)
+ CLASSIC
+ {global_activetask}
+ true
+
+
+ false
+ Benachrichtigung in Statusbar angezeigt: Automagic
+ ch.gridvision.ppam.androidautomagic
+ true
+ 1
+ TEXT
+ CONTAINS_TEXT
+
+ false
+ false
+
+
+ false
+ Benachrichtigung in Statusbar angezeigt: Telegram Messenger
+ org.telegram.messenger
+ true
+ 1
+ TEXT
+ CONTAINS_TEXT
+
+ false
+ false
+
+
+ false
+ Benachrichtigung in Statusbar angezeigt: WhatsApp
+ com.whatsapp
+ true
+ 1
+ TEXT
+ CONTAINS_TEXT
+
+ false
+ false
+
+
+ true
+ Bluetooth eingeschaltet
+
+
+ true
+ Bluetooth Gerät verbunden: Beliebiges Geräte
+ true
+
+
+ ANY
+
+
+ true
+ Bluetooth Gerät verbunden: Beliebiges Geräte (Advanced Audio Distribution)
+ true
+
+
+ A2DP
+
+
+ true
+ Display automatisch drehen eingeschaltet
+
+
+ true
+ Display eingeschaltet
+
+
+ true
+ Display Orientierung: Portrait
+ true
+
+
+ true
+ Dock Status: Docked
+ true
+ true
+ true
+ true
+ true
+ false
+
+
+ true
+ Expression: airpcount < 11
+ airpcount < 11
+
+
+ false
+ Expression: Airplanemode
+ param_syscmd == "airplanemodeON"
+
+
+ false
+ Expression: All
+ param_app == "All"
+
+
+ true
+ Expression: amadcmd == "firstrun"
+ amadcmd == "firstrun"
+
+
+ false
+ Expression: Automagic
+ param_app == "Automagic"
+
+
+ false
+ Expression: Clear Automagic Meldungen"
+ request_path == "/fhem-amad/setCommands/clearnotificationbar"
+
+
+ false
+ Expression: closeCall"
+ request_path == "/fhem-amad/setCommands/closeCall"
+
+
+ true
+ Expression: contains(value, " und ")
+ contains(value, " und ")
+
+
+ false
+ Expression: do not Disturb"
+ request_path == "/fhem-amad/setCommands/donotdisturb"
+
+
+ true
+ Expression: fhemcmd == "readingsval"
+ fhemcmd == "readingsval"
+
+
+ true
+ Expression: fhemcmd == "set"
+ fhemcmd == "set"
+
+
+ true
+ Expression: fhemcmd == "setreading"
+ fhemcmd == "setreading"
+
+
+ true
+ Expression: fhemcmd == "voiceinputvalue"
+ fhemcmd == "voiceinputvalue"
+
+
+ false
+ Expression: flowState"
+ request_path == "/fhem-amad/setCommands/flowState"
+
+
+ true
+ Expression: getAndroidSDKVersion() >= "16"
+ getAndroidSDKVersion() >= "16"
+
+
+ true
+ Expression: getAndroidSDKVersion() >= "19"
+ getAndroidSDKVersion() >= "19"
+
+
+ true
+ Expression: getAndroidSDKVersion() >= "21"
+ getAndroidSDKVersion() >= "21"
+
+
+ true
+ Expression: global_activetask != null
+ global_activetask != null
+
+
+ true
+ Expression: global_fhemctlmode != "thirdPartControl"
+ global_fhemctlmode != "thirdPartControl"
+
+
+ true
+ Expression: global_fhemip != null or global_bridgeport != null
+ global_fhemip != null or global_bridgeport != null
+
+
+ true
+ Expression: global_userflowstate != "none"
+ global_userflowstate != "none"
+
+
+ false
+ Expression: installFlow"
+ request_path == "/fhem-amad/setCommands/installFlow"
+
+
+ true
+ Expression: keyguard == "locked"
+ keyguard == "locked"
+
+
+ true
+ Expression: Leon == "Gaultier"
+ Leon == "Gaultier"
+
+
+ false
+ Expression: multimediaControl"
+ request_path == "/fhem-amad/setCommands/multimediaControl"
+
+
+ false
+ Expression: notifysnd"
+ request_path == "/fhem-amad/setCommands/playnotifysnd"
+
+
+ false
+ Expression: openApp"
+ request_path == "/fhem-amad/setCommands/openApp"
+
+
+ false
+ Expression: openCall"
+ request_path == "/fhem-amad/setCommands/openCall"
+
+
+ false
+ Expression: openURL"
+ request_path == "/fhem-amad/setCommands/openURL"
+
+
+ true
+ Expression: package_name == {global_activetask}
+ package_name == {global_activetask}
+
+
+ true
+ Expression: param_bluetooth == "off"
+ param_bluetooth == "off"
+
+
+ true
+ Expression: param_bluetooth == "on"
+ param_bluetooth == "on"
+
+
+ true
+ Expression: param_button == "back"
+ param_button == "back"
+
+
+ true
+ Expression: param_button == "next"
+ param_button == "next"
+
+
+ true
+ Expression: param_button == "play/pause"
+ param_button == "play/pause"
+
+
+ true
+ Expression: param_button == "stop"
+ param_button == "stop"
+
+
+ true
+ Expression: param_disturbmod == "alarmClockOnly"
+ param_disturbmod == "alarmClockOnly"
+
+
+ true
+ Expression: param_disturbmod == "always"
+ param_disturbmod == "always"
+
+
+ true
+ Expression: param_disturbmod == "never"
+ param_disturbmod == "never"
+
+
+ true
+ Expression: param_disturbmod == "onlyImportant"
+ param_disturbmod == "onlyImportant"
+
+
+ true
+ Expression: param_flowstate == "active"
+ param_flowstate == "active"
+
+
+ true
+ Expression: param_flowstate == "active" or param_flowstate == "inactive"
+ param_flowstate == "active" or param_flowstate == "inactive"
+
+
+ true
+ Expression: param_fullscreen == "off"
+ param_fullscreen == "off"
+
+
+ true
+ Expression: param_fullscreen == "on"
+ param_fullscreen == "on"
+
+
+ true
+ Expression: param_lockmod == "lock"
+ param_lockmod == "lock"
+
+
+ true
+ Expression: param_notifyfile == "RedAlert.mp3"
+ param_notifyfile == "RedAlert.mp3"
+
+
+ false
+ Expression: param_option
+ param_hanguptime != "none"
+
+
+ true
+ Expression: param_orientation == "auto"
+ param_orientation == "auto"
+
+
+ true
+ Expression: param_orientation == "landscape"
+ param_orientation == "landscape"
+
+
+ true
+ Expression: param_orientation == "portrait"
+ param_orientation == "portrait"
+
+
+ true
+ Expression: param_screen=="off"
+ param_screen=="off"
+
+
+ true
+ Expression: param_screen=="on"
+ param_screen=="on"
+
+
+ false
+ Expression: Reboot
+ param_syscmd == "reboot"
+
+
+ true
+ Expression: respreadingsval != "kaputt" and respreadingsval != "none"
+ respreadingsval != "kaputt" and respreadingsval != "none"
+
+
+ true
+ Expression: respreadingsval == "online"
+ respreadingsval == "online"
+
+
+ true
+ Expression: scrcount < 5
+ scrcount < 5
+
+
+ false
+ Expression: screenMsg"
+ request_path == "/fhem-amad/setCommands/screenMsg"
+
+
+ false
+ Expression: sendIntent"
+ request_path == "/fhem-amad/setCommands/sendIntent"
+
+
+ false
+ Expression: sendSms"
+ request_path == "/fhem-amad/setCommands/sendSms"
+
+
+ false
+ Expression: setAlarm"
+ request_path == "/fhem-amad/setCommands/setAlarm"
+
+
+ false
+ Expression: setBluetooth"
+ request_path == "/fhem-amad/setCommands/setbluetooth"
+
+
+ false
+ Expression: setBrightness"
+ request_path == "/fhem-amad/setCommands/setBrightness"
+
+
+ false
+ Expression: setBTDevice"
+ request_path == "/fhem-amad/setCommands/setbtdevice"
+
+
+ false
+ Expression: setNotifiVolume"
+ request_path == "/fhem-amad/setCommands/setNotifiVolume"
+
+
+ false
+ Expression: setRingSoundVolume"
+ request_path == "/fhem-amad/setCommands/setRingSoundVolume"
+
+
+ false
+ Expression: setScreenFullscreen"
+ request_path == "/fhem-amad/setCommands/setScreenFullscreen"
+
+
+ false
+ Expression: setScreenlock"
+ request_path == "/fhem-amad/setCommands/screenlock"
+
+
+ false
+ Expression: setScreenOnOff"
+ request_path == "/fhem-amad/setCommands/setScreenOnOff"
+
+
+ false
+ Expression: setScreenOrientation"
+ request_path == "/fhem-amad/setCommands/setScreenOrientation"
+
+
+ false
+ Expression: setTimer"
+ request_path == "/fhem-amad/setCommands/setTimer"
+
+
+ false
+ Expression: setVibrate"
+ request_path == "/fhem-amad/setCommands/setvibrate"
+
+
+ false
+ Expression: setVoiceCommand"
+ request_path == "/fhem-amad/setCommands/setvoicecmd"
+
+
+ false
+ Expression: setVolume"
+ request_path == "/fhem-amad/setCommands/setVolume"
+
+
+ false
+ Expression: Shutdown
+ param_syscmd == "shutdown"
+
+
+ true
+ Expression: sprachassi == "ja"
+ sprachassi == "ja"
+
+
+ false
+ Expression: startDaydream"
+ request_path == "/fhem-amad/setCommands/startDaydream"
+
+
+ false
+ Expression: System Command"
+ request_path == "/fhem-amad/setCommands/systemcommand"
+
+
+ true
+ Expression: togocount < 6
+ togocount < 6
+
+
+ true
+ Expression: trigger == "Akku Ladestand: grösser als 0%"
+ trigger == "Akku Ladestand: grösser als 0%"
+
+
+ true
+ Expression: trigger == "App Task Beendet"
+ trigger == "App Task Beendet"
+
+
+ true
+ Expression: trigger == "Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic" or trigger == "Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic"
+ or trigger == "Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic"
+ or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "Benachrichtigung in Statusbar angezeigt: com.whatsapp"
+ trigger == "Benachrichtigung in Statusbar angezeigt: com.whatsapp"
+
+
+ true
+ Expression: trigger == "Benachrichtigung in Statusbar angezeigt: org.telegram.messenger"
+ trigger == "Benachrichtigung in Statusbar angezeigt: org.telegram.messenger"
+
+
+ true
+ Expression: trigger == "Bluetooth Status: Schaltet aus, Aus" or trigger == "Bluetooth Gerät verbunden: Alle Geräte" or trigger == "Bluetooth Gerät getrennt: Alle Geräte" or trigger == "Bluetooth Status: Schaltet ein, Ein" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Bluetooth Status: Schaltet aus, Aus"
+ or trigger == "Bluetooth Gerät verbunden: Alle Geräte"
+ or trigger == "Bluetooth Gerät getrennt: Alle Geräte"
+ or trigger == "Bluetooth Status: Schaltet ein, Ein"
+ or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "Daydream Status: Gestartet"
+ trigger == "Daydream Status: Gestartet"
+
+
+ true
+ Expression: trigger == "Daydream Status: Gestartet" or trigger == "Daydream Status: Gestoppt"
+ trigger == "Daydream Status: Gestartet"
+ or trigger == "Daydream Status: Gestoppt"
+
+
+ true
+ Expression: trigger == "Display Orientierung: Landscape" or trigger == "Display Orientierung: Portrait" or trigger == "Display Status: Ein" or trigger == "Display Status: Aus" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Display Orientierung: Landscape"
+ or trigger == "Display Orientierung: Portrait"
+ or trigger == "Display Status: Ein"
+ or trigger == "Display Status: Aus"
+ or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "Display Status: Aus" or trigger == "Display Status: Ein" or udef_trigger == "setLockPin" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Display Status: Aus"
+ or trigger == "Display Status: Ein"
+ or udef_trigger == "setLockPin"
+ or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "Dock Event: Docked" or trigger == "Dock Event: Undocked" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Dock Event: Docked"
+ or trigger == "Dock Event: Undocked"
+ or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "Eingehender Anruf. Status: Klingelt, Nummern: Alle"
+ trigger == "Eingehender Anruf. Status: Klingelt, Nummern: Alle"
+
+
+ true
+ Expression: trigger == "Flugmodus: Aus" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Flugmodus: Aus"
+ or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT"
+or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS"
+or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE"
+or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE"
+or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "Genereller Broadcast: wenn org.smblott.intentradio.STATE"
+ trigger == "Genereller Broadcast: wenn org.smblott.intentradio.STATE"
+
+
+ true
+ Expression: trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*"
+ trigger == "HTTP Request: /fhem-amad/setCommands/*"
+
+
+ true
+ Expression: trigger == "Medien Session verändert" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Medien Session verändert"
+ or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "Periodischer Timer: alle 120s"
+ trigger == "Periodischer Timer: alle 120s"
+
+
+ true
+ Expression: trigger == "Periodischer Timer: alle 120s" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Periodischer Timer: alle 120s" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "Sprachbefehl angefordert"
+ trigger == "Sprachbefehl angefordert"
+
+
+ true
+ Expression: trigger == "Systemeinstellung verändert: System next_alarm" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Systemeinstellung verändert: System next_alarm"
+ or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "Systemeinstellung verändert: System screen_brightness"
+ trigger == "Systemeinstellung verändert: System screen_brightness"
+
+
+ true
+ Expression: trigger == "Systemeinstellung verändert: System volume_music_bt_a2dp" or trigger == "Systemeinstellung verändert: System volume_music_speaker" or trigger == "Systemeinstellung verändert: System volume_music_headphone" or trigger == "Systemeinstellung verändert: System volume_music_headset"
+ trigger == "Systemeinstellung verändert: System volume_music_bt_a2dp"
+ or trigger == "Systemeinstellung verändert: System volume_music_speaker"
+ or trigger == "Systemeinstellung verändert: System volume_music_headphone"
+ or trigger == "Systemeinstellung verändert: System volume_music_headset"
+
+
+ true
+ Expression: trigger == "Systemeinstellung verändert: System volume_ring"
+ trigger == "Systemeinstellung verändert: System volume_ring"
+
+
+ true
+ Expression: trigger == "Systemeinstellung verändert: System volume_ring_speaker"
+ trigger == "Systemeinstellung verändert: System volume_ring_speaker"
+
+
+ true
+ Expression: trigger == "Unterbrechnungen-Modus: Alle / Immer unterbrechen" or trigger == "Unterbrechnungen-Modus: Keine / Nicht unterbrechen" or trigger == "Unterbrechnungen-Modus: Nur Wecker (Android 6+)" or trigger == "Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ trigger == "Unterbrechnungen-Modus: Alle / Immer unterbrechen"
+or trigger == "Unterbrechnungen-Modus: Keine / Nicht unterbrechen"
+or trigger == "Unterbrechnungen-Modus: Nur Wecker (Android 6+)"
+or trigger == "Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen"
+or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: trigger == "WLAN Getrennt: toGo"
+ trigger == "WLAN Getrennt: toGo"
+
+
+ true
+ Expression: trigger == "WLAN Verbunden: toGo"
+ trigger == "WLAN Verbunden: toGo"
+
+
+ false
+ Expression: ttsMsg"
+ request_path == "/fhem-amad/setCommands/ttsMsg"
+
+
+ false
+ Expression: ttsMsgLang"
+ param_msglang == "en"
+
+
+ true
+ Expression: udef_trigger == "setLockPin" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ udef_trigger == "setLockPin"
+ or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+
+
+ true
+ Expression: value != ""
+ value != ""
+
+
+ true
+ Expression: value == "ja"
+ value == "ja"
+
+
+ true
+ Expression: value == "nein"
+ value == "nein"
+
+
+ true
+ Flow Aktiv: First Run Assistant
+ First Run Assistant
+
+
+ true
+ Flow Aktiv: Informations
+ Informations
+
+
+ true
+ Flow Aktiv: Send Data to AMADCommBridge
+ Send Data to AMADCommBridge
+
+
+ true
+ Flow Aktiv: SetCommands
+ SetCommands
+
+
+ true
+ Flow Aktiv: {global_userflowstate}
+ {global_userflowstate}
+
+
+ true
+ Gerätespeicherplatz: Freier Speicherplatz > 1kb (/sdcard)
+ /sdcard
+ true
+ true
+ 1024
+
+
+ true
+ Gerätespeicherplatz: Freier Speicherplatz > 1kb (/storage/emulated/0)
+ /storage/emulated/0
+ true
+ true
+ 1024
+
+
+ true
+ Gerätespeicherplatz: Freier Speicherplatz > 1kb (/storage/sdcard0)
+ /storage/sdcard0
+ true
+ true
+ 1024
+
+
+ true
+ Host erreichbar: {global_fhemip}:{global_bridgeport}
+ SOCKET
+ {global_fhemip}
+ {global_bridgeport}
+
+
+ true
+ Keyguard gesperrt
+
+
+ true
+ Keyguard mit Sicherheit
+
+
+ true
+ Musik Aktiv
+
+
+ true
+ Stromversorgung: Angeschlossen
+ true
+ true
+ true
+ true
+
+
+ true
+ Unterbrechnungen-Modus: Alle / Immer unterbrechen
+ OFF
+
+
+ true
+ Unterbrechnungen-Modus: Keine / Nicht unterbrechen
+ NO_INTERRUPTIONS
+
+
+ true
+ Unterbrechnungen-Modus: Nur Wecker (Android 6+)
+ ALARMS_ONLY
+
+
+ true
+ Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen
+ IMPORTANT_INTERRUPTIONS
+
+
+ true
+ WLAN verfügbar: {global_apssid}
+ {global_apssid}
+
+
+ false
+ Abfrage
+ Send Data to AMADCommBridge
+
+ false
+ true
+ true
+
+
+ false
+ AMAD First Run Assistent Begrüßung
+ MUSIC
+ Hallo und herzlich willkommen beim Einrichtungs Assistenten von Fhem Amaad. Wenn Du fortfahren möchtest antworte einfach mit ja. Wenn nicht mit nein.
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ false
+ true
+ false
+ true
+ TRANSIENT
+
+
+ false
+ AMAD Voice Control
+ true
+
+ true
+ de-DE
+ false
+
+
+ true
+ Anruf beenden
+
+
+ false
+ App Starten: App
+ {param_app}
+
+
+
+ true
+ Audio Player steuern: Medienknopf Play/Pause (/{kname})
+ true
+ TOGGLE_PAUSE
+ KEYCODE_MEDIA_PLAY_PAUSE
+ true
+ {pname}
+ {kname}
+
+
+
+ true
+ Audio Player steuern: Medienknopf Stopp ({pname}/{kname})
+ true
+ STOP
+ KEYCODE_MEDIA_STOP
+ true
+ {pname}
+ {kname}
+
+
+
+ true
+ Audio Player steuern: Medienknopf Weiter ({pname}/{kname})
+ true
+ NEXT
+ KEYCODE_MEDIA_NEXT
+ true
+ {pname}
+ {kname}
+
+
+
+ true
+ Audio Player steuern: Medienknopf Zurück ({pname}/{kname})
+ true
+ PREVIOUS
+ KEYCODE_MEDIA_PREVIOUS
+ true
+ {pname}
+ {kname}
+
+
+
+ true
+ Benachrichtigung auf Bildschirm: [AMAD2] Nicht mehr benötigte AMAD Flows wurden entfernt! (lange)
+ true
+ [AMAD2] Nicht mehr benötigte AMAD Flows wurden entfernt!
+
+ 200
+ 250
+ false
+ 1.0
+ true
+ false
+ TOP_LEFT
+ 0
+ 0
+
+
+ true
+ Benachrichtigung auf Bildschirm: {param_message} (lange)
+ true
+ {param_message}
+
+ 200
+ 250
+ false
+ 1.0
+ true
+ false
+ TOP_LEFT
+ 0
+ 0
+
+
+ true
+ Benachrichtigung auf Bildschirm: {value} (lange)
+ true
+ {value}
+
+ 200
+ 250
+ false
+ 1.0
+ true
+ false
+ TOP_LEFT
+ 0
+ 0
+
+
+ true
+ Benachrichtigung aus Statusbar entfernen: Alle
+ false
+ true
+ 1
+ true
+
+ true
+ {id}
+ TEXT
+ CONTAINS_TEXT
+
+
+
+ true
+ Benachrichtigung aus Statusbar entfernen: Alle (Automagic)
+ true
+ true
+ 1
+ false
+
+ true
+ {id}
+ TEXT
+ CONTAINS_TEXT
+
+
+
+ true
+ Bluetooth ein-/ausschalten: Aus
+ false
+
+
+ true
+ Bluetooth ein-/ausschalten: Ein
+ true
+
+
+ true
+ Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdeviceone}
+ A2DP
+ {param_btdeviceone}
+
+ false
+
+
+ true
+ Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdevicetwo}
+ A2DP
+ {param_btdevicetwo}
+
+ false
+
+
+ true
+ Bluetooth Gerät verbinden/trennen: Trennen Eingabegerät {param_btdeviceone}
+ INPUT_DEVICE
+ {param_btdeviceone}
+
+ false
+
+
+ true
+ Bluetooth Gerät verbinden/trennen: Trennen Eingabegerät {param_btdevicetwo}
+ INPUT_DEVICE
+ {param_btdevicetwo}
+
+ false
+
+
+ true
+ Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdeviceone}
+ HEADSET
+ {param_btdeviceone}
+
+ false
+
+
+ true
+ Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdevicetwo}
+ HEADSET
+ {param_btdevicetwo}
+
+ false
+
+
+ true
+ Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdeviceone}
+ PAN
+ {param_btdeviceone}
+
+ false
+
+
+ true
+ Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdevicetwo}
+ PAN
+ {param_btdevicetwo}
+
+ false
+
+
+ true
+ Bluetooth Gerät verbinden/trennen: Verbinden Advanced Audio Distribution {param_swtobtdevicemac}
+ A2DP
+ {param_swtobtdevicemac}
+
+ true
+
+
+ true
+ Broadcast senden: {param_action}
+ {param_action}
+ false
+ android.intent.category.DEFAULT
+ false
+
+ false
+ text/plain
+ false
+
+
+ FLAG_ACTIVITY_NEW_TASK
+ putString("{param_exkey1}", "{param_exval1}");
+putString("{param_exkey2}", "{param_exval2}");
+ false
+
+
+
+ true
+ Dateien löschen: /sdcard/Download/currentFlowsetUpdate.xml
+ /sdcard/Download/currentFlowsetUpdate.xml
+ true
+
+
+ true
+ Dateien löschen: /storage/emulated/0/Download/currentFlowsetUpdate.xml
+ /storage/emulated/0/Download/currentFlowsetUpdate.xml
+ true
+
+
+ true
+ Dateien löschen: /storage/emulated/0/Download/installFlow_{param_flowname}
+ /storage/emulated/0/Download/installFlow_{param_flowname}
+ true
+
+
+ true
+ Dateien löschen: /storage/sdcard0/Download/currentFlowsetUpdate.xml
+ /storage/sdcard0/Download/currentFlowsetUpdate.xml
+ true
+
+
+ true
+ Dateien löschen: /storage/sdcard0/Download/installFlow_{param_flowname}
+ /storage/sdcard0/Download/installFlow_{param_flowname}
+ true
+
+
+ true
+ Display automatisch drehen ein-/ausschalten: Aus
+ false
+
+
+ true
+ Display automatisch drehen ein-/ausschalten: Ein
+ true
+
+
+ true
+ Download URL: http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml to /sdcard/Download
+ http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml
+ /sdcard/Download
+ true
+
+
+ true
+ Download URL: http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml to /storage/emulated/0/Download
+ http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml
+ /storage/emulated/0/Download
+ true
+
+
+ true
+ Download URL: http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml to /storage/sdcard0/Download
+ http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml
+ /storage/sdcard0/Download
+ true
+
+
+ true
+ Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/emulated/0/Download
+ http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname}
+ /storage/emulated/0/Download
+ true
+
+
+ true
+ Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/sdcard0/Download
+ http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname}
+ /storage/sdcard0/Download
+ true
+
+
+ true
+ Eingabedialog: AMADCommBridge Port Einzeiliger Text Bitte gebe den Port der AMADCommBridge vom FHEM Server an.
+ AMADCommBridge Port
+ SINGLE_LINE_TEXT
+ Bitte gebe den Port der AMADCommBridge vom FHEM Server an.
+
+ 8090
+ false
+ 60000
+
+ false
+ false
+ false
+
+
+ true
+ Eingabedialog: Android Device IP Adresse Einzeiliger Text Bitte gebe die IP Adresse Deines Androidgerätes an. NUR IP kein FQDN!!!
+ Android Device IP Adresse
+ SINGLE_LINE_TEXT
+ Bitte gebe die IP Adresse Deines Androidgerätes an. NUR IP kein FQDN!!!
+
+ 192.168.x.x
+ false
+ 60000
+
+ false
+ false
+ false
+
+
+ true
+ Eingabedialog: FHEM Devicename Einzeiliger Text Wie soll das Device in FHEM heißen?
+ FHEM Devicename
+ SINGLE_LINE_TEXT
+ Wie soll das Device in FHEM heißen?
+
+ TabletWohnzimmer
+ false
+ 60000
+
+ false
+ false
+ false
+
+
+ true
+ Eingabedialog: FHEM Server IP Einzeiliger Text Bitte gebe die IP Adresse oder den FQDN Deines FHEM Servers an.
+ FHEM Server IP
+ SINGLE_LINE_TEXT
+ Bitte gebe die IP Adresse oder den FQDN Deines FHEM Servers an.
+
+ 192.168.x.x
+ false
+ 60000
+
+ false
+ false
+ false
+
+
+ true
+ Eingabedialog: Wünschst Du einen sprachgestützten oder dialoggestützten Installationsassistanten? Einfachauswahl Menü Sprache,Dialog (15s)
+ Wünschst Du einen sprachgestützten oder dialoggestützten Installationsassistanten?
+ SINGLE_CHOICE_MENU
+
+ Sprache,Dialog
+ Sprache
+ true
+ 15000
+
+ false
+ false
+ false
+
+
+ true
+ Flows ausführen: Send Data to AMADCommBridge
+ Send Data to AMADCommBridge
+
+ false
+ false
+ false
+
+
+ false
+ Flows ausführen: Send Data to AMADCommBridge mit warten
+ Send Data to AMADCommBridge
+
+ false
+ true
+ false
+
+
+ false
+ Flows ausführen: udef_trigger setLockPin
+ Informations
+
+ false
+ true
+ false
+
+
+ true
+ Flows ausführen: VoiceControl
+ VoiceControl
+
+ false
+ false
+ false
+
+
+ true
+ Flows löschen: First Run Assistant
+ First Run Assistant
+ true
+
+
+ true
+ Flows löschen: MultimediaControl
+ MultimediaControl
+ true
+
+
+ true
+ Flows/Widgets importieren: /sdcard/Download/currentFlowsetUpdate.xml
+ /sdcard/Download/currentFlowsetUpdate.xml
+ true
+
+
+ true
+ Flows/Widgets importieren: /storage/emulated/0/Download/currentFlowsetUpdate.xml
+ /storage/emulated/0/Download/currentFlowsetUpdate.xml
+ true
+
+
+ true
+ Flows/Widgets importieren: /storage/emulated/0/Download/installFlow_{param_flowname}
+ /storage/emulated/0/Download/installFlow_{param_flowname}
+ true
+
+
+ true
+ Flows/Widgets importieren: /storage/sdcard0/Download/currentFlowsetUpdate.xml
+ /storage/sdcard0/Download/currentFlowsetUpdate.xml
+ true
+
+
+ true
+ Flows/Widgets importieren: /storage/sdcard0/Download/installFlow_{param_flowname}
+ /storage/sdcard0/Download/installFlow_{param_flowname}
+ true
+
+
+ true
+ Flugmodus ein-/ausschalten: Ein
+ SYSTEM_SETTING
+ true
+
+
+ true
+ Gerät sperren
+
+
+ false
+ Get Android Version
+
+
+
+ true
+ Herunterfahren
+
+
+ false
+ HTTP Request: send FIRSTRUN data to AMADCommBridge JSON
+ http://{global_fhemip}:{global_bridgeport}
+ false
+ false
+
+ false
+
+ POST
+ GENERAL_TEXT
+ text/json
+ {firstrundata}
+ @@@@readingsNameXYZ@@readingsValueABC
+ 15000
+ true
+ Connection: close
+ true
+ respfirstrun
+ /storage/emulated/0/Download/file.bin
+ false
+
+
+ false
+ HTTP Request: send READINGS data to AMADCommBridge JSON
+ http://{global_fhemip}:{global_bridgeport}
+ false
+ false
+
+ false
+
+ POST
+ GENERAL_TEXT
+ text/json
+ {fhemdata}
+ @@@@readingsNameXYZ@@readingsValueABC
+ 15000
+ true
+ Connection: close
+ true
+ respsetreading
+ /storage/emulated/0/Download/file.bin
+ false
+
+
+ false
+ HTTP Request: send READINGSVAL data to AMADCommBridge JSON
+ http://{global_fhemip}:{global_bridgeport}
+ false
+ false
+
+ false
+
+ POST
+ GENERAL_TEXT
+ text/json
+ {readingsvalcmd}
+ @@@@readingsNameXYZ@@readingsValueABC
+ 15000
+ true
+ Connection: close
+ true
+ respreadingsval
+ /storage/emulated/0/Download/file.bin
+ false
+
+
+ false
+ HTTP Request: send SET data to AMADCommBridge JSON
+ http://{global_fhemip}:{global_bridgeport}
+ false
+ false
+
+ false
+
+ POST
+ GENERAL_TEXT
+ text/json
+ {setcmd}
+ @@@@readingsNameXYZ@@readingsValueABC
+ 15000
+ true
+ Connection: close
+ true
+ respset
+ /storage/emulated/0/Download/file.bin
+ false
+
+
+ false
+ HTTP Request: send VOICEINPUTVALUE data to AMADCommBridge
+ http://{global_fhemip}:{global_bridgeport}
+ false
+ false
+
+ false
+
+ POST
+ GENERAL_TEXT
+ text/json
+ {voiceinputdata}
+ @@@@readingsNameXYZ@@readingsValueABC
+ 15000
+ true
+ FHEMDEVICE: {global_fhemdevice}
+FHEMCMD: voiceinputvalue
+Connection: close
+ true
+ respvoiceinputvalue
+ /storage/emulated/0/Download/file.bin
+ true
+
+
+ true
+ In Datei Schreiben: Aktiviere Flows in /storage/emulated/0/file.txt (anhängen)
+ /storage/emulated/0/file.txt
+ Aktiviere Flows
+ true
+
+
+ true
+ In Datei Schreiben: Deaktiviere Flows in /storage/emulated/0/file.txt (anhängen)
+ /storage/emulated/0/file.txt
+ Deaktiviere Flows
+ true
+
+
+ false
+ Initialisiere Variable Nächster Alarm: next_alarm
+ next_alarm
+
+
+ false
+ Initialisiere Variable Systemeinstellung: screenBrightness
+ SYSTEM
+ screen_brightness
+ screenBrightness
+
+
+ false
+ Initialisiere Variable Systemeinstellung: volumeMusikBluetooth.2
+ SYSTEM
+ volume_music_bt_a2dp
+ volumeBT
+
+
+ false
+ Initialisiere Variable Systemeinstellung: volumeMusikSpeaker.2
+ SYSTEM
+ volume_music_speaker
+ volumeSP
+
+
+ false
+ Initialisiere Variable Systemeinstellung: volumeNotification
+ SYSTEM
+ volume_ring_speaker
+ volumeNotification
+
+
+ false
+ Initialisiere Variable Systemeinstellung: volumeRingSound
+ SYSTEM
+ volume_ring
+ volumeRingSound
+
+
+ true
+ Lautstärke einstellen: Medien auf Level 8
+ MUSIC
+ ADJUST_SET_ABSOLUTE
+ 8
+ false
+ false
+
+
+ false
+ Lautstärken setzen param_notifivolume
+ false
+ global_volume_alarm
+ false
+ global_volume_dtmf
+ false
+ param_volume
+ true
+ param_notifivolume
+ false
+ global_volume_ring
+ false
+ global_volume_system
+ false
+ global_volume_voice_call
+ false
+ global_ringer_mode
+ false
+ global_interruptions_mode
+
+
+ false
+ Lautstärken setzen param_ringsoundvolume
+ false
+ global_volume_alarm
+ false
+ global_volume_dtmf
+ false
+ param_volume
+ false
+ param_notifivolume
+ true
+ param_ringsoundvolume
+ false
+ global_volume_system
+ false
+ global_volume_voice_call
+ false
+ global_ringer_mode
+ false
+ global_interruptions_mode
+
+
+ false
+ Lautstärken setzen param_volume
+ false
+ global_volume_alarm
+ false
+ global_volume_dtmf
+ true
+ param_volume
+ false
+ global_volume_notification
+ false
+ global_volume_ring
+ false
+ global_volume_system
+ false
+ global_volume_voice_call
+ false
+ global_ringer_mode
+ false
+ global_interruptions_mode
+
+
+ false
+ Medianlautstärken Speichern
+ false
+ global_volume_alarm
+ false
+ global_volume_dtmf
+ true
+ global_volume_music
+ false
+ global_volume_notification
+ false
+ global_volume_ring
+ false
+ global_volume_system
+ false
+ global_volume_voice_call
+ false
+ global_ringer_mode
+ false
+ global_interruptions_mode
+
+
+ false
+ Medienlautstärke Wiederherstellen
+ false
+ global_volume_alarm
+ false
+ global_volume_dtmf
+ true
+ global_volume_music
+ false
+ global_volume_notification
+ false
+ global_volume_ring
+ false
+ global_volume_system
+ false
+ global_volume_voice_call
+ false
+ global_ringer_mode
+ false
+ global_interruptions_mode
+
+
+ true
+ Meldungsdialog: Alle Informationen wurden nun erfasst und zur Amaad Comm Bridge gesendet. Ich werde gleich einmal prüfen ob die Einrichtung des Devices in Fhem gelungen ist. Gib mir bitte bis zu einer Minute Zeit für die Prüfung.
+
+ Alle Informationen wurden nun erfasst und zur Amaad Comm Bridge gesendet. Ich werde gleich einmal prüfen ob die Einrichtung des Devices in Fhem gelungen ist. Gib mir bitte bis zu einer Minute Zeit für die Prüfung.
+ Weiter
+ false
+ 60000
+
+
+ true
+ Meldungsdialog: Die Einrichtung ist nun abgeschlossen und das Amaad Device wurde angelegt. Es scheint aber noch keine Verbindung zwischen Fhem und Deinem Amaad Device zu bestehen. Mache am besten einmal ein Status Request in Fhem für das Amaad Device. Ist der Status in Fhem weiterhin offline schaue bitte ob alle Am
+
+ Die Einrichtung ist nun abgeschlossen und das Amaad Device wurde angelegt. Es scheint aber noch keine Verbindung zwischen Fhem und Deinem Amaad Device zu bestehen. Mache am besten einmal ein Status Request in Fhem für das Amaad Device. Ist der Status in Fhem weiterhin offline schaue bitte ob alle Amaad, Flows aktiv sind.
+ Weiter
+ false
+ 60000
+
+
+ true
+ Meldungsdialog: Leider scheint es ein Problem beim Einrichten des FHEM Devices gegeben zu haben. Hast Du die AMADCommBridge definiert, und ist sie auch aktiv? Sollte es weiterhin Probleme geben, wende Dich bitte an CoolTux alias Leon, im FHEM Forum.
+
+ Leider scheint es ein Problem beim Einrichten des FHEM Devices gegeben zu haben. Hast Du die AMADCommBridge definiert, und ist sie auch aktiv? Sollte es weiterhin Probleme geben, wende Dich bitte an CoolTux alias Leon, im FHEM Forum.
+ Weiter
+ false
+ 60000
+
+
+ true
+ Meldungsdialog: Wunderbar. Bitte nimm Dir Zeit und lese Dir die Hilfe Dialoge genau durch. Wenn Du Dir unsicher bist, kannst Du die Standardeinstellung, sofern vorhanden, belassen. Lass uns nun mit der Einrichtung beginnen.
+
+ Wunderbar. Bitte nimm Dir Zeit und lese Dir die Hilfe Dialoge genau durch. Wenn Du Dir unsicher bist, kannst Du die Standardeinstellung, sofern vorhanden, belassen. Lass uns nun mit der Einrichtung beginnen.
+ Weiter
+ false
+ 60000
+
+
+ true
+ Neustart
+
+
+
+ false
+ Notification Lautstärke Speichern
+ false
+ global_volume_alarm
+ false
+ global_volume_dtmf
+ false
+ global_volume_music
+ true
+ global_volume_notification
+ false
+ global_volume_ring
+ false
+ global_volume_system
+ false
+ global_volume_voice_call
+ false
+ global_ringer_mode
+ false
+ global_interruptions_mode
+
+
+ false
+ Notification Lautstärke Wiederherstellen
+ false
+ global_volume_alarm
+ false
+ global_volume_dtmf
+ false
+ param_volume
+ true
+ global_volume_notification
+ false
+ global_volume_ring
+ false
+ global_volume_system
+ false
+ global_volume_voice_call
+ false
+ global_ringer_mode
+ false
+ global_interruptions_mode
+
+
+ false
+ NotificationLautstärke auf Level 7
+ NOTIFICATION
+ ADJUST_SET_ABSOLUTE
+ 7
+ false
+ false
+
+
+ true
+ Nummer anrufen: {param_callnumber}
+
+ {param_callnumber}
+ true
+
+
+ true
+ Pause: 1s (Gerät wach halten)
+ 1s
+ true
+ false
+
+
+ true
+ Pause: 2s (Gerät wach halten)
+ 2s
+ true
+ false
+
+
+ true
+ Pause: 3s (Gerät wach halten)
+ 3s
+ true
+ false
+
+
+ true
+ Pause: {param_hanguptime}s (Gerät wach halten)
+ {param_hanguptime}s
+ true
+ false
+
+
+ false
+ Prüfe und setze Bridgeport Variable
+
+
+
+ false
+ Prüfe und setze globale Variable
+
+
+
+ false
+ Schalte Display ein
+ false
+ 5s
+ true
+
+
+ true
+ Schalte Display ein: Hell für {param_screenontime}s
+ true
+ {param_screenontime}s
+ true
+
+
+ true
+ Script: airpcount = 0
+
+
+
+ true
+ Script: airpcount = airpcount + 1
+
+
+
+ true
+ Script: airplanemode = "\"airplanemode\":" + " \"" + {airplanemode} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: airplanemode = "airplanemode@@on"; fhemcmd = "setreading";
+
+
+
+ true
+ Script: airplanemode = "off"
+
+
+
+ true
+ Script: amadcmd = "firstrun"
+
+
+
+ true
+ Script: amaddevice_ip = {value}
+
+
+
+ true
+ Script: androidVersion = "\"androidVersion\":" + " \"" + {androidVersion} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: androidVersion = "not supported funktion"
+
+
+
+ true
+ Script: automagicState = "\"automagicState\":" + " \"" + replaceAll({notification_text}, "\\n", " ") + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: bluetooth = "\"bluetooth\":" + " \"" + {bluetooth_state} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: bluetooth_state = "off"
+
+
+
+ true
+ Script: bluetooth_state = "on"
+
+
+
+ true
+ Script: btdeviceinfo = "\"connectedBTdevices\":" + " \"" + {connected_devices_names} + "\"" + "," + "\"connectedBTdevicesMAC\":" + " \"" + {connected_devices_addresses} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: checkActiveTask = "\"checkActiveTask\":" + " \"" + {runTask} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: connected_devices_names = "none"; connected_devices_addresses = "none"
+
+
+
+ true
+ Script: currentMusic = "\"currentMusicTrack\":" + " \"" + {title} + "\"" + "," + "\"currentMusicAlbum\":" + " \"" + {description} + "\"" + "," + "\"currentMusicArtist\":" + " \"" + {subtitle} + "\"" + "," + "\"currentMusicApp\":" + " \"" + {musicapp} + "\"" + "," + "\"currentMusicIcon\":" + " \"" + {icon} + "\"" + "," + "\"currentMusicState\":" + " \"" + {playback_state} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: daydream = "\"daydream\":" + " \"" + {daydream_state} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: daydream_state = "off"
+
+
+
+ true
+ Script: daydream_state = "on"
+
+
+
+ true
+ Script: deviceState = "\"deviceState\": \"online\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: dndValue = "alarmClockOnly"
+
+
+
+ true
+ Script: dndValue = "always"
+
+
+
+ true
+ Script: dndValue = "never"
+
+
+
+ true
+ Script: dndValue = "onlyImportant"
+
+
+
+ true
+ Script: dock_state = "docked"
+
+
+
+ true
+ Script: dock_state = "undocked"
+
+
+
+ true
+ Script: dockingState = "\"dockingState\":" + " \"" + {dock_state} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: doNotDisturb = "\"doNotDisturb\":" + " \"" + {dndValue} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: flow_informations = "\"flow_informations\":" + " \"" + {informationFlow_state} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: flow_informations = "\"userFlowState\":" + " \"" + {flowState} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: flow_SetCommands = "\"flow_SetCommands\":" + " \"" + {setCommandFlow_state} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: flowState = "active"
+
+
+
+ true
+ Script: flowState = "inactive"
+
+
+
+ true
+ Script: global_activetask = "none"; global_apssid = "none"; global_userflowstate = "none";
+
+
+
+ true
+ Script: global_amadid = getDate();
+
+
+
+ true
+ Script: global_bridgeport = {value}
+
+
+
+ true
+ Script: global_fhemdevice = {value}
+
+
+
+ true
+ Script: global_fhemip = {value}
+
+
+
+ true
+ Script: if(index == 0) { sprachassi = "ja"; } else { sprachassi = "nein"; }
+
+
+
+ true
+ Script: if(package_name == "com.google.android.music") { musicapp = "Google Musik" } if(package_name == "com.amazon.mp3") { musicapp = "Amazon Musik" } if(package_name == "com.google.android.videos") { musicapp = "Google Video" } if(package_name == "com.spotify.music") { musicapp = "Spotify Musik" } if(package_name == "com.google.android.youtube") { musicapp = "YouTube" } if(package_name == "tunein.player") { musicapp = "TuneIn Player" } if(package_name == "com.rhapsody.alditalk") { musicapp = "Aldi Life Musik" } if(package_name == "org.videolan.vlc") { musicapp = "VLC Player" } if(package_name == "com.sec.android.app.music") { musicapp = "Samsung Music Player" }
+
+
+
+ true
+ Script: if(playback_state == 0) { playback_state = "keiner" } if(playback_state == 1) { playback_state = "gestoppt" } if(playback_state == 2) { playback_state = "pausiert" } if(playback_state == 3) { playback_state = "spielt ab" } if(playback_state == 4) { playback_state = "spult vorwärts" } if(playback_state == 5) { playback_state = "spült rückwärts" } if(playback_state == 6) { playback_state = "buffert" } if(playback_state == 7) { playback_state = "Fehler" } if(playback_state == 8) { playback_state = "verbindet" } if(playback_state == 9) { playback_state = "springt zum vorherigen" } if(playback_state == 10) { playback_state = "springt zum nächsten" } if(playback_state == 11) { playback_state = "springt zu Position in Wiedergabeliste" }
+
+
+
+ true
+ Script: if(togocount > 0) { togocount = togocount + 1; } else { togocount = 0; togocount = togocount + 1; }
+
+
+
+ true
+ Script: if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT") { nextalarmstate = "alert" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS") { nextalarmstate = "dismiss" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE") { nextalarmstate = "done" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE") { nextalarmstate = "snooze" }
+
+
+
+ true
+ Script: incomingCaller = "\"incomingCallerName\":" + " \"" + {contact_name} + "\"" + "," + "\"incomingCallerNumber\":" + " \"" + {incoming_number} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: incommingTelegramMessage = "\"incommingTelegramMessageFrom\":" + " \"" + replaceAll({notification_text}, "\\n", " ") + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: incommingWhatsAppMessage = "\"incommingWhatsAppMessageFrom\":" + " \"" + replaceAll({notification_text}, "\\n", " ") + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: informationFlow_state = "aktiv"
+
+
+
+ true
+ Script: informationFlow_state = "inaktiv"
+
+
+
+ true
+ Script: intentRadioState = "\"intentRadioState\":" + " \"" + {irstate} + "\"" + "," + "\"intentRadioName\":" + " \"" + {irname} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: keyguard = "locked"
+
+
+
+ true
+ Script: keyguard = "unlocked"
+
+
+
+ true
+ Script: keyguardSet = "0"
+
+
+
+ true
+ Script: keyguardSet = "1"
+
+
+
+ true
+ Script: keyguardSet = "\"keyguardSet\":" + " \"" + {keyguardSet} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: keyguardSet = "not supported from your device"
+
+
+
+ true
+ Script: next_alarmday = "{next_alarm,dateformat,c}"
+
+
+
+ true
+ Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}"
+
+
+
+ true
+ Script: nextAlarm = "\"nextAlarmTime\":" + " \"" + {next_alarmtime} + "\"" + "," + "\"nextAlarmDay\":" + " \"" + {next_alarmday} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: nextAlarmState = "\"nextAlarmState\":" + " \"" + {nextalarmstate} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff"
+
+
+
+ true
+ Script: notification_text = "Flow '{param_flowname}' has been set {param_flowstate}"
+
+
+
+ true
+ Script: notification_text = "Flow install: path for download not exist"
+
+
+
+ true
+ Script: notification_text = "Flowset Update: path for download not exist"
+
+
+
+ true
+ Script: notification_text = "not supported from your device"
+
+
+
+ true
+ Script: powerinfo = "\"powerLevel\":" + " \"" + "{battery_percentage,numberformat,0}" + "\"" + "," + "\"powerPlugged\":" + " \"" + {battery_plugged} + "\"" + "," + "\"batteryTemperature\":" + " \"" + "{battery_temperature/10.0,numberformat.0.0}" + "\"" + "," + "\"batteryHealth\":" + " \"" + {battery_health} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: readingsvalcmd = "{global_fhemdevice} deviceState kaputt"; fhemcmd = "readingsval"; respfirstrun = "none";
+
+
+
+ true
+ Script: runTask = "0"
+
+
+
+ true
+ Script: runTask = "1"
+
+
+
+ true
+ Script: runTask = "not supported android version"
+
+
+
+ true
+ Script: runTask = "null"
+
+
+
+ true
+ Script: scrcount = 0
+
+
+
+ true
+ Script: scrcount = scrcount + 1
+
+
+
+ true
+ Script: screen = "\"screen\":" + " \"" + {screen_state} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: screen_orientation = "landscape"
+
+
+
+ true
+ Script: screen_orientation = "portrait"
+
+
+
+ true
+ Script: screen_orientation_mode = "auto"
+
+
+
+ true
+ Script: screen_orientation_mode = "manual"
+
+
+
+ true
+ Script: screen_state = "off {keyguard}"
+
+
+
+ true
+ Script: screen_state = "off"
+
+
+
+ true
+ Script: screen_state = "on {keyguard}"
+
+
+
+ true
+ Script: screen_state = "on"
+
+
+
+ true
+ Script: screenBrightness = "\"screenBrightness\":" + " \"" + {screenBrightness} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: screenOrientation = "\"screenOrientation\":" + " \"" + {screen_orientation} + "\"" + "," + "\"screenOrientationMode\":" + " \"" + {screen_orientation_mode} + "\""; fhemcmd = "setreading";
+
+
+
+ false
+ Script: Set FHEMDATA JSON
+
+
+
+ false
+ Script: Set FHEMDATA JSON First Run Assistant
+
+
+
+ false
+ Script: Set FHEMREADINGSVALCMD JSON
+
+
+
+ false
+ Script: Set FHEMSETCMD JSON
+
+
+
+ false
+ Script: Set FHEMVOICEINPUTDATA JSON
+
+
+
+ true
+ Script: setCommandFlow_state = "aktiv"
+
+
+
+ true
+ Script: setCommandFlow_state = "inaktiv"
+
+
+
+ true
+ Script: subtitle = "no player active"; title = "no player active"; description = "no player active"; musicapp = "no player active"; icon = "no player active"
+
+
+
+ true
+ Script: udef_trigger = "setLockPin"
+
+
+
+ true
+ Script: voiceinputdata = value; fhemcmd = "voiceinputvalue";
+
+
+
+ true
+ Script: voiceinputdata = {left(value, (indexOf(value, " und ")))}; fhemcmd = "voiceinputvalue";
+
+
+
+ true
+ Script: volume = {volumeBT}
+
+
+
+ true
+ Script: volume = {volumeSP}
+
+
+
+ true
+ Script: volumeNotification = "\"volumeNotification\":" + " \"" + {volumeNotification} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: volumeRingSound = "\"volumeRingSound\":" + " \"" + {volumeRingSound} + "\""; fhemcmd = "setreading";
+
+
+
+ true
+ Script: volumevalue = "\"volume\":" + " \"" + {volume} + "\""; fhemcmd = "setreading";
+
+
+
+ false
+ Script: Zuordnung Mediaplayer
+
+
+
+ true
+ Setze Alarm: um {param_hour}:{param_minute}
+
+ {param_hour}
+ {param_minute}
+
+
+ false
+ true
+
+
+ true
+ Setze Display Helligkeit: {param_brightness}
+ false
+ {param_brightness}
+ false
+ 50
+ true
+
+
+ true
+ Setze Display Orientierung: Auf Default zurücksetzen
+ UNSPECIFIED
+ false
+
+
+ true
+ Setze Display Orientierung: Landscape
+ LANDSCAPE
+ false
+
+
+ true
+ Setze Display Orientierung: Portrait
+ PORTRAIT
+ false
+
+
+ true
+ Setze Flow Status: Aktivieren Informations
+ true
+ Informations
+
+
+
+ true
+ Setze Flow Status: Aktivieren Informations,SetCommands
+ true
+ Informations,SetCommands
+
+
+
+ true
+ Setze Flow Status: Aktivieren Send Data to AMADCommBridge
+ true
+ Send Data to AMADCommBridge
+
+
+
+ true
+ Setze Flow Status: Aktivieren SetCommands
+ true
+ SetCommands
+
+
+
+ true
+ Setze Flow Status: Aktivieren SetCommands,Update AMAD Flowset,VoiceControl
+ true
+ SetCommands,Update AMAD Flowset,VoiceControl
+
+
+
+ true
+ Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma}
+ true
+ {imported_flow_names,listformat,comma}
+
+
+
+ true
+ Setze Flow Status: Aktivieren {param_flowname}
+ true
+ {param_flowname}
+
+
+
+ true
+ Setze Flow Status: Deaktivieren First Run Assistant
+ false
+ First Run Assistant
+
+
+
+ true
+ Setze Flow Status: Deaktivieren Informations,SetCommands
+ false
+ Informations,SetCommands
+
+
+
+ true
+ Setze Flow Status: Deaktivieren {param_flowname}
+ false
+ {param_flowname}
+
+
+
+ true
+ Setze Lock PIN/Passwort: PIN/Passwort zurücksetzen
+ true
+ PIN
+ false
+ param_lockPIN
+
+
+ true
+ Setze Lock PIN/Passwort: Setze PIN von Variable param_lockpin
+ false
+ PIN
+ false
+ param_lockpin
+
+
+ false
+ Setze Timer
+
+ {param_minute}m
+ true
+
+
+ true
+ Setze Unterbrechnungen-Modus: Alle / Immer unterbrechen
+ NOTIFICATION_LISTENER
+ OFF
+
+
+ true
+ Setze Unterbrechnungen-Modus: Keine / Nicht unterbrechen
+ NOTIFICATION_LISTENER
+ NO_INTERRUPTIONS
+
+
+ true
+ Setze Unterbrechnungen-Modus: Nur Wecker (Android 6+)
+ NOTIFICATION_LISTENER
+ ALARMS_ONLY
+
+
+ true
+ Setze Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen
+ NOTIFICATION_LISTENER
+ IMPORTANT_INTERRUPTIONS
+
+
+ false
+ Setze voice Variablen
+
+
+
+ true
+ Setze Vollbild Modus: Auf Default zurücksetzen
+ UNSPECIFIED
+ false
+
+
+ true
+ Setze Vollbild Modus: Navigation nicht anzeigen
+ HIDE_NAVIGATION
+ false
+
+
+ true
+ SMS senden an: an {param_smsnumber} '{param_smsmessage}' (10 in 12h)
+
+ {param_smsnumber}
+ {param_smsmessage}
+ true
+ true
+ 10
+ 43200000
+ false
+ false
+ true
+ 600000
+
+
+ true
+ Sound: {param_notifypath}{param_notifyfile} als Benachrichtigung
+ FILE
+ Lautlos
+ {param_notifypath}{param_notifyfile}
+ NOTIFICATION
+
+ false
+ true
+ true
+ TRANSIENT
+
+
+ true
+ Sprachausgabe: Alle Informationen wurden nun erfasst und zur Amaad Comm Bridge gesendet. Ich werde gleich einmal prüfen ob die Einrichtung des Devices in Fhem gelungen ist. Gib mir bitte bis zu einer Minute Zeit für die Prüfung.
+ MUSIC
+ Alle Informationen wurden nun erfasst und zur Amaad Comm Bridge gesendet. Ich werde gleich einmal prüfen ob die Einrichtung des Devices in Fhem gelungen ist. Gib mir bitte bis zu einer Minute Zeit für die Prüfung.
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ false
+ true
+ false
+ true
+ TRANSIENT
+
+
+ false
+ Sprachausgabe: Deutsch
+ MUSIC
+ {param_message}
+ de_DE
+ true
+ 1.0
+ true
+ {param_msgspeed}
+ true
+ false
+ false
+ true
+ TRANSIENT
+
+
+ true
+ Sprachausgabe: Die Einrichtung ist nun abgeschlossen und das Amaad Device online.
+Soll der Assistent gelöscht werden?
+ MUSIC
+ Die Einrichtung ist nun abgeschlossen und das Amaad Device online.
+Soll der Assistent gelöscht werden?
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ false
+ true
+ false
+ true
+ TRANSIENT
+
+
+ true
+ Sprachausgabe: Die Einrichtung ist nun abgeschlossen und das Amaad Device wurde angelegt. Es scheint aber noch keine Verbindung zwischen Fhem und Deinem Amaad Device zu bestehen. Mache am besten einmal ein Status Request in Fhem für das Amaad Device. Ist der Status in Fhem weiterhin offline schaue bitte ob alle Amaad, Flows aktiv sind.
+Soll der Assistent gelöscht werden?
+ MUSIC
+ Die Einrichtung ist nun abgeschlossen und das Amaad Device wurde angelegt. Es scheint aber noch keine Verbindung zwischen Fhem und Deinem Amaad Device zu bestehen. Mache am besten einmal ein Status Request in Fhem für das Amaad Device. Ist der Status in Fhem weiterhin offline schaue bitte ob alle Amaad, Flows aktiv sind.
+Soll der Assistent gelöscht werden?
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ false
+ true
+ false
+ true
+ TRANSIENT
+
+
+ true
+ Sprachausgabe: Du möchtest also nicht fortfahren. Das ist schade. Bitte bedenke das dieses Android Gerät somit nicht als Amaad Device in Fhem angelegt ist. Du kannst jeder Zeit den Assistenten Flow neu aktivieren und von vorn beginnen.
+Auf Wiedersehen.
+ MUSIC
+ Du möchtest also nicht fortfahren. Das ist schade. Bitte bedenke das dieses Android Gerät somit nicht als Amaad Device in Fhem angelegt ist. Du kannst jeder Zeit den Assistenten Flow neu aktivieren und von vorn beginnen.
+Auf Wiedersehen.
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ false
+ true
+ false
+ true
+ TRANSIENT
+
+
+ false
+ Sprachausgabe: Englisch
+ MUSIC
+ {param_message}
+ en_US
+ true
+ 1.0
+ true
+ {param_msgspeed}
+ true
+ false
+ false
+ true
+ TRANSIENT
+
+
+ true
+ Sprachausgabe: In Ordnung. Der Einrichtungs Assistent bleibt erhalten. Auf Wiedersehen.
+ MUSIC
+ In Ordnung. Der Einrichtungs Assistent bleibt erhalten. Auf Wiedersehen.
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ false
+ true
+ false
+ true
+ TRANSIENT
+
+
+ true
+ Sprachausgabe: In Ordnung. Der Einrichtungs Assistent wird gelöscht. Auf Wiedersehen.
+ MUSIC
+ In Ordnung. Der Einrichtungs Assistent wird gelöscht. Auf Wiedersehen.
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ false
+ true
+ false
+ true
+ TRANSIENT
+
+
+ true
+ Sprachausgabe: Leider scheint es ein Problem beim einrichten des Fhem Devices gegeben zu haben. Hast Du die Amaad Comm Bridge definiert? Und ist sie auch aktiv? Sollte es weiterhin Probleme geben, wende Dich bitte an Cooltux alias Leon, im Fhem Forum.
+Soll der Assistent gelöscht werden?
+ MUSIC
+ Leider scheint es ein Problem beim einrichten des Fhem Devices gegeben zu haben. Hast Du die Amaad Comm Bridge definiert? Und ist sie auch aktiv? Sollte es weiterhin Probleme geben, wende Dich bitte an Cooltux alias Leon, im Fhem Forum.
+Soll der Assistent gelöscht werden?
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ false
+ true
+ false
+ true
+ TRANSIENT
+
+
+ true
+ Sprachausgabe: Oh das tut mir leid, da scheine ich Dich nicht verstanden zu haben. Bitte versuche es mit etwas Ruhe im Hintergrund noch einmal.
+ MUSIC
+ Oh das tut mir leid, da scheine ich Dich nicht verstanden zu haben. Bitte versuche es mit etwas Ruhe im Hintergrund noch einmal.
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ false
+ true
+ false
+ true
+ TRANSIENT
+
+
+ true
+ Sprachausgabe: Wunderbar. Bitte nimm Dir Zeit und lese Dir die Hilfe Dialoge genau durch. Wenn Du Dir unsicher bist, kannst Du die Standardeinstellung, sofern vorhanden, belassen. Lass uns nun mit der Einrichtung beginnen.
+ MUSIC
+ Wunderbar. Bitte nimm Dir Zeit und lese Dir die Hilfe Dialoge genau durch. Wenn Du Dir unsicher bist, kannst Du die Standardeinstellung, sofern vorhanden, belassen. Lass uns nun mit der Einrichtung beginnen.
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ false
+ true
+ false
+ true
+ TRANSIENT
+
+
+ false
+ Spracheingabe wurde nicht erkannt
+ NOTIFICATION
+ Ihre Eingabe wurde nicht verstanden
+ de_DE
+ true
+ 1.0
+ true
+ 1.0
+ true
+ false
+ false
+ true
+ TRANSIENT
+
+
+ true
+ Starte Daydream
+
+
+ true
+ URL in Browser öffnen: {param_url} (mit {param_browserapp}/{param_browserappclass})
+ {param_url}
+ true
+ {param_browserapp}
+ {param_browserappclass}
+
+
+
+ true
+ Vibrieren: Pattern 2 (-- --)
+ false
+ vibrate_pattern_2
+ 0,500
+
+
+ true
+ WLAN Reassoziieren
+
+
+ First Run Assistant
+ AMADNG Info/Control Flowset v3.9.76
+ false
+ PARALLEL
+
+ App Task Beendet: ch.gridvision.ppam.androidautomagic
+
+ AMAD Voice Control
+ Flows löschen: First Run Assistant
+ AMAD Voice Control
+ AMAD Voice Control
+ Flows löschen: First Run Assistant
+ Sprachausgabe: In Ordnung. Der Einrichtungs Assistent bleibt erhalten. Auf Wiedersehen.
+ Abfrage
+ Script: amadcmd = "firstrun"
+ Script: amaddevice_ip = {value}
+ Eingabedialog: Android Device IP Adresse Einzeiliger Text Bitte gebe die IP Adresse Deines Androidgerätes an. NUR IP kein FQDN!!!
+ Script: global_fhemip = {value}
+ Eingabedialog: FHEM Server IP Einzeiliger Text Bitte gebe die IP Adresse oder den FQDN Deines FHEM Servers an.
+ Script: global_fhemdevice = {value}
+ Eingabedialog: FHEM Devicename Einzeiliger Text Wie soll das Device in FHEM heißen?
+ Script: global_bridgeport = {value}
+ Eingabedialog: AMADCommBridge Port Einzeiliger Text Bitte gebe den Port der AMADCommBridge vom FHEM Server an.
+ Sprachausgabe: Du möchtest also nicht fortfahren. Das ist schade. Bitte bedenke das dieses Android Gerät somit nicht als Amaad Device in Fhem angelegt ist. Du kannst jeder Zeit den Assistenten Flow neu aktivieren und von vorn beginnen.
+Auf Wiedersehen.
+ AMAD Voice Control
+ Medienlautstärke Wiederherstellen
+ Lautstärke einstellen: Medien auf Level 8
+ Medianlautstärken Speichern
+ Setze Flow Status: Aktivieren Informations
+ Setze Flow Status: Aktivieren SetCommands,Update AMAD Flowset,VoiceControl
+ Pause: 2s (Gerät wach halten)
+ Script: readingsvalcmd = "{global_fhemdevice} deviceState kaputt"; fhemcmd = "readingsval"; respfirstrun = "none";
+ Expression: value != ""
+ Sprachausgabe: Oh das tut mir leid, da scheine ich Dich nicht verstanden zu haben. Bitte versuche es mit etwas Ruhe im Hintergrund noch einmal.
+ Expression: value == "nein"
+ Expression: value == "ja"
+ Expression: value == "ja"
+ Sprachausgabe: In Ordnung. Der Einrichtungs Assistent wird gelöscht. Auf Wiedersehen.
+ Sprachausgabe: Oh das tut mir leid, da scheine ich Dich nicht verstanden zu haben. Bitte versuche es mit etwas Ruhe im Hintergrund noch einmal.
+ Expression: value != ""
+ Expression: value == "nein"
+ Expression: value != ""
+ Sprachausgabe: Oh das tut mir leid, da scheine ich Dich nicht verstanden zu haben. Bitte versuche es mit etwas Ruhe im Hintergrund noch einmal.
+ Expression: value == "nein"
+ Expression: value == "ja"
+ Flows löschen: First Run Assistant
+ Sprachausgabe: In Ordnung. Der Einrichtungs Assistent wird gelöscht. Auf Wiedersehen.
+ Sprachausgabe: In Ordnung. Der Einrichtungs Assistent bleibt erhalten. Auf Wiedersehen.
+ Expression: value != ""
+ Sprachausgabe: Oh das tut mir leid, da scheine ich Dich nicht verstanden zu haben. Bitte versuche es mit etwas Ruhe im Hintergrund noch einmal.
+ Sprachausgabe: In Ordnung. Der Einrichtungs Assistent wird gelöscht. Auf Wiedersehen.
+ Sprachausgabe: In Ordnung. Der Einrichtungs Assistent bleibt erhalten. Auf Wiedersehen.
+ Expression: value == "ja"
+ Expression: value == "nein"
+ Script: if(index == 0) { sprachassi = "ja"; } else { sprachassi = "nein"; }
+ AMAD First Run Assistent Begrüßung
+ Eingabedialog: Wünschst Du einen sprachgestützten oder dialoggestützten Installationsassistanten? Einfachauswahl Menü Sprache,Dialog (15s)
+ Script: global_amadid = getDate();
+ Setze Flow Status: Deaktivieren First Run Assistant
+ Setze Flow Status: Aktivieren Send Data to AMADCommBridge
+ Script: global_activetask = "none"; global_apssid = "none"; global_userflowstate = "none";
+ Sprachausgabe: Wunderbar. Bitte nimm Dir Zeit und lese Dir die Hilfe Dialoge genau durch. Wenn Du Dir unsicher bist, kannst Du die Standardeinstellung, sofern vorhanden, belassen. Lass uns nun mit der Einrichtung beginnen.
+ Meldungsdialog: Wunderbar. Bitte nimm Dir Zeit und lese Dir die Hilfe Dialoge genau durch. Wenn Du Dir unsicher bist, kannst Du die Standardeinstellung, sofern vorhanden, belassen. Lass uns nun mit der Einrichtung beginnen.
+ Expression: sprachassi == "ja"
+ Flows ausführen: Send Data to AMADCommBridge
+ Sprachausgabe: Alle Informationen wurden nun erfasst und zur Amaad Comm Bridge gesendet. Ich werde gleich einmal prüfen ob die Einrichtung des Devices in Fhem gelungen ist. Gib mir bitte bis zu einer Minute Zeit für die Prüfung.
+ Expression: sprachassi == "ja"
+ Meldungsdialog: Alle Informationen wurden nun erfasst und zur Amaad Comm Bridge gesendet. Ich werde gleich einmal prüfen ob die Einrichtung des Devices in Fhem gelungen ist. Gib mir bitte bis zu einer Minute Zeit für die Prüfung.
+ Expression: respreadingsval != "kaputt" and respreadingsval != "none"
+ Expression: sprachassi == "ja"
+ Sprachausgabe: Leider scheint es ein Problem beim einrichten des Fhem Devices gegeben zu haben. Hast Du die Amaad Comm Bridge definiert? Und ist sie auch aktiv? Sollte es weiterhin Probleme geben, wende Dich bitte an Cooltux alias Leon, im Fhem Forum.
+Soll der Assistent gelöscht werden?
+ Meldungsdialog: Leider scheint es ein Problem beim Einrichten des FHEM Devices gegeben zu haben. Hast Du die AMADCommBridge definiert, und ist sie auch aktiv? Sollte es weiterhin Probleme geben, wende Dich bitte an CoolTux alias Leon, im FHEM Forum.
+ Expression: sprachassi == "ja"
+ Sprachausgabe: Die Einrichtung ist nun abgeschlossen und das Amaad Device wurde angelegt. Es scheint aber noch keine Verbindung zwischen Fhem und Deinem Amaad Device zu bestehen. Mache am besten einmal ein Status Request in Fhem für das Amaad Device. Ist der Status in Fhem weiterhin offline schaue bitte ob alle Amaad, Flows aktiv sind.
+Soll der Assistent gelöscht werden?
+ Meldungsdialog: Die Einrichtung ist nun abgeschlossen und das Amaad Device wurde angelegt. Es scheint aber noch keine Verbindung zwischen Fhem und Deinem Amaad Device zu bestehen. Mache am besten einmal ein Status Request in Fhem für das Amaad Device. Ist der Status in Fhem weiterhin offline schaue bitte ob alle Am
+ Expression: respreadingsval == "online"
+ Sprachausgabe: Die Einrichtung ist nun abgeschlossen und das Amaad Device online.
+Soll der Assistent gelöscht werden?
+ Expression: sprachassi == "ja"
+ Meldungsdialog: Wunderbar. Bitte nimm Dir Zeit und lese Dir die Hilfe Dialoge genau durch. Wenn Du Dir unsicher bist, kannst Du die Standardeinstellung, sofern vorhanden, belassen. Lass uns nun mit der Einrichtung beginnen.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Informations
+ AMADNG Info/Control Flowset v3.9.76
+ false
+ QUEUE
+ 900
+ Script: daydream_state = "on"
+ Script: daydream_state = "off"
+ Script: keyguard = "unlocked"
+ Display Orientierung: Portrait
+ Script: screen_orientation = "portrait"
+ Script: screen_orientation = "landscape"
+ Script: dock_state = "docked"
+ Script: dock_state = "undocked"
+ Script: keyguardSet = "0"
+ Script: screen_orientation_mode = "manual"
+ Script: scrcount = 0
+ Script: keyguard = "locked"
+ Expression: scrcount < 5
+ Script: scrcount = scrcount + 1
+ Pause: 2s (Gerät wach halten)
+ Dock Status: Docked
+ Display automatisch drehen eingeschaltet
+ Expression: trigger == "Daydream Status: Gestartet"
+ Bluetooth eingeschaltet
+ Expression: trigger == "App Task Beendet"
+ Keyguard gesperrt
+ Expression: keyguard == "locked"
+ Expression: getAndroidSDKVersion() >= "16"
+ Script: keyguardSet = "not supported from your device"
+ Display eingeschaltet
+ Display eingeschaltet
+ Expression: getAndroidSDKVersion() >= "16"
+ Unterbrechnungen-Modus: Nur Wecker (Android 6+)
+ Unterbrechnungen-Modus: Keine / Nicht unterbrechen
+ Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen
+ Unterbrechnungen-Modus: Alle / Immer unterbrechen
+ Script: dndValue = "always"
+ Script: dndValue = "onlyImportant"
+ Script: dndValue = "never"
+ Script: dndValue = "alarmClockOnly"
+ Script: screen_state = "on"
+ Script: screen_state = "off"
+ Script: screen_state = "on {keyguard}"
+ Script: screen_state = "off {keyguard}"
+ Script: airplanemode = "off"
+ Script: bluetooth_state = "on"
+ Script: androidVersion = "not supported funktion"
+ App Task läuft: {global_activetask} (neuster)
+ Script: runTask = "1"
+ Script: runTask = "0"
+ Expression: getAndroidSDKVersion() >= "19"
+ Script: runTask = "not supported android version"
+ Script: runTask = "null"
+ Expression: trigger == "Periodischer Timer: alle 120s"
+ Expression: global_activetask != null
+ Expression: trigger == "Display Status: Aus" or trigger == "Display Status: Ein" or udef_trigger == "setLockPin" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Expression: trigger == "Daydream Status: Gestartet" or trigger == "Daydream Status: Gestoppt"
+ Expression: trigger == "Display Orientierung: Landscape" or trigger == "Display Orientierung: Portrait" or trigger == "Display Status: Ein" or trigger == "Display Status: Aus" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Expression: trigger == "Akku Ladestand: grösser als 0%"
+ Stromversorgung: Angeschlossen
+ Script: screen_orientation_mode = "auto"
+ Script: bluetooth_state = "off"
+ Script: if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT") { nextalarmstate = "alert" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS") { nextalarmstate = "dismiss" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE") { nextalarmstate = "done" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE") { nextalarmstate = "snooze" }
+ Keyguard mit Sicherheit
+ Script: keyguardSet = "1"
+ Expression: udef_trigger == "setLockPin" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Expression: trigger == "Eingehender Anruf. Status: Klingelt, Nummern: Alle"
+ Expression: trigger == "Flugmodus: Aus" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Expression: trigger == "Systemeinstellung verändert: System screen_brightness"
+ Bluetooth Gerät verbunden: Beliebiges Geräte (Advanced Audio Distribution)
+ Script: volume = {volumeBT}
+ Pause: 2s (Gerät wach halten)
+ Musik Aktiv
+ Benachrichtigung auf Bildschirm: [AMAD2] Nicht mehr benötigte AMAD Flows wurden entfernt! (lange)
+ Expression: trigger == "Systemeinstellung verändert: System volume_music_bt_a2dp" or trigger == "Systemeinstellung verändert: System volume_music_speaker" or trigger == "Systemeinstellung verändert: System volume_music_headphone" or trigger == "Systemeinstellung verändert: System volume_music_headset"
+ Initialisiere Variable Systemeinstellung: volumeMusikBluetooth.2
+ Script: volume = {volumeSP}
+ Initialisiere Variable Systemeinstellung: volumeMusikSpeaker.2
+ Expression: trigger == "Unterbrechnungen-Modus: Alle / Immer unterbrechen" or trigger == "Unterbrechnungen-Modus: Keine / Nicht unterbrechen" or trigger == "Unterbrechnungen-Modus: Nur Wecker (Android 6+)" or trigger == "Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Expression: getAndroidSDKVersion() >= "21"
+ Script: airpcount = 0
+ Host erreichbar: {global_fhemip}:{global_bridgeport}
+ WLAN Reassoziieren
+ Expression: trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Expression: trigger == "Systemeinstellung verändert: System next_alarm" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Initialisiere Variable Nächster Alarm: next_alarm
+ Script: next_alarmday = "{next_alarm,dateformat,c}"
+ Script: next_alarmtime = "{next_alarm,dateformat,HH:mm}"
+ Expression: global_fhemip != null or global_bridgeport != null
+ Expression: getAndroidSDKVersion() >= "19"
+ Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff"
+ Script: notification_text = "not supported from your device"
+ Expression: getAndroidSDKVersion() >= "19"
+ Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff"
+ Expression: trigger == "Genereller Broadcast: wenn org.smblott.intentradio.STATE"
+ Expression: trigger == "Benachrichtigung in Statusbar angezeigt: com.whatsapp"
+ Benachrichtigung in Statusbar angezeigt: WhatsApp
+ Script: notification_text = "not supported from your device"
+ Expression: trigger == "Benachrichtigung in Statusbar angezeigt: org.telegram.messenger"
+ Initialisiere Variable Systemeinstellung: screenBrightness
+ Expression: trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Expression: trigger == "Systemeinstellung verändert: System volume_ring_speaker"
+ Initialisiere Variable Systemeinstellung: volumeNotification
+ Expression: trigger == "Systemeinstellung verändert: System volume_ring"
+ Initialisiere Variable Systemeinstellung: volumeRingSound
+ Expression: trigger == "Medien Session verändert" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Get Android Version
+ WLAN verfügbar: {global_apssid}
+ Script: volumeRingSound = "\"volumeRingSound\":" + " \"" + {volumeRingSound} + "\""; fhemcmd = "setreading";
+ Script: intentRadioState = "\"intentRadioState\":" + " \"" + {irstate} + "\"" + "," + "\"intentRadioName\":" + " \"" + {irname} + "\""; fhemcmd = "setreading";
+ Script: keyguardSet = "\"keyguardSet\":" + " \"" + {keyguardSet} + "\""; fhemcmd = "setreading";
+ Script: dockingState = "\"dockingState\":" + " \"" + {dock_state} + "\""; fhemcmd = "setreading";
+ Script: screenOrientation = "\"screenOrientation\":" + " \"" + {screen_orientation} + "\"" + "," + "\"screenOrientationMode\":" + " \"" + {screen_orientation_mode} + "\""; fhemcmd = "setreading";
+ Script: screenBrightness = "\"screenBrightness\":" + " \"" + {screenBrightness} + "\""; fhemcmd = "setreading";
+ Script: daydream = "\"daydream\":" + " \"" + {daydream_state} + "\""; fhemcmd = "setreading";
+ Script: nextAlarm = "\"nextAlarmTime\":" + " \"" + {next_alarmtime} + "\"" + "," + "\"nextAlarmDay\":" + " \"" + {next_alarmday} + "\""; fhemcmd = "setreading";
+ Script: volumevalue = "\"volume\":" + " \"" + {volume} + "\""; fhemcmd = "setreading";
+ Script: volumeNotification = "\"volumeNotification\":" + " \"" + {volumeNotification} + "\""; fhemcmd = "setreading";
+ Script: airplanemode = "\"airplanemode\":" + " \"" + {airplanemode} + "\""; fhemcmd = "setreading";
+ Script: screen = "\"screen\":" + " \"" + {screen_state} + "\""; fhemcmd = "setreading";
+ Script: nextAlarmState = "\"nextAlarmState\":" + " \"" + {nextalarmstate} + "\""; fhemcmd = "setreading";
+ Script: doNotDisturb = "\"doNotDisturb\":" + " \"" + {dndValue} + "\""; fhemcmd = "setreading";
+ Script: checkActiveTask = "\"checkActiveTask\":" + " \"" + {runTask} + "\""; fhemcmd = "setreading";
+ Expression: Leon == "Gaultier"
+ Flows löschen: MultimediaControl
+ Script: androidVersion = "\"androidVersion\":" + " \"" + {androidVersion} + "\""; fhemcmd = "setreading";
+ Script: powerinfo = "\"powerLevel\":" + " \"" + "{battery_percentage,numberformat,0}" + "\"" + "," + "\"powerPlugged\":" + " \"" + {battery_plugged} + "\"" + "," + "\"batteryTemperature\":" + " \"" + "{battery_temperature/10.0,numberformat.0.0}" + "\"" + "," + "\"batteryHealth\":" + " \"" + {battery_health} + "\""; fhemcmd = "setreading";
+ Expression: trigger == "Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic" or trigger == "Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Expression: getAndroidSDKVersion() >= "19"
+ Script: notification_text = "Aktiviere Automagic unter Einstellungen -> Benachrichtigungen -> Benachrichtigungszugriff"
+ Benachrichtigung in Statusbar angezeigt: Automagic
+ Expression: package_name == {global_activetask}
+ Script: deviceState = "\"deviceState\": \"online\""; fhemcmd = "setreading";
+ Expression: trigger == "Dock Event: Docked" or trigger == "Dock Event: Undocked" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Expression: trigger == "Periodischer Timer: alle 120s" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Flows ausführen: Send Data to AMADCommBridge
+ Prüfe und setze globale Variable
+ Script: bluetooth = "\"bluetooth\":" + " \"" + {bluetooth_state} + "\""; fhemcmd = "setreading";
+ Script: connected_devices_names = "none"; connected_devices_addresses = "none"
+ Script: btdeviceinfo = "\"connectedBTdevices\":" + " \"" + {connected_devices_names} + "\"" + "," + "\"connectedBTdevicesMAC\":" + " \"" + {connected_devices_addresses} + "\""; fhemcmd = "setreading";
+ Bluetooth Gerät verbunden: Beliebiges Geräte
+ Expression: trigger == "Bluetooth Status: Schaltet aus, Aus" or trigger == "Bluetooth Gerät verbunden: Alle Geräte" or trigger == "Bluetooth Gerät getrennt: Alle Geräte" or trigger == "Bluetooth Status: Schaltet ein, Ein" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Host erreichbar: {global_fhemip}:{global_bridgeport}
+ Script: flow_SetCommands = "\"flow_SetCommands\":" + " \"" + {setCommandFlow_state} + "\""; fhemcmd = "setreading";
+ Setze Flow Status: Aktivieren SetCommands
+ Script: setCommandFlow_state = "aktiv"
+ Script: setCommandFlow_state = "inaktiv"
+ Flow Aktiv: SetCommands
+ Expression: trigger == "Periodischer Timer: alle 120s"
+ Expression: global_userflowstate != "none"
+ Flow Aktiv: {global_userflowstate}
+ Script: flowState = "inactive"
+ Script: flowState = "active"
+ Script: flow_informations = "\"userFlowState\":" + " \"" + {flowState} + "\""; fhemcmd = "setreading";
+ Expression: trigger == "Periodischer Timer: alle 120s" or trigger == "HTTP Request: /fhem-amad/deviceInfo/"
+ Flow Aktiv: Send Data to AMADCommBridge
+ Setze Flow Status: Aktivieren Send Data to AMADCommBridge
+ Expression: trigger == "Periodischer Timer: alle 120s"
+ Script: incomingCaller = "\"incomingCallerName\":" + " \"" + {contact_name} + "\"" + "," + "\"incomingCallerNumber\":" + " \"" + {incoming_number} + "\""; fhemcmd = "setreading";
+ Script: incommingWhatsAppMessage = "\"incommingWhatsAppMessageFrom\":" + " \"" + replaceAll({notification_text}, "\\n", " ") + "\""; fhemcmd = "setreading";
+ Script: automagicState = "\"automagicState\":" + " \"" + replaceAll({notification_text}, "\\n", " ") + "\""; fhemcmd = "setreading";
+ Script: incommingTelegramMessage = "\"incommingTelegramMessageFrom\":" + " \"" + replaceAll({notification_text}, "\\n", " ") + "\""; fhemcmd = "setreading";
+ Benachrichtigung in Statusbar angezeigt: Telegram Messenger
+ Pause: 2s (Gerät wach halten)
+ Script: airpcount = airpcount + 1
+ Expression: airpcount < 11
+ Script: notification_text = "not supported from your device"
+
+ Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE
+ Genereller Broadcast: wenn org.smblott.intentradio.STATE
+ Systemeinstellung verändert: System volume_music_headphone
+ Systemeinstellung verändert: System volume_music_headset
+ Stromversorgung: Angeschlossen
+ Bluetooth Status: Schaltet ein, Ein
+ Display Status: Aus
+ Display Orientierung: Portrait
+ Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE
+ Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS
+ Bluetooth Status: Schaltet aus, Aus
+ Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen
+ Benachrichtigung in Statusbar angezeigt: com.whatsapp
+ Daydream Status: Gestoppt
+ Benachrichtigung in Statusbar angezeigt: ch.gridvision.ppam.androidautomagic
+ Eingehender Anruf. Status: Klingelt, Nummern: Alle
+ Display Status: Ein
+ Systemeinstellung verändert: System volume_music_speaker
+ Systemeinstellung verändert: System screen_brightness
+ Daydream Status: Gestartet
+ Bluetooth Gerät verbunden: Alle Geräte
+ Bluetooth Gerät getrennt: Alle Geräte
+ Dock Event: Docked
+ Periodischer Timer: alle 120s
+ Systemeinstellung verändert: System volume_music_bt_a2dp
+ Akku Ladestand: grösser als 0%
+ Unterbrechnungen-Modus: Alle / Immer unterbrechen
+ App Task Beendet
+ HTTP Request: /fhem-amad/deviceInfo/
+ Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT
+ Benachrichtigung in Statusbar angezeigt: org.telegram.messenger
+ Stromversorgung: Entfernt
+ Systemeinstellung verändert: System next_alarm
+ Benachrichtigung in Statusbar entfernt: ch.gridvision.ppam.androidautomagic
+ Unterbrechnungen-Modus: Keine / Nicht unterbrechen
+ Dock Event: Undocked
+ Display Orientierung: Landscape
+ Unterbrechnungen-Modus: Nur Wecker (Android 6+)
+ Systemeinstellung verändert: System volume_ring
+ Flugmodus: Aus
+ Systemeinstellung verändert: System volume_ring_speaker
+ Medien Session verändert
+
+ Script: subtitle = "no player active"; title = "no player active"; description = "no player active"; musicapp = "no player active"; icon = "no player active"
+ Script: if(playback_state == 0) { playback_state = "keiner" } if(playback_state == 1) { playback_state = "gestoppt" } if(playback_state == 2) { playback_state = "pausiert" } if(playback_state == 3) { playback_state = "spielt ab" } if(playback_state == 4) { playback_state = "spult vorwärts" } if(playback_state == 5) { playback_state = "spült rückwärts" } if(playback_state == 6) { playback_state = "buffert" } if(playback_state == 7) { playback_state = "Fehler" } if(playback_state == 8) { playback_state = "verbindet" } if(playback_state == 9) { playback_state = "springt zum vorherigen" } if(playback_state == 10) { playback_state = "springt zum nächsten" } if(playback_state == 11) { playback_state = "springt zu Position in Wiedergabeliste" }
+ Script: currentMusic = "\"currentMusicTrack\":" + " \"" + {title} + "\"" + "," + "\"currentMusicAlbum\":" + " \"" + {description} + "\"" + "," + "\"currentMusicArtist\":" + " \"" + {subtitle} + "\"" + "," + "\"currentMusicApp\":" + " \"" + {musicapp} + "\"" + "," + "\"currentMusicIcon\":" + " \"" + {icon} + "\"" + "," + "\"currentMusicState\":" + " \"" + {playback_state} + "\""; fhemcmd = "setreading";
+ Script: if(package_name == "com.google.android.music") { musicapp = "Google Musik" } if(package_name == "com.amazon.mp3") { musicapp = "Amazon Musik" } if(package_name == "com.google.android.videos") { musicapp = "Google Video" } if(package_name == "com.spotify.music") { musicapp = "Spotify Musik" } if(package_name == "com.google.android.youtube") { musicapp = "YouTube" } if(package_name == "tunein.player") { musicapp = "TuneIn Player" } if(package_name == "com.rhapsody.alditalk") { musicapp = "Aldi Life Musik" } if(package_name == "org.videolan.vlc") { musicapp = "VLC Player" } if(package_name == "com.sec.android.app.music") { musicapp = "Samsung Music Player" }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Send Data to AMADCommBridge
+ AMADNG Info/Control Flowset v3.9.76
+ true
+ PARALLEL
+ 900
+
+ WLAN Getrennt: toGo
+ WLAN Verbunden: toGo
+
+ Expression: fhemcmd == "set"
+ Expression: fhemcmd == "voiceinputvalue"
+ Expression: amadcmd == "firstrun"
+ Expression: fhemcmd == "readingsval"
+ Script: Set FHEMSETCMD JSON
+ Script: Set FHEMVOICEINPUTDATA JSON
+ Script: Set FHEMREADINGSVALCMD JSON
+ Expression: fhemcmd == "setreading"
+ Script: Set FHEMDATA JSON First Run Assistant
+ Host erreichbar: {global_fhemip}:{global_bridgeport}
+ In Datei Schreiben: Deaktiviere Flows in /storage/emulated/0/file.txt (anhängen)
+ Setze Flow Status: Deaktivieren Informations,SetCommands
+ Flow Aktiv: Informations
+ Flow Aktiv: SetCommands
+ Expression: trigger == "WLAN Getrennt: toGo"
+ Expression: togocount < 6
+ Pause: 1s (Gerät wach halten)
+ Setze Flow Status: Aktivieren Informations,SetCommands
+ Flow Aktiv: Informations
+ Flow Aktiv: SetCommands
+ Expression: trigger == "WLAN Verbunden: toGo"
+ In Datei Schreiben: Aktiviere Flows in /storage/emulated/0/file.txt (anhängen)
+ HTTP Request: send FIRSTRUN data to AMADCommBridge JSON
+ HTTP Request: send READINGS data to AMADCommBridge JSON
+ HTTP Request: send SET data to AMADCommBridge JSON
+ HTTP Request: send READINGSVAL data to AMADCommBridge JSON
+ HTTP Request: send VOICEINPUTVALUE data to AMADCommBridge
+ Script: if(togocount > 0) { togocount = togocount + 1; } else { togocount = 0; togocount = togocount + 1; }
+ Script: Set FHEMDATA JSON
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SetCommands
+ AMADNG Info/Control Flowset v3.9.76
+ false
+ QUEUE
+ 900
+
+ HTTP Request: /fhem-amad/deviceInfo/
+ Sprachbefehl angefordert
+ HTTP Request: /fhem-amad/setCommands/*
+ Periodischer Timer: alle 120s
+
+ Expression: setBrightness"
+ Expression: setScreenFullscreen"
+ Expression: param_orientation == "auto"
+ Setze Display Orientierung: Portrait
+ Setze Display Orientierung: Landscape
+ Expression: param_orientation == "landscape"
+ Setze Vollbild Modus: Navigation nicht anzeigen
+ Setze Vollbild Modus: Auf Default zurücksetzen
+ Setze Display Orientierung: Auf Default zurücksetzen
+ Display automatisch drehen ein-/ausschalten: Aus
+ Display automatisch drehen ein-/ausschalten: Ein
+ Expression: setScreenOrientation"
+ Expression: param_fullscreen == "off"
+ Expression: param_bluetooth == "off"
+ Expression: param_bluetooth == "on"
+ Bluetooth ein-/ausschalten: Ein
+ Bluetooth eingeschaltet
+ Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdeviceone}
+ Bluetooth Gerät verbinden/trennen: Trennen Eingabegerät {param_btdeviceone}
+ Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdeviceone}
+ Bluetooth Gerät verbinden/trennen: Trennen Advanced Audio Distribution {param_btdevicetwo}
+ Bluetooth Gerät verbinden/trennen: Trennen Eingabegerät {param_btdevicetwo}
+ Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdeviceone}
+ Bluetooth Gerät verbinden/trennen: Trennen Headset {param_btdevicetwo}
+ Bluetooth Gerät verbinden/trennen: Trennen Personal Area Network {param_btdevicetwo}
+ Pause: 3s (Gerät wach halten)
+ Bluetooth Gerät verbinden/trennen: Verbinden Advanced Audio Distribution {param_swtobtdevicemac}
+ Pause: 2s (Gerät wach halten)
+ Expression: setBTDevice"
+ Bluetooth ein-/ausschalten: Aus
+ Expression: param_orientation == "portrait"
+ Expression: setVoiceCommand"
+ Setze Display Helligkeit: {param_brightness}
+ Expression: setScreenlock"
+ Expression: sendIntent"
+ Expression: param_lockmod == "lock"
+ Setze Lock PIN/Passwort: PIN/Passwort zurücksetzen
+ Setze Lock PIN/Passwort: Setze PIN von Variable param_lockpin
+ Expression: trigger == "Sprachbefehl angefordert"
+ Expression: setAlarm"
+ Setze Timer
+ Expression: screenMsg"
+ Benachrichtigung auf Bildschirm: {param_message} (lange)
+ Script: udef_trigger = "setLockPin"
+ Display eingeschaltet
+ Gerät sperren
+ Schalte Display ein
+ Gerät sperren
+ Expression: setTimer"
+ Expression: param_option
+ Pause: {param_hanguptime}s (Gerät wach halten)
+ Anruf beenden
+ Broadcast senden: {param_action}
+ URL in Browser öffnen: {param_url} (mit {param_browserapp}/{param_browserappclass})
+ Setze Unterbrechnungen-Modus: Alle / Immer unterbrechen
+ Setze Unterbrechnungen-Modus: Wichtig / Nur wichtige Unterbrechnungen zulassen
+ Setze Unterbrechnungen-Modus: Keine / Nicht unterbrechen
+ Setze Unterbrechnungen-Modus: Nur Wecker (Android 6+)
+ Expression: openURL"
+ Expression: param_fullscreen == "on"
+ Expression: do not Disturb"
+ Expression: param_disturbmod == "always"
+ Expression: param_disturbmod == "onlyImportant"
+ Expression: param_disturbmod == "never"
+ Expression: param_disturbmod == "alarmClockOnly"
+ Expression: setBluetooth"
+ Expression: ttsMsg"
+ Expression: param_screen=="on"
+ Expression: setScreenOnOff"
+ Gerät sperren
+ Expression: param_screen=="off"
+ Expression: openApp"
+ App Task läuft: App (neuster)
+ Expression: setVolume"
+ App Starten: App
+ Dateien löschen: /storage/emulated/0/Download/installFlow_{param_flowname}
+ Dateien löschen: /storage/sdcard0/Download/installFlow_{param_flowname}
+ Dateien löschen: /storage/sdcard0/Download/installFlow_{param_flowname}
+ Script: notification_text = "Flow install: path for download not exist"
+ Flows/Widgets importieren: /storage/sdcard0/Download/installFlow_{param_flowname}
+ Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma}
+ Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/sdcard0/Download
+ Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/sdcard0/Download
+ Flows/Widgets importieren: /storage/emulated/0/Download/installFlow_{param_flowname}
+ Flows/Widgets importieren: /storage/sdcard0/Download/installFlow_{param_flowname}
+ Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma}
+ Gerätespeicherplatz: Freier Speicherplatz > 1kb (/storage/sdcard0)
+ Gerätespeicherplatz: Freier Speicherplatz > 1kb (/sdcard)
+ Expression: installFlow"
+ Neustart
+ Expression: Reboot
+ Expression: System Command"
+ Expression: Shutdown
+ Expression: Airplanemode
+ Script: airplanemode = "airplanemode@@on"; fhemcmd = "setreading";
+ Flows ausführen: Send Data to AMADCommBridge mit warten
+ Flugmodus ein-/ausschalten: Ein
+ Herunterfahren
+ Notification Lautstärke Wiederherstellen
+ Expression: param_notifyfile == "RedAlert.mp3"
+ Benachrichtigung aus Statusbar entfernen: Alle
+ Benachrichtigung aus Statusbar entfernen: Alle (Automagic)
+ Expression: Automagic
+ Expression: All
+ Expression: notifysnd"
+ NotificationLautstärke auf Level 7
+ Notification Lautstärke Speichern
+ Expression: param_notifyfile == "RedAlert.mp3"
+ Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma}
+ Expression: Clear Automagic Meldungen"
+ Expression: setVibrate"
+ Vibrieren: Pattern 2 (-- --)
+ Audio Player steuern: Medienknopf Zurück ({pname}/{kname})
+ Expression: param_button == "stop"
+ Expression: param_button == "next"
+ Expression: param_button == "back"
+ Schalte Display ein: Hell für {param_screenontime}s
+ Expression: ttsMsgLang"
+ Expression: global_fhemip != null or global_bridgeport != null
+ Setze Alarm: um {param_hour}:{param_minute}
+ Audio Player steuern: Medienknopf Weiter ({pname}/{kname})
+ Expression: openCall"
+ Nummer anrufen: {param_callnumber}
+ Expression: sendSms"
+ Expression: param_flowstate == "active" or param_flowstate == "inactive"
+ Expression: param_flowstate == "active"
+ SMS senden an: an {param_smsnumber} '{param_smsmessage}' (10 in 12h)
+ Setze Flow Status: Deaktivieren {param_flowname}
+ Script: notification_text = "Flow '{param_flowname}' has been set {param_flowstate}"
+ Expression: flowState"
+ Expression: closeCall"
+ Expression: multimediaControl"
+ Starte Daydream
+ Expression: startDaydream"
+ Lautstärken setzen param_volume
+ Expression: setNotifiVolume"
+ Lautstärken setzen param_notifivolume
+ Expression: trigger == "HTTP Request: /fhem-amad/setCommands/*"
+ Expression: setRingSoundVolume"
+ Lautstärken setzen param_ringsoundvolume
+ Expression: param_button == "play/pause"
+ Audio Player steuern: Medienknopf Play/Pause (/{kname})
+ Sound: {param_notifypath}{param_notifyfile} als Benachrichtigung
+ Gerätespeicherplatz: Freier Speicherplatz > 1kb (/storage/emulated/0)
+ Download URL: http://{global_fhemip}:{global_bridgeport}/installFlow_{param_flowname} to /storage/emulated/0/Download
+ Script: flow_informations = "\"flow_informations\":" + " \"" + {informationFlow_state} + "\""; fhemcmd = "setreading";
+ Script: automagicState = "\"automagicState\":" + " \"" + replaceAll({notification_text}, "\\n", " ") + "\""; fhemcmd = "setreading";
+ Script: automagicState = "\"automagicState\":" + " \"" + replaceAll({notification_text}, "\\n", " ") + "\""; fhemcmd = "setreading";
+ Flows ausführen: Send Data to AMADCommBridge
+ Sprachausgabe: Englisch
+ Sprachausgabe: Deutsch
+ Flows ausführen: VoiceControl
+ Flows ausführen: udef_trigger setLockPin
+ Setze Flow Status: Aktivieren {param_flowname}
+ Flow Aktiv: Informations
+ Script: informationFlow_state = "aktiv"
+ Script: informationFlow_state = "inaktiv"
+ Setze Flow Status: Aktivieren Informations
+ Host erreichbar: {global_fhemip}:{global_bridgeport}
+ Flow Aktiv: Send Data to AMADCommBridge
+ Setze Flow Status: Aktivieren Send Data to AMADCommBridge
+ Audio Player steuern: Medienknopf Stopp ({pname}/{kname})
+ Script: Zuordnung Mediaplayer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Update AMAD Flowset
+ AMADNG Info/Control Flowset v3.9.76
+ true
+ QUEUE
+
+ HTTP Request: /fhem-amad/currentFlowsetUpdate
+
+ Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma}
+ Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma}
+ Flows/Widgets importieren: /storage/sdcard0/Download/currentFlowsetUpdate.xml
+ Download URL: http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml to /storage/sdcard0/Download
+ Download URL: http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml to /sdcard/Download
+ Flows/Widgets importieren: /sdcard/Download/currentFlowsetUpdate.xml
+ Setze Flow Status: Aktivieren {imported_flow_names,listformat,comma}
+ Script: notification_text = "Flowset Update: path for download not exist"
+ Gerätespeicherplatz: Freier Speicherplatz > 1kb (/storage/sdcard0)
+ Gerätespeicherplatz: Freier Speicherplatz > 1kb (/sdcard)
+ Gerätespeicherplatz: Freier Speicherplatz > 1kb (/storage/emulated/0)
+ Script: automagicState = "\"automagicState\":" + " \"" + replaceAll({notification_text}, "\\n", " ") + "\""; fhemcmd = "setreading";
+ Prüfe und setze Bridgeport Variable
+ Flows/Widgets importieren: /storage/emulated/0/Download/currentFlowsetUpdate.xml
+ Download URL: http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml to /storage/emulated/0/Download
+ Dateien löschen: /storage/emulated/0/Download/currentFlowsetUpdate.xml
+ Dateien löschen: /storage/sdcard0/Download/currentFlowsetUpdate.xml
+ Dateien löschen: /sdcard/Download/currentFlowsetUpdate.xml
+ Flows ausführen: Send Data to AMADCommBridge
+ Flow Aktiv: First Run Assistant
+ Setze Flow Status: Deaktivieren First Run Assistant
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ VoiceControl
+ AMADNG Info/Control Flowset v3.9.76
+ true
+ QUEUE
+
+ AMAD Voice Control
+ Expression: value != ""
+ Expression: contains(value, " und ")
+ Script: voiceinputdata = {left(value, (indexOf(value, " und ")))}; fhemcmd = "voiceinputvalue";
+ Flows ausführen: Send Data to AMADCommBridge
+ Setze voice Variablen
+ Spracheingabe wurde nicht erkannt
+ Script: voiceinputdata = value; fhemcmd = "voiceinputvalue";
+ Flows ausführen: Send Data to AMADCommBridge
+ Benachrichtigung auf Bildschirm: {value} (lange)
+ Expression: global_fhemctlmode != "thirdPartControl"
+ Script: voiceinputdata = value; fhemcmd = "voiceinputvalue";
+ Flows ausführen: Send Data to AMADCommBridge
+ Benachrichtigung auf Bildschirm: {value} (lange)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+