mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 02:10:32 +00:00
72_FRITZBOX.pm: Version 07.57.12b
git-svn-id: https://svn.fhem.de/fhem/trunk@28642 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
fa9996e6ea
commit
f0d1422616
@ -45,7 +45,7 @@ use warnings;
|
|||||||
use Blocking;
|
use Blocking;
|
||||||
use HttpUtils;
|
use HttpUtils;
|
||||||
|
|
||||||
my $ModulVersion = "07.57.12a";
|
my $ModulVersion = "07.57.12b";
|
||||||
my $missingModul = "";
|
my $missingModul = "";
|
||||||
my $FRITZBOX_TR064pwd;
|
my $FRITZBOX_TR064pwd;
|
||||||
my $FRITZBOX_TR064user;
|
my $FRITZBOX_TR064user;
|
||||||
@ -1007,9 +1007,81 @@ sub FRITZBOX_Set($$@)
|
|||||||
. " update:noArg"
|
. " update:noArg"
|
||||||
. " inActive:on,off";
|
. " inActive:on,off";
|
||||||
|
|
||||||
# available, if passwor is set correctly
|
if ( lc $cmd eq 'checkapis') {
|
||||||
|
FRITZBOX_Log $hash, 3, "set $name $cmd " . join(" ", @val);
|
||||||
|
$hash->{APICHECKED} = 0;
|
||||||
|
$hash->{WEBCONNECT} = 0;
|
||||||
|
$hash->{APICHECK_RET_CODES} = "-";
|
||||||
|
$hash->{fhem}{sidTime} = 0;
|
||||||
|
$hash->{fhem}{sidErrCount} = 0;
|
||||||
|
$hash->{fhem}{sidNewCount} = 0;
|
||||||
|
$hash->{fhem}{LOCAL} = 1;
|
||||||
|
$hash->{SID_RENEW_ERR_CNT} = 0;
|
||||||
|
$hash->{SID_RENEW_CNT} = 0;
|
||||||
|
FRITZBOX_Readout_Start($hash->{helper}{TimerReadout});
|
||||||
|
$hash->{fhem}{LOCAL} = 0;
|
||||||
|
return undef;
|
||||||
|
} # end checkapis
|
||||||
|
|
||||||
|
# set password
|
||||||
|
elsif ( lc $cmd eq 'password') {
|
||||||
|
if (int @val == 1)
|
||||||
|
{
|
||||||
|
my $msg = FRITZBOX_Helper_store_Password ( $hash, $val[0] );
|
||||||
|
return $msg if $msg =~ /error/;
|
||||||
|
|
||||||
|
my $result = FRITZBOX_open_Web_Connection( $hash );
|
||||||
|
|
||||||
|
if (defined $result->{Error}) {
|
||||||
|
$hash->{fhem}{sidErrCount} += 1;
|
||||||
|
$hash->{fhem}{sidTime} = 0;
|
||||||
|
$hash->{WEBCONNECT} = 0;
|
||||||
|
} else {
|
||||||
|
$hash->{fhem}{sid} = $result->{sid};
|
||||||
|
$hash->{fhem}{sidNewCount} = defined $result->{sidNew} ? $result->{sidNew} : 0;
|
||||||
|
$hash->{fhem}{sidTime} = time();
|
||||||
|
$hash->{fhem}{sidErrCount} = 0;
|
||||||
|
$hash->{WEBCONNECT} = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$hash->{fhem}{LOCAL} = 1;
|
||||||
|
FRITZBOX_Readout_Start($hash->{helper}{TimerReadout});
|
||||||
|
$hash->{fhem}{LOCAL} = 0;
|
||||||
|
return $msg
|
||||||
|
}
|
||||||
|
} # end password
|
||||||
|
|
||||||
|
elsif ( lc $cmd eq 'update' ) {
|
||||||
|
FRITZBOX_Log $hash, 3, "set $name $cmd " . join(" ", @val);
|
||||||
|
$hash->{fhem}{LOCAL} = 1;
|
||||||
|
FRITZBOX_Readout_Start($hash->{helper}{TimerReadout});
|
||||||
|
$hash->{fhem}{LOCAL} = 0;
|
||||||
|
return undef;
|
||||||
|
} # end update
|
||||||
|
|
||||||
|
elsif ( 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;
|
||||||
|
$hash->{WEBCONNECT} = 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
|
||||||
|
|
||||||
|
|
||||||
|
# available, if passwor is set correctly
|
||||||
if ($hash->{WEBCONNECT}) {
|
if ($hash->{WEBCONNECT}) {
|
||||||
# set abhängig von TR064
|
# set abhängig von TR064
|
||||||
$list .= " reboot"
|
$list .= " reboot"
|
||||||
if $hash->{TR064} == 1 && $hash->{SECPORT};
|
if $hash->{TR064} == 1 && $hash->{SECPORT};
|
||||||
|
|
||||||
@ -1019,7 +1091,7 @@ sub FRITZBOX_Set($$@)
|
|||||||
. " tam"
|
. " tam"
|
||||||
if $hash->{TR064} == 1 && $hash->{SECPORT} && defined ($hash->{MODEL}) && ($hash->{MODEL} =~ "Box") && $mesh eq "master";
|
if $hash->{TR064} == 1 && $hash->{SECPORT} && defined ($hash->{MODEL}) && ($hash->{MODEL} =~ "Box") && $mesh eq "master";
|
||||||
|
|
||||||
# set abhängig von TR064 und luaCall
|
# set abhängig von TR064 und luaCall
|
||||||
$list .= " wlan:on,off"
|
$list .= " wlan:on,off"
|
||||||
. " guestWlan:on,off"
|
. " guestWlan:on,off"
|
||||||
if $hash->{TR064} == 1 && $hash->{SECPORT} && $hash->{LUAQUERY} == 1;
|
if $hash->{TR064} == 1 && $hash->{SECPORT} && $hash->{LUAQUERY} == 1;
|
||||||
@ -1028,7 +1100,7 @@ sub FRITZBOX_Set($$@)
|
|||||||
. " wlan5:on,off"
|
. " wlan5:on,off"
|
||||||
if $hash->{fhem}{is_double_wlan} == 1 && $hash->{TR064} == 1 && $hash->{SECPORT} && $hash->{LUAQUERY} == 1;
|
if $hash->{fhem}{is_double_wlan} == 1 && $hash->{TR064} == 1 && $hash->{SECPORT} && $hash->{LUAQUERY} == 1;
|
||||||
|
|
||||||
# set abhängig von TR064 und data.lua
|
# set abhängig von TR064 und data.lua
|
||||||
$list .= " macFilter:on,off"
|
$list .= " macFilter:on,off"
|
||||||
if ($hash->{LUADATA} == 1) && defined ($hash->{MODEL}) && ($hash->{MODEL} =~ "Box") && $hash->{TR064} == 1 && $hash->{SECPORT} && $mesh eq "master";
|
if ($hash->{LUADATA} == 1) && defined ($hash->{MODEL}) && ($hash->{MODEL} =~ "Box") && $hash->{TR064} == 1 && $hash->{SECPORT} && $mesh eq "master";
|
||||||
|
|
||||||
@ -1039,7 +1111,7 @@ sub FRITZBOX_Set($$@)
|
|||||||
if defined ($hash->{MODEL}) && ($hash->{MODEL} =~ "Box") && $hash->{TR064} == 1 && $hash->{SECPORT};
|
if defined ($hash->{MODEL}) && ($hash->{MODEL} =~ "Box") && $hash->{TR064} == 1 && $hash->{SECPORT};
|
||||||
|
|
||||||
|
|
||||||
# set abhängig von data.lua
|
# set abhängig von data.lua
|
||||||
$list .= " switchIPv4DNS:provider,other"
|
$list .= " switchIPv4DNS:provider,other"
|
||||||
. " dect:on,off"
|
. " dect:on,off"
|
||||||
. " lockLandevice"
|
. " lockLandevice"
|
||||||
@ -1062,7 +1134,6 @@ sub FRITZBOX_Set($$@)
|
|||||||
$list .= " rescanWLANneighbors:noArg"
|
$list .= " rescanWLANneighbors:noArg"
|
||||||
. " wlanLogExtended:on,off"
|
. " wlanLogExtended:on,off"
|
||||||
if ($hash->{LUADATA} == 1);
|
if ($hash->{LUADATA} == 1);
|
||||||
}
|
|
||||||
|
|
||||||
if ( lc $cmd eq 'smarthome') {
|
if ( lc $cmd eq 'smarthome') {
|
||||||
|
|
||||||
@ -1184,25 +1255,6 @@ sub FRITZBOX_Set($$@)
|
|||||||
|
|
||||||
} #end smarthome
|
} #end smarthome
|
||||||
|
|
||||||
elsif ( 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;
|
|
||||||
$hash->{WEBCONNECT} = 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") {
|
elsif ( lc $cmd eq 'call' && $mesh eq "master") {
|
||||||
if (int @val >= 0 && int @val <= 2) {
|
if (int @val >= 0 && int @val <= 2) {
|
||||||
FRITZBOX_Log $hash, 3, "set $name $cmd " . join(" ", @val);
|
FRITZBOX_Log $hash, 3, "set $name $cmd " . join(" ", @val);
|
||||||
@ -1256,22 +1308,6 @@ sub FRITZBOX_Set($$@)
|
|||||||
|
|
||||||
} # end blockincomingphonecall
|
} # end blockincomingphonecall
|
||||||
|
|
||||||
elsif ( lc $cmd eq 'checkapis') {
|
|
||||||
FRITZBOX_Log $hash, 3, "set $name $cmd " . join(" ", @val);
|
|
||||||
$hash->{APICHECKED} = 0;
|
|
||||||
$hash->{WEBCONNECT} = 0;
|
|
||||||
$hash->{APICHECK_RET_CODES} = "-";
|
|
||||||
$hash->{fhem}{sidTime} = 0;
|
|
||||||
$hash->{fhem}{sidErrCount} = 0;
|
|
||||||
$hash->{fhem}{sidNewCount} = 0;
|
|
||||||
$hash->{fhem}{LOCAL} = 1;
|
|
||||||
$hash->{SID_RENEW_ERR_CNT} = 0;
|
|
||||||
$hash->{SID_RENEW_CNT} = 0;
|
|
||||||
FRITZBOX_Readout_Start($hash->{helper}{TimerReadout});
|
|
||||||
$hash->{fhem}{LOCAL} = 0;
|
|
||||||
return undef;
|
|
||||||
} # end checkapis
|
|
||||||
|
|
||||||
elsif ( lc $cmd eq 'chgprofile' && $mesh eq "master") {
|
elsif ( lc $cmd eq 'chgprofile' && $mesh eq "master") {
|
||||||
|
|
||||||
if(int @val == 2) {
|
if(int @val == 2) {
|
||||||
@ -1862,34 +1898,6 @@ sub FRITZBOX_Set($$@)
|
|||||||
|
|
||||||
} # end macfilter
|
} # end macfilter
|
||||||
|
|
||||||
# set password
|
|
||||||
elsif ( lc $cmd eq 'password') {
|
|
||||||
if (int @val == 1)
|
|
||||||
{
|
|
||||||
my $msg = FRITZBOX_Helper_store_Password ( $hash, $val[0] );
|
|
||||||
return $msg if $msg =~ /error/;
|
|
||||||
|
|
||||||
my $result = FRITZBOX_open_Web_Connection( $hash );
|
|
||||||
|
|
||||||
if (defined $result->{Error}) {
|
|
||||||
$hash->{fhem}{sidErrCount} += 1;
|
|
||||||
$hash->{fhem}{sidTime} = 0;
|
|
||||||
$hash->{WEBCONNECT} = 0;
|
|
||||||
} else {
|
|
||||||
$hash->{fhem}{sid} = $result->{sid};
|
|
||||||
$hash->{fhem}{sidNewCount} = defined $result->{sidNew} ? $result->{sidNew} : 0;
|
|
||||||
$hash->{fhem}{sidTime} = time();
|
|
||||||
$hash->{fhem}{sidErrCount} = 0;
|
|
||||||
$hash->{WEBCONNECT} = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$hash->{fhem}{LOCAL} = 1;
|
|
||||||
FRITZBOX_Readout_Start($hash->{helper}{TimerReadout});
|
|
||||||
$hash->{fhem}{LOCAL} = 0;
|
|
||||||
return $msg
|
|
||||||
}
|
|
||||||
} # end password
|
|
||||||
|
|
||||||
# set phonebookentry
|
# set phonebookentry
|
||||||
elsif ( lc $cmd eq 'phonebookentry') {
|
elsif ( lc $cmd eq 'phonebookentry') {
|
||||||
|
|
||||||
@ -2146,7 +2154,7 @@ sub FRITZBOX_Set($$@)
|
|||||||
return FRITZBOX_Readout_SetGet_Start $hash->{helper}{TimerCmd};
|
return FRITZBOX_Readout_SetGet_Start $hash->{helper}{TimerCmd};
|
||||||
} # end rescanwlanneighbors
|
} # end rescanwlanneighbors
|
||||||
|
|
||||||
#set Ring
|
#set Ring
|
||||||
elsif ( lc $cmd eq 'ring' && $mesh eq "master") {
|
elsif ( lc $cmd eq 'ring' && $mesh eq "master") {
|
||||||
if (int @val > 0) {
|
if (int @val > 0) {
|
||||||
FRITZBOX_Log $hash, 3, "set $name $cmd " . join(" ", @val);
|
FRITZBOX_Log $hash, 3, "set $name $cmd " . join(" ", @val);
|
||||||
@ -2270,14 +2278,6 @@ sub FRITZBOX_Set($$@)
|
|||||||
}
|
}
|
||||||
} # end tam
|
} # end tam
|
||||||
|
|
||||||
elsif ( lc $cmd eq 'update' ) {
|
|
||||||
FRITZBOX_Log $hash, 3, "set $name $cmd " . join(" ", @val);
|
|
||||||
$hash->{fhem}{LOCAL} = 1;
|
|
||||||
FRITZBOX_Readout_Start($hash->{helper}{TimerReadout});
|
|
||||||
$hash->{fhem}{LOCAL} = 0;
|
|
||||||
return undef;
|
|
||||||
} # end update
|
|
||||||
|
|
||||||
elsif ( lc $cmd eq 'enablevpnshare' && $mesh eq "master" && $FW1 == 7 && $FW2 >= 21) {
|
elsif ( lc $cmd eq 'enablevpnshare' && $mesh eq "master" && $FW1 == 7 && $FW2 >= 21) {
|
||||||
|
|
||||||
if ( int @val == 2 && $val[1] =~ /^(on|off)$/ ) {
|
if ( int @val == 2 && $val[1] =~ /^(on|off)$/ ) {
|
||||||
@ -2412,6 +2412,7 @@ sub FRITZBOX_Set($$@)
|
|||||||
return FRITZBOX_Readout_SetGet_Start $hash->{helper}{TimerCmd};
|
return FRITZBOX_Readout_SetGet_Start $hash->{helper}{TimerCmd};
|
||||||
}
|
}
|
||||||
} # end wlanlogextended
|
} # end wlanlogextended
|
||||||
|
}
|
||||||
|
|
||||||
return "Unknown argument $cmd or wrong parameter(s), choose one of $list";
|
return "Unknown argument $cmd or wrong parameter(s), choose one of $list";
|
||||||
|
|
||||||
@ -2431,6 +2432,9 @@ sub FRITZBOX_Get($@)
|
|||||||
my $avmModel = InternalVal($name, "MODEL", "FRITZ!Box");
|
my $avmModel = InternalVal($name, "MODEL", "FRITZ!Box");
|
||||||
my $mesh = ReadingsVal($name, "box_meshRole", "master");
|
my $mesh = ReadingsVal($name, "box_meshRole", "master");
|
||||||
|
|
||||||
|
# available, if passwor is set correctly
|
||||||
|
if ($hash->{WEBCONNECT}) {
|
||||||
|
|
||||||
if( lc $cmd eq "luaquery" && $hash->{LUAQUERY} == 1) {
|
if( lc $cmd eq "luaquery" && $hash->{LUAQUERY} == 1) {
|
||||||
# get Fritzbox luaQuery inetstat:status/Today/BytesReceivedLow
|
# get Fritzbox luaQuery inetstat:status/Today/BytesReceivedLow
|
||||||
# get Fritzbox luaQuery telcfg:settings/AlarmClock/list(Name,Active,Time,Number,Weekdays)
|
# get Fritzbox luaQuery telcfg:settings/AlarmClock/list(Name,Active,Time,Number,Weekdays)
|
||||||
@ -2683,12 +2687,9 @@ sub FRITZBOX_Get($@)
|
|||||||
|
|
||||||
my $list;
|
my $list;
|
||||||
|
|
||||||
# available, if passwor is set correctly
|
|
||||||
if ($hash->{WEBCONNECT}) {
|
|
||||||
|
|
||||||
$list .= "luaQuery" if $hash->{LUAQUERY} == 1;
|
$list .= "luaQuery" if $hash->{LUAQUERY} == 1;
|
||||||
$list .= " luaData" if $hash->{LUADATA} == 1;
|
$list .= " luaData" if $hash->{LUADATA} == 1;
|
||||||
$list .= " luaDectRingTone" if $hash->{LUADATA};
|
$list .= " luaDectRingTone" if $hash->{LUADATA} == 1;
|
||||||
$list .= " luaFunction" if $hash->{LUAQUERY} == 1;
|
$list .= " luaFunction" if $hash->{LUAQUERY} == 1;
|
||||||
|
|
||||||
# luaData
|
# luaData
|
||||||
@ -2707,9 +2708,11 @@ sub FRITZBOX_Get($@)
|
|||||||
$list .= " tr064Command" if defined $hash->{SECPORT};
|
$list .= " tr064Command" if defined $hash->{SECPORT};
|
||||||
$list .= " tr064ServiceList:noArg" if defined $hash->{SECPORT};
|
$list .= " tr064ServiceList:noArg" if defined $hash->{SECPORT};
|
||||||
# $list .= " soapCommand" if defined $hash->{SECPORT};
|
# $list .= " soapCommand" if defined $hash->{SECPORT};
|
||||||
}
|
|
||||||
|
|
||||||
return "Unknown argument $cmd, choose one of $list" if defined $list;
|
return "Unknown argument $cmd, choose one of $list" if defined $list;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "get command not available";
|
||||||
|
|
||||||
} # end FRITZBOX_Get
|
} # end FRITZBOX_Get
|
||||||
|
|
||||||
@ -5218,26 +5221,13 @@ sub FRITZBOX_Readout_Process($$)
|
|||||||
readingsBulkUpdate( $hash, "retStat_lastReadoutError", $values{Error} );
|
readingsBulkUpdate( $hash, "retStat_lastReadoutError", $values{Error} );
|
||||||
readingsBulkUpdate( $hash, "state", $values{Error} );
|
readingsBulkUpdate( $hash, "state", $values{Error} );
|
||||||
}
|
}
|
||||||
# if (defined $values{"fhem->sidTime"}) {
|
|
||||||
# $hash->{fhem}{sidTime} = $values{"fhem->sidTime"};
|
|
||||||
# FRITZBOX_Log $hash, 4, "Reset SID";
|
|
||||||
# }
|
|
||||||
# if (defined $values{"fhem->sidErrCount"}) {
|
|
||||||
# $hash->{fhem}{sidErrCount} = $values{"fhem->sidErrCount"};
|
|
||||||
# }
|
|
||||||
# if (defined $values{"->APICHECKED"}) {
|
|
||||||
# $hash->{APICHECKED} = $values{"->APICHECKED"};
|
|
||||||
# }
|
|
||||||
# if (defined $values{"->APICHECK_RET_CODES"}) {
|
|
||||||
# $hash->{APICHECK_RET_CODES} = $values{"->APICHECK_RET_CODES"};
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# } else {
|
|
||||||
# Statistics
|
# Statistics
|
||||||
if ($mesh ne "slave") {
|
if ($mesh ne "slave") {
|
||||||
if ( defined $values{".box_TodayBytesReceivedLow"} && defined $hash->{READINGS}{".box_TodayBytesReceivedLow"}) {
|
if ( defined $values{".box_TodayBytesReceivedLow"} && defined $hash->{READINGS}{".box_TodayBytesReceivedLow"}) {
|
||||||
my $valueHigh = $values{".box_TodayBytesReceivedHigh"} - $hash->{READINGS}{".box_TodayBytesReceivedHigh"}{VAL};
|
my $valueHigh = $values{".box_TodayBytesReceivedHigh"} - $hash->{READINGS}{".box_TodayBytesReceivedHigh"}{VAL};
|
||||||
my $valueLow = $values{".box_TodayBytesReceivedLow"} - $hash->{READINGS}{".box_TodayBytesReceivedLow"}{VAL};
|
my $valueLow = $values{".box_TodayBytesReceivedLow"} - $hash->{READINGS}{".box_TodayBytesReceivedLow"}{VAL};
|
||||||
|
|
||||||
# Consider reset of day counter
|
# Consider reset of day counter
|
||||||
if ($valueHigh < 0 || $valueHigh == 0 && $valueLow < 0) {
|
if ($valueHigh < 0 || $valueHigh == 0 && $valueLow < 0) {
|
||||||
$valueLow = $values{".box_TodayBytesReceivedLow"};
|
$valueLow = $values{".box_TodayBytesReceivedLow"};
|
||||||
@ -5276,42 +5266,51 @@ sub FRITZBOX_Readout_Process($$)
|
|||||||
|
|
||||||
#hash values
|
#hash values
|
||||||
if ($rName =~ /->/) {
|
if ($rName =~ /->/) {
|
||||||
|
|
||||||
# 4 levels
|
# 4 levels
|
||||||
my ($rName1, $rName2, $rName3, $rName4) = split /->/, $rName;
|
my ($rName1, $rName2, $rName3, $rName4) = split /->/, $rName;
|
||||||
|
|
||||||
# 4th level (Internal Value)
|
# 4th level (Internal Value)
|
||||||
if ($rName1 ne "" && defined $rName4) {
|
if ($rName1 ne "" && defined $rName4) {
|
||||||
$hash->{$rName1}{$rName2}{$rName3}{$rName4} = $rValue;
|
$hash->{$rName1}{$rName2}{$rName3}{$rName4} = $rValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
# 3rd level (Internal Value)
|
# 3rd level (Internal Value)
|
||||||
elsif ($rName1 ne "" && defined $rName3) {
|
elsif ($rName1 ne "" && defined $rName3) {
|
||||||
$hash->{$rName1}{$rName2}{$rName3} = $rValue;
|
$hash->{$rName1}{$rName2}{$rName3} = $rValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
# 1st level (Internal Value)
|
# 1st level (Internal Value)
|
||||||
elsif ($rName1 eq "") {
|
elsif ($rName1 eq "") {
|
||||||
$hash->{$rName2} = $rValue;
|
$hash->{$rName2} = $rValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
# 2nd levels
|
# 2nd levels
|
||||||
else {
|
else {
|
||||||
$hash->{$rName1}{$rName2} = $rValue;
|
$hash->{$rName1}{$rName2} = $rValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete ($hash->{HINWEIS_BOXUSER}) if $rName2 eq "HINWEIS_BOXUSER" && $rValue eq "";
|
delete ($hash->{HINWEIS_BOXUSER}) if $rName2 eq "HINWEIS_BOXUSER" && $rValue eq "";
|
||||||
delete ($hash->{HINWEIS_PASSWORD}) if $rName2 eq "HINWEIS_PASSWORD" && $rValue eq "";
|
delete ($hash->{HINWEIS_PASSWORD}) if $rName2 eq "HINWEIS_PASSWORD" && $rValue eq "";
|
||||||
}
|
}
|
||||||
|
|
||||||
elsif ($rName eq "-<fhem") {
|
elsif ($rName eq "-<fhem") {
|
||||||
FRITZBOX_Log $hash, 5, "calling fhem() with: " . $rValue;
|
FRITZBOX_Log $hash, 5, "calling fhem() with: " . $rValue;
|
||||||
fhem($rValue,1);
|
fhem($rValue,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
elsif ($rName eq "box_fwVersion" && defined $values{box_fwUpdate}) {
|
elsif ($rName eq "box_fwVersion" && defined $values{box_fwUpdate}) {
|
||||||
$rValue .= " (old)" if $values{box_fwUpdate} eq "1";
|
$rValue .= " (old)" if $values{box_fwUpdate} eq "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
elsif ( $rName eq "Error" ) {
|
elsif ( $rName eq "Error" ) {
|
||||||
readingsBulkUpdate( $hash, "retStat_lastReadoutError", $rValue );
|
readingsBulkUpdate( $hash, "retStat_lastReadoutError", $rValue );
|
||||||
readingsBulkUpdate( $hash, "state", $rValue );
|
readingsBulkUpdate( $hash, "state", $rValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
elsif ($rName eq "box_model") {
|
elsif ($rName eq "box_model") {
|
||||||
$hash->{MODEL} = $rValue;
|
$hash->{MODEL} = $rValue;
|
||||||
if (($rValue =~ "Box") && (lc($rValue) =~ "6[4,5,6][3,6,9][0,1]") ) {
|
if (($rValue =~ "Box") && (lc($rValue) =~ "6[4,5,6][3,6,9][0,1]") ) {
|
||||||
#if (1==1) {
|
|
||||||
my $cable = "boxUser "
|
my $cable = "boxUser "
|
||||||
."disable:0,1 "
|
."disable:0,1 "
|
||||||
."nonblockingTimeOut:50,75,100,125 "
|
."nonblockingTimeOut:50,75,100,125 "
|
||||||
@ -5361,6 +5360,7 @@ sub FRITZBOX_Readout_Process($$)
|
|||||||
} else {
|
} else {
|
||||||
setDevAttrList($hash->{NAME});
|
setDevAttrList($hash->{NAME});
|
||||||
}
|
}
|
||||||
|
|
||||||
$rValue .= " [".$values{box_oem}."]" if $values{box_oem};
|
$rValue .= " [".$values{box_oem}."]" if $values{box_oem};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5406,6 +5406,7 @@ sub FRITZBOX_Readout_Process($$)
|
|||||||
else {
|
else {
|
||||||
$newState .= "off";
|
$newState .= "off";
|
||||||
}
|
}
|
||||||
|
|
||||||
$newState .=" gWLAN: ".$values{box_guestWlan} ;
|
$newState .=" gWLAN: ".$values{box_guestWlan} ;
|
||||||
$newState .=" (Remain: ".$values{box_guestWlanRemain}." min)" if $values{box_guestWlan} eq "on" && $values{box_guestWlanRemain} > 0;
|
$newState .=" (Remain: ".$values{box_guestWlanRemain}." min)" if $values{box_guestWlan} eq "on" && $values{box_guestWlanRemain} > 0;
|
||||||
readingsBulkUpdate( $hash, "state", $newState);
|
readingsBulkUpdate( $hash, "state", $newState);
|
||||||
@ -5427,10 +5428,15 @@ sub FRITZBOX_Readout_Process($$)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $msg = keys( %values ) . " values captured in " . $values{readoutTime} . " s";
|
my $msg;
|
||||||
|
if (keys( %values ) && $values{readoutTime}) {
|
||||||
|
$msg = keys( %values ) . " values captured in " . $values{readoutTime} . " s";
|
||||||
|
} else {
|
||||||
|
$msg = "no values read out";
|
||||||
|
}
|
||||||
|
|
||||||
readingsBulkUpdate( $hash, "retStat_lastReadout", $msg );
|
readingsBulkUpdate( $hash, "retStat_lastReadout", $msg );
|
||||||
FRITZBOX_Log $hash, 5, "BulkUpdate lastReadout: " . $msg;
|
FRITZBOX_Log $hash, 5, "BulkUpdate lastReadout: " . $msg;
|
||||||
# }
|
|
||||||
|
|
||||||
readingsEndUpdate( $hash, 1 );
|
readingsEndUpdate( $hash, 1 );
|
||||||
|
|
||||||
@ -7021,9 +7027,12 @@ sub FRITZBOX_Set_lock_Landevice_OnOffRt($)
|
|||||||
|
|
||||||
my $result = FRITZBOX_read_LuaData($hash, "data", \@webCmdArray);
|
my $result = FRITZBOX_read_LuaData($hash, "data", \@webCmdArray);
|
||||||
|
|
||||||
if ( defined $result->{Error} ) {
|
my $analyse = FRITZBOX_Helper_analyse_Lua_Result($hash, $result);
|
||||||
FRITZBOX_Log $hash, 2, "lockLandevice status: " . $result->{Error};
|
|
||||||
FRITZBOX_Readout_Add_Reading $hash, \@roReadings, "retStat_lockLandevice", $val[0] . "->ERROR: " . $result->{Error};
|
if ( $analyse =~ /ERROR/) {
|
||||||
|
FRITZBOX_Log $hash, 2, "lockLandevice status: " . $analyse;
|
||||||
|
FRITZBOX_Readout_Add_Reading $hash, \@roReadings, "retStat_lockLandevice", $val[0] . "->ERROR: " . $analyse;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$lock_res = FRITZBOX_Get_Lan_Device_Info( $hash, $val[0], "lockLandevice");
|
$lock_res = FRITZBOX_Get_Lan_Device_Info( $hash, $val[0], "lockLandevice");
|
||||||
@ -8001,14 +8010,10 @@ sub FRITZBOX_Get_SmartHome_Devices_List($@) {
|
|||||||
|
|
||||||
if ($devID) {
|
if ($devID) {
|
||||||
|
|
||||||
if ( defined $result->{Error} ) {
|
if ( $analyse =~ /ERROR/) {
|
||||||
FRITZBOX_Log $hash, 2, "evaluating user info -> " . $analyse;
|
FRITZBOX_Log $hash, 2, "evaluating user info -> " . $analyse;
|
||||||
my %retHash = ("Error" => $returnStr, "Info" => $analyse);
|
my %retHash = ("Error" => $returnStr, "Info" => $analyse);
|
||||||
return \%retHash;
|
return \%retHash;
|
||||||
} elsif ( defined $result->{AuthorizationRequired} ) {
|
|
||||||
FRITZBOX_Log $hash, 2, "evaluating user info -> AuthorizationRequired";
|
|
||||||
my %retHash = ("Error" => $returnStr, "Info" => "AuthorizationRequired");
|
|
||||||
return \%retHash;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
my $devData = $result->{'data'}{'devices'}; # hier entsteht die Referenz auf das Array
|
my $devData = $result->{'data'}{'devices'}; # hier entsteht die Referenz auf das Array
|
||||||
@ -8216,16 +8221,11 @@ sub FRITZBOX_Get_SmartHome_Devices_List($@) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ( defined $result->{Error} ) {
|
if ( $analyse =~ /ERROR/) {
|
||||||
FRITZBOX_Log $hash, 2, "evaluating user info -> " . $analyse;
|
FRITZBOX_Log $hash, 2, "evaluating user info -> " . $analyse;
|
||||||
$returnStr = "SmartHome Devices: Active\n";
|
$returnStr = "SmartHome Devices: Active\n";
|
||||||
$returnStr .= "------------------\n";
|
$returnStr .= "------------------\n";
|
||||||
return $returnStr . $analyse;
|
return $returnStr . $analyse;
|
||||||
} elsif ( defined $result->{AuthorizationRequired} ) {
|
|
||||||
FRITZBOX_Log $hash, 2, "evaluating user info -> AuthorizationRequired";
|
|
||||||
$returnStr = "Smart Home Devices: Active\n";
|
|
||||||
$returnStr .= "------------------\n";
|
|
||||||
return $returnStr . "AuthorizationRequired";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# border(8),cellspacing(10),cellpadding(20)
|
# border(8),cellspacing(10),cellpadding(20)
|
||||||
@ -8990,10 +8990,6 @@ sub FRITZBOX_Get_Lua_Kids($$@)
|
|||||||
return \%retHash;
|
return \%retHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
#################
|
|
||||||
#FRITZBOX_Log $hash, 3, "Response: ".$response->content;
|
|
||||||
#################
|
|
||||||
|
|
||||||
# Remove illegal escape sequences
|
# Remove illegal escape sequences
|
||||||
$jsonText =~ s/\\'/'/g; #Hochkomma
|
$jsonText =~ s/\\'/'/g; #Hochkomma
|
||||||
$jsonText =~ s/\\x\{[0-9a-f]\}//g; #delete control codes (as hex numbers)
|
$jsonText =~ s/\\x\{[0-9a-f]\}//g; #delete control codes (as hex numbers)
|
||||||
@ -9547,7 +9543,7 @@ sub FRITZBOX_call_Lua_Query($$@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#################
|
#################
|
||||||
FRITZBOX_Log $hash, 5, "Response: " . $response->content;
|
# FRITZBOX_Log $hash, 5, "Response: " . $response->content;
|
||||||
#################
|
#################
|
||||||
|
|
||||||
my $jsonResult ;
|
my $jsonResult ;
|
||||||
@ -9734,9 +9730,6 @@ sub FRITZBOX_read_LuaData($$$@)
|
|||||||
return FRITZBOX_Helper_process_JSON($hash, $profile_content, $result->{sid}, $charSet, $sidNew);
|
return FRITZBOX_Helper_process_JSON($hash, $profile_content, $result->{sid}, $charSet, $sidNew);
|
||||||
}
|
}
|
||||||
|
|
||||||
########### Standard JSON #################################
|
|
||||||
FRITZBOX_Log $hash, 5, "Response: \n" . $response->content;
|
|
||||||
|
|
||||||
return FRITZBOX_Helper_process_JSON($hash, $response->content, $result->{sid}, $charSet, $sidNew);
|
return FRITZBOX_Helper_process_JSON($hash, $response->content, $result->{sid}, $charSet, $sidNew);
|
||||||
|
|
||||||
} # end FRITZBOX_Lua_Data
|
} # end FRITZBOX_Lua_Data
|
||||||
@ -10369,6 +10362,9 @@ sub FRITZBOX_Helper_Url_Regex {
|
|||||||
<dt><code>set <name> call <number> [duration]</code></dt>
|
<dt><code>set <name> call <number> [duration]</code></dt>
|
||||||
<br>
|
<br>
|
||||||
Calls for 'duration' seconds (default 60) the given number from an internal port (default 1).
|
Calls for 'duration' seconds (default 60) the given number from an internal port (default 1).
|
||||||
|
<br>
|
||||||
|
The ringing occurs via the dialing aid, which must be activated via "Telephony/Calls/Dialing aid".<br>
|
||||||
|
A different port may need to be set via the Fritz!Box web interface. The current one is in “box_stdDialPort”.
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
<li><a name="checkAPIs"></a>
|
<li><a name="checkAPIs"></a>
|
||||||
@ -11276,6 +11272,8 @@ sub FRITZBOX_Helper_Url_Regex {
|
|||||||
Ruft für 'Dauer' Sekunden (Standard 60 s) die angegebene Telefonnummer von einem internen Telefonanschluss an (Standard ist 1). Wenn der Angerufene abnimmt, hört er die Wartemusik.
|
Ruft für 'Dauer' Sekunden (Standard 60 s) die angegebene Telefonnummer von einem internen Telefonanschluss an (Standard ist 1). Wenn der Angerufene abnimmt, hört er die Wartemusik.
|
||||||
Der interne Telefonanschluss klingelt ebenfalls.
|
Der interne Telefonanschluss klingelt ebenfalls.
|
||||||
<br>
|
<br>
|
||||||
|
Das Klingeln erfolgt über die Wählhilfe, die über "Telefonie/Anrufe/Wählhilfe" aktiviert werden muss.<br>
|
||||||
|
Eventuell muss über die Weboberfläche der Fritz!Box ein anderer Port eingestellt werden. Der aktuelle steht in "box_stdDialPort".
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
<li><a name="checkAPIs"></a>
|
<li><a name="checkAPIs"></a>
|
||||||
@ -11442,7 +11440,6 @@ sub FRITZBOX_Helper_Url_Regex {
|
|||||||
Wenn der Anruf angenommen wird, hört der Angerufene die Wartemusik (music on hold).
|
Wenn der Anruf angenommen wird, hört der Angerufene die Wartemusik (music on hold).
|
||||||
<br>
|
<br>
|
||||||
Je nach Fritz!OS kann das beschriebene Verhalten abweichen.
|
Je nach Fritz!OS kann das beschriebene Verhalten abweichen.
|
||||||
<br>
|
|
||||||
</li><br>
|
</li><br>
|
||||||
|
|
||||||
<li><a name="smartHome"></a>
|
<li><a name="smartHome"></a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user