Schau mal in die command ref auf der fhem seite:
at
Start an arbitrary
fhem.pl command at a later time.
Define
define <name> at <timespec> <command>
<timespec> format: [+][*{N}]<timedet>
The optional + indicates that the specification is relative(i.e. it
will be added
to the current time).
The optional * indicates that the command should be executed
repeatedly.
The optional {N} after the * indicates,that the command should be
repeated N-times
only.
<timedet> is either HH:MM, HH:MM:SS or {perlfunc()}, where
perlfunc must return a
HH:MM or HH:MM:SS date.
Examples:
# absolute ones:
define a1 at 17:00:00 set lamp on # fhem
command
define a2 at 17:00:00 { Log 1, "Teatime" } # Perl
command
define a3 at 17:00:00 "/bin/echo "Teatime" > /dev/console" #
shell command
define a4 at *17:00:00 set lamp on # every
day
# relative ones
define a5 at +00:00:10 set lamp on # switch on in
10 seconds
define a6 at +00:00:02 set lamp on-for-timer 1 # Blink once in
2 seconds
define a7 at +*{3}00:00:02 set lamp on-for-timer 1 # Blink 3 times
# Blink 3 times if the piri sends a command
define n1 notify piri:on.* define a8 at +*{3}00:00:02 set lamp
on-for-timer 1
# Switch the lamp on from sunset to 11 PM
define a9 at +*{sunset_rel()} set lamp on
define a10 at *23:00:00 set lamp off
# More elegant version, works for sunset > 23:00 too
define a11 at +*{sunset_rel()} set lamp on-till 23:00
# Only do this on weekend
define a12 at +*{sunset_rel()} { fhem("set lamp on-till 23:00")
if($we) }
# Switch lamp1 and lamp2 on from 7:00 till 10 minutes after sunrise
define a13 at *07:00 set lamp1,lamp2 on-till {sunrise(+600)}
# Switch the lamp off 2 minutes after sunrise each day
define a14 at +{sunrise(+120)} set lamp on
# Switch lamp1 on at sunset, not before 18:00 and not after 21:00
define a15 at *{sunset(0,"18:00","21:00")} set lamp1 on
Notes:
if no
* is specified, then a command will be executed only once, and then
the at
entry will be deleted. In this case the command will be saved to
the statefile (as
it considered volatile, i.e. entered by cronjob) and not to the
configfile (see the
save
command.)
if the current time is greater than the time specified, then the
command will be
executed tomorrow.
For even more complex date handling you either have to call fhem
from cron or filter
the date in a perl expression, see the last example and the section
Perl special
.
Set
N/A
Get
N/A
...
lG
Martin