FHEM Forum

FHEM => Codeschnipsel => Thema gestartet von: Loredo am 07 November 2015, 17:46:24

Titel: DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Loredo am 07 November 2015, 17:46:24
Die Weihnachtszeit ist ja gerade großes Thema wie es scheint. Ich hatte mir dazu auch Gedanken gemacht und wollte das etwas allumfänglicher über ein DOIF für alle möglichen Zeiten im Jahr definieren.

Ziel sollte es sein damit z.B. Beleuchtungen unterschiedlich zu steuern (z.B. Farben je nach "sozialer Jahreszeit", also ähnlich wie wenn man regelmäßig den Tischschmuck abändert). Aber auch eine simple Anzeige bei mir in der Umweltkontrolle finde ich recht schön  (zusammen mit der eigentlichen Jahreszeit (http://forum.fhem.de/index.php/topic,42180.0.html) und der Sommer-/Normalzeit (http://forum.fhem.de/index.php/topic,42181.0.html)).

Dieses DOIF konnte ich noch nicht vollständig auf Herz und Nieren testen, da man mehr oder weniger bis zum entsprechenden Tag warten müsste (oder die Definitionen abändern muss, damit sie eben heute schon zutreffen oder sie erst in Debug-Perl-Funktionen einbauen muss, um sie einmalig zu testen).

Folgende Events/Zeitspannen sollen hier abgedeckt werden:

define SocialSeason DOIF

## Carnival: Carnival Mon/Tue and Valentine's Day at the same day
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;
  my $carnivalTue = $carnivalMon + 86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);

  [00:00] and
  $mon eq 1 and
  $mday eq 14 and
  ($mday eq $mdayB or $mday eq $mdayE)
)

## Valentine's Day
(
  [00:00] and
  $mon eq 1 and
  $mday eq 14
)

## Carnival: Mon+Tue
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;
  my $carnivalTue = $carnivalMon + 86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);


  [00:00] and
  ($mday eq $mdayB or $mday eq $mdayE)
)

## Carnival: Thursday before Ash Wednesday until day before Ash Wednesday w/o Valentine's Day
DOELSEIF
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $carnivalEnd = str2time("$year-$monEaster-$mdayEaster") - 46*86400;
  my $carnivalStart = $carnivalEnd - 5*86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalStart);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalEnd);

  [00:00] and
  ($mon eq $monB and $mday ge $mdayB) or
  ($mon eq $monE and $mday le $mdayE)
)

## Fasting/Strong-Beer Time: Ash Wednesday until Good Friday
DOELSEIF
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $fastEnd = str2time("$year-$monEaster-$mdayEaster") - 2*86400;
  my $fastStart = $fastEnd - 43*86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($fastStart);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($fastEnd);

  [00:00] and
  ($mon eq $monB and $mday ge $mdayB) and
  ($mon eq $monE and $mday le $mdayE)
)

## Easter Time: Starts Easter Saturday, ends Apr 29th
DOELSEIF
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monB, $mdayB) = western_easter($year);
  my $easterTimeBegin = $mdayB - 1;

  [00:00] and
  ($mon eq $monB and $mday ge $easterTimeBegin) or
  ($mon eq 3 and $mday ge 25 and $mday le 29)
)

## May Festival: Apr 30th and May 1st
DOELSEIF
(
  [00:00] and
  ($mon eq 3 and $mday eq 30) or
  ($mon eq 4 and $mday eq 1)
)

## Pentecost: Saturday til Monday
DOELSEIF
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $pentecostSat = str2time("$year-$monEaster-$mdayEaster") + 48*86400;
  my $pentecostMon = $pentecostSat + 2*86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($pentecostSat);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($pentecostMon);

  [00:00] and
  ($mon eq $monB and $mday ge $mdayB) and
  ($mon eq $monE and $mday le $mdayE)
)

## Oktoberfest: Saturday after Sept 15th for 3 weeks
DOELSEIF
(
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my $midSept = str2time("$year-09-15");
  my ( $secS, $minS, $hourS, $mdayS, $monS, $yearS, $wdayS, $ydayS, $isdstS ) = localtime($midSept);
  if ($wdayS eq 6) {
    $wdayS = 7;
  } elsif ($wdayS eq 0) {
    $wdayS = 6;
  } elsif ($wdayS eq 1) {
    $wdayS = 5;
  } elsif ($wdayS eq 2) {
    $wdayS = 4;
  } elsif ($wdayS eq 3) {
    $wdayS = 3;
  } elsif ($wdayS eq 4) {
    $wdayS = 2;
  } elsif ($wdayS eq 5) {
    $wdayS = 1;
  }
  my $wiesnBegin = $midSept + $wdayS*86400;
  my $wiesnEnd = $wiesnBegin + 21*86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($wiesnBegin);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($wiesnEnd);

  [00:00] and
  ($mon eq $monB and $mday ge $mdayB) and
  ($mon eq $monE and $mday le $mdayE)
)

## Harvest festival: 1st sunday in Oct
DOELSEIF
(
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  [00:00] and
  $mon eq 9 and
  $mday le 7 and
  $wday eq 0
)

## Halloween Week: Oct 24th until Otc 30th
DOELSEIF
(
  [00:00] and
  $mon eq 9 and
  $mday ge 24 and
  $mday le 30
)

## Halloween: Oct 31th and Nov 1st
DOELSEIF
(
  [00:00] and
  ($mon eq 9 and $mday eq 31) or
  ($mon eq 10 and $mday eq 1)
)

## St. Martin's Day: Nov 11th
DOELSEIF
(
  [00:00] and
  ($mon eq 10 and $mday eq 11)
)

## Christmas time: Starts 1st Advent, ends Dec 30th
DOELSEIF
(
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my $christmas = str2time("$year-12-25");
  my ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime($christmas);
  $wdayC = $wdayC ? $wdayC : 7;
  my $adventBegin = $christmas - ($wdayC+21)*86400;
  my ( $sec2, $min2, $hour2, $mday2, $mon2, $year2, $wday2, $yday2, $isdst2 ) = localtime($adventBegin);

  [00:00] and
  ($mon eq $mon2 and $mday ge $mday2) or
  ($mon eq 11 and $mday le 30)
)

## New Year: Dec 31st and Jan 1st
DOELSEIF
(
  [00:00] and
  ($mon eq 11 and $mday eq 31) or
  ($mon eq 0 and $mday eq 1)
)

DOELSE


Folgende Attribute wurden gesetzt:

attr SocialSeason alias Social Season
attr SocialSeason cmdState carnivalvalentine|valentine|carnival|carnivalweek|fasting|easter|may|pentecost|wiesn|harvest|halloweenweek|halloween|stmartin|christmas|newyear|none
attr SocialSeason event-on-change-reading state
attr SocialSeason eventMap valentine:Valentinstag carnivalvalentine:Karneval-und-Valentinstag carnivalweek:Faschingszeit carnival:Karneval fasting:Fastenzeit easter:Osterzeit may:Tanz-in-den-Mai pentecost:Pfingsten wiesn:Wiesn harves:Erntedankfest halloweenweek:Halloween-Woche halloween:Halloween stmartin:St.Martin christmas:Weihnachtszeit newyear:Jahreswechsel none:keine initialized:---
attr SocialSeason group Season Details
attr SocialSeason room Environment
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Rince am 07 November 2015, 18:21:58
Holla zack,
Da hat wer nicht gekleckert, sondern geklotzt.

Wenn mein fhem wieder am Leben ist, probiere ich das gerne aus :)
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: inesa394 am 21 November 2015, 12:47:21
Wollte das mal testen bekomme
diese Fehlermeldung
SocialSeason DOIF: no right bracket: (use 95_holiday
fehlt wohl irgendwo eine Klammer
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: kumue am 21 November 2015, 13:09:04
vermute, Du hast den ganzen Code in den DEF-Editor eingegeben...
Falls ja, dann bitte die erste Zeile im DEF-Editor löschen.

define SocialSeason DOIF
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: inesa394 am 22 November 2015, 21:11:42
Ja habe ich komplett so eingegeben...ich soll
also ab ( use 95_holiday;
aber da weiss ja fhem nicht das es sich um ein doif handelt???
oder habe ich das jetzt falsch verstanden
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Loredo am 22 November 2015, 21:49:46
Du legst erst ein leeres DOIF AN:


define SocialSeason DOIF ([d])




Danach editierst du das neue DOIF, löscht den Inhalt dort raus und kopierst den Inhalt von oben hinein. Dabei lässt du dann die erste Zeile weg.
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: inesa394 am 23 November 2015, 13:10:29
Ok danke werd das gleich heute abend testen
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: McCavity am 27 November 2015, 09:42:37
Moin,

erstmal vielen Dank für das DOIF - ich habe noch zwei Fragen dazu. Ich konnte es problemlos mit der hier empfohlenen Vorgehensweise einrichten ("leeres" DOIF anlegen und im Anschluß die DEF mit dem hier geposteten Inhalt ersetzen) - FHEM ist zufrieden. Fast. Denn wenn das DOIF ausgeführt wird (ein paar Sekunden nach Mitternacht), gibt es in meinem Logfile jede Menge Perl Warnungen:

2015.11.27 00:00:04 2: SocialSeason: perl error in condition:   DOIF_time_once($hash,$hash->{timer}{8},$wday,"") and  $mon eq 9 and  $mday ge 24 and  $mday le 30: Global symbol "$mon" requires explicit package name at (eval 25003) line 1.

2015.11.27 00:00:04 2: SocialSeason: perl error in condition:   DOIF_time_once($hash,$hash->{timer}{4},$wday,"") and  ($mon eq 3 and $mday eq 30) or  ($mon eq 4 and $mday eq 1): Global symbol "$mon" requires explicit package name at (eval 25006) line 1.
Global symbol "$mon" requires explicit package name at (eval 25006) line 1.

2015.11.27 00:00:04 1: PERL WARNING: Misplaced _ in number at (eval 25007) line 1.
2015.11.27 00:00:04 1: PERL WARNING: Bareword found where operator expected at (eval 25007) line 1, near "95_holiday"
2015.11.27 00:00:04 1: PERL WARNING: (Missing operator before holiday?)
2015.11.27 00:00:04 2: SocialSeason: perl error in condition:   use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monEaster, $mdayEaster) = western_easter($year);  my $fastEnd = str2time("$year-$monEaster-$mdayEaster") - 2*86400;  my $fastStart = $fastEnd - 43*86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($fastStart);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($fastEnd);  DOIF_time_once($hash,$hash->{timer}{2},$wday,"") and  ($mon eq $monB and $mday ge $mdayB) and  ($mon eq $monE and $mday le $mdayE): syntax error at (eval 25007) line 1, near "use 95_"

2015.11.27 00:00:04 2: SocialSeason: perl error in condition:   DOIF_time_once($hash,$hash->{timer}{12},$wday,"") and  ($mon eq 11 and $mday eq 31) or  ($mon eq 0 and $mday eq 1): Global symbol "$mon" requires explicit package name at (eval 25008) line 1.
Global symbol "$mon" requires explicit package name at (eval 25008) line 1.

2015.11.27 00:00:04 2: SocialSeason: perl error in condition:   DOIF_time_once($hash,$hash->{timer}{9},$wday,"") and  ($mon eq 9 and $mday eq 31) or  ($mon eq 10 and $mday eq 1): Global symbol "$mon" requires explicit package name at (eval 25009) line 1.
Global symbol "$mon" requires explicit package name at (eval 25009) line 1.

2015.11.27 00:00:04 2: SocialSeason: perl error in condition:   DOIF_time_once($hash,$hash->{timer}{10},$wday,"") and  ($mon eq 10 and $mday eq 11): Global symbol "$mon" requires explicit package name at (eval 25010) line 1.

2015.11.27 00:00:04 1: PERL WARNING: Misplaced _ in number at (eval 25011) line 1.
2015.11.27 00:00:04 1: PERL WARNING: Bareword found where operator expected at (eval 25011) line 1, near "95_holiday"
2015.11.27 00:00:04 2: SocialSeason: perl error in condition:   use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monEaster, $mdayEaster) = western_easter($year);  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;  my $carnivalTue = $carnivalMon + 86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);  DOIF_time_once($hash,$hash->{timer}{0},$wday,"") and  $mon eq 1 and  $mday eq 14 and  ($mday eq $mdayB or $mday eq $mdayE): syntax error at (eval 25011) line 1, near "use 95_"

2015.11.27 00:00:04 2: SocialSeason: perl error in condition:   my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my $christmas = str2time("$year-12-25");  my ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime($christmas);  $wdayC = $wdayC ? $wdayC : 7;  my $adventBegin = $christmas - ($wdayC+21)*86400;  my ( $sec2, $min2, $hour2, $mday2, $mon2, $year2, $wday2, $yday2, $isdst2 ) = localtime($adventBegin);  DOIF_time_once($hash,$hash->{timer}{11},$wday,"") and  ($mon eq $mon2 and $mday ge $mday2) or  ($mon eq 11 and $mday le 30): Undefined subroutine &main::str2time called at (eval 25012) line 1.

2015.11.27 00:00:04 1: PERL WARNING: Misplaced _ in number at (eval 25014) line 1.
2015.11.27 00:00:04 1: PERL WARNING: Bareword found where operator expected at (eval 25014) line 1, near "95_holiday"
2015.11.27 00:00:04 2: SocialSeason: perl error in condition:   use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monEaster, $mdayEaster) = western_easter($year);  my $carnivalEnd = str2time("$year-$monEaster-$mdayEaster") - 46*86400;  my $carnivalStart = $carnivalEnd - 5*86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalStart);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalEnd);  DOIF_time_once($hash,$hash->{timer}{1},$wday,"") and  ($mon eq $monB and $mday ge $mdayB) or  ($mon eq $monE and $mday le $mdayE): syntax error at (eval 25014) line 1, near "use 95_"

2015.11.27 00:00:04 1: PERL WARNING: Misplaced _ in number at (eval 25015) line 1.
2015.11.27 00:00:04 1: PERL WARNING: Bareword found where operator expected at (eval 25015) line 1, near "95_holiday"
2015.11.27 00:00:04 2: SocialSeason: perl error in condition:   use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monEaster, $mdayEaster) = western_easter($year);  my $pentecostSat = str2time("$year-$monEaster-$mdayEaster") + 48*86400;  my $pentecostMon = $pentecostSat + 2*86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($pentecostSat);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($pentecostMon);  DOIF_time_once($hash,$hash->{timer}{5},$wday,"") and  ($mon eq $monB and $mday ge $mdayB) and  ($mon eq $monE and $mday le $mdayE): syntax error at (eval 25015) line 1, near "use 95_"

2015.11.27 00:00:05 1: PERL WARNING: Misplaced _ in number at (eval 25017) line 1.
2015.11.27 00:00:05 1: PERL WARNING: Bareword found where operator expected at (eval 25017) line 1, near "95_holiday"
2015.11.27 00:00:05 2: SocialSeason: perl error in condition:   use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monB, $mdayB) = western_easter($year);  my $easterTimeBegin = $mdayB - 1;  DOIF_time_once($hash,$hash->{timer}{3},$wday,"") and  ($mon eq $monB and $mday ge $easterTimeBegin) or  ($mon eq 3 and $mday ge 25 and $mday le 29): syntax error at (eval 25017) line 1, near "use 95_"

2015.11.27 00:00:05 2: SocialSeason: perl error in condition:   my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my $midSept = str2time("$year-09-15");  my ( $secS, $minS, $hourS, $mdayS, $monS, $yearS, $wdayS, $ydayS, $isdstS ) = localtime($midSept);  if ($wdayS eq 6) {    $wdayS = 7;  } elsif ($wdayS eq 0) {    $wdayS = 6;  } elsif ($wdayS eq 1) {    $wdayS = 5;  } elsif ($wdayS eq 2) {    $wdayS = 4;  } elsif ($wdayS eq 3) {    $wdayS = 3;  } elsif ($wdayS eq 4) {    $wdayS = 2;  } elsif ($wdayS eq 5) {    $wdayS = 1;  }  my $wiesnBegin = $midSept + $wdayS*86400;  my $wiesnEnd = $wiesnBegin + 21*86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($wiesnBegin);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($wiesnEnd);  DOIF_time_once($hash,$hash->{timer}{6},$wday,"") and  ($mon eq $monB and $mday ge $mdayB) and  ($mon eq $monE and $mday le $mdayE): Undefined subroutine &main::str2time called at (eval 25019) line 1.


Es sieht so aus, als störe ihn überwiegend das "use 95_holiday" - kann es sein, daß da trotz Einfügen in das "DEF" Feld etwas mit der Enkapsulierung der Sonderzeichen nicht stimmt? Der letzte dieser Fehler findet sich dann auch im Reading "error" des Devices:

Internals:
   DEF        ## Carnival: Carnival Mon/Tue and Valentine's Day at the same day
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;
  my $carnivalTue = $carnivalMon + 86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);

  [00:00] and
  $mon eq 1 and
  $mday eq 14 and
  ($mday eq $mdayB or $mday eq $mdayE)
)

## Valentine's Day
(
  [00:00] and
  $mon eq 1 and
  $mday eq 14
)

## Carnival: Mon+Tue
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;
  my $carnivalTue = $carnivalMon + 86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);


  [00:00] and
  ($mday eq $mdayB or $mday eq $mdayE)
)

## Carnival: Thursday before Ash Wednesday until day before Ash Wednesday w/o Valentine's Day
DOELSEIF
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $carnivalEnd = str2time("$year-$monEaster-$mdayEaster") - 46*86400;
  my $carnivalStart = $carnivalEnd - 5*86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalStart);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalEnd);

  [00:00] and
  ($mon eq $monB and $mday ge $mdayB) or
  ($mon eq $monE and $mday le $mdayE)
)

## Fasting/Strong-Beer Time: Ash Wednesday until Good Friday
DOELSEIF
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $fastEnd = str2time("$year-$monEaster-$mdayEaster") - 2*86400;
  my $fastStart = $fastEnd - 43*86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($fastStart);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($fastEnd);

  [00:00] and
  ($mon eq $monB and $mday ge $mdayB) and
  ($mon eq $monE and $mday le $mdayE)
)

## Easter Time: Starts Easter Saturday, ends Apr 29th
DOELSEIF
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monB, $mdayB) = western_easter($year);
  my $easterTimeBegin = $mdayB - 1;

  [00:00] and
  ($mon eq $monB and $mday ge $easterTimeBegin) or
  ($mon eq 3 and $mday ge 25 and $mday le 29)
)

## May Festival: Apr 30th and May 1st
DOELSEIF
(
  [00:00] and
  ($mon eq 3 and $mday eq 30) or
  ($mon eq 4 and $mday eq 1)
)

## Pentecost: Saturday til Monday
DOELSEIF
(
  use 95_holiday;
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $pentecostSat = str2time("$year-$monEaster-$mdayEaster") + 48*86400;
  my $pentecostMon = $pentecostSat + 2*86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($pentecostSat);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($pentecostMon);

  [00:00] and
  ($mon eq $monB and $mday ge $mdayB) and
  ($mon eq $monE and $mday le $mdayE)
)

## Oktoberfest: Saturday after Sept 15th for 3 weeks
DOELSEIF
(
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my $midSept = str2time("$year-09-15");
  my ( $secS, $minS, $hourS, $mdayS, $monS, $yearS, $wdayS, $ydayS, $isdstS ) = localtime($midSept);
  if ($wdayS eq 6) {
    $wdayS = 7;
  } elsif ($wdayS eq 0) {
    $wdayS = 6;
  } elsif ($wdayS eq 1) {
    $wdayS = 5;
  } elsif ($wdayS eq 2) {
    $wdayS = 4;
  } elsif ($wdayS eq 3) {
    $wdayS = 3;
  } elsif ($wdayS eq 4) {
    $wdayS = 2;
  } elsif ($wdayS eq 5) {
    $wdayS = 1;
  }
  my $wiesnBegin = $midSept + $wdayS*86400;
  my $wiesnEnd = $wiesnBegin + 21*86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($wiesnBegin);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($wiesnEnd);

  [00:00] and
  ($mon eq $monB and $mday ge $mdayB) and
  ($mon eq $monE and $mday le $mdayE)
)

## Harvest festival: 1st sunday in Oct
DOELSEIF
(
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  [00:00] and
  $mon eq 9 and
  $mday le 7 and
  $wday eq 0
)

## Halloween Week: Oct 24th until Otc 30th
DOELSEIF
(
  [00:00] and
  $mon eq 9 and
  $mday ge 24 and
  $mday le 30
)

## Halloween: Oct 31th and Nov 1st
DOELSEIF
(
  [00:00] and
  ($mon eq 9 and $mday eq 31) or
  ($mon eq 10 and $mday eq 1)
)

## St. Martin's Day: Nov 11th
DOELSEIF
(
  [00:00] and
  ($mon eq 10 and $mday eq 11)
)

## Christmas time: Starts 1st Advent, ends Dec 30th
DOELSEIF
(
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;
  my $christmas = str2time("$year-12-25");
  my ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime($christmas);
  $wdayC = $wdayC ? $wdayC : 7;
  my $adventBegin = $christmas - ($wdayC+21)*86400;
  my ( $sec2, $min2, $hour2, $mday2, $mon2, $year2, $wday2, $yday2, $isdst2 ) = localtime($adventBegin);

  [00:00] and
  ($mon eq $mon2 and $mday ge $mday2) or
  ($mon eq 11 and $mday le 30)
)

## New Year: Dec 31st and Jan 1st
DOELSEIF
(
  [00:00] and
  ($mon eq 11 and $mday eq 31) or
  ($mon eq 0 and $mday eq 1)
)

DOELSE
   NAME       SocialSeason
   NR         577
   NTFY_ORDER 50-SocialSeason
   STATE      Weihnachtszeit
   TYPE       DOIF
   Readings:
     2015-11-27 00:00:04   cmd_event       timer_8
     2015-11-27 00:00:04   cmd_nr          14
     2015-11-27 00:00:05   error           perl error in condition:   my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my $midSept = str2time("$year-09-15");  my ( $secS, $minS, $hourS, $mdayS, $monS, $yearS, $wdayS, $ydayS, $isdstS ) = localtime($midSept);  if ($wdayS eq 6) {    $wdayS = 7;  } elsif ($wdayS eq 0) {    $wdayS = 6;  } elsif ($wdayS eq 1) {    $wdayS = 5;  } elsif ($wdayS eq 2) {    $wdayS = 4;  } elsif ($wdayS eq 3) {    $wdayS = 3;  } elsif ($wdayS eq 4) {    $wdayS = 2;  } elsif ($wdayS eq 5) {    $wdayS = 1;  }  my $wiesnBegin = $midSept + $wdayS*86400;  my $wiesnEnd = $wiesnBegin + 21*86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($wiesnBegin);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($wiesnEnd);  DOIF_time_once($hash,$hash->{timer}{6},$wday,"") and  ($mon eq $monB and $mday ge $mdayB) and  ($mon eq $monE and $mday le $mdayE): Undefined subroutine &main::str2time called at (eval 25019) line 1.
     2015-11-27 00:00:04   state           christmas
     2015-11-27 09:12:15   timer_10_c10    28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_11_c11    28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_12_c12    28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_13_c13    28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_1_c1      28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_2_c2      28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_3_c3      28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_4_c4      28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_5_c5      28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_6_c6      28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_7_c7      28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_8_c8      28.11.2015 00:00:00
     2015-11-27 09:12:15   timer_9_c9      28.11.2015 00:00:00
   Condition:
     0            use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monEaster, $mdayEaster) = western_easter($year);  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;  my $carnivalTue = $carnivalMon + 86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);  DOIF_time_once($hash,$hash->{timer}{0},$wday,"") and  $mon eq 1 and  $mday eq 14 and  ($mday eq $mdayB or $mday eq $mdayE)
     1            use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monEaster, $mdayEaster) = western_easter($year);  my $carnivalEnd = str2time("$year-$monEaster-$mdayEaster") - 46*86400;  my $carnivalStart = $carnivalEnd - 5*86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalStart);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalEnd);  DOIF_time_once($hash,$hash->{timer}{1},$wday,"") and  ($mon eq $monB and $mday ge $mdayB) or  ($mon eq $monE and $mday le $mdayE)
     10           DOIF_time_once($hash,$hash->{timer}{10},$wday,"") and  ($mon eq 10 and $mday eq 11)
     11           my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my $christmas = str2time("$year-12-25");  my ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime($christmas);  $wdayC = $wdayC ? $wdayC : 7;  my $adventBegin = $christmas - ($wdayC+21)*86400;  my ( $sec2, $min2, $hour2, $mday2, $mon2, $year2, $wday2, $yday2, $isdst2 ) = localtime($adventBegin);  DOIF_time_once($hash,$hash->{timer}{11},$wday,"") and  ($mon eq $mon2 and $mday ge $mday2) or  ($mon eq 11 and $mday le 30)
     12           DOIF_time_once($hash,$hash->{timer}{12},$wday,"") and  ($mon eq 11 and $mday eq 31) or  ($mon eq 0 and $mday eq 1)
     2            use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monEaster, $mdayEaster) = western_easter($year);  my $fastEnd = str2time("$year-$monEaster-$mdayEaster") - 2*86400;  my $fastStart = $fastEnd - 43*86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($fastStart);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($fastEnd);  DOIF_time_once($hash,$hash->{timer}{2},$wday,"") and  ($mon eq $monB and $mday ge $mdayB) and  ($mon eq $monE and $mday le $mdayE)
     3            use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monB, $mdayB) = western_easter($year);  my $easterTimeBegin = $mdayB - 1;  DOIF_time_once($hash,$hash->{timer}{3},$wday,"") and  ($mon eq $monB and $mday ge $easterTimeBegin) or  ($mon eq 3 and $mday ge 25 and $mday le 29)
     4            DOIF_time_once($hash,$hash->{timer}{4},$wday,"") and  ($mon eq 3 and $mday eq 30) or  ($mon eq 4 and $mday eq 1)
     5            use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monEaster, $mdayEaster) = western_easter($year);  my $pentecostSat = str2time("$year-$monEaster-$mdayEaster") + 48*86400;  my $pentecostMon = $pentecostSat + 2*86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($pentecostSat);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($pentecostMon);  DOIF_time_once($hash,$hash->{timer}{5},$wday,"") and  ($mon eq $monB and $mday ge $mdayB) and  ($mon eq $monE and $mday le $mdayE)
     6            my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my $midSept = str2time("$year-09-15");  my ( $secS, $minS, $hourS, $mdayS, $monS, $yearS, $wdayS, $ydayS, $isdstS ) = localtime($midSept);  if ($wdayS eq 6) {    $wdayS = 7;  } elsif ($wdayS eq 0) {    $wdayS = 6;  } elsif ($wdayS eq 1) {    $wdayS = 5;  } elsif ($wdayS eq 2) {    $wdayS = 4;  } elsif ($wdayS eq 3) {    $wdayS = 3;  } elsif ($wdayS eq 4) {    $wdayS = 2;  } elsif ($wdayS eq 5) {    $wdayS = 1;  }  my $wiesnBegin = $midSept + $wdayS*86400;  my $wiesnEnd = $wiesnBegin + 21*86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($wiesnBegin);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($wiesnEnd);  DOIF_time_once($hash,$hash->{timer}{6},$wday,"") and  ($mon eq $monB and $mday ge $mdayB) and  ($mon eq $monE and $mday le $mdayE)
     7            my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  DOIF_time_once($hash,$hash->{timer}{7},$wday,"") and  $mon eq 9 and  $mday le 7 and  $wday eq 0
     8            DOIF_time_once($hash,$hash->{timer}{8},$wday,"") and  $mon eq 9 and  $mday ge 24 and  $mday le 30
     9            DOIF_time_once($hash,$hash->{timer}{9},$wday,"") and  ($mon eq 9 and $mday eq 31) or  ($mon eq 10 and $mday eq 1)
   Days:
   Devices:
   Do:
     0:
       0            [00:00] and  $mon eq 1 and  $mday eq 14
       1            use 95_holiday;  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);  $year += 1900;  my ( $monEaster, $mdayEaster) = western_easter($year);  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;  my $carnivalTue = $carnivalMon + 86400;  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);  [00:00] and  ($mday eq $mdayB or $mday eq $mdayE)
     1:
       0
     10:
       0
     11:
       0
     12:
       0
     13:
       0
     2:
       0
     3:
       0
     4:
       0
     5:
       0
     6:
       0
     7:
       0
     8:
       0
     9:
       0
   Helper:
     globalinit 1
     last_timer 13
     sleeptimer -1
   Itimer:
   Realtime:
     0          00:00:00
     1          00:00:00
     10         00:00:00
     11         00:00:00
     12         00:00:00
     2          00:00:00
     3          00:00:00
     4          00:00:00
     5          00:00:00
     6          00:00:00
     7          00:00:00
     8          00:00:00
     9          00:00:00
   State:
   Time:
     0          00:00:00
     1          00:00:00
     10         00:00:00
     11         00:00:00
     12         00:00:00
     2          00:00:00
     3          00:00:00
     4          00:00:00
     5          00:00:00
     6          00:00:00
     7          00:00:00
     8          00:00:00
     9          00:00:00
   Timecond:
     0          0
     1          1
     10         10
     11         11
     12         12
     2          2
     3          3
     4          4
     5          5
     6          6
     7          7
     8          8
     9          9
   Timer:
     0          0
     1          0
     10         0
     11         0
     12         0
     2          0
     3          0
     4          0
     5          0
     6          0
     7          0
     8          0
     9          0
   Timerfunc:
   Timers:
     0           0
     1           1
     10          10
     11          11
     12          12
     2           2
     3           3
     4           4
     5           5
     6           6
     7           7
     8           8
     9           9
Attributes:
   alias      Social Season
   cmdState   carnivalvalentine|valentine|carnival|carnivalweek|fasting|easter|may|pentecost|wiesn|harvest|halloweenweek|halloween|stmartin|christmas|newyear|none
   event-on-change-reading state
   eventMap   valentine:Valentinstag carnivalvalentine:Karneval-und-Valentinstag carnivalweek:Faschingszeit carnival:Karneval fasting:Fastenzeit easter:Osterzeit may:Tanz-in-den-Mai pentecost:Pfingsten wiesn:Wiesn harvest:Erntedankfest halloweenweek:Halloween-Woche halloween:Halloween stmartin:St.Martin christmas:Weihnachtszeit newyear:Jahreswechsel none:keine initialized:---
   group      Season Details
   room       Aussen


Hier zum Vergleich noch einmal das, was FHEM in die fhem.cgf geschrieben hat:

define SocialSeason DOIF ## Carnival: Carnival Mon/Tue and Valentine's Day at the same day\
(\
  use 95_holiday;;\
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);;\
  $year += 1900;;\
  my ( $monEaster, $mdayEaster) = western_easter($year);;\
  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;;\
  my $carnivalTue = $carnivalMon + 86400;;\
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);;\
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);;\
\
  [00:00] and\
  $mon eq 1 and\
  $mday eq 14 and\
  ($mday eq $mdayB or $mday eq $mdayE)\
)\
\
## Valentine's Day\
(\
  [00:00] and\
  $mon eq 1 and\
  $mday eq 14\
)\
\
## Carnival: Mon+Tue\
(\
  use 95_holiday;;\
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);;\
  $year += 1900;;\
  my ( $monEaster, $mdayEaster) = western_easter($year);;\
  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;;\
  my $carnivalTue = $carnivalMon + 86400;;\
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);;\
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);;\
\
\
  [00:00] and\
  ($mday eq $mdayB or $mday eq $mdayE)\
)\
\
## Carnival: Thursday before Ash Wednesday until day before Ash Wednesday w/o Valentine's Day\
DOELSEIF\
(\
  use 95_holiday;;\
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);;\
  $year += 1900;;\
  my ( $monEaster, $mdayEaster) = western_easter($year);;\
  my $carnivalEnd = str2time("$year-$monEaster-$mdayEaster") - 46*86400;;\
  my $carnivalStart = $carnivalEnd - 5*86400;;\
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalStart);;\
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalEnd);;\
\
  [00:00] and\
  ($mon eq $monB and $mday ge $mdayB) or\
  ($mon eq $monE and $mday le $mdayE)\
)\
\
## Fasting/Strong-Beer Time: Ash Wednesday until Good Friday\
DOELSEIF\
(\
  use 95_holiday;;\
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);;\
  $year += 1900;;\
  my ( $monEaster, $mdayEaster) = western_easter($year);;\
  my $fastEnd = str2time("$year-$monEaster-$mdayEaster") - 2*86400;;\
  my $fastStart = $fastEnd - 43*86400;;\
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($fastStart);;\
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($fastEnd);;\
\
  [00:00] and\
  ($mon eq $monB and $mday ge $mdayB) and\
  ($mon eq $monE and $mday le $mdayE)\
)\
\
## Easter Time: Starts Easter Saturday, ends Apr 29th\
DOELSEIF\
(\
  use 95_holiday;;\
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);;\
  $year += 1900;;\
  my ( $monB, $mdayB) = western_easter($year);;\
  my $easterTimeBegin = $mdayB - 1;;\
\
  [00:00] and\
  ($mon eq $monB and $mday ge $easterTimeBegin) or\
  ($mon eq 3 and $mday ge 25 and $mday le 29)\
)\
\
## May Festival: Apr 30th and May 1st\
DOELSEIF\
(\
  [00:00] and\
  ($mon eq 3 and $mday eq 30) or\
  ($mon eq 4 and $mday eq 1)\
)\
\
## Pentecost: Saturday til Monday\
DOELSEIF\
(\
  use 95_holiday;;\
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);;\
  $year += 1900;;\
  my ( $monEaster, $mdayEaster) = western_easter($year);;\
  my $pentecostSat = str2time("$year-$monEaster-$mdayEaster") + 48*86400;;\
  my $pentecostMon = $pentecostSat + 2*86400;;\
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($pentecostSat);;\
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($pentecostMon);;\
\
  [00:00] and\
  ($mon eq $monB and $mday ge $mdayB) and\
  ($mon eq $monE and $mday le $mdayE)\
)\
\
## Oktoberfest: Saturday after Sept 15th for 3 weeks\
DOELSEIF\
(\
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);;\
  $year += 1900;;\
  my $midSept = str2time("$year-09-15");;\
  my ( $secS, $minS, $hourS, $mdayS, $monS, $yearS, $wdayS, $ydayS, $isdstS ) = localtime($midSept);;\
  if ($wdayS eq 6) {\
    $wdayS = 7;;\
  } elsif ($wdayS eq 0) {\
    $wdayS = 6;;\
  } elsif ($wdayS eq 1) {\
    $wdayS = 5;;\
  } elsif ($wdayS eq 2) {\
    $wdayS = 4;;\
  } elsif ($wdayS eq 3) {\
    $wdayS = 3;;\
  } elsif ($wdayS eq 4) {\
    $wdayS = 2;;\
  } elsif ($wdayS eq 5) {\
    $wdayS = 1;;\
  }\
  my $wiesnBegin = $midSept + $wdayS*86400;;\
  my $wiesnEnd = $wiesnBegin + 21*86400;;\
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($wiesnBegin);;\
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($wiesnEnd);;\
\
  [00:00] and\
  ($mon eq $monB and $mday ge $mdayB) and\
  ($mon eq $monE and $mday le $mdayE)\
)\
\
## Harvest festival: 1st sunday in Oct\
DOELSEIF\
(\
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);;\
  [00:00] and\
  $mon eq 9 and\
  $mday le 7 and\
  $wday eq 0\
)\
\
## Halloween Week: Oct 24th until Otc 30th\
DOELSEIF\
(\
  [00:00] and\
  $mon eq 9 and\
  $mday ge 24 and\
  $mday le 30\
)\
\
## Halloween: Oct 31th and Nov 1st\
DOELSEIF\
(\
  [00:00] and\
  ($mon eq 9 and $mday eq 31) or\
  ($mon eq 10 and $mday eq 1)\
)\
\
## St. Martin's Day: Nov 11th\
DOELSEIF\
(\
  [00:00] and\
  ($mon eq 10 and $mday eq 11)\
)\
\
## Christmas time: Starts 1st Advent, ends Dec 30th\
DOELSEIF\
(\
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);;\
  $year += 1900;;\
  my $christmas = str2time("$year-12-25");;\
  my ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime($christmas);;\
  $wdayC = $wdayC ? $wdayC : 7;;\
  my $adventBegin = $christmas - ($wdayC+21)*86400;;\
  my ( $sec2, $min2, $hour2, $mday2, $mon2, $year2, $wday2, $yday2, $isdst2 ) = localtime($adventBegin);;\
\
  [00:00] and\
  ($mon eq $mon2 and $mday ge $mday2) or\
  ($mon eq 11 and $mday le 30)\
)\
\
## New Year: Dec 31st and Jan 1st\
DOELSEIF\
(\
  [00:00] and\
  ($mon eq 11 and $mday eq 31) or\
  ($mon eq 0 and $mday eq 1)\
)\
\
DOELSE
attr SocialSeason alias Social Season
attr SocialSeason cmdState carnivalvalentine|valentine|carnival|carnivalweek|fasting|easter|may|pentecost|wiesn|harvest|halloweenweek|halloween|stmartin|christmas|newyear|none
attr SocialSeason event-on-change-reading state
attr SocialSeason eventMap valentine:Valentinstag carnivalvalentine:Karneval-und-Valentinstag carnivalweek:Faschingszeit carnival:Karneval fasting:Fastenzeit easter:Osterzeit may:Tanz-in-den-Mai pentecost:Pfingsten wiesn:Wiesn harvest:Erntedankfest halloweenweek:Halloween-Woche halloween:Halloween stmartin:St.Martin christmas:Weihnachtszeit newyear:Jahreswechsel none:keine initialized:---
attr SocialSeason group Season Details
attr SocialSeason room Aussen


Und noch eine weitere Frage: Das DOIF hat bei mir schon den STATE "Weihnachtszeit" (siehe auch Ausgabe des "list" Kommandos in der Mitte) - dabei ist der erste Advent doch erst am Wochenende und auch der Timer zeigt korrekt "28.11.2015 00:00:00" an? (Das ist mir gestern schon aufgefallen, aber da bin ich noch nicht zum Schreiben gekommen ;-))

LG
McCavity
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: trinitywhm am 30 Juli 2017, 23:35:43
Bin beim stöbern auf diesen Codeschnipsel gestoßen und fand das ein nettes Gimmick. Allerdings erhalte ich ähnlich wie beim letzten Beitrag ein error kurz nach Mitternacht "condition c01: syntax error, line 1, near "use 95_"". Wo liegt hier das Problem? Ist es vielleicht nur eine Kleinigkeit und dann läuft es doch?
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: raspklaus am 05 August 2017, 15:38:34
Den gleichen Fehler habe ich auch, aber hier scheint niemand mehr zu antworten :'(
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Clyde am 01 September 2018, 10:36:32
Würde das auch gern verwenden, habe aber dasselbe Problem. Hat jemand eine Lösung gefunden?
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Prof. Dr. Peter Henning am 01 September 2018, 12:25:22
Alles hat einen Grund - es gibt inzwischen verschiedene Automatisierungsmodule, die das viel eleganter machen können.

Von mir z.B. YAAHM.

LG

pah
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: TomLee am 01 September 2018, 13:16:28
Oder das u.a. DOIF selbst um die gewünschten "Social Seasons" erweitern.
Hab ich irgendwann mal hier im Forum aufgeschnappt.

defmod doif_Jahreszeiten DOIF (([00:00] or ["^global$:^MODIFIED $SELF$"]) and ($md ge "11-25" or $md le "01-08")) ()
DOELSEIF (([00:00] or ["^global$:^MODIFIED $SELF$"]) and ($md ge "06-30" or $md le "08-25")) ()
attr doif_Jahreszeiten cmdState Weihnachtszeit|Sommerzeit
attr doif_Jahreszeiten do always
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Prof. Dr. Peter Henning am 01 September 2018, 14:07:00
Zitathier im Forum aufgeschnappt.

Scheint so - das ist aber weder wartbar, noch in irgendeinem standardisierten Format, noch sinnvoll. Besser: Einen Kalender im iCal-Format mit den entsprechenden Daten befüllen.

LG

pah
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: TomLee am 01 September 2018, 20:14:06
Es ist eine Alternative zum oben genannten DOIF nicht mehr und nicht weniger und mit Sicherheit für viele User erstmal eine Hilfe/Lösung. Wer sich lange genug mit FHEM beschäftigt hat sieht die Vorteile in deinen genannten Vorschlägen.
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Damian am 02 September 2018, 10:47:06
Das Problem bei der Definition von Loredo ist die Tatsache, dass er die DOIF-Syntax etwas "missbraucht" hat. Er hat in den Bedingungen eines DOIFs ganze Perl-Programme untergebracht. Das ist nirgendwo dokumentiert, es kann gut funktionieren oder irgendwann durch ein Update auch nicht mehr.

Übrigens steht in der Fehlermeldung:  Undefined subroutine &main::str2time 

Dann ist wohl klar was hier fehlt.

Die Definition ist hier nicht gut strukturiert, da immer Wiederholungen programmiert wurden, die unnötig den Code aufblähen. Dieser Fall wäre prädestiniert für DOIF-Perl. Dort lassen sich Routinen, die im Device immer wieder benötigt werden, im DOIF-Device selbst gekapselt definieren.

Für ein eigenständiges FHEM-Modul finde ich die Problematik wiederum zu banal. Gleichzeitig wäre ein eigenes Modul von Usern schlecht erweiterbar.

Wenn ich heute Zeit finde, dann bastle ich euch eine adäquate Lösung in DOIF-Perl, die im Gegensatz zu einem eigenständigen FHEM-Modul von Usern für ihre Zwecke leicht erweiterbar wäre.
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Clyde am 02 September 2018, 19:17:43
Ich wollte für eine Email-Subject-Zeile immer ein passendes Icon ausgewählt haben, was auch die Feiertage berücksichtigt.

Die SuFu hatte mich hierher geführt. Vielen Dank für die Antworten. Ich habe mir schließlich in Anlehnung an den DOIF-Code folgende Perl-sub gebastelt, die mir genügt und evtl. anderen als Vorlage dienen kann:


sub my_subject() {

  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);
  $year += 1900;

  my ( $monEaster, $mdayEaster) = western_easter($year);
  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;
  my $carnivalTue = $carnivalMon + 86400;
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);

  my $carnivalEnd = str2time("$year-$monEaster-$mdayEaster") - 46*86400;
  my $carnivalStart = $carnivalEnd - 5*86400;

  my $fastEnd = str2time("$year-$monEaster-$mdayEaster") - 2*86400;
  my $fastStart = $fastEnd - 43*86400;

  my ( $monB, $mdayB) = western_easter($year);
  my $easterTimeBegin = $mdayB - 1;

  my $pentecostSat = str2time("$year-$monEaster-$mdayEaster") + 48*86400;
  my $pentecostMon = $pentecostSat + 2*86400;

  my $midSept = str2time("$year-09-15");
  my ( $secS, $minS, $hourS, $mdayS, $monS, $yearS, $wdayS, $ydayS, $isdstS ) = localtime($midSept);

  my $wiesnBegin = $midSept + $wdayS*86400;
  my $wiesnEnd = $wiesnBegin + 21*86400;

  my $christmas = str2time("$year-12-25");
  my ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime($christmas);
  my $adventBegin = $christmas - ($wdayC+21)*86400;
  my ( $sec2, $min2, $hour2, $mday2, $mon2, $year2, $wday2, $yday2, $isdst2 ) = localtime($adventBegin);

  my $subject;
  my $saisonal = "nix";


## Carnival: Carnival Mon/Tue and Valentine's Day at the same day
{if   ($mon eq 1 and  $mday eq 14 and  ($mday eq $mdayB or $mday eq $mdayE))
      {$saisonal = "Karneval"; $subject = '👹 ';}
## Valentine's Day
elsif ($mon eq 1 and  $mday eq 14)
      {$saisonal = "Valentin"; $subject = '💘 ';}
## Carnival: Mon+Tue
elsif ($mday eq $mdayB or $mday eq $mdayE)
      {$saisonal = "Karneval"; $subject = '👹 ';}
else {
## Carnival: Thursday before Ash Wednesday until day before Ash Wednesday w/o Valentine's Day
  $carnivalEnd = str2time("$year-$monEaster-$mdayEaster") - 46*86400;
  $carnivalStart = $carnivalEnd - 5*86400;
  ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalStart);
  ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalEnd);

{if  (($mon eq $monB and $mday ge $mdayB) or
      ($mon eq $monE and $mday le $mdayE))
     {$saisonal = "Karneval"; $subject = '👺 ';}
else {
  $fastEnd = str2time("$year-$monEaster-$mdayEaster") - 2*86400;
  $fastStart = $fastEnd - 43*86400;
  ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($fastStart);
  ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($fastEnd);

## Fasting/Strong-Beer Time: Ash Wednesday until Good Friday
{if  (
  ($mon eq $monB and $mday ge $mdayB) and
  ($mon eq $monE and $mday le $mdayE)
     )
     {$saisonal = "Starkbierzeit"; $subject = '🍺 ';}
else {
  ( $monB, $mdayB) = western_easter($year);
  $easterTimeBegin = $mdayB - 1;

## Easter Time: Starts Easter Saturday, ends Apr 29th
{if  (
  ($mon eq $monB and $mday ge $easterTimeBegin) or
  ($mon eq 3 and $mday ge 25 and $mday le 29)
     )
     {$saisonal = "Osterzeit"; $subject = '🐇 ';}
else {
  ( $monB, $mdayB) = western_easter($year);
  $easterTimeBegin = $mdayB - 1;

## May Festival: Apr 30th and May 1st
{if  (
  ($mon eq 3 and $mday eq 30) or
  ($mon eq 4 and $mday eq 1)
     )
     {$saisonal = "Tanz in den Mai"; $subject = '👗 ';}
else {
  $pentecostSat = str2time("$year-$monEaster-$mdayEaster") + 48*86400;
  $pentecostMon = $pentecostSat + 2*86400;
  ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($pentecostSat);
  ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($pentecostMon);

## Pentecost: Saturday til Monday
{if  (
  ($mon eq $monB and $mday ge $mdayB) and
  ($mon eq $monE and $mday le $mdayE)
     )
     {$saisonal = "Pfingsten"; $subject = '👻 ';}
else {
  $midSept = str2time("$year-09-15");
  ( $secS, $minS, $hourS, $mdayS, $monS, $yearS, $wdayS, $ydayS, $isdstS ) = localtime($midSept);
  if ($wdayS eq 6) {
    $wdayS = 7;
  } elsif ($wdayS eq 0) {
    $wdayS = 6;
  } elsif ($wdayS eq 1) {
    $wdayS = 5;
  } elsif ($wdayS eq 2) {
    $wdayS = 4;
  } elsif ($wdayS eq 3) {
    $wdayS = 3;
  } elsif ($wdayS eq 4) {
    $wdayS = 2;
  } elsif ($wdayS eq 5) {
    $wdayS = 1;
  };
  $wiesnBegin = $midSept + $wdayS*86400;
  $wiesnEnd = $wiesnBegin + 21*86400;
  ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($wiesnBegin);
  ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($wiesnEnd);

## Oktoberfest: Saturday after Sept 15th for 3 weeks
{if  (
  ($mon eq $monB and $mday ge $mdayB) and
  ($mon eq $monE and $mday le $mdayE)
     )
     {$saisonal = "Wiesn"; $subject = '🍺 ';}
else {

## Harvest festival: 1st sunday in Oct
{if  (
  $mon eq 9 and
  $mday le 7 and
  $wday eq 0
     )
     {$saisonal = "Erntedank"; $subject = '🌾 ';}
else {

## Halloween Week: Oct 24th until Otc 30th
{if  (
  $mon eq 9 and
  $mday ge 24 and
  $mday le 30
     )
     {$saisonal = "Halloweenwoche"; $subject = '🎃 ';}
else {

## Halloween: Oct 31th and Nov 1st
{if  (
  ($mon eq 9 and $mday eq 31) or
  ($mon eq 10 and $mday eq 1)
     )
     {$saisonal = "Halloween"; $subject = '🎃 ';}
else {

## St. Martin's Day: Nov 11th
{if  (
  ($mon eq 10 and $mday eq 11)
     )
     {$saisonal = "Martinstag"; $subject = '🌜 ';}
else {
  $christmas = str2time("$year-12-25");
  ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime($christmas);
  $wdayC = $wdayC ? $wdayC : 7;
  $adventBegin = $christmas - ($wdayC+21)*86400;
  ( $sec2, $min2, $hour2, $mday2, $mon2, $year2, $wday2, $yday2, $isdst2 ) = localtime($adventBegin);

## Christmas time: Starts 1st Advent, ends Dec 30th
{if  (
  ($mon eq $mon2 and $mday ge $mday2) or
  ($mon eq 11 and $mday le 30)
     )
     {$saisonal = "Adventszeit"; $subject = '🎄 ';}
else {

## New Year: Dec 31st and Jan 1st
{if  (
  ($mon eq 11 and $mday eq 31)
     )
     {$saisonal = "Sylvester"; $subject = '🚀 ';}

elsif  (
  ($mon eq 0 and $mday eq 1)
     )
     {$saisonal = "Neujahr"; $subject = '✨ ';}
};

}};
}};
}};
}};
}};
}};
}};
}};
}};
}};
}};
}};


{if ($saisonal == "nix" or $wday == 2){
#Saisonal
if   ($yday >   1 and $yday <=  20){$subject = '🎿 '.$subject; $saisonal = "Winter";}
elsif($yday >  31 and $yday <=  45){$subject = '💘 '.$subject; $saisonal = "Valentin";}
elsif($yday >  20 and $yday <=  40){$subject = '⛄ '.$subject; $saisonal = "Winter";}
elsif($yday >  40 and $yday <=  60){$subject = '❆ '.$subject; $saisonal = "Winter";}
elsif($yday >  60 and $yday <=  80){$subject = '🐑 '.$subject; $saisonal = "Schafe";}
elsif($yday >  80 and $yday <=  90){$subject = '🎢 '.$subject; $saisonal = "Hamburger Frühlingsdom";}
elsif($yday >  90 and $yday <= 100){$subject = '🎡 '.$subject; $saisonal = "Osterwiese";}
elsif($yday > 100 and $yday <= 110){$subject = '🚴 '.$subject; $saisonal = "Radtour";}
elsif($yday > 110 and $yday <= 120){$subject = '🌼 '.$subject; $saisonal = "Frühling";}
elsif($yday > 120 and $yday <= 130){$subject = '🍦 '.$subject; $saisonal = "Eis";}
elsif($yday > 130 and $yday <= 140){$subject = '🍓 '.$subject; $saisonal = "Erdbeeren";}
elsif($yday > 140 and $yday <= 150){$subject = '🚴 '.$subject; $saisonal = "Radtour";}
elsif($yday > 150 and $yday <= 160){$subject = '🍦 '.$subject; $saisonal = "Eis";}
elsif($yday > 160 and $yday <= 170){$subject = '🚴 '.$subject; $saisonal = "Radtour";}
elsif($yday > 170 and $yday <= 180){$subject = '👙 '.$subject; $saisonal = "Sommer";}
elsif($yday > 180 and $yday <= 190){$subject = '🍅 '.$subject; $saisonal = "Tomatenzeit";}
elsif($yday > 190 and $yday <= 200){$subject = '⚓ '.$subject; $saisonal = "Cuxhaven";}
elsif($yday > 200 and $yday <= 210){$subject = '🍉 '.$subject; $saisonal = "Melonenzeit";}
elsif($yday > 210 and $yday <= 220){$subject = '🚴 '.$subject; $saisonal = "Radtour";}
elsif($yday > 220 and $yday <= 230){$subject = '🚗 '.$subject;  $saisonal = "Magdeburg";}
elsif($yday > 230 and $yday <= 240){$subject = '🍅 '.$subject; $saisonal = "Tomaten";}
elsif($yday > 240 and $yday <= 250){$subject = '🌻 '.$subject; $saisonal = "Spätsommer";}
elsif($yday > 250 and $yday <= 270){$subject = '👗 '.$subject; $saisonal = "Stoffmarkt";}
elsif($yday > 270 and $yday <= 280){$subject = '🍁 '.$subject; $saisonal = "Herbst";}
elsif($yday > 280 and $yday <= 290){$subject = '🎡 '.$subject; $saisonal = "Freimarkt";}
elsif($yday > 290 and $yday <= 305){$subject = '🎃 '.$subject; $saisonal = "Kürbisernte";}
elsif($yday > 305 and $yday <= 315){$subject = '🎢 '.$subject; $saisonal = "Hamburger Herbstdom";}
elsif($yday > 315 and $yday <= 330){$subject = '🛁 '.$subject; $saisonal = "Wannenbad";}
elsif($yday > 330 and $yday <= 340){$subject = '🎄 '.$subject; $saisonal = "Adventszeit";}
elsif($yday > 340 and $yday <= 350){$subject = '🎄 '.$subject; $saisonal = "Adventszeit";}
elsif($yday > 350 and $yday <= 361){$subject = '🎅 '.$subject; $saisonal = "Weihnachten";}
elsif($yday > 361 and $yday <= 365){$subject = '🚀 '.$subject; $saisonal = "Sylvester";}
}};

fhem "set Test  $subject $saisonal";
}
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: ThoTo am 02 September 2018, 21:45:25
Zitat von: Damian am 02 September 2018, 10:47:06
Wenn ich heute Zeit finde, dann bastle ich euch eine adäquate Lösung in DOIF-Perl, die im Gegensatz zu einem eigenständigen FHEM-Modul von Usern für ihre Zwecke leicht erweiterbar wäre.

Danke, Damian  8) 8) 8)
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Damian am 08 September 2018, 20:27:43
Ich habe ausgehend vom Code von Clyde eine DOIF-Version gebaut, die im Status Season angibt und im  Reading subject das entsprechende Icon.

Beim Antesten sind mir in beiden Versionen Fehler aufgefallen (die habe ich korrigiert), ich schließe allerdings nicht aus, dass noch mehr Fehler drin stecken.

Hier die Rawdefinition:

defmod SocialSeason2 DOIF subs {\
sub my_subject() {\
\
  my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(time);;\
  #my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime(str2time"2018-12-1");;\
\
  $year += 1900;;\
\
  my ( $monEaster, $mdayEaster) = western_easter($year);;\
  my $carnivalMon = str2time("$year-$monEaster-$mdayEaster") - 47*86400;;\
  my $carnivalTue = $carnivalMon + 86400;;\
  my ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalMon);;\
  my ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalTue);;\
\
  my $carnivalEnd = str2time("$year-$monEaster-$mdayEaster") - 46*86400;;\
  my $carnivalStart = $carnivalEnd - 5*86400;;\
\
  my $fastEnd = str2time("$year-$monEaster-$mdayEaster") - 2*86400;;\
  my $fastStart = $fastEnd - 43*86400;;\
\
  my ( $monB, $mdayB) = western_easter($year);;\
  my $easterTimeBegin = $mdayB - 1;;\
\
  my $pentecostSat = str2time("$year-$monEaster-$mdayEaster") + 48*86400;;\
  my $pentecostMon = $pentecostSat + 2*86400;;\
\
  my $midSept = str2time("$year-09-15");;\
  my ( $secS, $minS, $hourS, $mdayS, $monS, $yearS, $wdayS, $ydayS, $isdstS ) = localtime($midSept);;\
\
  my $wiesnBegin = $midSept + $wdayS*86400;;\
  my $wiesnEnd = $wiesnBegin + 21*86400;;\
\
  my $christmas = str2time("$year-12-25");;\
  my ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime($christmas);;\
  my $adventBegin = $christmas - ($wdayC+21)*86400;;\
  my ( $sec2, $min2, $hour2, $mday2, $mon2, $year2, $wday2, $yday2, $isdst2 ) = localtime($adventBegin);;\
\
  my $subject;;\
  my $saisonal = "nix";;\
\
\
## Carnival: Carnival Mon/Tue and Valentine's Day at the same day\
{if   ($mon eq 1 and  $mday eq 14 and  ($mday eq $mdayB or $mday eq $mdayE))\
      {$saisonal = "Karneval";; $subject = '👹 ';;}\
## Valentine's Day\
elsif ($mon eq 1 and  $mday eq 14)\
      {$saisonal = "Valentin";; $subject = '💘 ';;}\
## Carnival: Mon+Tue\
elsif ($mday eq $mdayB or $mday eq $mdayE)\
      {$saisonal = "Karneval";; $subject = '👹 ';;}\
else {\
## Carnival: Thursday before Ash Wednesday until day before Ash Wednesday w/o Valentine's Day\
  $carnivalEnd = str2time("$year-$monEaster-$mdayEaster") - 46*86400;;\
  $carnivalStart = $carnivalEnd - 5*86400;;\
  ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($carnivalStart);;\
  ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($carnivalEnd);;\
\
{if  (($mon eq $monB and $mday ge $mdayB) or\
      ($mon eq $monE and $mday le $mdayE))\
     {$saisonal = "Karneval";; $subject = '👺 ';;}\
else {\
  $fastEnd = str2time("$year-$monEaster-$mdayEaster") - 2*86400;;\
  $fastStart = $fastEnd - 43*86400;;\
  ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($fastStart);;\
  ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($fastEnd);;\
\
## Fasting/Strong-Beer Time: Ash Wednesday until Good Friday\
{if  (\
  ($mon eq $monB and $mday ge $mdayB) and\
  ($mon eq $monE and $mday le $mdayE)\
     )\
     {$saisonal = "Starkbierzeit";; $subject = '🍺 ';;}\
else {\
  ( $monB, $mdayB) = western_easter($year);;\
  $easterTimeBegin = $mdayB - 1;;\
\
## Easter Time: Starts Easter Saturday, ends Apr 29th\
{if  (\
  ($mon eq $monB and $mday ge $easterTimeBegin) or\
  ($mon eq 3 and $mday ge 25 and $mday le 29)\
     )\
     {$saisonal = "Osterzeit";; $subject = '🐇 ';;}\
else {\
  ( $monB, $mdayB) = western_easter($year);;\
  $easterTimeBegin = $mdayB - 1;;\
\
## May Festival: Apr 30th and May 1st\
{if  (\
  ($mon eq 3 and $mday eq 30) or\
  ($mon eq 4 and $mday eq 1)\
     )\
     {$saisonal = "Tanz in den Mai";; $subject = '👗 ';;}\
else {\
  $pentecostSat = str2time("$year-$monEaster-$mdayEaster") + 48*86400;;\
  $pentecostMon = $pentecostSat + 2*86400;;\
  ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($pentecostSat);;\
  ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($pentecostMon);;\
\
## Pentecost: Saturday til Monday\
{if  (\
  ($mon eq $monB and $mday ge $mdayB) and\
  ($mon eq $monE and $mday le $mdayE)\
     )\
     {$saisonal = "Pfingsten";; $subject = '👻 ';;}\
else {\
  $midSept = str2time("$year-09-15");;\
  ( $secS, $minS, $hourS, $mdayS, $monS, $yearS, $wdayS, $ydayS, $isdstS ) = localtime($midSept);;\
  if ($wdayS eq 6) {\
    $wdayS = 7;;\
  } elsif ($wdayS eq 0) {\
    $wdayS = 6;;\
  } elsif ($wdayS eq 1) {\
    $wdayS = 5;;\
  } elsif ($wdayS eq 2) {\
    $wdayS = 4;;\
  } elsif ($wdayS eq 3) {\
    $wdayS = 3;;\
  } elsif ($wdayS eq 4) {\
    $wdayS = 2;;\
  } elsif ($wdayS eq 5) {\
    $wdayS = 1;;\
  };;\
  $wiesnBegin = $midSept + $wdayS*86400;;\
  $wiesnEnd = $wiesnBegin + 21*86400;;\
  ( $secB, $minB, $hourB, $mdayB, $monB, $yearB, $wdayB, $ydayB, $isdstB ) = localtime($wiesnBegin);;\
  ( $secE, $minE, $hourE, $mdayE, $monE, $yearE, $wdayE, $ydayE, $isdstE ) = localtime($wiesnEnd);;\
\
## Oktoberfest: Saturday after Sept 15th for 3 weeks\
{if  (\
  ($mon eq $monB and $mday ge $mdayB) and\
  ($mon eq $monE and $mday le $mdayE)\
     )\
     {$saisonal = "Wiesn";; $subject = '🍺 ';;}\
else {\
\
## Harvest festival: 1st sunday in Oct\
{if  (\
  $mon eq 9 and\
  $mday le 7 and\
  $wday eq 0\
     )\
     {$saisonal = "Erntedank";; $subject = '🌾 ';;}\
else {\
\
## Halloween Week: Oct 24th until Otc 30th\
{if  (\
  $mon eq 9 and\
  $mday ge 24 and\
  $mday le 30\
     )\
     {$saisonal = "Halloweenwoche";; $subject = '🎃 ';;}\
else {\
\
## Halloween: Oct 31th and Nov 1st\
{if  (\
  ($mon eq 9 and $mday eq 31) or\
  ($mon eq 10 and $mday eq 1)\
     )\
     {$saisonal = "Halloween";; $subject = '🎃 ';;}\
else {\
\
## St. Martin's Day: Nov 11th\
{if  (\
  ($mon eq 10 and $mday eq 11)\
     )\
     {$saisonal = "Martinstag";; $subject = '🌜 ';;}\
else {\
  $christmas = str2time("$year-12-25");;\
  ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime($christmas);;\
  $wdayC = $wdayC ? $wdayC : 7;;\
  $adventBegin = $christmas - ($wdayC+21)*86400;;\
  ( $sec2, $min2, $hour2, $mday2, $mon2, $year2, $wday2, $yday2, $isdst2 ) = localtime($adventBegin);;\
\
## Christmas time: Starts 1st Advent, ends Dec 30th\
{if  (\
  ($mon eq $mon2 and $mday ge $mday2) and\
  ($mon eq 11 and $mday le 30)\
     )\
     {$saisonal = "Adventszeit";; $subject = '🎄 ';;}\
else {\
\
## New Year: Dec 31st and Jan 1st\
{if  (\
  ($mon eq 11 and $mday eq 31) \
     )\
     {$saisonal = "Sylvester";; $subject = '🚀 ';;}\
\
elsif  (\
  ($mon eq 0 and $mday eq 1)\
     )\
     {$saisonal = "Neujahr";; $subject = '✨ ';;}\
};;\
\
}};;\
}};;\
}};;\
}};;\
}};;\
}};;\
}};;\
}};;\
}};;\
}};;\
}};;\
}};;\
\
\
{if ($saisonal eq "nix" or $wday == 2){\
#Saisonal\
if   ($yday >   1 and $yday <=  20){$subject = '🎿 '.$subject;; $saisonal = "Winter";;}\
elsif($yday >  31 and $yday <=  45){$subject = '💘 '.$subject;; $saisonal = "Valentin";;}\
elsif($yday >  20 and $yday <=  40){$subject = '⛄ '.$subject;; $saisonal = "Winter";;}\
elsif($yday >  40 and $yday <=  60){$subject = '❆ '.$subject;; $saisonal = "Winter";;}\
elsif($yday >  60 and $yday <=  80){$subject = '🐑 '.$subject;; $saisonal = "Schafe";;}\
elsif($yday >  80 and $yday <=  90){$subject = '🎢 '.$subject;; $saisonal = "Hamburger Frühlingsdom";;}\
elsif($yday >  90 and $yday <= 100){$subject = '🎡 '.$subject;; $saisonal = "Osterwiese";;}\
elsif($yday > 100 and $yday <= 110){$subject = '🚴 '.$subject;; $saisonal = "Radtour";;}\
elsif($yday > 110 and $yday <= 120){$subject = '🌼 '.$subject;; $saisonal = "Frühling";;}\
elsif($yday > 120 and $yday <= 130){$subject = '🍦 '.$subject;; $saisonal = "Eis";;}\
elsif($yday > 130 and $yday <= 140){$subject = '🍓 '.$subject;; $saisonal = "Erdbeeren";;}\
elsif($yday > 140 and $yday <= 150){$subject = '🚴 '.$subject;; $saisonal = "Radtour";;}\
elsif($yday > 150 and $yday <= 160){$subject = '🍦 '.$subject;; $saisonal = "Eis";;}\
elsif($yday > 160 and $yday <= 170){$subject = '🚴 '.$subject;; $saisonal = "Radtour";;}\
elsif($yday > 170 and $yday <= 180){$subject = '👙 '.$subject;; $saisonal = "Sommer";;}\
elsif($yday > 180 and $yday <= 190){$subject = '🍅 '.$subject;; $saisonal = "Tomatenzeit";;}\
elsif($yday > 190 and $yday <= 200){$subject = '⚓ '.$subject;; $saisonal = "Cuxhaven";;}\
elsif($yday > 200 and $yday <= 210){$subject = '🍉 '.$subject;; $saisonal = "Melonenzeit";;}\
elsif($yday > 210 and $yday <= 220){$subject = '🚴 '.$subject;; $saisonal = "Radtour";;}\
elsif($yday > 220 and $yday <= 230){$subject = '🚗 '.$subject;;  $saisonal = "Magdeburg";;}\
elsif($yday > 230 and $yday <= 240){$subject = '🍅 '.$subject;; $saisonal = "Tomaten";;}\
elsif($yday > 240 and $yday <= 250){$subject = '🌻 '.$subject;; $saisonal = "Spätsommer";;}\
elsif($yday > 250 and $yday <= 270){$subject = '👗 '.$subject;; $saisonal = "Stoffmarkt";;}\
elsif($yday > 270 and $yday <= 280){$subject = '🍁 '.$subject;; $saisonal = "Herbst";;}\
elsif($yday > 280 and $yday <= 290){$subject = '🎡 '.$subject;; $saisonal = "Freimarkt";;}\
elsif($yday > 290 and $yday <= 305){$subject = '🎃 '.$subject;; $saisonal = "Kürbisernte";;}\
elsif($yday > 305 and $yday <= 315){$subject = '🎢 '.$subject;; $saisonal = "Hamburger Herbstdom";;}\
elsif($yday > 315 and $yday <= 330){$subject = '🛁 '.$subject;; $saisonal = "Wannenbad";;}\
elsif($yday > 330 and $yday <= 340){$subject = '🎄 '.$subject;; $saisonal = "Adventszeit";;}\
elsif($yday > 340 and $yday <= 350){$subject = '🎄 '.$subject;; $saisonal = "Adventszeit";;}\
elsif($yday > 350 and $yday <= 361){$subject = '🎅 '.$subject;; $saisonal = "Weihnachten";;}\
elsif($yday > 361 and $yday <= 365){$subject = '🚀 '.$subject;; $saisonal = "Sylvester";;}\
}};;\
return "$subject $saisonal";;\
}\
\
}\
\
{\
  if ([00:00]) {\
    my ($subject,$saisonal)=split(" ",my_subject());;\
    set_Reading ("state",$saisonal,1);;\
    set_Reading ("subject",$subject,1);;\
  }\
}

Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: rischbiter123 am 08 September 2018, 21:52:14
Erst mal vielen Dank für die Arbeit. Allerdings habe ich noch eine Frage. Kann man Definitionen, die man nicht braucht (z.B. Oktoberfest) einfach löschen, oder muss man noch andere Teile auskommentieren?

LG

Andreas
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Damian am 08 September 2018, 22:13:20
Zitat von: rischbiter123 am 08 September 2018, 21:52:14
Erst mal vielen Dank für die Arbeit. Allerdings habe ich noch eine Frage. Kann man Definitionen, die man nicht braucht (z.B. Oktoberfest) einfach löschen, oder muss man noch andere Teile auskommentieren?

LG

Andreas

Es ist eine programmierte Lösung. Man kann alles ändern bzw. herausnehmen, solange der Perl-Code funktioniert :)

Das ist auch gleichzeitig der Nachteil dieser Lösungen, weil sie nicht gut konfigurierbar sind.

Es meiner Sicht kann man die meisten Dinge genau so gut in einer holiday-Datei definieren.
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Damian am 09 September 2018, 20:16:37
Hier eine Version, die leicht konfigurierbar ist und flexibler mit Intervallen umgehen kann als holiday:

defmod SocialSeason2 DOIF init {\
$_season{Ostern}="E+0 E+1";;\
$_season{"1. Mai"}="05-01";;\
$_season{Weihnachten}="12-25 12-26";;\
$_season{Advent}="A+0 A+21";;\
}\
\
{\
  if ([00:00]) {\
    my $season=myseason(split("-",$ymd,2));;\
    set_Reading ("state",$season,1);;\
  }\
}\
\
subs {\
sub myseason {\
my ($year,$md)=@_;;\
my $from;;\
my $to;;\
my ( $monEaster, $mdayEaster) = western_easter($year);;\
my $easter=str2time("$year-$monEaster-$mdayEaster");;\
\
my $christmas = str2time("$year-12-25");;\
my ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime(str2time("$year-12-25"));;\
$wdayC = $wdayC ? $wdayC : 7;;\
my $adventBegin = $christmas - ($wdayC+21)*86400;;\
\
\
foreach my $key (keys %{$_season}) {\
  ($from,$to)=split (' ',$_season{$key});;\
  if ($from =~ /E((\+|\-)\d+)/) {\
    my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime ($easter + $1*86400);;   \
    $from=sprintf("%02d-%02d",$mon+1,$mday);;\
  } elsif ($from =~ /A((\+|\-)\d+)/) {\
    my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime ($adventBegin + $1*86400);;   \
    $from=sprintf("%02d-%02d",$mon+1,$mday);;\
  }\
\
  if (defined $to) {\
    if ($to =~ /E((\+|\-)\d+)/) {\
      my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime ($easter + $1*86400);;   \
      $to=sprintf("%02d-%02d",$mon+1,$mday);;\
    } elsif ($to =~ /A((\+|\-)\d+)/) {\
      my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime ($adventBegin + $1*86400);;   \
      $to=sprintf("%02d-%02d",$mon+1,$mday);;\
    }\
  }\
  if (!defined ($to) and $from eq $md or (defined ($to) and $md ge $from and $md le $to)) {\
    return"$key";;\
  } \
}\
return ("none");;\
}\
}\


Im init-Block können einzelne Tage im Format MM-DD oder Zeitintervalle von bis im Format MM-DD MM-DD definiert werden.

Eine Besonderheit ist der Buchstabe E für Ostersonntag und A für 1. Advent, diese Angaben können mit Addition oder Subtraktion einer Zahl statt MM-DD angegeben werden.

$_season{Ostern}="E+0 E+1" bedeutet Ostersonntag bis Ostermontag -> Ostern
$_season{Advent}="A+0 A+21" bedeutet vom ersten bis zum vierten Adventsonntag

Der init-Block lässt sich beliebig erweitern. Das Schlüsselwort in geschweiften Klammern kann frei gewählt werden und ist gleichzeitig der Status des Moduls in der jeweiligen Zeit, sonst steht da "none".

Beispiel für Karneval (von Weiberfastnacht bis Fastnacht) wäre:

$_season{Kerneval}="E-51 E-46" Weiberfastnacht ist 51 Tage vor Ostersonntag und Fastnacht ist 46 Tage vor Ostersonntag.




Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Damian am 11 September 2018, 18:52:16
Es ist mir aufgefallen, dass bei überschneidenden Einträgen, die Eindeutigkeit der Definition nicht gegeben war, weil das Auslesen eines Hashes keine eindeutige Reihenfolge hat. Ich habe die Definition auf Array umgestellt, gleichzeitig ist die Konfiguration noch einfacher geworden. Sie wird zeilenweise innerhalb von $_season definiert (sie könnte auch aus einer Datei kommen).
Hier die neue Version:

Syntax:
<from> <to>, <designation> oder <date>, <designation>

defmod SocialSeason2 DOIF init {
$_season="
E-10 E+1,    Ostern
05-01,       1. Mai
12-25 12-26, Weihnachten
A+0,         1. Advent
A+7,         2. Advent
A+14,        3. Advent
A+21,        4. Advent
A+0 A+21,    Adventszeit
E-51 E-46,   Karneval
";
}

{
  if ([00:00]) {
    my $season=myseason(split("-",$ymd,2));
    set_Reading ("state",$season,1);
  }
}

subs {
sub myseason {
my ($year,$md)=@_;
my $from;
my $to;
my $date;
my $token;
my ( $monEaster, $mdayEaster) = western_easter($year);
my $easter=str2time("$year-$monEaster-$mdayEaster");

my $christmas = str2time("$year-12-25");
my ( $secC, $minC, $hourC, $mdayC, $monC, $yearC, $wdayC, $ydayC, $isdstC ) = localtime(str2time("$year-12-25"));
$wdayC = $wdayC ? $wdayC : 7;
my $adventBegin = $christmas - ($wdayC+21)*86400;

my @s=split ('\n',$_season);

foreach (@s) {
   next if ($_ eq "");
  ($date,$token)=split (',\s*',$_);
  ($from,$to)=split (' ',$date);
  if ($from =~ /E((\+|\-)\d+)/) {
    my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime ($easter + $1*86400);   
    $from=sprintf("%02d-%02d",$mon+1,$mday);
  } elsif ($from =~ /A((\+|\-)\d+)/) {
    my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime ($adventBegin + $1*86400);   
    $from=sprintf("%02d-%02d",$mon+1,$mday);
  }

  if (defined $to) {
    if ($to =~ /E((\+|\-)\d+)/) {
      my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime ($easter + $1*86400);   
      $to=sprintf("%02d-%02d",$mon+1,$mday);
    } elsif ($to =~ /A((\+|\-)\d+)/) {
      my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) = localtime ($adventBegin + $1*86400);   
      $to=sprintf("%02d-%02d",$mon+1,$mday);
    }
  }
  if (!defined ($to) and $from eq $md or (defined ($to) and $md ge $from and $md le $to)) {
    return($token);
  }
}
return ("none");
}
}



Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Jamo am 11 September 2018, 22:06:44
Hallo Damian,
Ich bekomme eine Fehlermeldung:Undefined subroutine &main::str2time
In meiner 99_MyUtils.pm habe ich "use Time::Local;" definiert
Was muss ich da machen? Danke!
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Damian am 11 September 2018, 22:34:26
Bei mir brauche ich str2time nicht zu definieren.

Dann trage bei dir ein:

...
sub myseason {
use Date::Parse qw(str2time);
my ($year,$md)=@_;
...
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Jamo am 12 September 2018, 01:06:03
Danke!
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: Loredo am 02 Juli 2019, 12:36:17
Diese vereinfachte Logik ist jetzt in ein eigenes Modul namens DaySchedule mit eingeflossen:
https://forum.fhem.de/index.php/topic,101942.0.html (https://forum.fhem.de/index.php/topic,101942.0.html)
Titel: Antw:DOIF für "Social" Seasons (zB Weihnachtszeit, Osterzeit, Karneval etc.)
Beitrag von: TomLee am 02 Juli 2019, 12:44:53
Musste während der Vorstellung im Webinar gleich an dieses DOIF denken. Danke. Werd ich mich wohl oder Übel mit befassen (müssen).