diff --git a/fhem/FHEM/99_SUNRISE_EL.pm b/fhem/FHEM/99_SUNRISE_EL.pm index 906826da7..144b357b0 100755 --- a/fhem/FHEM/99_SUNRISE_EL.pm +++ b/fhem/FHEM/99_SUNRISE_EL.pm @@ -48,12 +48,13 @@ sub sr($$$$$$) { my ($rise, $seconds, $isrel, $daycheck, $min, $max) = @_; - sr_alt($rise, $isrel, $daycheck, $defaultaltit, $seconds, $min, $max); + sr_alt(time(), $rise, $isrel, $daycheck, $defaultaltit, $seconds, $min, $max); } sub -sr_alt($$$$$$$) +sr_alt($$$$$$$$) { + my $nt=shift; my $rise=shift; my $isrel=shift; my $daycheck=shift; @@ -81,7 +82,7 @@ sr_alt($$$$$$$) Log3 undef, 5, "Compute sunrise/sunset for latitude $lat , longitude $long"; - my $nt = time; + #my $nt = time; my @lt = localtime($nt); my $gmtoff = _calctz($nt,@lt); # in hour @@ -358,16 +359,19 @@ h2hms_fmt($) return sprintf("%02d:%02d:%02d", $h, $m, $s); } - -sub sunrise_rel(@) { return sr_alt(1, 1, 0, shift, shift, shift, shift) } -sub sunset_rel(@) { return sr_alt(0, 1, 0, shift, shift, shift, shift) } -sub sunrise_abs(@) { return sr_alt(1, 0, 0, shift, shift, shift, shift) } -sub sunset_abs(@) { return sr_alt(0, 0, 0, shift, shift, shift, shift) } -sub sunrise(@) { return sr_alt(1, 2, 0, shift, shift, shift, shift) } -sub sunset(@) { return sr_alt(0, 2, 0, shift, shift, shift, shift) } -sub isday(@) { return sr_alt(1, 0, 1, shift, 0, undef, undef) } sub sunrise_coord($$$) { ($long, $lat, $tz) = @_; return undef; } +sub sunrise_rel (@) { return sr_alt(time(), 1, 1, 0, shift, shift, shift, shift) } +sub sunset_rel (@) { return sr_alt(time(), 0, 1, 0, shift, shift, shift, shift) } +sub sunrise_abs (@) { return sr_alt(time(), 1, 0, 0, shift, shift, shift, shift) } +sub sunset_abs (@) { return sr_alt(time(), 0, 0, 0, shift, shift, shift, shift) } +sub sunrise (@) { return sr_alt(time(), 1, 2, 0, shift, shift, shift, shift) } +sub sunset (@) { return sr_alt(time(), 0, 2, 0, shift, shift, shift, shift) } +sub isday (@) { return sr_alt(time(), 1, 0, 1, shift, 0, undef, undef) } + +sub sunrise_abs_dat(@) { return sr_alt(shift, 1, 0, 0, shift, shift, shift, shift) } +sub sunset_abs_dat (@) { return sr_alt(shift, 0, 0, 0, shift, shift, shift, shift) } + 1; =pod @@ -401,6 +405,9 @@ isday sunrise/sunset.
sunrise_abs()/sunset_abs() return the absolute time of the corresponding event today (no 24 hours added).
+ sunrise_abs_dat()/sunset_abs_dat() return the absolute time of the corresponding + event to a given date(no 24 hours added).
+ All functions take up to three arguments: