Notify Problem (brauch mal einen Denkanstoß bitte)

Begonnen von Groej, 09 Februar 2019, 08:46:30

Vorheriges Thema - Nächstes Thema

Groej

Guten Morgen,

ich brauch bestimmt nur einen Denkanstoß weil ich den Wald vor lauter Bäumen nicht mehr sehe denke ich.

Ich habe ein Notify mit mehreren Auslösern. Füge ich das dritte Auslöse Device hinzu und einen IF Befehl dafür geht das Notify soweit bis auf das zuletzt hinzugefügte Device aber mit Fehlermeldung im LOG. Nehme ich dieses dritte Device und den Befehl dazu raus kommt keine Fehlermeldung mehr dazu im LOG. Mach ich daraus dann ein eigenständiges NOTIFY funktioniert es.

Hier ein List des Notify:

Internals:
   DEF        MQTT2_.*|heizung_wohnzi_stemp_dmy:.*|schlafzi_stehlampe:relay_state:.* {
if (($NAME eq "MQTT2_ESPClient_60_01_94_55_F7_8D") && ($EVENT eq "status: 0")) {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[2].b[4].val 0")}
if (($NAME eq "MQTT2_ESPClient_60_01_94_55_F7_8D") && ($EVENT eq "status: 1")) {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[2].b[4].val 1")}
if (($NAME eq "schlafzi_stehlampe") && ($EVTPART1 eq "1")) {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[5].b[4].val 1")}
if (($NAME eq "schlafzi_stehlampe") && ($EVTPART1 eq "0")) {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[5].b[4].val 0")}
if ($NAME eq "heizung_wohnzi_stemp_dmy") {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[2].b[14].txt \"$EVENT\"")}
}
   FUUID      5c574538-f33f-a55f-c294-947a14a8c6219699
   NAME       device_to_nextion_wohnzi_nf
   NOTIFYDEV  heizung_wohnzi_stemp_dmy,schlafzi_stehlampe,MQTT2_.*
   NR         35
   NTFY_ORDER 50-device_to_nextion_wohnzi_nf
   REGEXP     MQTT2_.*|heizung_wohnzi_stemp_dmy:.*|schlafzi_stehlampe:relay_state:.*
   STATE      2019-02-09 08:30:11
   TRIGGERTIME 1549697411.54725
   TYPE       notify
   READINGS:
     2019-02-09 08:29:18   state           active
Attributes:
   room       99_Notify



Es geht um das Device heizung_wohnzi_stemp_dmy:.*  mit dem Befehl if ($NAME eq "heizung_wohnzi_stemp_dmy") {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[2].b[14].txt \"$EVENT\"")}

Steht im Log folgendes:
ERROR evaluating my $TYPE='dummy';my $EVTPART0='10';my $EVENT='10';my $SELF='device_to_nextion_wohnzi_nf';my $NAME='heizung_wohnzi_stemp_dmy';{ if (($NAME eq "MQTT2_ESPClient_60_01_94_55_F7_8D") && ($EVENT eq "status: 0")) {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[2].b[4].val 0")} if (($NAME eq "MQTT2_ESPClient_60_01_94_55_F7_8D") && ($EVENT eq "status: 1")) {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[2].b[4].val 1")} if (($NAME eq "schlafzi_stehlampe") && ($EVTPART1 eq "1")) {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[5].b[4].val 1")} if (($NAME eq "schlafzi_stehlampe") && ($EVTPART1 eq "0")) {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[5].b[4].val 0")} if ($NAME eq "heizung_wohnzi_stemp_dmy") {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[2].b[14].txt \"$EVENT\"")} }: Global symbol "$EVTPART1" requires explicit package name (did you forget to declare "my $EVTPART1"?) at (eval 155618) line 4. Global symbol "$EVTPART1" requires explicit package name (did you forget to declare "my $EVTPART1"?) at (eval 155618) line 5.

Nehm ich die Sachen raus ist das Notify im LOG sauber. Mach ich dafür ein eigenes Notify geht es. Ich habs auch schon mit elsif probiert aber gleiche Fehlermeldung.

Hat wohl was mit EVTPART1 davor zu tun aber ich werde da nicht schlau draus weil es ohne den letzten Befehl ohne Fehlermeldung funktioniert ohne Probleme.

Danke fürs helfen.

Gruß

Jörg
FHEM - RaspPi2 - KNXD - KNX - CUL 868 - FS20 - HMS - WH3080 - Signalduino 433 MHz - Telegram - Anel Elektronik IP Steckdosen - BME280

CoolTux

Es gibt nun mal nicht immer ein $EVTPART1. Wenn ein Event nur aus einem Teil besteht, zum Beispiel bei einem state Event dann kommt nur ein EVTPART0 aber kein EVTPART1.
Du wirst um auf Nummer sicher gehen zu können Dein Event wohl selber zerlegen.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Groej

Danke für den Denkanstoß.

Hab es jetzt so gemacht.

Internals:
   DEF        MQTT2_.*|heizung_wohnzi_stemp_dmy:.*|schlafzi_stehlampe:relay_state:.* {
my $obi2 = ReadingsVal("MQTT2_ESPClient_60_01_94_55_F7_8D","status",99);
my $schlaf_stehl = ReadingsVal("schlafzi_stehlampe","relay_state",99);
my $wohn_tempsoll = ReadingsVal("heizung_wohnzi_stemp_dmy","state",99);
if ($NAME eq "MQTT2_ESPClient_60_01_94_55_F7_8D"){fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[2].b[4].val $obi2")}
if ($NAME eq "schlafzi_stehlampe") {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[5].b[4].val $schlaf_stehl")}
if ($NAME eq "heizung_wohnzi_stemp_dmy") {fhem ("set MQTT2_Server publish wohnung/4OG/nto_wohnzi/command/p[2].b[14].txt \"$wohn_tempsoll\"")}
}
   FUUID      5c574538-f33f-a55f-c294-947a14a8c6219699
   NAME       device_to_nextion_wohnzi_nf
   NOTIFYDEV  MQTT2_.*,schlafzi_stehlampe,heizung_wohnzi_stemp_dmy
   NR         35
   NTFY_ORDER 50-device_to_nextion_wohnzi_nf
   REGEXP     MQTT2_.*|heizung_wohnzi_stemp_dmy:.*|schlafzi_stehlampe:relay_state:.*
   STATE      2019-02-09 09:50:05
   TRIGGERTIME 1549702205.55521
   TYPE       notify
   READINGS:
     2019-02-09 09:48:11   state           active
Attributes:
   room       99_Notify


FHEM - RaspPi2 - KNXD - KNX - CUL 868 - FS20 - HMS - WH3080 - Signalduino 433 MHz - Telegram - Anel Elektronik IP Steckdosen - BME280