diff --git a/FHEM/99_SUNRISE_EL.pm b/FHEM/99_SUNRISE_EL.pm index 6d394b2d9..fa5b5bb94 100755 --- a/FHEM/99_SUNRISE_EL.pm +++ b/FHEM/99_SUNRISE_EL.pm @@ -20,8 +20,8 @@ sub sunrise_coord($$$); sub SUNRISE_Initialize($); # See perldoc DateTime::Event::Sunrise for details -my $long = "8.686"; -my $lat = "50.112"; +my $long; +my $lat; my $tz = ""; # will be overwritten my $altit = "-6"; # Civil twilight my $RADEG = ( 180 / 3.1415926 ); @@ -50,6 +50,15 @@ sr($$$$$$) my $needset = (!$rise || $daycheck) ? 1 : 0; $seconds = 0 if(!$seconds); + ############################ + # If set in global, use longitude/latitude + # from global, otherwise set Frankfurt/Germany as + # default + $long = AttrVal("global", "longitude", "8.686"); + $lat = AttrVal("global", "latitude", "50.112"); + Log 5, "Compute sunrise/sunset for latitude $lat , longitude $long"; + + my $nt = time; my @lt = localtime($nt); my $gmtoff = _calctz($nt,@lt); # in hour diff --git a/docs/commandref.html b/docs/commandref.html index f058bbf95..d3d63d477 100644 --- a/docs/commandref.html +++ b/docs/commandref.html @@ -924,6 +924,13 @@ A line ending with \ will be concatenated with the next one, so long lines This attribute is DEPRECATED, use notify, with the INITIALIZED event to execute commands after initialization.
+ + +
  • latitude
    + If set, this latitude is used to calculate sunset/sunrise
    + Notation need to be in decimal format (for example Berlin = 52.666) + As default Frankfurt/Main, Germany (50.112) is used. +

  • logfile
    @@ -933,6 +940,13 @@ A line ending with \ will be concatenated with the next one, so long lines see the FileLog section.

  • +
  • modpath
    Specify the path to the modules directory FHEM. The path @@ -3031,6 +3045,25 @@ A line ending with \ will be concatenated with the next one, so long lines Set
    @@ -3118,11 +3154,28 @@ A line ending with \ will be concatenated with the next one, so long lines +
  • MD15-FtL-HE (Heating/Valve-regulator)
    + subType must be MD15. This is done if the device was created by + autocreate.
    + + diff --git a/docs/faq.html b/docs/faq.html index dc6b1ca53..e9708a75e 100644 --- a/docs/faq.html +++ b/docs/faq.html @@ -327,8 +327,8 @@ by fhem.pl?