diff --git a/73_AMADCommBridge.pm b/73_AMADCommBridge.pm index 75b4cf8..90caeb0 100644 --- a/73_AMADCommBridge.pm +++ b/73_AMADCommBridge.pm @@ -74,8 +74,8 @@ eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode "; eval "use JSON;1" or $missingModul .= "JSON "; -my $modulversion = "4.1.99.31"; -my $flowsetversion = "4.1.99.9"; +my $modulversion = "4.2.0"; +my $flowsetversion = "4.2.0"; @@ -1044,8 +1044,21 @@ sub AMADCommBridge_ParseMsg($$) {
This statement creates a new AMADCommBridge device named AMADBridge.
+ The APP Automagic or Tasker can be used on the Android device.
+
+ For Autoremote:
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. + 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.
+
+ For Tasker:
+ When using Tasker, the Tasker-project must be loaded onto the Android device and imported into Tasker via the import function.
+ For the initial setup on the Android device there is an Tasker input mask (Scene), in which the required parameters (device name, device IP, bridgeport etc.)
+ can be entered, these fields are filled (if possible) automatically, but can also be adjusted manually.
+ To do this, run the "AMAD" task.
+ For quick access, a Tasker shortcut can also be created on the home screen for this task.
+ Information on the individual settings can be obtained by touching the respective text field.
+ If all entries are complete, the AMAD Device can be created via the button "create Device".
+ For control commands from FHEM to Tasker, the APP "Autoremote" or "Tasker Network Event Server (TNES)" is additionally required.

@@ -1105,8 +1118,21 @@ sub AMADCommBridge_ParseMsg($$) {
Diese Anweisung erstellt ein neues AMADCommBridge Device Namens AMADBridge.
+ Es kann wahlweise die APP Automagic oder Tasker auf dem Android Gerät verwendet werden. +
+ Für Autoremote:
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. + 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.
+
+ Für Tasker:
+ Bei Verwendung von Tasker muss das Tasker-Projekt auf das Android Gerät geladen und in Tasker über die Import Funktion importiert werden.
+ Für die Ersteinrichtung auf dem Android Gerät gibt es eine Eingabemaske (Scene), in der die benötigten Parameter (Device Name, Device IP, Bridgeport usw.)
+ eingegeben werden können, diese Felder werden (soweit möglich) automatisch befüllt, können aber auch manuell angepasst werden.
+ Hierfür den Task "AMAD" ausführen.
+ Für schnellen Zugriff kann für diesen Task auch ein Tasker-Shortcut auf dem Homescreen angelegt werden.
+ Infos zu den einzelnen Einstellungen erhält man durch einen Touch auf das jeweiligen Textfeld.
+ Sind alle Eingaben vollständig, kann das AMAD Device über die Schaltfläche "create Device" erstellt werden.
+ Damit Steuerbefehle von FHEM zu Tasker funktionieren wird zusätzlich noch die APP "Autoremote" oder "Tasker Network Event Server (TNES)" benötigt.

diff --git a/74_AMADDevice.pm b/74_AMADDevice.pm index 42e554f..dca996d 100644 --- a/74_AMADDevice.pm +++ b/74_AMADDevice.pm @@ -58,14 +58,15 @@ eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode "; eval "use JSON;1" or $missingModul .= "JSON "; -my $modulversion = "4.1.99.42"; -my $flowsetversion = "4.1.99.9"; +my $modulversion = "4.2.0"; +my $flowsetversion = "4.2.0"; # Declare functions sub AMADDevice_Attr(@); +sub AMADDevice_Notify($$); sub AMADDevice_checkDeviceState($); sub AMADDevice_decrypt($); sub AMADDevice_Define($$); @@ -96,6 +97,7 @@ sub AMADDevice_Initialize($) { $hash->{DefFn} = "AMADDevice_Define"; $hash->{UndefFn} = "AMADDevice_Undef"; $hash->{AttrFn} = "AMADDevice_Attr"; + $hash->{NotifyFn} = "AMADDevice_Notify"; $hash->{ParseFn} = "AMADDevice_Parse"; $hash->{AttrList} = "setOpenApp ". @@ -152,6 +154,7 @@ sub AMADDevice_Define($$) { $hash->{AMAD_ID} = $amad_id; $hash->{VERSIONMODUL} = $modulversion; $hash->{VERSIONFLOWSET} = $flowsetversion; + $hash->{NOTIFYDEV} = "global,$name"; $hash->{PORT} = 8090 if($remoteServer eq 'Automagic'); $hash->{PORT} = 1817 if($remoteServer eq 'Autoremote'); @@ -304,7 +307,7 @@ sub AMADDevice_Attr(@) { } elsif( $attrName eq "setAPSSID" ) { - if( $cmd eq "set" && $attrVal ) { + if( $cmd eq "set" and $attrVal ) { AMADDevice_statusRequest($hash); @@ -338,6 +341,25 @@ sub AMADDevice_Attr(@) { return undef; } +sub AMADDevice_Notify($$) { + + my ($hash,$dev) = @_; + my $name = $hash->{NAME}; + return if (IsDisabled($name)); + + my $devname = $dev->{NAME}; + my $devtype = $dev->{TYPE}; + my $events = deviceEvents($dev,1); + return if (!$events); + + + AMADDevice_statusRequest($hash) if( (grep /^DELETEATTR.$name.setAPSSID$/,@{$events} + or grep /^ATTR.$name.setAPSSID.*/,@{$events} ) + and $init_done and $devname eq 'global' ); + + return; +} + sub AMADDevice_GetUpdate($) { my ( $hash ) = @_; @@ -1001,19 +1023,28 @@ sub AMADDevice_CreateChangeBtDeviceValue($$) {
- 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. + 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/Tasker.


@@ -1037,19 +1068,19 @@ sub AMADDevice_CreateChangeBtDeviceValue($$) {