From 2d044a1c7e0e17ed6f1f81dcf10726915ff60061 Mon Sep 17 00:00:00 2001 From: jowiemann <> Date: Tue, 23 Jan 2024 14:56:22 +0000 Subject: [PATCH] 72_FRITZBOX.pm: Version 07.57.10b git-svn-id: https://svn.fhem.de/fhem/trunk@28408 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/72_FRITZBOX.pm | 68 +++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/fhem/FHEM/72_FRITZBOX.pm b/fhem/FHEM/72_FRITZBOX.pm index b6c41c329..15ee68a07 100644 --- a/fhem/FHEM/72_FRITZBOX.pm +++ b/fhem/FHEM/72_FRITZBOX.pm @@ -41,7 +41,7 @@ use warnings; use Blocking; use HttpUtils; -my $ModulVersion = "07.57.10a"; +my $ModulVersion = "07.57.10b"; my $missingModul = ""; my $FRITZBOX_TR064pwd; my $FRITZBOX_TR064user; @@ -612,19 +612,20 @@ sub FRITZBOX_Define($$) } # INTERNALS - $hash->{STATE} = "Initializing"; - $hash->{INTERVAL} = 300; - $hash->{TIMEOUT} = 55; - $hash->{SID_RENEW_ERR_CNT} = 0; - $hash->{SID_RENEW_CNT} = 0; - $hash->{_BETA} = 0; + $hash->{STATE} = "Initializing"; + $hash->{INTERVAL} = 300; + $hash->{TIMEOUT} = 55; + $hash->{SID_RENEW_ERR_CNT} = 0; + $hash->{SID_RENEW_CNT} = 0; + $hash->{_BETA} = 0; - $hash->{fhem}{LOCAL} = 0; - $hash->{fhem}{is_double_wlan} = -1; + $hash->{fhem}{LOCAL} = 0; + $hash->{fhem}{is_double_wlan} = -1; - $hash->{helper}{TimerReadout} = $name.".Readout"; - $hash->{helper}{TimerCmd} = $name.".Cmd"; - $hash->{helper}{FhemLog3Std} = AttrVal($name, "FhemLog3Std", 0); + $hash->{helper}{TimerReadout} = $name.".Readout"; + $hash->{helper}{TimerCmd} = $name.".Cmd"; + $hash->{helper}{FhemLog3Std} = AttrVal($name, "FhemLog3Std", 0); + $hash->{helper}{timerInActive} = 0; # my $tr064Port = FRITZBOX_init_TR064 ($hash); # $hash->{SECPORT} = $tr064Port if $tr064Port; @@ -959,7 +960,8 @@ sub FRITZBOX_Set($$@) my $list = " checkAPIs:noArg" . " password" - . " update:noArg"; + . " update:noArg" + . " inActive:on,off"; # set abhängig von TR064 $list .= " reboot" @@ -1014,7 +1016,25 @@ sub FRITZBOX_Set($$@) . " wlanLogExtended:on,off" if ($hash->{LUADATA} == 1); - if ( lc $cmd eq 'call' && $mesh eq "master") { + if ( lc $cmd eq 'inactive') { + return "ERROR: for active arguments. Required on|off" if (int @val != 1) || $val[0] != /on|off/; + + if ($val[0] eq "on") { + $hash->{helper}{timerInActive} = 1; + } else { + $hash->{helper}{timerInActive} = 0; + FRITZBOX_Log $hash, 4, "set $name $cmd -> Neustart internal Timer"; + $hash->{APICHECKED} = 0; + RemoveInternalTimer($hash->{helper}{TimerReadout}); + InternalTimer(gettimeofday()+1, "FRITZBOX_Readout_Start", $hash->{helper}{TimerReadout}, 1); + } + + FRITZBOX_Log $hash, 3, "set $name $cmd " . join(" ", @val); + return undef; + + } #end active + + elsif ( lc $cmd eq 'call' && $mesh eq "master") { if (int @val >= 0 && int @val <= 2) { FRITZBOX_Log $hash, 3, "set $name $cmd " . join(" ", @val); push @cmdBuffer, "call " . join(" ", @val); @@ -2601,6 +2621,12 @@ sub FRITZBOX_Readout_Start($) return undef; } + if( $hash->{helper}{timerInActive} && $hash->{fhem}{LOCAL} != 1) { + RemoveInternalTimer($hash->{helper}{TimerReadout}); + readingsSingleUpdate( $hash, "state", "inactive", 1 ); + return undef; + } + if( AttrVal( $name, "disable", 0 ) == 1 && $hash->{fhem}{LOCAL} != 1) { RemoveInternalTimer($hash->{helper}{TimerReadout}); readingsSingleUpdate( $hash, "state", "disabled", 1 ); @@ -9663,6 +9689,13 @@ sub FRITZBOX_Helper_Url_Regex { Switches the guest WLAN on or off. The guest password must be set. If necessary, the normal WLAN is also switched on.
+
  • +
    set <name> active <on|off>
    +
    + Temporarily deactivates the internal timer. +
    +

  • +
  • set <name> ledSetting <led:on|off> and/or <bright:1..3> and/or <env:on|off>

    @@ -10508,6 +10541,13 @@ sub FRITZBOX_Helper_Url_Regex { Schaltet das Gäste-WLAN an oder aus. Das Gäste-Passwort muss gesetzt sein. Wenn notwendig wird auch das normale WLAN angeschaltet.

  • +
  • +
    set <name> active <on|off>
    +
    + Deaktiviert temporär den intern Timer. +
    +

  • +
  • set <name> ledSetting <led:on|off> und/oder <bright:1..3> und/oder <env:on|off>