From f224f20ef0ef9374f121142e0c21ed30a8542c30 Mon Sep 17 00:00:00 2001 From: LeonGaultier Date: Sun, 20 Aug 2017 09:22:46 +0000 Subject: [PATCH] 73_AMADCommBridge: fix AnalyzeCommandChain sub call and more bugfixes git-svn-id: https://svn.fhem.de/fhem/trunk@14931 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 + fhem/FHEM/73_AMADCommBridge.pm | 57 +- fhem/FHEM/74_AMADDevice.pm | 2 +- ....xml => 74_AMADautomagicFlowset_4.0.4.xml} | 822 +++++++++--------- 4 files changed, 458 insertions(+), 425 deletions(-) rename fhem/FHEM/lib/{74_AMADautomagicFlowset_4.0.3.xml => 74_AMADautomagicFlowset_4.0.4.xml} (88%) diff --git a/fhem/CHANGED b/fhem/CHANGED index b771675ef..0e82c5efc 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 73_AMADCommBridge: fix AnalyzeCommandChain sub call, fix + AMADautomagicFlowset - bugfix: 72_FB_CALLLIST: fix shifted table header - new: 59_WUup: first release (Forum #65587) - feature: 49_SSCam: V2.6.3, snapGallery can be triggered by e.g. notify diff --git a/fhem/FHEM/73_AMADCommBridge.pm b/fhem/FHEM/73_AMADCommBridge.pm index 57a1b0f62..257cbb2dc 100644 --- a/fhem/FHEM/73_AMADCommBridge.pm +++ b/fhem/FHEM/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.0.2"; -my $flowsetversion = "4.0.3"; +my $modulversion = "4.0.4"; +my $flowsetversion = "4.0.4"; @@ -283,14 +283,14 @@ sub AMADCommBridge_ErrorHandling($$$) { if( $dhash->{helper}{infoErrorCounter} > 0 ) { readingsBeginUpdate( $dhash ); - readingsBulkUpdateIfChanged( $dhash, "lastStatusRequestState", "statusRequest_error", 1 ); + readingsBulkUpdate( $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); + readingsBulkUpdate( $dhash, "deviceState", "offline", 1 ); + readingsBulkUpdate ( $dhash, "state", "AMAD Flows inactive, device set offline",1); } elsif( $dhash->{helper}{infoErrorCounter} > 7 && $dhash->{helper}{setCmdErrorCounter} > 4 ) { @@ -298,7 +298,7 @@ sub AMADCommBridge_ErrorHandling($$$) { 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); + readingsBulkUpdate ( $dhash, "state", "Unknown Error, device disabled", 1); $dhash->{helper}{infoErrorCounter} = 0; $dhash->{helper}{setCmdErrorCounter} = 0; @@ -315,8 +315,8 @@ sub AMADCommBridge_ErrorHandling($$$) { 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); + readingsBulkUpdate( $dhash, "deviceState", "offline", 1 ); + readingsBulkUpdate ( $dhash, "state", "To many Errors, device set offline", 1); $dhash->{helper}{infoErrorCounter} = 0; } @@ -332,10 +332,10 @@ sub AMADCommBridge_ErrorHandling($$$) { if( $err ne "" ) { readingsBeginUpdate( $dhash ); - readingsBulkUpdateIfChanged ( $dhash, "state", "$err") if( ReadingsVal( $dname, "state", 1 ) ne "initialized" ); + readingsBulkUpdate ( $dhash, "state", "$err") if( ReadingsVal( $dname, "state", 1 ) ne "initialized" ); $dhash->{helper}{infoErrorCounter} = ( $dhash->{helper}{infoErrorCounter} + 1 ); - readingsBulkUpdateIfChanged( $dhash, "lastStatusRequestState", "statusRequest_error", 1 ); + readingsBulkUpdate( $dhash, "lastStatusRequestState", "statusRequest_error", 1 ); if( $err =~ /timed out/ ) { @@ -362,10 +362,10 @@ sub AMADCommBridge_ErrorHandling($$$) { 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" ); + readingsBulkUpdate ( $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 ); + readingsBulkUpdate( $dhash, "lastStatusRequestState", "statusRequest_error", 1 ); if( $param->{code} ne 200 ) { @@ -381,10 +381,10 @@ sub AMADCommBridge_ErrorHandling($$$) { if( ( $data =~ /Error/i ) and exists( $param->{code} ) ) { readingsBeginUpdate( $dhash ); - readingsBulkUpdateIfChanged( $dhash, "state", $param->{code}, 1 ) if( ReadingsVal( $dname, "state" ,0) ne "initialized" ); + readingsBulkUpdate( $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 ); + readingsBulkUpdate( $dhash, "lastStatusRequestState", "statusRequest_error", 1 ); if( $param->{code} eq 404 && ReadingsVal( $dname, "flow_Informations", "inactive" ) eq "inactive" ) { @@ -409,6 +409,7 @@ sub AMADCommBridge_ErrorHandling($$$) { ### End Error Handling + readingsSingleUpdate( $dhash, "lastStatusRequestState", "statusRequest_done", 1 ); $dhash->{helper}{infoErrorCounter} = 0; } @@ -418,14 +419,14 @@ sub AMADCommBridge_ErrorHandling($$$) { if( $dhash->{helper}{setCmdErrorCounter} > 2 ) { readingsBeginUpdate( $dhash ); - readingsBulkUpdateIfChanged( $dhash, "lastSetCommandState", "statusRequest_error", 1 ); + readingsBulkUpdate( $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 ); + readingsBulkUpdate( $dhash, "deviceState", "offline", 1 ); + readingsBulkUpdate( $dhash, "state", "AMAD Flows inactive, device set offline", 1 ); } elsif( $dhash->{helper}{infoErrorCounter} > 7 && $dhash->{helper}{setCmdErrorCounter} > 4 ) { @@ -433,7 +434,7 @@ sub AMADCommBridge_ErrorHandling($$$) { 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 ); + readingsBulkUpdate( $dhash, "state", "Unknown Error, device disabled", 1 ); $dhash->{helper}{infoErrorCounter} = 0; $dhash->{helper}{setCmdErrorCounter} = 0; @@ -449,8 +450,8 @@ sub AMADCommBridge_ErrorHandling($$$) { 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 ); + readingsBulkUpdate( $dhash, "deviceState", "offline", 1 ); + readingsBulkUpdate( $dhash, "state", "To many Errors, device set offline", 1 ); $dhash->{helper}{setCmdErrorCounter} = 0; } @@ -465,10 +466,10 @@ sub AMADCommBridge_ErrorHandling($$$) { if( defined( $err ) ) { if( $err ne "" ) { readingsBeginUpdate( $dhash ); - readingsBulkUpdateIfChanged( $dhash, "state", $err, 1 ) if( ReadingsVal( $dname, "state", 0 ) ne "initialized" ); + readingsBulkUpdate( $dhash, "state", $err, 1 ) if( ReadingsVal( $dname, "state", 0 ) ne "initialized" ); $dhash->{helper}{setCmdErrorCounter} = ($dhash->{helper}{setCmdErrorCounter} + 1); - readingsBulkUpdateIfChanged( $dhash, "lastSetCommandState", "setCmd_error", 1 ); + readingsBulkUpdate( $dhash, "lastSetCommandState", "setCmd_error", 1 ); if( $err =~ /timed out/ ) { @@ -495,11 +496,11 @@ sub AMADCommBridge_ErrorHandling($$$) { 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" ); + readingsBulkUpdate( $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 ); + readingsBulkUpdate($dhash, "lastSetCommandState", "setCmd_error", 1 ); readingsEndUpdate( $dhash, 1 ); @@ -511,15 +512,15 @@ sub AMADCommBridge_ErrorHandling($$$) { if( ( $data =~ /Error/i ) and exists( $param->{code} ) ) { readingsBeginUpdate( $dhash ); - readingsBulkUpdateIfChanged( $dhash, "state", $param->{code}, 1 ) if( ReadingsVal( $dname, "state", 0 ) ne "initialized" ); + readingsBulkUpdate( $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 ); + readingsBulkUpdate( $dhash, "lastSetCommandState", "setCmd_error", 1 ); if( $param->{code} eq 404 ) { - readingsBulkUpdateIfChanged( $dhash, "lastSetCommandError", "", 1 ); + readingsBulkUpdate( $dhash, "lastSetCommandError", "", 1 ); Log3 $dname, 5, "AMADCommBridge ($dname) - setCommandERROR: setCommands flow is inactive on your device!"; } else { @@ -808,7 +809,7 @@ sub AMADCommBridge_ResponseProcessing($$) { my $fhemCmd = $decode_json->{payload}{setcmd}; fhem ("set $fhemCmd") if( AttrVal( $bname, 'fhemControlMode', 'trigger' ) eq 'setControl' ); - my $r = AnalyzeCommandChain($bhash, 'set'.$fhemCmd); + my $r = AnalyzeCommandChain($bhash, 'set '.$fhemCmd); 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"; diff --git a/fhem/FHEM/74_AMADDevice.pm b/fhem/FHEM/74_AMADDevice.pm index b65982778..4866256ce 100644 --- a/fhem/FHEM/74_AMADDevice.pm +++ b/fhem/FHEM/74_AMADDevice.pm @@ -59,7 +59,7 @@ eval "use JSON;1" or $missingModul .= "JSON "; my $modulversion = "4.0.6"; -my $flowsetversion = "4.0.3"; +my $flowsetversion = "4.0.4"; diff --git a/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.3.xml b/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.4.xml similarity index 88% rename from fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.3.xml rename to fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.4.xml index 3fb6c7271..e3bb9a116 100644 --- a/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.3.xml +++ b/fhem/FHEM/lib/74_AMADautomagicFlowset_4.0.4.xml @@ -1,5 +1,5 @@ - + true Akku Ladestand: grösser als 0% @@ -13,18 +13,21 @@ false App Task Beendet true + CLASSIC * true App Task Beendet: ch.gridvision.ppam.androidautomagic false + CLASSIC ch.gridvision.ppam.androidautomagic false App Task Gestartet true + CLASSIC * @@ -444,12 +447,14 @@ irname=getString("name") false App Task läuft: App (neuster) + CLASSIC {param_app} true true App Task läuft: {global_activetask} (neuster) + CLASSIC {global_activetask} true @@ -1826,6 +1831,8 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich" false false + false + POST GENERAL_TEXT text/json @@ -1846,6 +1853,8 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich" false false + false + POST GENERAL_TEXT text/json @@ -1866,6 +1875,8 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich" false false + false + POST GENERAL_TEXT text/json @@ -1886,6 +1897,8 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich" false false + false + POST GENERAL_TEXT text/json @@ -1906,6 +1919,8 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich" false false + false + POST GENERAL_TEXT text/json @@ -1926,6 +1941,8 @@ androidVersion = "4.0 - 4.0.2 Ice Cream Sandwich" false false + false + POST GENERAL_TEXT text/json @@ -2123,6 +2140,16 @@ Connection: close false 60000 + + true + Meldungsdialog: Die Einrichtung ist nun abgeschlossen und das Amaad Device online. Soll der Assistent gelöscht werden? + + Die Einrichtung ist nun abgeschlossen und das Amaad Device online. +Soll der Assistent gelöscht werden? + 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 @@ -2221,6 +2248,7 @@ Connection: close true Nummer anrufen: {param_callnumber} + {param_callnumber} true @@ -2896,7 +2924,7 @@ fhemcmd = "setreading"; false Script: Set FHEMDATA JSON -