diff --git a/fhem/FHEM/70_PylonLowVoltage.pm b/fhem/FHEM/70_PylonLowVoltage.pm index 29a163c34..ae9124837 100644 --- a/fhem/FHEM/70_PylonLowVoltage.pm +++ b/fhem/FHEM/70_PylonLowVoltage.pm @@ -472,12 +472,20 @@ sub Attr { } } - if ($aName eq 'interval') { - if (!looks_like_number($aVal)) { - return qq{The value for $aName is invalid, it must be numeric!}; - } + if ($cmd eq 'set') { + if ($aName eq 'interval') { + if (!looks_like_number($aVal)) { + return qq{The value for $aName is invalid, it must be numeric!}; + } - InternalTimer(gettimeofday()+1.0, "FHEM::PylonLowVoltage::manageUpdate", $hash, 0); + InternalTimer(gettimeofday()+1.0, "FHEM::PylonLowVoltage::manageUpdate", $hash, 0); + } + + if ($aName =~ /timeout|waitTimeBetweenRS485Cmd/xs) { + if (!looks_like_number($aVal)) { + return qq{The value for $aName is invalid, it must be numeric!}; + } + } } if ($aName eq 'userBatterytype') { @@ -485,12 +493,6 @@ sub Attr { InternalTimer(gettimeofday()+1.0, "FHEM::PylonLowVoltage::manageUpdate", $hash, 0); } - if ($aName =~ /timeout|waitTimeBetweenRS485Cmd/xs) { - if (!looks_like_number($aVal)) { - return qq{The value for $aName is invalid, it must be numeric!}; - } - } - return; } diff --git a/fhem/contrib/DS_Starter/70_PylonLowVoltage.pm b/fhem/contrib/DS_Starter/70_PylonLowVoltage.pm index 250d33ece..ae9124837 100644 --- a/fhem/contrib/DS_Starter/70_PylonLowVoltage.pm +++ b/fhem/contrib/DS_Starter/70_PylonLowVoltage.pm @@ -220,7 +220,7 @@ my %halm = ( # # 7E 32 30 31 30 34 36 39 33 45 30 30 32 31 30 = 02D1H -> bitweise invert = 1111 1101 0010 1110 -> +1 = 1111 1101 0010 1111 -> FD2FH ################################################################################################################################################################## my %hrsnb = ( - 1 => { cmd => '20--4693E002--', fnclsnr => 1, fn => 'serialNumber', mlen => 52 }, + 1 => { cmd => '20--4693E002--', fnclsnr => 1, fname => 'serialNumber', mlen => 52 }, ); ################################################################################################################################################################## @@ -238,7 +238,7 @@ my %hrsnb = ( # 7E 32 20 31 30 34 36 35 31 30 30 30 30 - - FD BD = 0243H -> bitweise invert = 1111 1101 1011 1100 -> +1 = 1111 1101 1011 1101 = FDBDH ################################################################################################################################################################## my %hrmfi = ( - 1 => { cmd => '20--46510000', fnclsnr => 2, fn => 'manufacturerInfo', mlen => 82 }, + 1 => { cmd => '20--46510000', fnclsnr => 2, fname => 'manufacturerInfo', mlen => 82 }, ); ################################################################################################################################################################## @@ -255,7 +255,7 @@ my %hrmfi = ( # ~ 00 0A 46 4F 00 00 empty ################################################################################################################################################################## my %hrprt = ( - 1 => { cmd => '00--464F0000', fnclsnr => 3, fn => 'protocolVersion', mlen => 18 }, + 1 => { cmd => '00--464F0000', fnclsnr => 3, fname => 'protocolVersion', mlen => 18 }, ); ################################################################################################################################################################## @@ -267,7 +267,7 @@ my %hrprt = ( # 7E 32 30 31 31 34 36 39 36 45 30 30 32 31 31 ################################################################################################################################################################## my %hrswv = ( - 1 => { cmd => '20--4696E002--', fnclsnr => 4, fn => 'softwareVersion', mlen => 30 }, + 1 => { cmd => '20--4696E002--', fnclsnr => 4, fname => 'softwareVersion', mlen => 30 }, ); ################################################################################################################################################################## @@ -279,7 +279,7 @@ my %hrswv = ( # 7E 32 30 30 41 34 36 34 37 45 30 30 32 30 41 ################################################################################################################################################################## my %hrspm = ( - 1 => { cmd => '20--4647E002--', fnclsnr => 5, fn => 'systemParameter', mlen => 68 }, + 1 => { cmd => '20--4647E002--', fnclsnr => 5, fname => 'systemParameter', mlen => 68 }, ); ################################################################################################################################################################## @@ -297,7 +297,7 @@ my %hrspm = ( # 7E 32 30 31 30 34 36 34 32 45 30 30 32 31 30 ################################################################################################################################################################## my %hrcmn = ( - 1 => { cmd => '20--4642E002--', fnclsnr => 6, fn => 'analogValue', mlen => 128 }, + 1 => { cmd => '20--4642E002--', fnclsnr => 6, fname => 'analogValue', mlen => 128 }, ); ################################################################################################################################################################## @@ -309,7 +309,7 @@ my %hrcmn = ( # 7E 32 30 31 30 34 36 34 34 45 30 30 32 31 30 1111 1101 0011 0010 ################################################################################################################################################################## my %hralm = ( - 1 => { cmd => '20--4644E002--', fnclsnr => 7, fn => 'alarmInfo', mlen => 82 }, + 1 => { cmd => '20--4644E002--', fnclsnr => 7, fname => 'alarmInfo', mlen => 82 }, ); ################################################################################################################################################################## @@ -321,7 +321,7 @@ my %hralm = ( # 7E 32 30 30 41 34 36 39 32 45 30 30 32 30 41 ################################################################################################################################################################## my %hrcmi = ( - 1 => { cmd => '20--4692E002--', fnclsnr => 8, fn => 'chargeManagmentInfo', mlen => 38 }, + 1 => { cmd => '20--4692E002--', fnclsnr => 8, fname => 'chargeManagmentInfo', mlen => 38 }, ); @@ -472,12 +472,20 @@ sub Attr { } } - if ($aName eq 'interval') { - if (!looks_like_number($aVal)) { - return qq{The value for $aName is invalid, it must be numeric!}; - } + if ($cmd eq 'set') { + if ($aName eq 'interval') { + if (!looks_like_number($aVal)) { + return qq{The value for $aName is invalid, it must be numeric!}; + } - InternalTimer(gettimeofday()+1.0, "FHEM::PylonLowVoltage::manageUpdate", $hash, 0); + InternalTimer(gettimeofday()+1.0, "FHEM::PylonLowVoltage::manageUpdate", $hash, 0); + } + + if ($aName =~ /timeout|waitTimeBetweenRS485Cmd/xs) { + if (!looks_like_number($aVal)) { + return qq{The value for $aName is invalid, it must be numeric!}; + } + } } if ($aName eq 'userBatterytype') { @@ -485,12 +493,6 @@ sub Attr { InternalTimer(gettimeofday()+1.0, "FHEM::PylonLowVoltage::manageUpdate", $hash, 0); } - if ($aName =~ /timeout|waitTimeBetweenRS485Cmd/xs) { - if (!looks_like_number($aVal)) { - return qq{The value for $aName is invalid, it must be numeric!}; - } - } - return; }