"; ## Zeilenende
}
@@ -713,6 +743,45 @@ sub Timer_FW_Detail {
}
}
+ /* input numbre - Check Werte | nur 0-9 . - */
+ function isValidInputKey(evt){
+ var charCode = (evt.which) ? evt.which : evt.keyCode
+ return !(charCode > 31 && (charCode < 45 || charCode == 47 || charCode > 57) );
+ }
+
+ /* Check - eingestellter Wert Browser fuer Ein/Ausblendung Eingabefeld zuständig */
+ function validColumn(id,TimersCnt) {
+ var idOffset = id - id % 20 + 17;
+ let column_hide = false;
+ var TimersCntOffset = 0;
+
+ if (document.getElementById(id).value.charAt(0) == "S") {
+ console.log("plausible column found with id " + id +" | idOffset: " + idOffset);
+ document.getElementById(idOffset).style.display = \'table-cell\';
+ column_hide = true;
+ } else {
+ var idLine = id - id % 20;
+ if (document.getElementById(idLine + 4).value.charAt(0) != "S" && document.getElementById(idLine + 5).value.charAt(0) != "S") {
+ document.getElementById(idOffset).style.display = \'none\';
+ }
+ }
+
+ /* Check - Wert testValues irgendwo in Rest der Tabelle */
+ for (var i3 = 1; i3 <= TimersCnt; i3++) {
+ var column_hhmm = i3 * 20 + 4;
+ if(document.getElementById(column_hhmm).value.charAt(0) == "S" || document.getElementById(column_hhmm + 1).value.charAt(0) == "S") {
+ TimersCntOffset++;
+ }
+ }
+
+ /* Ausblendung Offset Ueberschrift */
+ if(TimersCntOffset == 0){
+ document.getElementById(17).style.display = \'none\';
+ } else {
+ document.getElementById(17).style.display = \'table-cell\';
+ }
+ }
+
/* Aktion wenn Speichern */
function pushed_savebutton(id) {
/* all id´s is passed as a string with comma separation */
@@ -722,9 +791,9 @@ sub Timer_FW_Detail {
for (var i2 = 0; i2 < myIDs.length; i2++) {
var allVals = [];
- var timerNr = (myIDs[i2] - 16) / 20;
+ var timerNr = (myIDs[i2] - 17) / 20;
allVals.push(timerNr);
- var start = myIDs[i2] - 16 + 1;
+ var start = myIDs[i2] - 17 + 1;
for(var i = start; i <= myIDs[i2]; i++) {
allVals.push(document.getElementById(i).value);
}
@@ -788,100 +857,127 @@ sub FW_pushed_savebutton_preparation {
sub FW_pushed_savebutton {
my $name = shift;
my $hash = $defs{$name};
- my $selected_buttons = shift; # neu,alle,alle,alle,alle,alle,00,Beispiel,on,0,0,0,0,0,0,0,0
- my @selected_buttons = split(',' , $selected_buttons);
+ my $rowsField = shift; # neu,alle,alle,alle,alle,alle,00,Beispiel,on,0,0,0,0,0,0,0,0
+ my @rowsField = split(',' , $rowsField);
my $FW_room_dupl = shift;
- my $cnt_names = scalar(@selected_buttons); # counter for name split from string -> $selected_buttons
+ my $cnt_names = scalar(@rowsField); # counter for name split from string -> $rowsField
my $room = AttrVal($name, 'room', 'Unsorted');
my $ReadingsVal; # OldValue from Timer in Reading
my @timestamp_values = split( /-|\s|:/xms , TimeNow() ); # Time now splitted from -> 2016-02-16 19:34:24
my ($sec, $min, $hour, $mday, $month, $year) = ($timestamp_values[5], $timestamp_values[4], $timestamp_values[3], $timestamp_values[2], $timestamp_values[1], $timestamp_values[0]);
+ my $readingStr = "";
- if ($cnt_names > 17) { return 'ERROR: Comma not allowed in description!'; }
+ if ($cnt_names > 18) { return 'ERROR: Comma not allowed in description!'; }
if (not defined $hash->{helper}->{pushed_savebutton_count} || not defined $hash->{helper}->{ID_cnt}) {
Log3 $name, 2, "$name: FW_pushed_savebutton | cancellation, helper_pushed_savebutton_count ".$hash->{helper}->{pushed_savebutton_count};
Log3 $name, 2, "$name: FW_pushed_savebutton | cancellation, helper_ID_cnt ".$hash->{helper}->{ID_cnt};
return 'ERROR: Timer cancellation!';
}
-
- Log3 $name, 4, "$name: FW_pushed_savebutton | ReadingsVal set: $selected_buttons";
+ Log3 $name, 4, "$name: FW_pushed_savebutton | ReadingsVal set: $rowsField";
$hash->{helper}->{pushed_savebutton_count}++;
- $ReadingsVal = ReadingsVal($name, 'Timer_'.sprintf("%02s", $selected_buttons[0]), undef);
+ my $checkInput = 0;
+ if ($rowsField[1] eq $year) {
+ if ($rowsField[2] eq $month || ($rowsField[2] eq 'alle' && $month == 12)) {
+ if ($rowsField[3] eq $mday || ($rowsField[3] eq 'alle' && $mday == 31)) {
+ $checkInput = 1;
+ } elsif (length($rowsField[3]) == 2 && $rowsField[3] < $mday) {return 'ERROR: The day is in the past.';}
+ } elsif (length($rowsField[2]) == 2 && $rowsField[2] < $month) {return 'ERROR: The month is in the past.';}
+ }
+ $ReadingsVal = ReadingsVal($name, 'Timer_'.sprintf("%02s", $rowsField[0]), undef);
if ($ReadingsVal) {
- Log3 $name, 5, "$name: FW_pushed_savebutton | ReadingsVal old: ".$selected_buttons[0].','.$ReadingsVal.' cnt='.$hash->{helper}->{pushed_savebutton_count};
+ Log3 $name, 5, "$name: FW_pushed_savebutton | ReadingsVal old: ".$rowsField[0].','.$ReadingsVal.' cnt='.$hash->{helper}->{pushed_savebutton_count};
- if ($hash->{helper}->{pushed_savebutton_count} == $hash->{helper}->{ID_cnt}) {
+ if ($hash->{helper}->{pushed_savebutton_count} && $hash->{helper}->{ID_cnt} && $hash->{helper}->{pushed_savebutton_count} == $hash->{helper}->{ID_cnt}) {
Log3 $name, 4, "$name: FW_pushed_savebutton | found END with ".$hash->{helper}->{changes}.' changes !!!';
$hash->{helper}->{refresh}++; # now, browser can be updated to view current values
}
- if ($selected_buttons eq ($selected_buttons[0].','.$ReadingsVal)) {
+ if ($rowsField eq ($rowsField[0].','.$ReadingsVal)) {
goto ENDPOINT; # no difference, needs no update
} else {
- Log3 $name, 4, "$name: FW_pushed_savebutton | ReadingsVal ---> ".$selected_buttons[0]." must SAVE !!!";
+ Log3 $name, 4, "$name: FW_pushed_savebutton | ReadingsVal ---> ".$rowsField[0]." must SAVE !!!";
$hash->{helper}->{changes}++;
}
}
for(my $i = 0;$i < $cnt_names;$i++) {
- Log3 $name, 5, "$name: FW_pushed_savebutton | ".$names[$i].' -> '.$selected_buttons[$i];
+ Log3 $name, 5, "$name: FW_pushed_savebutton | ".$names[$i].' -> '.$rowsField[$i];
## to set time to check input ## SA -> pos 4 array | SU -> pos 5 array ##
- if ($i >= 1 && $i <=6 && ( $selected_buttons[$i] ne $description_all && $selected_buttons[$i] ne $designations[4] && $selected_buttons[$i] ne $designations[5] )) {
- if ($i == 6) { $sec = $selected_buttons[$i]; }
- if ($i == 5) { $min = $selected_buttons[$i]; }
- if ($i == 4) { $hour = $selected_buttons[$i]; }
- if ($i == 3) { $mday = $selected_buttons[$i]; }
- if ($i == 2) { $month = $selected_buttons[$i]-1; }
- if ($i == 1) { $year = $selected_buttons[$i]-1900; }
+ if ($i >= 1 && $i <=6 && ( $rowsField[$i] ne $description_all && $rowsField[$i] ne $designations[4] && $rowsField[$i] ne $designations[5] )) {
+ if ($i == 6) { $sec = $rowsField[$i]; }
+ if ($i == 5) { $min = $rowsField[$i]; }
+ if ($i == 4) { $hour = $rowsField[$i]; }
+ if ($i == 3) { $mday = $rowsField[$i]; }
+ if ($i == 2) { $month = $rowsField[$i]; }
+ if ($i == 1) { $year = $rowsField[$i]; }
}
if ($i == 7) {
- Log3 $name, 5, "$name: FW_pushed_savebutton | check: exists device or name -> ".$selected_buttons[$i];
- if (IsDevice($selected_buttons[$i]) == 1) {
- Log3 $name, 5, "$name: FW_pushed_savebutton | ".$selected_buttons[$i].' is checked and exists';
+ Log3 $name, 5, "$name: FW_pushed_savebutton | check: exists device or name -> ".$rowsField[$i];
+ if (IsDevice($rowsField[$i]) == 1) {
+ Log3 $name, 5, "$name: FW_pushed_savebutton | ".$rowsField[$i].' is checked and exists';
}
- if ( (IsDevice($selected_buttons[$i]) == 0) && ($selected_buttons[$i+1] eq 'on' || $selected_buttons[$i+1] eq 'off') ) {
- Log3 $name, 5, "$name: FW_pushed_savebutton | ".$selected_buttons[$i].' is NOT exists';
+ if ( (IsDevice($rowsField[$i]) == 0) && ($rowsField[$i+1] eq 'on' || $rowsField[$i+1] eq 'off') ) {
+ Log3 $name, 5, "$name: FW_pushed_savebutton | ".$rowsField[$i].' is NOT exists';
return 'ERROR: device not exists or no description! NO timer saved!';
}
}
+ if ($i == 17) {
+ #$rowsField[17] =~ s/-$//gxms; # nur bei input typ=text
+ #$rowsField[17] =~ s/^-+/-/gxms; # nur bei input typ=text
+ $rowsField[17] *= 1;
+ if ($rowsField[17] > 1440) {$rowsField[17] = 1440;} # max. 1 Tag
+ if ($rowsField[17] < -1440) {$rowsField[17] = -1440;} # max. 1 Tag
+ $rowsField[17] = sprintf "%.0f", $rowsField[17];
+ Log3 $name, 4, "$name: FW_pushed_savebutton | offset= ".$rowsField[17];
+ }
+ if ($i > 0) {$readingStr .= $rowsField[$i] . ','}
+ }
+ chop($readingStr);
+
+ my $timeTimer = fhemTimeLocal($sec, $min, $hour, $mday, $month - 1, $year - 1900);
+ if ($checkInput == 1) {
+ # Log3 $name, 3, "$name: $timeStamp - $timeTimer = $diff";
+ if ((time() - $timeTimer) > 0) {
+ # Log3 $name, 3, 'ERROR: The time is in the past. Please set a time in the future!';
+ return 'ERROR: The time is in the past. Please set a time in the future!';
+ }
+ if (($timeTimer - time()) < 60) {
+ # Log3 $name, 3, 'ERROR: The next switching point is too small!';
+ return 'ERROR: The next switching point is too small!';
+ }
}
- if ((time() - fhemTimeLocal($sec, $min, $hour, $mday, $month, $year)) > 0) { return 'ERROR: The time is in the past. Please set a time in the future!'; }
- if ((fhemTimeLocal($sec, $min, $hour, $mday, $month, $year) - time()) < 60) { return 'ERROR: The next switching point is too small!'; }
-
- my $oldValue = ReadingsVal($name,'Timer_'.sprintf("%02s", $selected_buttons[0]) ,0);
- my $newValue = substr($selected_buttons,(index($selected_buttons,',') + 1));
-
+ my $oldValue = ReadingsVal($name,'Timer_'.sprintf("%02s", $rowsField[0]) ,0);
my @Value_split = split(/,/xms , $oldValue);
$oldValue = $Value_split[7];
- @Value_split = split(/,/xms , $newValue);
- $newValue = $Value_split[7];
+ @Value_split = split(/,/xms , $readingStr);
+ my $newValue = $Value_split[7];
if ($Value_split[6] eq '' && $Value_split[7] eq 'DEF') { # standard name, if no name set in DEF option
- my $replace = 'Timer_'.sprintf("%02s", $selected_buttons[0]);
- $selected_buttons =~ s/,,/,$replace,/gxms;
+ my $replace = 'Timer_'.sprintf("%02s", $rowsField[0]);
+ $readingStr =~ s/,,/,$replace,/gxms;
}
-
+
readingsBeginUpdate($hash);
- readingsBulkUpdate($hash, 'Timer_'.sprintf("%02s", $selected_buttons[0]) , substr($selected_buttons,(index($selected_buttons,',') + 1)));
+ readingsBulkUpdate($hash, 'Timer_'.sprintf("%02s", $rowsField[0]) , $readingStr);
- my $state = 'Timer_'.sprintf("%02s", $selected_buttons[0]).' saved';
- my $userattrName = 'Timer_'.sprintf("%02s", $selected_buttons[0]).'_set:textField-long';
+ my $state = 'Timer_'.sprintf("%02s", $rowsField[0]).' saved';
+ my $userattrName = 'Timer_'.sprintf("%02s", $rowsField[0]).'_set:textField-long';
my $popup = 0;
if (($oldValue eq 'on' || $oldValue eq 'off') && $newValue eq 'DEF') {
- $state = 'Timer_'.sprintf("%02s", $selected_buttons[0]).' is saved and revised userattr. Please set DEF in attribute Timer_'.sprintf("%02s", $selected_buttons[0]).'_set !';
+ $state = 'Timer_'.sprintf("%02s", $rowsField[0]).' is saved and revised userattr. Please set DEF in attribute Timer_'.sprintf("%02s", $rowsField[0]).'_set !';
addToDevAttrList($name,$userattrName);
addStructChange('modify', $name, "attr $name userattr"); # note with question mark
$popup++;
}
if ($oldValue eq 'DEF' && ($newValue eq 'on' || $newValue eq 'off')) {
- $state = 'Timer_'.sprintf("%02s", $selected_buttons[0]).' is saved and deleted from userattr';
+ $state = 'Timer_'.sprintf("%02s", $rowsField[0]).' is saved and deleted from userattr';
if (AttrVal($name, 'userattr', undef)) { Timer_delFromUserattr($hash,$userattrName); }
addStructChange('modify', $name, "attr $name userattr"); # note with question mark
$hash->{helper}->{changes}++;
@@ -896,7 +992,7 @@ sub FW_pushed_savebutton {
## popup user message DEF (jump to javascript) ##
if ($popup != 0) {
Log3 $name, 4, "$name: FW_pushed_savebutton | popup user info for DEF";
- FW_directNotify("FILTER=(room=$room|$name)", "#FHEMWEB:WEB", "show_popup(".$selected_buttons[0].")", '');
+ FW_directNotify("FILTER=(room=$room|$name)", "#FHEMWEB:WEB", "show_popup(".$rowsField[0].")", '');
$hash->{helper}->{refresh_locked}++; # reset, refresh closed popup -> need to right running
}
}
@@ -909,7 +1005,7 @@ sub FW_pushed_savebutton {
FW_directNotify("FILTER=(room=$room)", "#FHEMWEB:WEB", "location.reload('true')", '');
}
- if ($selected_buttons[16] eq '1' && ReadingsVal($name, 'internalTimer', 'stop') eq 'stop') { Timer_Check($hash); }
+ if ($rowsField[16] eq '1' && ReadingsVal($name, 'internalTimer', 'stop') eq 'stop') { Timer_Check($hash); }
return;
}
@@ -921,7 +1017,7 @@ sub Timer_Popup {
$selected_button = sprintf("%02s", $selected_button);
my $ret = '';
- Log3 $name, 5, "$name: Timer_Popup is running";
+ Log3 $name, 5, "$name: Popup is running";
if ($language eq 'DE') {
$ret.= "
Hinweis:
";
@@ -957,7 +1053,7 @@ sub Timer_delFromUserattr {
if (AttrVal($name, 'userattr', undef) =~ /$deleteTimer/xms) {
delFromDevAttrList($name, $deleteTimer);
- Log3 $name, 5, "$name: delete $deleteTimer from userattr Attributes";
+ Log3 $name, 5, "$name: delFromUserattr | delete $deleteTimer from userattr Attributes";
}
return;
@@ -976,46 +1072,69 @@ sub Timer_Check {
my $cnt_activ = 0; # counter for activ timers
my ($seconds, $microseconds) = gettimeofday();
my $horizon = AttrVal($name,'Offset_Horizon','REAL');
- my @sunriseValues = split(':' , sunrise_abs($horizon)); # Sonnenaufgang (06:34:24) splitted in array
- my @sunsetValues = split(':' , sunset_abs($horizon)); # Sonnenuntergang (19:34:24) splitted in array
+ my $sunrise = sunrise_abs($horizon); # Sonnenaufgang 06:34:24
+ my $sunset = sunset_abs($horizon); # Sonnenuntergang 19:34:24
+ my @sunriseValues = split(':' , $sunrise); # Sonnenaufgang splitted in array
+ my @sunsetValues = split(':' , $sunset); # Sonnenuntergang splitted in array
my $state;
- Log3 $name, 5, "$name: Check is running, Sonnenaufgang $sunriseValues[0]:$sunriseValues[1]:$sunriseValues[2], Sonnenuntergang $sunsetValues[0]:$sunsetValues[1]:$sunsetValues[2]";
- Log3 $name, 4, "$name: Check is running, drift $microseconds microSeconds";
+ Log3 $name, 5, "$name: Check | Sonnenaufgang $sunriseValues[0]:$sunriseValues[1]:$sunriseValues[2], Sonnenuntergang $sunsetValues[0]:$sunsetValues[1]:$sunsetValues[2]";
+ Log3 $name, 4, "$name: Check | drift $microseconds microSeconds";
- foreach my $d (keys %{$hash->{READINGS}}) {
+ foreach my $d (sort keys %{$hash->{READINGS}}) {
if ($d =~ /^Timer_\d+$/xms) {
my @values = split(',' , $hash->{READINGS}->{$d}->{VAL});
- #Jahr Monat Tag Stunde Minute Sekunde Gerät Aktion Mo Di Mi Do Fr Sa So aktiv
- #alle, alle, alle, alle, alle, 00, BlueRay_Player_LG, on, 0, 0, 0, 0, 0, 0, 0, 0
- #0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ #Jahr Monat Tag Stunde Minute Sekunde Gerät Aktion Mo Di Mi Do Fr Sa So aktiv Offset
+ #alle, alle, alle, alle, alle, 00, BlueRay_Player_LG, on, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ #0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+
my $set = 1;
- if ($values[15] == 1) { # Timer aktiv
+
+ if ($values[15] == 1) { # input checkbox "aktiv"
$cnt_activ++;
- if ($values[3] eq $designations[4]) { $values[3] = $sunriseValues[0]; } # Stunde | Sonnenaufgang -> pos 4 array
- if ($values[4] eq $designations[4]) { $values[4] = $sunriseValues[1]; } # Minute | Sonnenaufgang -> pos 4 array
- if ($values[3] eq $designations[5]) { $values[3] = $sunsetValues[0]; } # Stunde | Sonnenuntergang -> pos 5 array
- if ($values[4] eq $designations[5]) { $values[4] = $sunsetValues[1]; } # Stunde | Sonnenuntergang -> pos 5 array
+ if ($values[16] && $values[16] != 0) { # input number "Offset"
+ # Log3 $name, 3, "$name: $d must calculated, hh:$values[3] mm:$values[4] | offset: $values[16]";
+ my $sunriseSeconds = $sunriseValues[0] * 3600 + $sunriseValues[1] * 60 + $sunriseValues[2] + $values[16] * 60;
+ while($sunriseSeconds > 86400) {$sunriseSeconds -= 86400;}
+ while($sunriseSeconds < 0) {$sunriseSeconds += 86400;}
+ $sunriseValues[0] = sprintf("%02d", $sunriseSeconds / 3600); # Stunde
+ $sunriseValues[1] = sprintf("%02d", $sunriseSeconds % 3600 / 60); # Minute
+ # $sunriseValues[2] = sprintf("%02d", $sunriseSeconds % 60); # Sekunde
+ Log3 $name, 4, "$name: $d New switch time with offset, Sonnenaufgang $sunriseValues[0]:$sunriseValues[1]:$sunriseValues[2], Offset $values[16] Minuten";
+ my $sunsetSeconds = $sunsetValues[0] * 3600 + $sunsetValues[1] * 60 + $sunsetValues[2] + $values[16] * 60;
+ while($sunsetSeconds > 86400) {$sunsetSeconds -= 86400;}
+ while($sunsetSeconds < 0) {$sunsetSeconds += 86400;}
+ $sunsetValues[0] = sprintf("%02d", $sunsetSeconds / 3600); # Stunde
+ $sunsetValues[1] = sprintf("%02d", $sunsetSeconds % 3600 / 60); # Minute
+ # $sunsetValues[2] = sprintf("%02d", $sunsetSeconds % 60); # Sekunde
+ Log3 $name, 4, "$name: $d New switch time with offset, Sonnenuntergang $sunsetValues[0]:$sunsetValues[1]:$sunsetValues[2], Offset $values[16] Minuten";
+ }
+ if ($values[3] eq $designations[4]) { $values[3] = $sunriseValues[0]; } # Stunde | Sonnenaufgang -> pos 0 array
+ if ($values[4] eq $designations[4]) { $values[4] = $sunriseValues[1]; } # Minute | Sonnenaufgang -> pos 1 array
+ if ($values[3] eq $designations[5]) { $values[3] = $sunsetValues[0]; } # Stunde | Sonnenuntergang -> pos 0 array
+ if ($values[4] eq $designations[5]) { $values[4] = $sunsetValues[1]; } # Minute | Sonnenuntergang -> pos 1 array
+ Log3 $name, 4, "$name: $d - set $values[6] $values[7] ($dayOfWeek, $values[0]-$values[1]-$values[2] $values[3]:$values[4]:$values[5])";
+ @sunriseValues = split(':' , $sunrise); # reset Sonnenaufgang (06:34:24) splitted in array
+ @sunsetValues = split(':' , $sunset); # reset Sonnenuntergang (19:34:24) splitted in array
for (my $i = 0;$i < 5;$i++) { # Jahr, Monat, Tag, Stunde, Minute
if ($values[$i] ne $description_all && $values[$i] ne $timestamp_values[$i]) { $set = 0; }
}
-
if ($values[(($dayOfWeek*1) + 7)] eq '0') { $set = 0; } # Wochentag
if ($values[5] eq '00' && $timestamp_values[5] ne '00') { $set = 0; } # Sekunde (Intervall 60)
if ($values[5] ne '00' && $timestamp_values[5] ne $values[5]) { $set = 0; } # Sekunde (Intervall 10)
if ($values[5] ne '00') { $intervall = 10; }
- Log3 $name, 5, "$name: $d - set=$set intervall=$intervall dayOfWeek=$dayOfWeek column array=".(($dayOfWeek*1) + 7).' ('.$values[($dayOfWeek*1) + 7].") $values[0]-$values[1]-$values[2] $values[3]:$values[4]:$values[5]";
+ Log3 $name, 5, "$name: Check | $d - set=$set intervall=$intervall dayOfWeek=$dayOfWeek column array=".(($dayOfWeek*1) + 7).' ('.$values[($dayOfWeek*1) + 7].") $values[0]-$values[1]-$values[2] $values[3]:$values[4]:$values[5]";
if ($set == 1) {
- Log3 $name, 4, "$name: $d - set $values[6] $values[7] ($dayOfWeek, $values[0]-$values[1]-$values[2] $values[3]:$values[4]:$values[5])";
+ Log3 $name, 4, "$name: Check | $d - set $values[6] $values[7] ($dayOfWeek, $values[0]-$values[1]-$values[2] $values[3]:$values[4]:$values[5])";
if ($values[7] ne 'DEF') { CommandSet($hash, $values[6].' '.$values[7]); }
# $state = "$d set $values[6] $values[7] accomplished";
readingsSingleUpdate($hash, 'state' , "$d set $values[6] $values[7] accomplished", 1);
if ($values[7] eq 'DEF') {
if (AttrVal($name, $d.'_set', undef)) {
- Log3 $name, 5, "$name: $d - exec at command: ".AttrVal($name, $d.'_set', undef);
+ Log3 $name, 5, "$name: Check | $d - exec at command: ".AttrVal($name, $d.'_set', undef);
my $ret = AnalyzeCommandChain(undef, SemicolonEscape(AttrVal($name, $d.'_set', undef)));
if ($ret) { Log3 $name, 3, "$name: $d\_set - ERROR: $ret"; }
} else {
@@ -1072,10 +1191,10 @@ sub Timer_PawList {
} elsif ($values[7] eq 'DEF') {
my $Timer_set_attr = AttrVal($name, $d.'_set', '');
if ($Timer_set_attr ne '') {
- Log3 $name, 5, "$name: Timer_PawList | look at DEF: ".$Timer_set_attr;
+ Log3 $name, 5, "$name: PawList | look at DEF: ".$Timer_set_attr;
$Timer_set_attr =~ /(get|set)\s(\w+)\s/xms;
if ($2) {
- Log3 $name, 5, "$name: Timer_PawList | found in DEF: ".$2;
+ Log3 $name, 5, "$name: PawList | found in DEF: ".$2;
if (not grep { /$2/xms } $associatedWith) {
$associatedWith = $associatedWith eq '' ? $2 : $associatedWith.','.$2;
}
@@ -1086,7 +1205,7 @@ sub Timer_PawList {
}
}
- Log3 $name, 5, "$name: Timer_PawList | Reading .associatedWith is: ".$associatedWith;
+ Log3 $name, 5, "$name: PawList | Reading .associatedWith is: ".$associatedWith;
if ($associatedWith ne '') {
CommandSetReading(undef, "$name .associatedWith $associatedWith");
} else {
@@ -1232,6 +1351,7 @@ This makes it possible, for example, to have a timer run every Sunday at 15:30:0
Hints:
Entries in the system logfile like: 2019.09.20 22:15:01 3: Timer: time difference too large! interval=59, Sekunde=01 say that the timer has recalculated the time.
+
The offset function can only be activated at sunrise (SR) and sunset (SS).
=end html
@@ -1359,7 +1479,7 @@ Damit ist es möglich, einen Timer beispielsweise nur jeden Sonntag um 15:30
Hinweise:
Einträge im Systemlogfile wie: 2019.09.20 22:15:01 3: Timer: time difference too large! interval=59, Sekunde=01 sagen aus, das der Timer die Zeit neu berechnet hat.
-
+
Die Funktion Offset ist nur bei Sonnenaufgang (SA) und Sonnenuntergang (SU) aktivierbar.