fbmail zeitversetzt ausführen

Begonnen von Terabyte, 18 Mai 2013, 08:48:14

Vorheriges Thema - Nächstes Thema

Terabyte

Ist es prinzipiell nicht möglich mittels "at" den watchdog auf defined zu setzen?

Fehlermeldung hab ich aber keine im Log

MisterEltako

define wdog_weg watchdog MAX:on 00:00:30 Max:off {\
if ((Value("Handy") eq "off") && (Value("ALARM1") eq "on")) {\
fb_mail('xxxx@gmail.com','ALARM','Eingangstuer ist offen');;\
}}


define ALARM_OFF at +*00:01:00 {\
  if ((( Value("Handy1") eq "present") || (Value("Handy2") eq "present")) && (Value("ALARM") eq "on")) {\
        fhem("set ALARM off ;; setstate wdog_weg defined");;\
    }\
}



funktioniert bei mir im Test....


MfG, MisterEltako.
HMLAN-Konfigurations-Adapter, HM-Funkjalousieaktor/HM-Dimmaktor/HM-Schaltaktor f. Markenschalter, Jalousie-/Schaltaktor von Eltako, FT4 v. Eltako, TCM310

Terabyte


Terabyte

Hallo

Hab ich nun getestet. Eine Kleinigkeit funktioniert leider noch nicht.

Und zwar bleibt bei der Alarmmeldung anscheinend der Status des "ALARM" Dummy Schalter unberücksichtigt.


define Alarmmeldung1 watchdog MAX_060f08:opened 00:01:30 Handy1&Handy2:present {\
if ((Value("Handy1") eq "absent" && Value("Handy2") eq "absent") && (Value("ALARM") eq "on")) {\
fb_mail('xxxx@gmail.com','ALARM','Eingangstuer ist offen');;\
fhem("setstate Alarmmeldung1 defined")}}


Wenn Handy1 oder 2 als anwesend registriert werden dann funktioniert alles wie gewollt. Weiters wird mit dieser Anwesenheit der ALARM Dummy auf off gestellt.

Ist nun aber bereits eines der beiden Handy´s anwesend und der Alarm bereits off und das 2. Handy "kommt", dann wird die Alarmmeldung1 erneut komplett durchlaufen.

Negativ dabei: Dieser Alarmmeldung1 watchdog bleibt dann auf triggered, weil ja durch das ALARM_OFF vom 1. Handy, der Alarmmeldung1 watchdog auf defined gesetzt wurde, wird er beim 2. dann nicht mehr gesetzt weil ja der ALARM Dummy bereits off ist.


Als Workaround könnte ich jetzt beim ALARM_OFF die Abfrage rausnehmen ob der ALARM Dummy auf "on" steht. Dies müsste ja bewirken, dass das ALARM_OFF dann immer ausgeführt wird und die Alarmmeldung1 auf defined setzt.


Aber rein aus Interesse, würde mich interessieren warum der ALARM Dummy Status nicht berücksichtigt wird bei der Alarmmeldung


Puschel74

Hallo,

nur weil ich selbst schon drüber gestolpert bin ...
Steht den on und off im STATE (also nicht im state)
Value fragt nämlich STATE ab.

Grüße
Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.

Terabyte

Hallo

Meinst du das hier auf dem Bild?
Wenn ja, das wäre doch STATE?


Puschel74

Hallo,

ja genau das meinte ich.

Das wird durch Value abgefragt - ok ist bei dir on und off.
Dann zieh ich mich mal wieder unwissend zurück und lese weiterhin nur mit.
Sorry das ich nicht mehr helfen konnte.

Grüße
Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.

Terabyte

Hallo

Klar hast du mir geholfen. Zwar leider nicht zur Lösung aber zumindest eine Fehlerquelle ausgeschlossen :)

Also auch Danke hierfür :)

MisterEltako

Baue doch einfach eine Logabfrage ein

...
my $Test;;\
Log 3, "ALARM-Value: $Test;;\
...

Dann siehst du ja, was ausgewertet wird.

MfG, MisterEltako.
HMLAN-Konfigurations-Adapter, HM-Funkjalousieaktor/HM-Dimmaktor/HM-Schaltaktor f. Markenschalter, Jalousie-/Schaltaktor von Eltako, FT4 v. Eltako, TCM310

Terabyte

Du meinst so?


define Alarmmeldung1 watchdog MAX_060f08:opened 00:01:30 Handy1&Handy2:present {\
if ((Value("Handy1") eq "absent" && Value("Handy2") eq "absent") && (Value("ALARM") eq "on")) {\
fb_mail('xxxx@gmail.com','ALARM','Eingangstuer ist offen');;\
fhem("setstate Alarmmeldung1 defined")
my $Test;;\
Log 3, "ALARM-Value: $Test;;\}}

MisterEltako

Bitte so versuchen:

define Alarmmeldung1 watchdog MAX_060f08:opened 00:01:30 Handy1&Handy2:present {\
       my $Test = Value("ALARM");;\
       Log 3, "ALARM-Value: $Test;;\
       if ( (Value("Handy1") eq "absent") && (Value("Handy2") eq "absent") ) {\
            if (Value("ALARM") eq "on") {\
               fb_mail([email]'xxxx@gmail.com'[/email],'ALARM','Eingangstuer ist offen');;\
               fhem("setstate Alarmmeldung1 defined");;\
            } else { fhem("setstate Alarmmeldung1 triggered");;\
            }
       }
}


MfG, MisterEltako
HMLAN-Konfigurations-Adapter, HM-Funkjalousieaktor/HM-Dimmaktor/HM-Schaltaktor f. Markenschalter, Jalousie-/Schaltaktor von Eltako, FT4 v. Eltako, TCM310

Terabyte

Hallo

Das ist nun die Ausgabe:


2013.06.10 14:36:01 3: Watchdog Alarmmeldung1 triggered
Bareword found where operator expected at (eval 146821) line 1, near ""ALARM-Value: $Test;        if ( (Value("Handy1"
(Missing operator before Handy1?)
String found where operator expected at (eval 146821) line 1, near "Handy1") eq ""
Bareword found where operator expected at (eval 146821) line 1, near "") eq "absent"
(Missing operator before absent?)
String found where operator expected at (eval 146821) line 1, near "absent") && (Value(""
Bareword found where operator expected at (eval 146821) line 1, near "") && (Value("Handy2"
(Missing operator before Handy2?)
String found where operator expected at (eval 146821) line 1, near "Handy2") eq ""
Bareword found where operator expected at (eval 146821) line 1, near "") eq "absent"
(Missing operator before absent?)
String found where operator expected at (eval 146821) line 1, near "absent") ) {             if (Value(""
Bareword found where operator expected at (eval 146821) line 1, near "") ) {             if (Value("ALARM"
(Missing operator before ALARM?)
String found where operator expected at (eval 146821) line 1, near "ALARM") eq ""
Bareword found where operator expected at (eval 146821) line 1, near "") eq "on"
(Missing operator before on?)
String found where operator expected at (eval 146821) line 1, near "on") {                fb_mail('xxxx@gmail.com','ALARM','Eingangstuer ist offen');                fhem(""
Bareword found where operator expected at (eval 146821) line 1, near "");             } else { fhem("setstate"
(Missing operator before setstate?)
String found where operator expected at (eval 146821) line 1, at end of line
(Missing semicolon on previous line?)
2013.06.10 14:36:01 3: Can't find string terminator '"' anywhere before EOF at (eval 146821) line 1.

Puschel74

Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.

Terabyte


Puschel74

Hallo,

mit den " verhält es sich so wie mit den ( und {.
Es gehören immer 2 zusammen.
In diesem Fall fehlt hier
ZitatLog 3, "ALARM-Value: $Test;;\
noch eines.

Da ich die Log-Zeile aber anders schreibe als MisterEltako hier mal meine Lösung
Log 3,("ALARM-Value: ".$Test);;\

Grüße

P.S.: Schön langsam wird es aber mal Zeit das Einsteiger.pdf durchzulesen und auch mal im Wiki zu stöbern.
Dort hat es jede Menge solcher Beispiele.
Zotac BI323 als Server mit DBLog
CUNO für FHT80B, 3 HM-Lan per vCCU, RasPi mit CUL433 für Somfy-Rollo (F2F), RasPi mit I2C(LM75) (F2F), RasPi für Panstamp+Vegetronix +SONOS(F2F)
Ich beantworte keine Supportanfragen per PM! Bitte im Forum suchen oder einen Beitrag erstellen.