diff --git a/fhem/FHEM/57_Calendar.pm b/fhem/FHEM/57_Calendar.pm
index 323ce8c30..7fd6e142a 100644
--- a/fhem/FHEM/57_Calendar.pm
+++ b/fhem/FHEM/57_Calendar.pm
@@ -2620,7 +2620,7 @@ sub Calendar_ProcessUpdate($$$) {
} else {
$hash->{".fhem"}{iCalendar}= $ics; # the plain text iCalendar
$hash->{".fhem"}{removeall}= $removeall;
- if(AttrVal($name, "synchronousUpdate", 0) == 1) {
+ if( $^O =~ m/Win/ || AttrVal($name, "synchronousUpdate", 0) == 1 ) {
Calendar_SynchronousUpdateCalendar($hash);
} else {
Calendar_AsynchronousUpdateCalendar($hash);
@@ -3550,6 +3550,9 @@ sub CalendarEventsAsHtml($;$) {
in the background and FHEM will not block during updates.
If this attribute is set to 1, the processing of the calendar is done
in the foreground. Large calendars will block FHEM on slow systems.
+
+ Attribute value will be ignored if FHEM is running on a Windows platform.
+ On Windows platforms the processing will always be done synchronously
update onUrlChanged|none
update none|onUrlChanged| %s | %s | %s |
| %s | %s | %s |
define <name> Calendar ical url <URL> [<interval>]define <name> Calendar ical file <FILENAME> [<interval>]https://, the perl module IO::Socket::SSL must be installed
- (use cpan -i IO::Socket::SSL).<URL> may contain %-wildcards of the
- POSIX strftime function of the underlying OS (see your strftime manual).
- Common used wildcards are:
- %d day of month (01..31)%m month (01..12)%Y year (1970...)%w day of week (0..6); 0 represents Sunday%j day of year (001..366)%U week number of year with Sunday as first day of week (00..53)%W week number of year with Monday as first day of week (00..53)https:// and the perl module IO::Socket::SSL is
- not installed on your system, you can replace it by http:// if and only if there is
- no redirection to the https:// URL. Check with your browser first if unsure.https://admin:admin@demo.nextcloud.com/wid0ohgh/remote.php/dav/calendars/admin/personal/?export.
-
-
- The optional parameter interval is the time between subsequent updates
- in seconds. It defaults to 3600 (1 hour).
- An interval = 0 will not be allowed and replaced by 3600 automatically. A corresponding log entry will be created.
-
- Examples:
-
- define MyCalendar Calendar ical url https://www.google.com/calendar/ical/john.doe%40example.com/private-foo4711/basic.ics - define YourCalendar Calendar ical url http://www.google.com/calendar/ical/jane.doe%40example.com/private-bar0815/basic.ics 86400 - define SomeCalendar Calendar ical file /home/johndoe/calendar.ics -- - - - Set
set <name> updateinterval seconds later.set <name> reloadupdate but all calendar events are removed first.get <name> updateset <name> updateget <name> reloadset <name> updateget <name> events [format:<formatSpec>] [timeFormat:<timeFormatSpec>] [filter:<filterSpecs>] [series:next[=<max>]] [limit:<limitSpecs>]format,
- timeFormat, filter, series and limit
- parameters and it makes even sense to give the filter
- parameter several times.
- format parameter determines the overall formatting of the calendar event.
- The following format specifications are available:| <formatSpec> | content |
|---|---|
default | the default format (see below) |
full | same as custom="$U $M $A $T1-$T2 $S $CA $L" |
text | same as custom="$T1 $S" |
custom="<formatString>" | a custom format (see below) |
custom="{ <perl-code> }" | a custom format (see below) |
') can be used instead of double quotes (") in the
- custom format.<formatString> and in
- the <perl-code>:| variable | meaning |
|---|---|
$t1 | the start time in seconds since the epoch |
$T1 | the start time according to the time format |
$t2 | the end time in seconds since the epoch |
$T2 | the end time according to the time format |
$a | the alarm time in seconds since the epoch |
$A | the alarm time according to the time format |
$d | the duration in seconds |
$D | the duration in human-readable form |
$S | the summary |
$L | the location |
$CA | the categories |
$CL | the classification |
$DS | the description |
$U | the UID |
$M | the mode |
format parameter is omitted, the custom format string
- from the defaultFormat attribute is used. If this attribute
- is not set, "$T1 $D $S" is used as default custom format string.
- The last occurance wins if the format
- parameter is given several times.get MyCalendar events format:fullget MyCalendar events format:custom="$T1-$T2 $S \@ $L"get MyCalendar events format:custom={ sprintf("%20s %8s", $S, $D) }timeFormat parameter determines the formatting of
- start, end and alarm times.<timeFormatSpec>.
- The web page strftime.net has a nice builder
- for <timeFormatSpec>.timeFormat parameter is omitted, the time format specification
- from the defaultTimeFormat attribute is used. If this attribute
- is not set, "%d.%m.%Y %H:%M" is used as default time format
- specification.
- Single quotes (') or double quotes (") can be
- used to enclose the format specification.get MyCalendar events timeFormat:"%e-%b-%Y" format:fullfilter parameter restricts the calendar
- events displayed to a subset. <filterSpecs> is a comma-separated
- list of <filterSpec> specifications. All filters must apply for a
- calendar event to be displayed. The parameter is cumulative: all separate
- occurances of the parameter add to the list of filters.<filterSpec> | description |
|---|---|
uid=="<uid>" | UID is <uid>- same as field(uid)=="<uid>" |
uid=~"<regex>" | UID matches regular expression <regex>- same as field(uid)=~"<regex>" |
mode=="<mode>" | mode is <mode>- same as field(mode)=="<mode>" |
mode=~"<regex>" | mode matches regular expression <regex>- same as field(mode)=~"<regex>" |
field(<field>)=="<value>" | content of the field <field> is <value>- <field> is one of uid, mode, summary, location,
- description, categories, classification
- |
field(<field>)=~"<regex>" | content of the field <field> matches <regex> - <field> is one of uid, mode, summary, location,
- description, categories, classification- |
") on the right hand side of a <filterSpec>
- are not part of the value or regular expression. Single quotes (') can be
- used instead.get MyCalendar events filter:uid=="432dsafweq64yehdbwqhkd"get MyCalendar events filter:uid=~"^7"get MyCalendar events filter:mode=="alarm"get MyCalendar events filter:mode=~"alarm|upcoming"get MyCalendar events filter:field(summary)=~"Mama"get MyCalendar events filter:field(classification)=="PUBLIC"get MyCalendar events filter:field(summary)=~"Gelber Sack",mode=~"upcoming|start"get MyCalendar events filter:field(summary)=~"Gelber Sack" filter:mode=~"upcoming|start"
- series parameter determines the display of
- recurring events. series:next limits the display to the
- next calendar event out of all calendar events in the series that have
- not yet ended. series:next=<max> shows at most the
- <max> next calendar events in the series. This applies
- per series. To limit the total amount of events displayed see the limit
- parameter below.limit parameter limits the number of events displayed.
- <limitSpecs> is a comma-separated list of <limitSpec>
- specifications.<limitSpec> | description |
|---|---|
count=<n> | shows at most <n> events, <n> is a positive integer |
from=[+|-]<timespec> | shows only events that end after - a timespan <timespec> from now; use a minus sign for events in the - past; <timespec> is described below in the Attributes section |
to=[+|-]<timespec> | shows only events that start before - a timespan <timespec> from now; use a minus sign for events in the - past; <timespec> is described below in the Attributes section |
when=today|tomorrow | shows events for today or tomorrow |
get MyCalendar events limit:count=10get MyCalendar events limit:from=-2dget MyCalendar events limit:when=todayget MyCalendar events limit:count=10,from=0,to=+10dget <name> find <regexp>get <name> vcalendarget <name> veventsdefaultFormat <formatSpec>get <name> events
- command. The specification is explained there. You must enclose
- the <formatSpec> in double quotes (") like input
- in attr myCalendar defaultFormat "$T1 $D $S".defaultTimeFormat <timeFormatSpec>get <name>events
- command. The specification is explained there. Do not enclose
- the <timeFormatSpec> in quotes.synchronousUpdate 0|1- -
update onUrlChanged|noneonUrlChanged, the processing is done only
- if url to calendar has changed since last calendar update.none, the calendar will not be updated at all.
- - -
removevcalendar 0|1get <name> vcalendar is then no longer possible.
- - -
hideOlderThan <timespec>hideLaterThan <timespec>
-
- These attributes limit the list of events shown by
- get <name> full|debug|text|summary|location|alarm|start|end ....
- - The time is specified relative to the current time t. If hideOlderThan is set, - calendar events that ended before t-hideOlderThan are not shown. If hideLaterThan is - set, calendar events that will start after t+hideLaterThan are not shown.
- - Please note that an action triggered by a change to mode "end" cannot access the calendar event - if you set hideOlderThan to 0 because the calendar event will already be hidden at that time. Better set - hideOlderThan to 10.
-
- <timespec> must have one of the following formats:
-
| format | description | example |
|---|---|---|
| SSS | seconds | 3600 |
| SSSs | seconds | 3600s |
| HH:MM | hours:minutes | 02:30 |
| HH:MM:SS | hours:minutes:seconds | 00:01:30 |
| D:HH:MM:SS | days:hours:minutes:seconds | 122:10:00:00 |
| DDDd | days | 100d |
- -
cutoffOlderThan <timespec>- -
onCreateEvent <perl-code>- -
SSLVerify- -
ignoreCancelled- -
quirks <values><values> is
- a comma-separated list of the following keywords:
- ignoreDtStamp: if present, a modified DTSTAMP attribute of a calendar event
- does not signify that the calendar event was modified.- - -
- - A calendar event has a summary (usually the title shown in a visual - representation of the source calendar), a start time, an end time, and zero, one or more alarm times. In case of multiple alarm times for a calendar event, only the - earliest alarm time is kept.
- - Recurring calendar events (series) are currently supported to an extent: - FREQ INTERVAL UNTIL COUNT are interpreted, BYMONTHDAY BYMONTH WKST - are recognized but not interpreted. BYDAY is correctly interpreted for weekly and monthly events. - The module will get it most likely wrong - if you have recurring calendar events with unrecognized or uninterpreted keywords. - Out-of-order events and events excluded from a series (EXDATE) are handled. - Calendar events are only created within ±400 days around the time of the - last update. -
-
- Calendar events are created when FHEM is started or when the respective entry in the source
- calendar has changed and the calendar is updated or when the calendar is reloaded with
- get <name> reload.
- Only calendar events within ±400 days around the event creation time are created. Consider
- reloading the calendar from time to time to avoid running out of upcoming events. You can use something like define reloadCalendar at +*240:00:00 set MyCalendar reload for that purpose.
- - Some dumb calendars do not use LAST-MODIFIED. This may result in modifications in the source calendar - go unnoticed. Reload the calendar if you experience this issue.
- - A calendar event is identified by its UID. The UID is taken from the source calendar. - All events in a series including out-of-order events habe the same UID. - All non-alphanumerical characters - are stripped off the original UID to make your life easier.
- - A calendar event can be in one of the following modes: -
| upcoming | Neither the alarm time nor the start time of the calendar event is reached. |
| alarm | The alarm time has passed but the start time of the calendar event is not yet reached. |
| start | The start time has passed but the end time of the calendar event is not yet reached. |
| end | The end time of the calendar event has passed. |
-
- A calendar device has several readings. Except for calname, each reading is a semicolon-separated list of UIDs of
- calendar events that satisfy certain conditions:
-
| calname | name of the calendar |
| modeAlarm | events in alarm mode |
| modeAlarmOrStart | events in alarm or start mode |
| modeAlarmed | events that have just transitioned from upcoming to alarm mode |
| modeChanged | events that have just changed their mode somehow |
| modeEnd | events in end mode |
| modeEnded | events that have just transitioned from start to end mode |
| modeStart | events in start mode |
| modeStarted | events that have just transitioned to start mode |
| modeUpcoming | events in upcoming mode |
- - For recurring events, usually several calendar events exists with the same UID. In such a case, - the UID is only shown in the mode reading for the most interesting mode. The most - interesting mode is the first applicable of start, alarm, upcoming, end.
- - In particular, you will never see the UID of a series in modeEnd or modeEnded as long as the series - has not yet ended - the UID will be in one of the other mode... readings. This means that you better - do not trigger FHEM events for series based on mode... readings. See below for a recommendation.
-
-
- triggered
-
- When you receive this event, you can rely on the calendar's readings being in a consistent and
- most recent state.
- - When a calendar event has changed, two FHEM events are created:
-
- changed: UID <mode>
- <mode>: UID
-
- <mode> is the current mode of the calendar event after the change. Note: there is a
- colon followed by a single space in the FHEM event specification.
-
- The recommended way of reacting on mode changes of calendar events is to get notified
- on the aforementioned FHEM events and do not check for the FHEM events triggered
- by a change of a mode reading.
-
-
$e. The most important elements are as follows:
-
- | code | description |
|---|---|
| $e->{start} | the start time of the calendar event, in seconds since the epoch |
| $e->{end} | the end time of the calendar event, in seconds since the epoch |
| $e->{alarm} | the alarm time of the calendar event, in seconds since the epoch |
| $e->{summary} | the summary (caption, title) of the calendar event |
| $e->{location} | the location of the calendar event |
attr MyCalendar onCreateEvent { $e->{alarm}= $e->{start}-86400 if($e->{summary} =~ /Tonne/);; }attr MyCalendar onCreateEvent { $e->{end}= $e->{start}+86400 unless(defined($e->{end})) }
- get MyCalendar events format:full
- 2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom alarm 31.05.2012 17:00:00 07.06.2012 16:30:00-07.06.2012 18:00:00 Erna for coffee
- 992hydf4y44awer5466lhfdsrgl7tin6b6mckf8glmhui4googlecom upcoming 08.06.2012 00:00:00-09.06.2012 00:00:00 Vacation
- text 20 60 { fhem("get MyCalendar events timeFormat:'%d.%m.%Y %H:%M' format:custom='$T1 $S' filter:mode=~'alarm|start') }
- 07.06.12 16:30 Erna for coffee
- 08.06.12 00:00 Vacation
-
- get MyCalendar find .*Erna.*
- 2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom
-
- define ErnaComes notify MyCalendar:start:.2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom set MyLight on
-
- define LogErna notify MyCalendar:alarm:.2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom { Log3 $NAME, 1, "ALARM name=$NAME event=$EVENT part1=$EVTPART0 part2=$EVTPART1" }
-
- define SwitchActorOn notify MyCalendar:start:.* { \
- my $reading="$EVTPART0";; \
- my $uid= "$EVTPART1";; \
- my $actor= fhem('get MyCalendar filter:uid=="'.$uid.'" format:custom="$S"');; \
- if(defined $actor) {
- fhem("set $actor on")
- } \
- }
- define SwitchActorOff notify MyCalendar:end:.* { \
- my $reading="$EVTPART0";; \
- my $uid= "$EVTPART1";; \
- my $actor= fhem('get MyCalendar filter:uid=="'.$uid.'" format:custom="$S"');; \
- if(defined $actor) {
- fhem("set $actor off")
- } \
- }
-
- define LogActors notify MyCalendar:(start|end):.*
- { my $reading= "$EVTPART0";; my $uid= "$EVTPART1";; \
- my $actor= fhem('get MyCalendar filter:uid=="'.$uid.'" format:custom="$S"');; \
- Log3 $NAME, 1, "Actor: $actor, Reading $reading" }
- GarbageCalendar has all the dates of the
- garbage collection with the type of garbage collected in the summary. The
- following notify can be used to inform about the garbage collection:
-
- define GarbageCollectionNotifier notify GarbageCalendar:alarm:.* { \
- my $uid= "$EVTPART1";; \
- my $summary= fhem('get MyCalendar events filter:uid=="'.$uid.'" format:custom="$S"');; \
- # e.g. mail $summary to someone \
- }
- attr GarbageCalendar onCreateEvent { $e->{alarm}= $e->{start}-86400 }
- { CalendarEventsAsHtml('GarbageCalendar','format:text filter:mode=~"alarm|start"') }
- CalendarAsHtml(<name>,<options>)
- returns the HTML code for a list of calendar events. <name> is the name of the
- Calendar device and <options> is what you would write
- after get <name> text .... This function is deprecated.
- define MyCalendarWeblink weblink htmlCode { CalendarAsHtml("MyCalendar","next 3") }
- CalendarEventsAsHtml(<name>,<parameters>)
- returns the HTML code for a list of calendar events. <name> is the name of the
- Calendar device and <parameters> is what you would write
- in get <name> events <parameters>.
- define MyCalendarWeblink weblink htmlCode
- { CalendarEventsAsHtml('F','format:custom="$T1 $D $S" timeFormat:"%d.%m" series:next=3') }
- -
define <name> Calendar ical url <URL> [<interval>]define <name> Calendar ical file <FILENAME> [<interval>]https://, muss das Perl-Modul IO::Socket::SSL installiert sein
- (use cpan -i IO::Socket::SSL).<URL> kann %-wildcards der POSIX
- strftime-Funktion des darunterliegenden OS enthalten (siehe auch strftime
- Beschreibung).
- Allgemein gebräuchliche Wildcards sind:
- %d Tag des Monats (01..31)%m Monat (01..12)%Y Jahr (1970...)%w Wochentag (0..6); beginnend mit Sonntag (0)%j Tag des Jahres (001..366)%U Wochennummer des Jahres, wobei Wochenbeginn = Sonntag (00..53)%W Wochennummer des Jahres, wobei Wochenbeginn = Montag (00..53)https:// beginnen und das Perl-Modul IO::Socket::SSL ist nicht auf deinem System installiert,
- kannst Du in der URL https:// durch http:// ersetzen, falls keine automatische Umleitung auf die https:// URL erfolgt.
- Solltest Du unsicher sein, ob dies der Fall ist, überprüfe es bitte zuerst mit deinem Browser.https://admin:admin@demo.nextcloud.com/wid0ohgh/remote.php/dav/calendars/admin/personal/?export.
-
- Der optionale Parameter interval bestimmt die Zeit in Sekunden zwischen den Updates. Default-Wert ist 3600 (1 Stunde).
- Eine Intervallangabe von 0 ist nicht erlaubt. Diese wird automatisch durch den Standardwert 3600 ersetzt und im Log protokolliert.
-
- Beispiele:
-
- define MeinKalender Calendar ical url https://www.google.com/calendar/ical/john.doe%40example.com/private-foo4711/basic.ics - define DeinKalender Calendar ical url http://www.google.com/calendar/ical/jane.doe%40example.com/private-bar0815/basic.ics 86400 - define IrgendeinKalender Calendar ical file /home/johndoe/calendar.ics -- - - - Set
set <name> updateinterval Sekunden später.set <name> reloadupdate, jedoch werden zuerst alle Termine entfernt.get <name> updateset <name> updateget <name> reloadset <name> reloadget <name> events [format:<formatSpec>] [timeFormat:<timeFormatSpec>] [filter:<filterSpecs>] [series:next[=<max>]] [limit:<limitSpecs>]format,
- timeFormat, filter, series und limit
- können angegeben werden, weiterhin ist es sinnvoll, den Parameter filter mehrere Male anzugeben.
- format legt den zurückgegeben Inhalt fest.| <formatSpec> | Beschreibung |
|---|---|
default | Standardformat (siehe unten) |
full | entspricht custom="$U $M $A $T1-$T2 $S $CA $L" |
text | entspricht custom="$T1 $S" |
custom="<formatString>" | ein spezifisches Format (siehe unten) |
custom="{ <perl-code> }" | ein spezifisches Format (siehe unten) |
') können anstelle von doppelten Anführungszeichen (") innerhalb
- eines spezifischen Formats benutzt werden.
-
- Folgende Variablen können in <formatString> und in
- <perl-code> verwendet werden:
- | variable | Bedeutung |
|---|---|
$t1 | Startzeit in Sekunden |
$T1 | Startzeit entsprechend Zeitformat |
$t2 | Endzeit in Sekunden |
$T2 | Endzeit entsprechend Zeitformat |
$a | Alarmzeit in Sekunden |
$A | Alarmzeit entsprechend Zeitformat |
$d | Dauer in Sekunden |
$D | Dauer in menschenlesbarer Form |
$S | Zusammenfassung |
$L | Ortsangabe |
$CA | Kategorien |
$CL | Klassifizierung |
$DS | Beschreibung |
$U | UID |
$M | Modus |
format ausgelassen, dann wird die Formatierung
- aus defaultFormat benutzt. Ist dieses Attribut nicht gesetzt, wird "$T1 $D $S"
- als Formatierung benutzt.
-
- Das letzte Auftreten von format gewinnt bei mehrfacher Angabe.
- get MyCalendar events format:fullget MyCalendar events format:custom="$T1-$T2 $S \@ $L"get MyCalendar events format:custom={ sprintf("%20s %8s", $S, $D) }timeFormat legt das Format für die Start-,
- End- und Alarmzeiten fest.<timeFormatSpec> kann die POSIX-Spezifikation verwendet werden.
- Auf strftime.net gibt es ein Tool zum Erstellen von
- <timeFormatSpec>.timeFormat ausgelassen, dann wird die Formatierung
- aus defaultTimeFormat benutzt. Ist dieses Attribut nicht gesetzt, dann
- wird "%d.%m.%Y %H:%M" als Formatierung benutzt.
- Zum Umschließen der Formatangabe können einfache (') oder
- doppelte (") Anführungszeichen verwendet werden.timeFormat gewinnt bei mehrfacher Angabe.
- get MyCalendar events timeFormat:"%e-%b-%Y" format:fullfilter schränkt die Anzeige der Termine ein.
- <filterSpecs> ist eine kommaseparierte Liste von
- <filterSpec>-Angaben.
- Alle Filterangaben müssen zutreffen, damit ein Termin angezeigt wird.
- Die Angabe ist kumulativ: jeder angegebene Filter wird zur Filterliste hinzugef&uum;gt
- und ber&uum;cksichtigt.<filterSpec> | Beschreibung |
|---|---|
uid=="<uid>" | UID ist <uid>- entspricht field(uid)=="<uid>" |
uid=~"<regex>" | Der reguläre Ausdruck <regex> entspricht der UID- entspricht field(uid)=~"<regex>" |
mode=="<mode>" | Modus ist <mode>- entspricht field(mode)=="<mode>" |
mode=~"<regex>" | Der reguläre Ausdruck <regex> entspricht mode- entspricht field(mode)=~"<regex>" |
field(<field>)=="<value>" | Inhalt von <field> ist <value>- <field> ist eines von uid, mode, summary, location,
- description, categories, classification
- |
field(<field>)=~"<regex>" | Inhalt von <field> entspricht dem regulären Ausdruck <regex>- <field> ist eines von uid, mode, summary, location,
- description, categories, classification- |
<filterSpec> sind nicht
- Teil des regulären Ausdrucks. Es können stattdessen einfache Anführungszeichen verwendet werden.
- get MyCalendar events filter:uid=="432dsafweq64yehdbwqhkd"get MyCalendar events filter:uid=~"^7"get MyCalendar events filter:mode=="alarm"get MyCalendar events filter:mode=~"alarm|upcoming"get MyCalendar events filter:field(summary)=~"Mama"get MyCalendar events filter:field(classification)=="PUBLIC"get MyCalendar events filter:field(summary)=~"Gelber Sack",mode=~"upcoming|start"get MyCalendar events filter:field(summary)=~"Gelber Sack" filter:mode=~"upcoming|start"
- series bestimmt die Anzeige von wiederkehrenden
- Terminen. series:next begrenzt die Anzeige auf den nächsten Termin
- der noch nicht beendeten Termine innerhalb der Serie. series:next=<max>
- zeigt die nächsten <max> Termine der Serie. Dies gilt pro Serie.
- Zur Begrenzung der Anzeige siehe den limit-Parameter.limit begrenzt die Anzeige der Termine.
- <limitSpecs> ist eine kommaseparierte Liste von <limitSpec> Angaben.
- <limitSpec> | Beschreibung |
|---|---|
count=<n> | zeigt <n> Termine, wobei <n> eine positive Ganzzahl (integer) ist |
from=[+|-]<timespec> | zeigt nur Termine die nach einer Zeitspanne <timespec> ab jetzt enden; - Minuszeichen für Termine in der Vergangenheit benutzen; <timespec> wird weiter unten im Attribut-Abschnitt beschrieben. |
to=[+|-]<timespec> | - zeigt nur Termine die vor einer Zeitspanne <timespec> ab jetzt starten; - Minuszeichen für Termine in der Vergangenheit benutzen; <timespec> wird weiter unten im Attribut-Abschnitt beschrieben. |
when=today|tomorrow | zeigt anstehende Termin für heute oder morgen an |
get MyCalendar events limit:count=10get MyCalendar events limit:from=-2dget MyCalendar events limit:when=todayget MyCalendar events limit:count=10,from=0,to=+10dget <name> find <regexp>get <name> vcalendarget <name> veventsdefaultFormat <formatSpec>get <name> events.
- Der Aufbau wird dort erklät. <formatSpec> muss in doppelte
- Anführungszeichen (") gesetzt werden, wie z.B. attr myCalendar defaultFormat "$T1 $D $S".defaultTimeFormat <timeFormatSpec>get <name> events.
- Der Aufbau wird dort erklät. <timeFormatSpec> nicht in Anführungszeichen setzten. synchronousUpdate 0|1- -
update none|onUrlChangednone gesetzt ist, wird der Kalender überhaupt nicht aktualisiert.onUrlChanged gesetzt ist, wird der Kalender nur dann aktualisiert, wenn sich die
- URL seit dem letzten Aufruf verändert hat, insbesondere nach der Auswertung von wildcards im define.- -
removevcalendar 0|1get <name> vcalendar ist dann nicht mehr möglich.
- - -
hideOlderThan <timespec>hideLaterThan <timespec>
-
- Dieses Attribut grenzt die Liste der durch get <name> full|debug|text|summary|location|alarm|start|end ... gezeigten Termine ein.
-
- Die Zeit wird relativ zur aktuellen Zeit t angegeben.
- Wenn <hideOlderThan> gesetzt ist, werden Termine, die vor <t-hideOlderThan> enden, ingnoriert.
- Wenn <hideLaterThan> gesetzt ist, werden Termine, die nach <t+hideLaterThan> anfangen, ignoriert.
-
- Bitte beachte, dass eine Aktion, die durch einen Wechsel in den Modus "end" ausgelöst wird, nicht auf den Termin
- zugreifen kann, wenn hideOlderThan 0 ist, denn der Termin ist dann schon versteckt. Setze hideOlderThan besser auf 10.
-
-
- <timespec> muss; einem der folgenden Formate entsprechen:
-
| Format | Beschreibung | Beispiel |
|---|---|---|
| SSS | Sekunden | 3600 |
| SSSs | Sekunden | 3600s |
| HH:MM | Stunden:Minuten | 02:30 |
| HH:MM:SS | Stunden:Minuten:Sekunden | 00:01:30 |
| D:HH:MM:SS | Tage:Stunden:Minuten:Sekunden | 122:10:00:00 |
| DDDd | Tage | 100d |
- -
cutoffOlderThan <timespec>cutoffOlderThan
- vor der letzten Aktualisierung des Kalenders endeten. Der Zweck dieses Attributs ist es Speicher zu
- sparen. Auf solche Termine kann gar nicht mehr aus FHEM heraus zugegriffen
- werden. Serientermine ohne Ende (UNTIL) und
- Termine ohne Endezeitpunkt (DTEND) werden nicht weggeschnitten.
- - -
onCreateEvent <perl-code>- -
SSLVerify- -
ignoreCancelled- -
quirks <values><values> ist
- eine kommaseparierte Liste der folgenden Schlüsselwörter:
- ignoreDtStamp: wenn gesetzt, dann zeigt
- ein verändertes DTSTAMP Attribut eines Termins nicht an, dass;
- der Termin verändert wurde.- - -
-
- Termine werden erzeugt, wenn FHEM gestartet wird oder der betreffende Eintrag im Quell-Kalender verändert
- wurde oder der Kalender mit get <name> reload neu geladen wird. Es werden nur Termine
- innerhalb ±400 Tage um die Erzeugungs des Termins herum erzeugt. Ziehe in Betracht, den Kalender von Zeit zu Zeit
- neu zu laden, um zu vermeiden, dass; FHEM die künftigen Termine ausgehen. Du kann so etwas wie define reloadCalendar at +*240:00:00 set MyCalendar reload dafür verwenden.
- - Manche dumme Kalender benutzen LAST-MODIFIED nicht. Das kann dazu führen, dass Veränderungen im - Quell-Kalender unbemerkt bleiben. Lade den Kalender neu, wenn Du dieses Problem hast.
- - Ein Termin wird durch seine UID identifiziert. Die UID wird vom Quellkalender bezogen. Um das Leben leichter zu machen, werden alle nicht-alphanumerischen Zeichen automatisch aus der UID entfernt.
- - Ein Termin kann sich in einem der folgenden Modi befinden: -
| upcoming | Weder die Alarmzeit noch die Startzeit des Kalendereintrags ist erreicht. |
| alarm | Die Alarmzeit ist überschritten, aber die Startzeit des Kalender-Ereignisses ist noch nicht erreicht. |
| start | Die Startzeit ist überschritten, aber die Ende-Zeit des Kalender-Ereignisses ist noch nicht erreicht. |
| end | Die Endzeit des Kalender-Ereignisses wurde überschritten. |
-
- Ein Kalender-Device hat verschiedene Readings. Mit Ausnahme von calname stellt jedes Reading eine semikolonseparierte Liste aus UID von Kalender-Ereignisse dar, welche bestimmte Zustände haben:
-
| calname | Name des Kalenders |
| modeAlarm | Ereignisse im Alarm-Modus |
| modeAlarmOrStart | Ereignisse im Alarm- oder Startmodus |
| modeAlarmed | Ereignisse, welche gerade in den Alarmmodus gewechselt haben |
| modeChanged | Ereignisse, welche gerade in irgendeiner Form ihren Modus gewechselt haben |
| modeEnd | Ereignisse im Endmodus |
| modeEnded | Ereignisse, welche gerade vom Start- in den Endmodus gewechselt haben |
| modeStart | Ereignisse im Startmodus |
| modeStarted | Ereignisse, welche gerade in den Startmodus gewechselt haben |
| modeUpcoming | Ereignisse im zukünftigen Modus |
- - Für Serientermine werden mehrere Termine mit identischer UID erzeugt. In diesem Fall - wird die UID nur im interessantesten gelesenen Modus-Reading angezeigt. - Der interessanteste Modus ist der erste zutreffende Modus aus der Liste der Modi start, alarm, upcoming, end.
- - Die UID eines Serientermins wird nicht angezeigt, solange sich der Termin im Modus: modeEnd oder modeEnded befindet - und die Serie nicht beendet ist. Die UID befindet sich in einem der anderen mode... Readings. - Hieraus ergibts sich, das FHEM-Events nicht auf einem mode... Reading basieren sollten. - Weiter unten im Text gibt es hierzu eine Empfehlung.
-
-
- triggered
-
- Man kann sich darauf verlassen, dass alle Readings des Kalenders in einem konsistenten und aktuellen
- Zustand befinden, wenn dieses Event empfangen wird.
- - Wenn ein Termin geändert wurde, werden zwei FHEM-Events erzeugt:
-
- changed: UID <mode>
- <mode>: UID
-
- <mode> ist der aktuelle Modus des Termins nach der änderung. Bitte beachten: Im FHEM-Event befindet sich ein Doppelpunkt gefolgt von einem Leerzeichen.
- - FHEM-Events sollten nur auf den vorgenannten Events basieren und nicht auf FHEM-Events, die durch ändern eines mode... Readings ausgelöst werden. -
-
-
- Ein Plug-In ist ein kleines Perl-Programm, das Termine nebenher verändern kann.
- Das Perl-Programm arbeitet mit der Hash-Referenz $e.
- Die wichtigsten Elemente sind:
-
-
| code | Beschreibung |
|---|---|
| $e->{start} | Startzeit des Termins, in Sekunden seit 1.1.1970 |
| $e->{end} | Endezeit des Termins, in Sekunden seit 1.1.1970 |
| $e->{alarm} | Alarmzeit des Termins, in Sekunden seit 1.1.1970 |
| $e->{summary} | die Zusammenfassung (Betreff, Titel) des Termins |
| $e->{location} | Der Ort des Termins |
attr MyCalendar onCreateEvent { $e->{alarm}= $e->{start}-86400 if($e->{summary} =~ /Tonne/);; }attr MyCalendar onCreateEvent { $e->{end}= $e->{start}+86400 unless(defined($e->{end})) }
- get MyCalendar events format:full
- 2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom alarm 31.05.2012 17:00:00 07.06.2012 16:30:00-07.06.2012 18:00:00 Erna for coffee
- 992hydf4y44awer5466lhfdsrgl7tin6b6mckf8glmhui4googlecom upcoming 08.06.2012 00:00:00-09.06.2012 00:00:00 Vacation
- text 20 60 { fhem("get MyCalendar events timeFormat:'%d.%m.%Y %H:%M' format:custom='$T1 $S' filter:mode=~'alarm|start') }
- 07.06.12 16:30 Erna zum Kaffee
- 08.06.12 00:00 Urlaub
-
- get MyCalendar find .*Erna.*
- 2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom
-
- define ErnaComes notify MyCalendar:start:.2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom.* set MyLight on
-
- define LogErna notify MyCalendar:alarm:.2767324dsfretfvds7dsfn3e4dsa234r234sdfds6bh874googlecom.* { Log3 $NAME, 1, "ALARM name=$NAME event=$EVENT part1=$EVTPART0 part2=$EVTPART1" }
-
- define SwitchActorOn notify MyCalendar:start:.* { \
- my $reading="$EVTPART0";; \
- my $uid= "$EVTPART1";; \
- my $actor= fhem('get MyCalendar filter:uid=="'.$uid.'" format:custom="$S"');; \
- if(defined $actor) {
- fhem("set $actor on")
- } \
- }
- define SwitchActorOff notify MyCalendar:end:.* { \
- my $reading="$EVTPART0";; \
- my $uid= "$EVTPART1";; \
- my $actor= fhem('get MyCalendar filter:uid=="'.$uid.'" format:custom="$S"');; \
- if(defined $actor) {
- fhem("set $actor off")
- } \
- }
-
- define LogActors notify MyCalendar:(start|end):.*
- { my $reading= "$EVTPART0";; my $uid= "$EVTPART1";; \
- my $actor= fhem('get MyCalendar filter:uid=="'.$uid.'" format:custom="$S"');; \
- Log3 $NAME, 1, "Actor: $actor, Reading $reading" }
- GarbageCalendar beinhaltet alle Termine der
- Müllabholung mit der Art des Mülls innerhalb der Zusammenfassung (summary).
- Das folgende notify kann zur Benachrichtigung über die Müllabholung
- benutzt werden:
- define GarbageCollectionNotifier notify GarbageCalendar:alarm:.* { \
- my $uid= "$EVTPART1";; \
- my $summary= fhem('get GarbageCalendar events filter:uid=="'.$uid.'" format:custom="$S"');; \
- # e.g. mail $summary to someone \
- }
- attr GarbageCalendar onCreateEvent { $e->{alarm}= $e->{start}-86400 }
- { CalendarEventsAsHtml('GarbageCalendar','format:text filter:mode=~"alarm|start"') }
- CalendarAsHtml(<name>,<parameter>) liefert eine Liste von Kalendereinträgen als
- HTML zurück. <name> ist der Name des Kalender-Devices; <parameter>
- würdest Du nach get <name> text ... schreiben. Diese Funktion ist veraltert
- und sollte nicht mehr genutzt werden!.
- define MyCalendarWeblink weblink htmlCode { CalendarAsHtml("MyCalendar","next 3") }
- CalendarEventsAsHtml(<name>,<parameter>) liefert eine Liste von Kalender-Events
- zurück; zu name und parameters siehe oben.
- define MyCalendarWeblink weblink htmlCode
- { CalendarEventsAsHtml('F','format:custom="$T1 $D $S" timeFormat:"%d.%m" series:next=3') }
- -