Moin,
wie würdet ihr folgendes lösen:
Die Alarmanlage soll abgeschaltet werden, wenn ein bestimmtes Handy auftaucht, aber nur von 12:00 bis 14:00 Uhr
Die Alarmanlage gibt es schon als Gerät und läßt sich abschalten über:
set Alarmanlage off
Die Abfrage ob das Handy present ist, gibts auch schon mit Presence
Meine Herausforderung ist gerade die zeitliche Einschränkung.
Im Prinzip brauche ich ein device ALAutoSwitch notify handy:.present wenn (12Uhr bis 14Uhr){fhem(set Alarmanlage off);}
oder macht man das anders?
Danke
Hallo,
mit googeln von: ,,fhem schalten uhrzeit von bis" u.a. folgendes gefunden: https://forum.fhem.de/index.php?topic=10497.0 Und es gibt noch mehr Beispiele.
Off Topic: Warum müssen immer andere suchen!?
Gesendet von iPad mit Tapatalk
Grüße Jörg
Manchmal hilft es auch, mal in die commandref zu sehen:
Notify ist eine gute Bildschirmseite lang, und das Stichwort heißt: disabledForIntervals ;)
Trotzdem Danke!
Das sollte auch mit DOIF einfach hinzubekommen sein, etwa:
define ALAutoSwitch DOIF ([12:00-14:00] and [handy:".+present"]) (set Alarmanlage off)
Und bitte ggf. auf "gelöst" setzen...
LG,
Stephan.
Das werde ich bei Gelegenheit auch mal testen.
Es funktioniert bei mir jetzt so:
define SecsysAutoSwitchIPHONE notify PrIPhone:.ONLINE set Alarmanlage off ;; set SecsysAutoSwitchIPHONE inactive
define SecsysAutoSwitchIPHONE.ON at *12:00:00 {\
if (!$we) {\
fhem ("set SecsysAutoSwitchIPHONE active");;\
}\
}
define SecsysAutoSwitchIPHONE.OF at *15:00:00 {\
if (!$we) {\
fhem ("set SecsysAutoSwitchIPHONE inactive");;\
}\
}
Aber ich gebe zu mit DOIF sollte es schöner sein ;-)
Danke