From 8ee757a01cfcd82b1d2fece072aa0d4ab9ec6e06 Mon Sep 17 00:00:00 2001 From: dietmar63 Date: Sun, 14 Aug 2016 19:44:24 +0000 Subject: [PATCH] 98_Twilight: patch to alow negativ weather horizons from joe99 added git-svn-id: https://svn.fhem.de/fhem/trunk@11964 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/59_Twilight.pm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/59_Twilight.pm b/fhem/FHEM/59_Twilight.pm index 1d7707c5f..e4ee67f90 100644 --- a/fhem/FHEM/59_Twilight.pm +++ b/fhem/FHEM/59_Twilight.pm @@ -108,7 +108,8 @@ sub Twilight_Define($$) if(int(@a)>4) { if ($a[4] =~ /^[\+-]*[0-9]*\.*[0-9]*$/ && $a[4] !~ /^[\. ]*$/ ) { $indoor_horizon = $a[4]; if($indoor_horizon > 20) { $indoor_horizon=20;} - if($indoor_horizon < 0) { $indoor_horizon= 0;} + # minimal indoor_horizon makes values like civil_sunset and civil_sunrise + if($indoor_horizon < -6) { $indoor_horizon= -6;} }else{ return "Argument Indoor_Horizon is not a valid number";} } @@ -752,7 +753,8 @@ sub twilight($$$$) {

indoor_horizon
- The parameter indoor_horizon gives a virtual horizon higher than 0, that shall be used for calculation of indoor twilight (typical values are between 0 and 6) + The parameter indoor_horizon gives a virtual horizon, that shall be used for calculation of indoor twilight. Minimal value -6 means indoor values are the same like civil values. + indoor_horizon 0 means indoor values are the same as real values. indoor_horizon > 0 means earlier indoor sunset resp. later indoor sunrise.

Weather_Position
@@ -861,6 +863,11 @@ sub twilight($$$$) {
+Example: +
+    define BlindDown at *{twilight("myTwilight","sr_indoor","7:30","9:00")} set xxxx position 100
+    # xxxx is a defined blind
+
@@ -886,7 +893,8 @@ sub twilight($$$$) {

indoor_horizon
- Der Parameter indoor_horizon bestimmt einen virtuellen Horizont größer 0, der für die Berechnung der Dämmerung innerhalb von Rämen genutzt werden kann (Typische Werte sind zwischen 0 und 6). + Der Parameter indoor_horizon bestimmt einen virtuellen Horizont, der für die Berechnung der Dämmerung innerhalb von Rämen genutzt werden kann. Minimalwert ist -6 (ergibt gleichen Wert wie Zivile Dämmerung). Bei 0 fallen + indoor- und realer Dämmerungswert zusammen. Werte grösser 0 ergeben frühere Werte für den Abend bzw. spätere für den Morgen.

Weather_Position
@@ -992,6 +1000,11 @@ Wissenswert dazu ist, dass die Sonne, abhägnig vom Breitengrad, bestimmte E
+Anwendungsbeispiel: +
+    define BlindDown at *{twilight("myTwilight","sr_indoor","7:30","9:00")} set xxxx position 100
+    # xxxx ist ein definiertes Rollo
+