hallo,
ich habe schon des längeren mittels 99_SUNRISE_EL.pm, sunset_rel() und
fs20_holidays.sh eine anwesenheitssimulation realisiert.
das ganze funktioniert so (auszug):
# Anwesendheitssimulation
define AWAY.dum dummy
# FS20S4A-2 4 Kanal Wandsender
# Taste 01/02
define EG.fl.WS.01.01.n1 notify EG.fl.WS.01.01:off set AWAY.dum off
define EG.fl.WS.01.01.n2 notify EG.fl.WS.01.01:dimdown AWAY.dum off
define EG.fl.WS.01.01.n3 notify EG.fl.WS.01.01:on set AWAY.dum on
define EG.fl.WS.01.01.n4 notify EG.fl.WS.01.01:dimup set AWAY.dum on
# Abwesenheitsschaltung
define AWAY.dum.not.01 notify .*AWAY.dum:.*on define at.AWAY at
+*{sunset_rel()} "/usr/local/bin/fs20_holidays.sh"
define AWAY.dum.not.03 notify .*AWAY.dum:.*off delete at.AWAY,at.random.*
also auf deutsch:
wird am wandsender die taste "1" gedrückt, wird AWAY.dum auf off gesetzt und
über das notify alle zufälligen schaltzeiten gelöscht.
wird am wandsender die taste "2" gedrückt, wird AWAY.dum auf on gesetzt und
über das notify das fs20_holiday.sh um sunset_rel() gestartet.
heute fiel mir dabei auf:
wenn AWAY.dum auf on gesetzt wird und die aktuelle uhrzeit bereits _nach_
sunset_rel() ist, dann wird der at.AWAY erst am nächsten tag ausgeführt.
wenn AWAY.dum auf on gesetzt wird und die aktuelle uhrzeit liegt _vor_
sunset_rel(), dann wird der at.AWAY am selben tag ausgeführt.
wie bringe ich dem obigen AWAY.dum.not.01 nun das richtige verhalten bei? also
wenn die aktuelle uhrzeit bereits _nach_ der sunset_rel() ist, starte das
skript trotzdem?
gruß martin
--
You received this message because you are subscribed to the Google Groups "FHEM users" group.
To post to this group, send email to fhem-users@googlegroups.com.
To unsubscribe from this group, send email to fhem-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fhem-users?hl=en.
> define AWAY.dum.not.01 notify .*AWAY.dum:.*on define at.AWAY at
> +*{sunset_rel()} "/usr/local/bin/fs20_holidays.sh"
Mir faellt nur ein langer "7-Zeiler" dazu ein (nicht getestet):
define AWAY.dum.not.01 notify .*AWAY.dum:.*on {\
if("$hour:$min:$sec" -gt sunset_abs()) {\
system("/usr/local/bin/fs20_holidays.sh &")\
} else {\
fhem('define at.AWAY at +*{sunset_rel()} "/usr/local/bin/fs20_holidays.sh"')\
}\
}
--
You received this message because you are subscribed to the Google Groups "FHEM users" group.
To post to this group, send email to fhem-users@googlegroups.com.
To unsubscribe from this group, send email to fhem-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fhem-users?hl=en.
Am Donnerstag 24 Dezember 2009 schrieb Rudolf Koenig:
> > define AWAY.dum.not.01 notify .*AWAY.dum:.*on define at.AWAY at
> > +*{sunset_rel()} "/usr/local/bin/fs20_holidays.sh"
>
> Mir faellt nur ein langer "7-Zeiler" dazu ein (nicht getestet):
>
> define AWAY.dum.not.01 notify .*AWAY.dum:.*on {\
> if("$hour:$min:$sec" -gt sunset_abs()) {\
> system("/usr/local/bin/fs20_holidays.sh &")\
> } else {\
> fhem('define at.AWAY at +*{sunset_rel()}
> "/usr/local/bin/fs20_holidays.sh"')\ }\
> }
erst hatte ich auch überlegt, das so ähnlich zu machen. hatte mich dann aber
gefragt ob es eine einfachere variante gibt. zwischenzeitlich hatte ich mich
dazu entschieden, den neuen define nach 10 sekunden auszuführen und dem script
{sunset_rel()} zu übergeben. dann sollte sich das script selber drum kümmern.
lieft soweit auch, aber dann dachte ich mir, vielleicht gibt es ja doch noch
die angestrebte einfachere methode direkt in der config. aber dein beispiel
zeigt, das es eigentlich nur den weg gibt.
ich denke, ich werde deine variante nehmen, da man dann in der config auch
sieht, was wann passiert.
danke rudi!
--
You received this message because you are subscribed to the Google Groups "FHEM users" group.
To post to this group, send email to fhem-users@googlegroups.com.
To unsubscribe from this group, send email to fhem-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fhem-users?hl=en.
Am Donnerstag 24 Dezember 2009 schrieb Rudolf Koenig:
> Mir faellt nur ein langer "7-Zeiler" dazu ein (nicht getestet):
>
> define AWAY.dum.not.01 notify .*AWAY.dum:.*on {\
> if("$hour:$min:$sec" -gt sunset_abs()) {\
> system("/usr/local/bin/fs20_holidays.sh &")\
> } else {\
> fhem('define at.AWAY at +*{sunset_rel()}
> "/usr/local/bin/fs20_holidays.sh"')\ }\
> }
hab da über dein 7-zeiler nochmal nachgedacht:
im ersten fall ("aktuelle zeit" gt sunset_abs()) fehlt dann aber trotzdem noch
ein define, da sonst das script ja nur einmal ausgeführt wird.
der zweite fall würde sich richtig verhalten:
timer in zukunft definiert, ausführen, verschwunden, gleich wieder einen neuen
für den nächsten tag anlegen.
richtig müsste es dann heissen:
define AWAY.dum.not.01 notify .*AWAY.dum:.*on {\
if("$hour:$min:$sec" gt sunset_abs()) {\
system("/usr/local/bin/fs20_holidays.sh &")\
fhem('define at.AWAY at +*{sunset_rel()}
"/usr/local/bin/fs20_holidays.sh"')\
} else {\
fhem('define at.AWAY at +*{sunset_rel()}
"/usr/local/bin/fs20_holidays.sh"')\
}\
}
gruß martin
--
You received this message because you are subscribed to the Google Groups "FHEM users" group.
To post to this group, send email to fhem-users@googlegroups.com.
To unsubscribe from this group, send email to fhem-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fhem-users?hl=en.