watchdog für Anwesenheit auf DOIF umstellen.

Begonnen von yogiflop, 11 Januar 2016, 15:26:52

Vorheriges Thema - Nächstes Thema

yogiflop

Moin,

ich habe da mal wieder ein Problem und finde gerade nicht wirklich einen Ansatz. Das könnte daran liegen, das ich wahrscheinlich von Anfang an die Funktionsweise des Modules watchdog nicht verstanden habe.
Deswegen aber nun auch der Grund, warum ich es umstellen möchte.

Momentan habe ich zwei watchdog laufen.


define handy.struc.wd.niemand watchdog handy.struc:absent 00:10 handy.struc:present set whg.jemand.dum off ;; setstate handy.struc.wd.jemand defined
attr handy.struc.wd.niemand alias Überwachung zum verlassen des Hauses
attr handy.struc.wd.niemand regexp1WontReactivate 1
attr handy.struc.wd.niemand room Timer

define handy.struc.wd.jemand watchdog handy.struc:present 00:00 handy.struc:absent set whg.jemand.dum on ;; setstate handy.struc.wd.niemand defined
attr handy.struc.wd.jemand alias Überwachung beim betreten des Hauses
attr handy.struc.wd.jemand regexp1WontReactivate 1
attr handy.struc.wd.jemand room Timer


Das würde ich nun gerne mit DOIF realisieren.


define handy.struc.doif DOIF ([handy.struc] eq "absent") (set whg.jemand.dum off)\
DOELSEIF ([handy.struc] eq "present") (set whg.jemand.dum on)


Ich denke mal, das der Ansatz so nicht verkehrt ist und ich die "setstate" ja nicht mehr brauche. Wie bekomme ich nun hin, das er erst nach 10 Minuten "absent" "whg.jemand.dum" auf off setzt, aber bei present sofort wieder auf on?

mfg
Marc
CubieTruck mit FHEM 5.7
433MHz, 868MHz HMLan
div. Baumarktsteckdosen, 3x HM
div. MiLight's

Otto123

#1
Hallo Marc,

Du nimmst einfach das Attribute wait. In meiner DEF steht:
([PersonD1] eq "absent") (set PersonD1da 0) DOELSEIF ([PersonD1] eq "present") (set PersonD1da 1)
und wait ist gesetzt. Damit kann der Status absent innerhalb von wait beliebig oft wechseln. Ich habe damit, so wie auch Du in Deinem Ansatz, gleich noch "Ich bin wieder da" gemacht, da hatte ich bisher ein extra notify. D.h. der zweite Teil wird sofort ausgeführt.

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

yogiflop

Zitat von: Otto123 am 11 Januar 2016, 16:32:42
Hallo Marc,

Du nimmst einfach das Attribute wait. In meiner DEF steht:
([PersonD1] eq "absent") (set PersonD1da 0) DOELSEIF ([PersonD1] eq "present") (set PersonD1da 1)
und wait ist gesetzt. Damit kann der Status absent innerhalb von wait beliebig oft wechseln. Ich habe damit, so wie auch Du in Deinem Ansatz, gleich noch "Ich bin wieder da" gemacht, da hatte ich bisher ein extra notify. D.h. der zweite Teil wird sofort ausgeführt.

Gruß Otto

Ich danke dir.
Habe es mit wait realisiert, wußte bis dato nicht, das ich es auch so einstellen kann, das es nur auf einen Teil wirkt.


define handy.struc.doif DOIF ([handy.struc] eq "absent" and [zuhause.dum] ne "ja") (set whg.jemand.dum off) \
DOELSEIF ([handy.struc] eq "present" or [zuhause.dum] eq "ja") (set fl.fb.tab3 off, set whg.jemand.dum on)
attr handy.struc.doif alias DOIF für Anwesenheitssteuerung
attr handy.struc.doif group DOIF
attr handy.struc.doif room Timer
attr handy.struc.doif wait 600:0


nun wird 10 Minuten nach verlassen cmd1 ausgeführt und direkt beim zurückkehren cmd2
CubieTruck mit FHEM 5.7
433MHz, 868MHz HMLan
div. Baumarktsteckdosen, 3x HM
div. MiLight's

chq

Und was passiert, wenn jmd. nach sieben Minuten schon wieder zurückkommt?

Und was passiert, wenn jmd. nach sieben Minuten schon wieder zurückkommt und gleich wieder geht?

Gruß Chris
So einfach wie möglich, so kompliziert wie nötig

Per

Noch leichter:

define whg.jemand.dum DOIF ([handy.struc] eq "absent")
DOELSEIF ([handy.struc] eq "present")
attr whg.jemand.dum cmdState off|on