diff --git a/fhem/FHEM/98_HMinfo.pm b/fhem/FHEM/98_HMinfo.pm index 9fac9b4af..a31b6b184 100644 --- a/fhem/FHEM/98_HMinfo.pm +++ b/fhem/FHEM/98_HMinfo.pm @@ -272,7 +272,8 @@ sub HMinfo_paramCheck(@) { #################################################### return $ret; } sub HMinfo_tempList(@) { ###################################################### - my ($action,$fName)=@_; + my ($filter,$action,$fName)=@_; + $filter = "." if (!$filter); $fName = "tempList.cfg" if (!$fName); $action = "save" if (!$action); my $ret; @@ -288,7 +289,7 @@ sub HMinfo_tempList(@) { ###################################################### elsif ($md =~ m/(ROTO_ZEL-STG-RM-FWT|HM-CC-TC)/){ $chN = $defs{$eN}{channel_02}; } - next if (!$chN || !$defs{$chN} ); + next if (!$chN || !$defs{$chN} || $chN !~ m/$filter/); print aSave "\nentities:$chN"; my @tl = sort grep /tempList[SMFWT]/,keys %{$defs{$chN}{READINGS}}; if (scalar@tl != 7){ @@ -318,7 +319,7 @@ sub HMinfo_tempList(@) { ###################################################### @el = (); foreach (split(",",$line)){ if ($defs{$_}){ - push @el,$_ if ($defs{$_}); + push @el,$_ if ($defs{$_} && $_ =~ m/$filter/); } else{ push @entryNF,$_; @@ -356,7 +357,7 @@ sub HMinfo_tempList(@) { ###################################################### @el = (); foreach (split(",",$line)){ if ($defs{$_}){ - push @el,$_ if ($defs{$_}); + push @el,$_ if ($defs{$_} && $_ =~ m/$filter/); } else{ push @entryNF,$_; @@ -390,7 +391,9 @@ sub HMinfo_tempList(@) { ###################################################### $ret = "failed Entries:\n " .join("\n ",@entryFail) if (scalar@entryFail); $ret = "Entries not found:\n ".join("\n ",@entryNF) if (scalar@entryNF); } - + else{ + $ret = "$action unknown option - please use save, verify or restore"; + } return $ret; } @@ -794,8 +797,8 @@ sub HMinfo_SetFn($@) {######################################################### elsif($cmd eq "update") {##update hm counts ----------------------------- $ret = HMinfo_status($hash); } - elsif($cmd eq "tempList") {##update hm counts ----------------------------- - $ret = HMinfo_tempList(@a); + elsif($cmd eq "tempList") {##handle thermostat templist from file ------- + $ret = HMinfo_tempList($filter,@a); } elsif($cmd eq "help") { $ret = " Unknown argument $cmd, choose one of " @@ -806,7 +809,7 @@ sub HMinfo_SetFn($@) {######################################################### ."\n ---actions---" ."\n saveConfig [] # stores peers and register with saveConfig" ."\n autoReadReg [] # trigger update readings if attr autoReadReg is set" - ."\n tempList [save|restore|verify][filename] # handle tempList of thermostat devices" + ."\n tempList [][save|restore|verify][]# handle tempList of thermostat devices" ."\n ---infos---" ."\n update # update HMindfo counts" ."\n register [] # devicefilter parse devicename. Partial strings supported" @@ -1529,7 +1532,7 @@ sub HMinfo_noDup(@) {#return list with no duplicates performs a save for all HM register setting and peers. See CUL_HM saveConfig.
-
  • tempList [save|restore|verify] [filename]
    +
  • tempList [filter][save|restore|verify] [filename]
    this function supports handling of tempList for thermstates. It allows templists to be saved in a separate file, verify settings against the file and write the templist of the file to the devices.
    @@ -1537,10 +1540,10 @@ sub HMinfo_noDup(@) {#return list with no duplicates Note that templist as available in FHEM is put to the file. It is up to the user to make sure the data is actual
    Storage is not cumulative - former content of the file will be removed
  • -
  • restore available templist as defined in the file is written directly +
  • restore available templist as defined in the file are written directly to the device
  • verify file data is compared to readings as present in FHEM. It does not - verify data in the device - user needs to ensure actuallity on the readings
  • + verify data in the device - user needs to ensure actuallity of present readings
  • filename is the name of the file to be used. Default ist tempList.cfg
  • File example
    @@ -1563,7 +1566,8 @@ sub HMinfo_noDup(@) {#return list with no duplicates tempListWed>06:00 17.0 12:00 21.0 23:00 20.0 24:00 17.0
    File keywords
    -
  • entities comma separated list of entities which refers to the teml lists following
  • +
  • entities comma separated list of entities which refers to the temp lists following. + The actual entity holding the templist must be given - which is channel 04 for RTs or channel 02 for TCs
  • tempList... time and temp couples as used in the set tempList commands