dummy notify funktioniert nicht immer

Begonnen von acw81, 06 März 2018, 17:18:56

Vorheriges Thema - Nächstes Thema

acw81

Hallo,

ich habe ein dummy Gerät


Internals:
   NAME       aut_beleuchtung_status
   NR         177
   STATE      off
   TYPE       dummy
   READINGS:
     2018-03-06 08:54:43   state           off
Attributes:
   group      Aut. Beleuchtung
   room       Esszimmer
   webCmd     on:off


welches per notify an oder aus geschaltet wird


(Bewohner.*|ez_Bewegungsmelder.*) {
  my $AutBeleuchtung = ReadingsVal("aut_beleuchtung_status","state","");
  my $HomeState = Value("Bewohner");
  my $luminance = ReadingsNum('ez_Bewegungsmelder','luminance','');
 
  if ( ($luminance < 10) && ($HomeState eq "home") && ($AutBeleuchtung eq "off")) {
fhem("set aut_beleuchtung_status on");
  }
  elsif ( (($HomeState eq "absent") || ($luminance > 25)) && ($AutBeleuchtung eq "on") ) {
    fhem("set aut_beleuchtung_status off");
  } 
}


Dieses notify setzt mir zuverlässig den state des dummys, aber das notify welches an diesem dummy hängt wird leider nicht sauber getriggert


aut_beleuchtung_status {
  fhem("set ez_ledband $EVENT");
  fhem("set fl_baum $EVENT"); 
}


Am Timestamp erkennt man das zwar der state von aut_beleuchtung_status richtig gesetzt, aber das notify nicht aufgerufen wird. Ich bin langsam am verzweifeln und finde den Fehler leider nicht. Ich kann mir auch nicht wirklich erklären wieso es teilweise funktioniert.

Sieht von euch jemand einen Fehler?

Grüße
Andreas

CoolTux

aut_beleuchtung_status {

so passt das ja auch nicht

aut_beleuchtung_status.* {

oder besser

aut_beleuchtung_status.(on|off) {
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

acw81

Hmm,

ich habe das notify mal auf


aut_beleuchtung_status.(on|off) {


abgeändert, aber das scheint nicht das Hauptproblem zu sein. Mein erstes Notify wurde am 2018-03-06 18:04:51 ausgelöst und der state von aut_beleuchtung_status steht auf on. Leider wurde das notiy welches am dummy hängt nicht getriggert und damit auch die zwei Lampen nicht eingeschaltet  :-\



CoolTux

mach mal bitte ein list vom dummy und vom notify welches auf den dummy triggert
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

acw81


Internals:
   NAME       aut_beleuchtung_status
   NR         177
   STATE      on
   TYPE       dummy
   CHANGED:
     on
   CHANGEDWITHSTATE:
   READINGS:
     2018-03-06 18:03:10   state           on
Attributes:
   group      Aut. Beleuchtung
   room       Esszimmer
   webCmd     on:off



Internals:
   DEF        aut_beleuchtung_status.(on|off) {
  fhem("set ez_ledband $EVENT");
  fhem("set fl_baum $EVENT"); 
}
   NAME       notify_AutBeleuchtung
   NR         178
   NTFY_ORDER 50-notify_AutBeleuchtung
   REGEXP     aut_beleuchtung_status.(on|off)
   STATE      2018-03-06 18:02:50
   TYPE       notify
   READINGS:
     2018-03-06 17:59:44   state           active
Attributes:
   group      Aut. Beleuchtung

CoolTux

Auf jeden Fall hat es geschalten
STATE      2018-03-06 18:02:50


Passt also
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

acw81

Müsste der Timestamp nicht noch neuer sein, da das dummy Gerät einen neueren state "on" hat?

2018-03-06 18:03:10   state           on

und ich ja in dem intialen notify den state und nicht den STATE mit setstate setze?

Bin etwas verwirrt  und weiß nur das es in der Praxis nicht sauber funktioniert ???

Teilweise passt es, ab meistens steht das Dummy dann auf on und die zwei eigentlichen Lampen auf off ...

CoolTux

Wie sieht es denn aus wenn du nur am Dummy on oder off schaltest? Springt das Notify dann immer an?
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

acw81

Also heute morgen hat das Einschalten funktioniert  8), aber beim Ausschalten ging nur das dummy auf off


Internals:
   NAME       aut_beleuchtung_status
   NR         177
   STATE      off
   TYPE       dummy
   CHANGED:
     off
   CHANGEDWITHSTATE:
   READINGS:
     2018-03-08 07:41:35   state           off
Attributes:
   group      Aut. Beleuchtung
   room       Esszimmer
   webCmd     on:off



Internals:
   DEF        aut_beleuchtung_status.(on|off) {
  fhem("Log 3, 'Notify aut_beleuchtung_status $EVENT'");
  fhem("set ez_ledband $EVENT");
  fhem("set fl_baum $EVENT"); 
}
   NAME       notify_AutBeleuchtung
   NR         178
   NTFY_ORDER 50-notify_AutBeleuchtung
   REGEXP     aut_beleuchtung_status.(on|off)
   STATE      2018-03-08 06:04:25
   TYPE       notify
   READINGS:
     2018-03-06 17:59:44   state           active
Attributes:
   group      Aut. Beleuchtung


Der State des notify ist noch vom Einschaltzeitpunkt  :-\

Manuelles schalten des DUMMYS scheint sehr zuverlässig zu funktionieren (habe ich gerade eben ein paar mal getestet). Kann es sein das die beiden notifys das Problem sind?


CoolTux

stell mal sowohl den dummy als auch das notify auf verbose 5. Interessant ist auch ob im Eventmonitor ein Event kommt und wie der aus schaut.
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

acw81

Szenario war folgendes:

1. das DUMMY Gerät war an und die beiden Lampen waren aus
2. Ich schalte das DUMMY Gerät händisch aus, damit es über mein erstes notify wieder angeschaltet wird

Logfile

2018.03.09 07:21:02.340 4: dummy set aut_beleuchtung_status off
2018.03.09 07:21:02.343 5: Triggering notify_AutBeleuchtung
2018.03.09 07:21:02.343 4: notify_AutBeleuchtung exec {
  fhem("set ez_ledband $EVENT");;
  fhem("set fl_baum $EVENT");; 
}
2018.03.09 07:21:02.345 3: nanoCUL IT_set: ez_ledband on
2018.03.09 07:21:02.870 3: nanoCUL IT_set: fl_baum on
2018.03.09 07:21:03.395 5: Triggering notify_AutBeleuchtung
2018.03.09 07:21:03.395 4: notify_AutBeleuchtung exec {
  fhem("set ez_ledband $EVENT");;
  fhem("set fl_baum $EVENT");; 
}
2018.03.09 07:21:03.397 3: nanoCUL IT_set: ez_ledband off
2018.03.09 07:21:03.922 3: nanoCUL IT_set: fl_baum off
2018.03.09 07:21:31.549 4: dummy set aut_beleuchtung_status on



Eventmonitor

2018-03-09 07:21:02.350 IT ez_ledband on
2018-03-09 07:21:02.869 CUL nanoCUL raw: is00111100100101100000000000010011
2018-03-09 07:21:02.875 IT fl_baum on
2018-03-09 07:21:03.394 CUL nanoCUL raw: is00111100100101100000000000010010
2018-03-09 07:21:03.402 IT ez_ledband off
2018-03-09 07:21:03.921 CUL nanoCUL raw: is00111100100101100000000000000011
2018-03-09 07:21:03.926 IT fl_baum off
2018-03-09 07:21:04.446 CUL nanoCUL raw: is00111100100101100000000000000010
2018-03-09 07:21:04.448 dummy aut_beleuchtung_status on
2018-03-09 07:21:04.448 dummy aut_beleuchtung_status off
2018-03-09 07:21:31.559 ZWave ez_Bewegungsmelder alarm_HomeSecurity: Motion Detection - Unknown Location, notificationIsOn
2018-03-09 07:21:31.559 ZWave ez_Bewegungsmelder ja


Das Problem mit falschen Zuständen hatte ich auch schon einmal mit meinem ZWave Switch, welches ich nun mangels Zeit nicht weiter verfolgt habe.

https://forum.fhem.de/index.php/topic,65842.msg622228.html#msg622228


Das sieht auf den ersten Blick auch so aus, als ob der letzte Event im o.a. Szenario verschluckt wird und dann anscheinend erst beim nächsten Event mit ausgelöst wird. Aber wieso tauchen die Schaltvorgänge der Lampen vor dem DUMMY auf?


CoolTux

Sorry aber damit kann ich nichts anfangen.
Die Zeiten beider Logs sind unterschiedlich. Event passt nicht zu log. Wenn im Eventmon ein on kommt muss zur selben zeit das auch im Log zu sehen sein und umgekehrt.


Stelle alles auf off.


Dann schalte den dummy auf on und ab da brauche ich eventausgabe und log
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

acw81

Hallo CoolTux,

tut mir leider aber da war sonst nichts im Log bzw. Eventmonitor. Ich kann mir wie gesagt dieses komische Verhalten bisher auch nicht erklären  :-\

Hier nochmal Log und Eventmonitor vom Auschalten (da taucht im Eventmonitor auch kein off auf)

Log (ungeschnitten seit heute morgen 7 Uhr)

2018.03.09 07:00:04.651 1: hwr_MasterSchalter: Error, no send_nonce to decrypt message available
2018.03.09 07:00:06.436 2: ZWDongle_ProcessSendStack: no ACK, resending message 01110013110a98801cc26065e650fd0d257137
2018.03.09 07:00:08.404 2: ZWDongle_ProcessSendStack: no ACK, resending message 01110013110a98809e06f3463e508b38257259
2018.03.09 07:03:36.360 2: ZWDongle_ProcessSendStack: no ACK, resending message 01110013110a9880de184c4fa66436e725737e
2018.03.09 07:03:37.269 2: ZWDongle_ProcessSendStack: no ACK, resending message 01110013110a9880cfc37dcaf8546aa7257475
2018.03.09 07:17:54.258 2: ROOMMATE set rr_Christiane absent
2018.03.09 07:21:00.235 1: No Logdevice FileLog_CUL_FHTTK_7fbb7f
2018.03.09 07:21:00.284 1: No Logdevice FileLog_CUL_TX_0
2018.03.09 07:21:00.291 4: FileLog_fl_danalock get: Input file ./log/fl_danalock-2018.log, from:2018-03-09_00:00:00  to:2018-03-10_00:01:59
2018.03.09 07:21:00.292 4: FileLog_fl_danalock get: line 1, regexp:fl_danalock.alarm, col:2, output lines:1
2018.03.09 07:21:02.340 4: dummy set aut_beleuchtung_status off
2018.03.09 07:21:02.343 5: Triggering notify_AutBeleuchtung
2018.03.09 07:21:02.343 4: notify_AutBeleuchtung exec {
  fhem("set ez_ledband $EVENT");;
  fhem("set fl_baum $EVENT");; 
}
2018.03.09 07:21:02.345 3: nanoCUL IT_set: ez_ledband on
2018.03.09 07:21:02.870 3: nanoCUL IT_set: fl_baum on
2018.03.09 07:21:03.395 5: Triggering notify_AutBeleuchtung
2018.03.09 07:21:03.395 4: notify_AutBeleuchtung exec {
  fhem("set ez_ledband $EVENT");;
  fhem("set fl_baum $EVENT");; 
}
2018.03.09 07:21:03.397 3: nanoCUL IT_set: ez_ledband off
2018.03.09 07:21:03.922 3: nanoCUL IT_set: fl_baum off
2018.03.09 07:21:19.109 4: FileLog_fl_danalock get: Input file ./log/fl_danalock-2018.log, from:2018-03-09_00:00:00  to:2018-03-10_00:01:59
2018.03.09 07:21:19.110 4: FileLog_fl_danalock get: line 1, regexp:fl_danalock.alarm, col:2, output lines:1
2018.03.09 07:21:19.123 1: No Logdevice FileLog_CUL_FHTTK_7fbb7f
2018.03.09 07:21:19.156 1: No Logdevice FileLog_CUL_TX_0
2018.03.09 07:21:31.549 4: dummy set aut_beleuchtung_status on
2018.03.09 07:52:19.864 3: ABFALL Abfalltermine - CALENDAR:Familienkalender triggered, updating ABFALL Abfalltermine ...
2018.03.09 07:52:39.603 3: UWZ Unwetterzentrale: Run.1043 Done fetching data
2018.03.09 08:09:36.777 2: ZWDongle_ProcessSendStack: no ACK, resending message 01110013110a988042fdd7906a7bec20257f81
2018.03.09 08:16:09.864 4: dummy set aut_beleuchtung_status off
2018.03.09 08:45:00.033 3: ABFALL Abfalltermine - CALENDAR:Familienkalender triggered, updating ABFALL Abfalltermine ...
2018.03.09 08:52:21.096 3: ABFALL Abfalltermine - CALENDAR:Familienkalender triggered, updating ABFALL Abfalltermine ...
2018.03.09 08:52:39.770 3: UWZ Unwetterzentrale: Run.1043 Done fetching data


Eventmonitor (nur der Auszug vom Auschaltzeitpunkt 8:16 Uhr)

2018-03-09 08:15:58.432 Unifi ak_accesspoint oneplus_last_seen: 2018-03-09 08:15:51
2018-03-09 08:15:58.432 Unifi ak_accesspoint -AP_penny_utilizationNG: 20
2018-03-09 08:16:09.258 Unifi ak_accesspoint ftui_last_seen: 2018-03-09 08:16:02
2018-03-09 08:16:09.258 Unifi ak_accesspoint IPCAM_last_seen: 2018-03-09 08:16:02
2018-03-09 08:16:09.258 Unifi ak_accesspoint ChristileWagner_last_seen: 2018-03-09 08:16:02
2018-03-09 08:16:09.258 Unifi ak_accesspoint stuart_last_seen: 2018-03-09 08:16:02
2018-03-09 08:16:09.258 Unifi ak_accesspoint Google-Home_last_seen: 2018-03-09 08:16:02
2018-03-09 08:16:09.258 Unifi ak_accesspoint note_last_seen: 2018-03-09 08:16:02
2018-03-09 08:16:09.258 Unifi ak_accesspoint oneplus_last_seen: 2018-03-09 08:16:02
2018-03-09 08:16:09.258 Unifi ak_accesspoint -AP_penny_utilizationNG: 16
2018-03-09 08:16:09.872 ZWave ez_Bewegungsmelder luminance: 34 Lux
2018-03-09 08:16:09.872 ZWave ez_Bewegungsmelder nein
2018-03-09 08:16:31.223 Unifi ak_accesspoint ftui_last_seen: 2018-03-09 08:16:28
2018-03-09 08:16:31.223 Unifi ak_accesspoint IPCAM_last_seen: 2018-03-09 08:16:28
2018-03-09 08:16:31.223 Unifi ak_accesspoint ChristileWagner_last_seen: 2018-03-09 08:16:28
2018-03-09 08:16:31.223 Unifi ak_accesspoint stuart_last_seen: 2018-03-09 08:16:28
2018-03-09 08:16:31.223 Unifi ak_accesspoint Google-Home_last_seen: 2018-03-09 08:16:28
2018-03-09 08:16:31.223 Unifi ak_accesspoint note_last_seen: 2018-03-09 08:16:28
2018-03-09 08:16:31.223 Unifi ak_accesspoint oneplus_last_seen: 2018-03-09 08:16:28
2018-03-09 08:16:31.223 Unifi ak_accesspoint -AP_penny_utilizationNG: 18
2018-03-09 08:16:42.273 Unifi ak_accesspoint ftui_last_seen: 2018-03-09 08:16:40
2018-03-09 08:16:42.273 Unifi ak_accesspoint IPCAM_last_seen: 2018-03-09 08:16:40
2018-03-09 08:16:42.273 Unifi ak_accesspoint ChristileWagner_last_seen: 2018-03-09 08:16:40
2018-03-09 08:16:42.273 Unifi ak_accesspoint stuart_last_seen: 2018-03-09 08:16:40
2018-03-09 08:16:42.273 Unifi ak_accesspoint Google-Home_last_seen: 2018-03-09 08:16:40
2018-03-09 08:16:42.273 Unifi ak_accesspoint note_last_seen: 2018-03-09 08:16:40
2018-03-09 08:16:42.273 Unifi ak_accesspoint oneplus_last_seen: 2018-03-09 08:16:40
2018-03-09 08:16:42.273 Unifi ak_accesspoint -AP_penny_utilizationNG: 19
2018-03-09 08:16:55.402 ROOMMATE rr_Andreas durTimerPresence_cr: 2138
2018-03-09 08:16:55.402 ROOMMATE rr_Andreas durTimerPresence: 35:37:44
2018-03-09 08:16:55.412 ROOMMATE rr_Kevin durTimerPresence_cr: 5273
2018-03-09 08:16:55.412 ROOMMATE rr_Kevin durTimerPresence: 87:52:48
2018-03-09 08:16:55.420 ROOMMATE rr_Christiane durTimerAbsence_cr: 59
2018-03-09 08:16:55.420 ROOMMATE rr_Christiane durTimerAbsence: 00:59:01
2018-03-09 08:16:55.445 RESIDENTS Bewohner durTimerPresence_cr: 5273
2018-03-09 08:16:55.445 RESIDENTS Bewohner durTimerPresence: 87:52:48
2018-03-09 08:16:56.452 SYSMON sysmon starttime_text: 04.03.2018 08:27:48
2018-03-09 08:16:56.452 SYSMON sysmon uptime_text: 4 days, 23 hours, 49 minutes
2018-03-09 08:16:56.452 SYSMON sysmon fhemuptime_text: 2 days, 14 hours, 24 minutes
2018-03-09 08:16:56.452 SYSMON sysmon uptime: 431346
2018-03-09 08:16:56.452 SYSMON sysmon starttime: 1520148468
2018-03-09 08:16:56.452 SYSMON sysmon idletime: 365362 84.70 %
2018-03-09 08:16:56.452 SYSMON sysmon fhemuptime: 224690
2018-03-09 08:16:56.452 SYSMON sysmon idletime_text: 4 days, 05 hours, 29 minutes (84.70 %)

CoolTux

Sorry aber da bin ich gerade über fragt. Ich versuche später mal Deinen Dummy nach zu stellen.
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

CoolTux

Also ich habe das mal mit Dummys nachgestellt.
Mal davon ab das das hier

fhem("Log 3, 'Notify aut_beleuchtung_status $EVENT'");

Unsinn ist, scheinst aber nicht mehr drin zu haben, funktioniert alles.

Bleibt die Frage wie das bei Dir nicht geht.
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