diff --git a/fhem/FHEM/98_MSwitch.pm b/fhem/FHEM/98_MSwitch.pm index 0f236b0c9..efdc8c3c2 100644 --- a/fhem/FHEM/98_MSwitch.pm +++ b/fhem/FHEM/98_MSwitch.pm @@ -88,7 +88,7 @@ if ( $preconf && $preconf ne "" ) { } my $autoupdate = 'off'; #off/on -my $version = '2.6a'; +my $version = '2.61'; my $vupdate = 'V2.00'; # versionsnummer der datenstruktur . änderung der nummer löst MSwitch_VUpdate aus . my $savecount = 30; # anzahl der zugriff im zeitraum zur auslösung des safemodes. kann durch attribut überschrieben werden . my $standartstartdelay = 60; # zeitraum nach fhemstart , in dem alle aktionen geblockt werden. kann durch attribut überschrieben werden . @@ -1099,7 +1099,7 @@ sub MSwitch_Get($$@) { } if ( AttrVal( $name, 'MSwitch_Mode', 'Notify' ) eq "Dummy" ) { - return "Unknown argument $opt, choose one of support_info:noArg restore_MSwitch_Data:this_Device,all_Devices"; + return "Unknown argument $opt, choose one of Eventlog:timeline,clear support_info:noArg restore_MSwitch_Data:this_Device,all_Devices"; } if ( ReadingsVal( $name, '.lock', 'undef' ) ne "undef" ) { @@ -1268,7 +1268,7 @@ my %setlist; return "Unknown argument $cmd, choose one of active:noArg del_function_data:noArg inactive:noArg on off del_delays:noArg backup_MSwitch:all_devices fakeevent wait reload_timer:noArg del_repeats:noArg change_renamed $setList $special"; } elsif ( $devicemode eq "Dummy" ) { - return "Unknown argument $cmd, choose one of state $setList $special"; + return "Unknown argument $cmd, choose one of state backup_MSwitch:all_devices $setList $special"; } else { #full @@ -2418,6 +2418,69 @@ sub MSwitch_Attr(@) { MSwitch_Clear_timer($hash); $hash->{NOTIFYDEV} = 'no_trigger'; $hash->{MODEL} = 'Dummy'; + + + + fhem("deleteattr $name MSwitch_Include_Webcmds"); + fhem("deleteattr $name MSwitch_Include_MSwitchcmds"); + fhem("deleteattr $name MSwitch_Include_Devicecmds"); + fhem("deleteattr $name MSwitch_Safemode"); + + + #fhem("deleteattr $name MSwitch_Debug"); + #fhem("deleteattr $name MSwitch_Eventhistory"); + + #fhem("deleteattr $name MSwitch_Eventhistory"); + fhem("deleteattr $name MSwitch_Expert"); + fhem("deleteattr $name MSwitch_Extensions"); + fhem("deleteattr $name MSwitch_Lock_Quickedit"); + + fhem("deleteattr $name MSwitch_Delete_Delays"); + + delete( $hash->{NOTIFYDEV} ); + delete( $hash->{NTFY_ORDER} ); + + #delete( $hash->{READINGS}{Bulkfrom} ); + #delete( $hash->{READINGS}{Device_Affected} ); + #delete( $hash->{READINGS}{Device_Affected_Details} ); + delete( $hash->{READINGS}{Trigger_device} ); + delete( $hash->{IncommingHandle} ); + + + delete( $hash->{READINGS}{EVENT} ); + delete( $hash->{READINGS}{EVTFULL} ); + delete( $hash->{READINGS}{EVTPART1} ); + delete( $hash->{READINGS}{EVTPART2} ); + delete( $hash->{READINGS}{EVTPART3} ); + + delete( $hash->{READINGS}{last_activation_by} ); + delete( $hash->{READINGS}{last_event} ); + delete( $hash->{READINGS}{last_exec_cmd} ); + + + + my $attrzerolist = + " disable:0,1" + . " MSwitch_Debug:0,1" + . " disabledForIntervals" + . " stateFormat:textField-long" + . " MSwitch_Eventhistory:0,10" + . " MSwitch_Help:0,1" + . " MSwitch_Ignore_Types:textField-long " + . " MSwitch_Extensions:0,1" + . " MSwitch_Inforoom" + . " MSwitch_DeleteCMDs:manually,automatic,nosave" + . " MSwitch_Mode:Dummy" + . " MSwitch_Selftrigger_always:0,1" + . " MSwitch_Event_Id_Distributor:textField-long " + . " setList:textField-long " + . " readingList:textField-long " + . " textField-long "; + + setDevAttrList($name, $attrzerolist); + + + } if ( $aName eq 'MSwitch_Mode' && $aVal eq 'Notify' ) { @@ -2568,7 +2631,7 @@ sub MSwitch_Notify($$) { my $startdelay = AttrVal( $ownName, 'MSwitch_Startdelay', $standartstartdelay ); my $attrrandomnumber = AttrVal( $ownName, 'MSwitch_RandomNumber', '' ); - return if ( $devicemode eq 'Dummy' ); + # return if ( $devicemode eq 'Dummy' ); if ( AttrVal( $ownName, "MSwitch_Selftrigger_always", 0 ) ne "1") { @@ -3150,7 +3213,7 @@ delete( $own_hash->{helper}{history} );# lösche historyberechnung verschieben a "$ownName: anzahl gefundener Befehle -> " . $anzahl ); MSwitch_LOG( $ownName, 6, "$ownName: inhalt gefundener Befehle -> @cmdarray" ); - $own_hash->{IncommingHandle} = 'fromnotify'; + $own_hash->{IncommingHandle} = 'fromnotify' if AttrVal( $ownName, 'MSwitch_Mode', 'Notify' ) ne "Dummy"; $event =~ s/~/ /g; #? if ( $devicemode eq "Notify" and $activecount == 0 ) @@ -3431,7 +3494,7 @@ sub MSwitch_fhemwebFn($$$$) { my $cmdfrombase = "0"; MSwitch_del_savedcmds($hash); - return if ( AttrVal( $Name, 'MSwitch_Mode', "Notify" ) eq 'Dummy' ); + # return if ( AttrVal( $Name, 'MSwitch_Mode', "Notify" ) eq 'Dummy' ); if ( AttrVal( $Name, 'MSwitch_Debug', "0" ) eq '4' ) { $border = 1; @@ -5000,7 +5063,10 @@ sub MSwitch_fhemwebFn($$$$) { } my $ret = ''; - $ret .= "
"; + + +# ACHTUNG bei Javaerror + # $ret .= "
"; ######################## my $blocking = ''; $blocking = $hash->{helper}{savemodeblock}{blocking} @@ -5243,7 +5309,7 @@ sub MSwitch_fhemwebFn($$$$) { $ret .= "
Device is inactive - |
Device is disabled, configuration avaible - |