FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: noesberger am 15 März 2014, 17:09:01

Titel: Notify Befehl wird doppelt ausgeführt
Beitrag von: noesberger am 15 März 2014, 17:09:01
Hallo zusammen

Ich bin gerade am testen mit einem Tür-Sensor und einem Gong.
Ich möchte für den Anfang nur, dass wenn ich die Tür öffne, der Gong ertönt.

define eingang_tuer CUL_HM 24CB7D
define gong_Sound CUL_HM 20811F02
mit diversen Attributen.

Danach habe ich folgenden Notify eingerichtet.
define eingang_tuer_Notify notify eingang_tuer { if ( Value("eingang_tuer") eq "open") {fhem("set gong_Sound on")} }
oder auch mit OldValue:
define eingang_tuer_Notify notify eingang_tuer { if ( Value("eingang_tuer") eq "open" && OldValue("eingang_tuer") ne "open") {fhem("set gong_Sound on")} }

Aber im Log wird der Befehl beim öffnen der Tür immer zweimal ausgeführt.
2014.03.15 16:54:43 2: CUL_HM set gong_Sound on
2014.03.15 16:54:43 2: CUL_HM set gong_Sound on
2014.03.15 16:54:53 3: CUL_HM eingang_signal repeat, level 00 instead of C8
2014.03.15 16:55:02 3: CUL_HM eingang_signal repeat, level 00 instead of C8

Was mache ich da falsch?
Titel: Antw:Notify Befehl wird doppelt ausgeführt
Beitrag von: streetworker am 15 März 2014, 17:14:46
Hi,

welche Events stehen denn im Eventlog, wenn die Tür geöffnet wird?

Ich würde eher nicht auf den Status open sondern auf den Event eingang_tuer:open triggern

sinngemäß:   define handler notify eingang_tuer:open {...}

//sw
Titel: Antw:Notify Befehl wird doppelt ausgeführt
Beitrag von: noesberger am 16 März 2014, 11:18:45
Danke für deine Antwort.

Folgende Events werden angezeigt:
2014-03-15 17:17:47 CUL_HM gong_Sound set_on
2014-03-15 17:17:47 CUL_HM gong_Sound set_on
2014-03-15 17:17:47 CUL_HM eingang_tuer open
2014-03-15 17:17:47 CUL_HM eingang_tuer contact: open (to broadcast)
2014-03-15 17:17:47 CUL_HM gong_Sound level: 100
2014-03-15 17:17:47 CUL_HM gong_Sound pct: 100
2014-03-15 17:17:47 CUL_HM gong_Sound deviceMsg: on (to HMLAN1)
2014-03-15 17:17:47 CUL_HM gong_Sound on
2014-03-15 17:17:47 CUL_HM gong_Sound timedOn: running
2014-03-15 17:17:48 CUL_HM gong_Sound level: 100
2014-03-15 17:17:48 CUL_HM gong_Sound pct: 100
2014-03-15 17:17:48 CUL_HM gong_Sound deviceMsg: on (to HMLAN1)
2014-03-15 17:17:48 CUL_HM gong_Sound on
2014-03-15 17:17:48 CUL_HM gong_Sound timedOn: running
2014-03-15 17:17:49 CUL_HM eingang_tuer closed
2014-03-15 17:17:49 CUL_HM eingang_tuer contact: closed (to broadcast)
2014-03-15 17:17:57 CUL_HM gong_Sound level: 0
2014-03-15 17:17:57 CUL_HM gong_Sound pct: 0
2014-03-15 17:17:57 CUL_HM gong_Sound deviceMsg: off (to broadcast)
2014-03-15 17:17:57 CUL_HM gong_Sound off
2014-03-15 17:17:57 CUL_HM gong_Sound timedOn: off
2014-03-15 17:17:57 CUL_HM gong_Sound level: 100
2014-03-15 17:17:57 CUL_HM gong_Sound pct: 100
2014-03-15 17:17:57 CUL_HM gong_Sound deviceMsg: on (to HMLAN1)
2014-03-15 17:17:57 CUL_HM gong_Sound on
2014-03-15 17:17:57 CUL_HM gong_Sound timedOn: running
2014-03-15 17:18:07 CUL_HM gong_Sound level: 0
2014-03-15 17:18:07 CUL_HM gong_Sound pct: 0
2014-03-15 17:18:07 CUL_HM gong_Sound deviceMsg: off (to broadcast)
2014-03-15 17:18:07 CUL_HM gong_Sound off
2014-03-15 17:18:07 CUL_HM gong_Sound timedOn: off
2014-03-15 17:18:07 CUL_HM gong_Sound levelMissed: desired:100

Nach der Umstellung:
2014-03-15 17:23:50 CUL_HM gong_Sound set_on
2014-03-15 17:23:50 CUL_HM eingang_tuer open
2014-03-15 17:23:50 CUL_HM eingang_tuer contact: open (to broadcast)
2014-03-15 17:23:50 CUL_HM gong_Sound level: 100
2014-03-15 17:23:50 CUL_HM gong_Sound pct: 100
2014-03-15 17:23:50 CUL_HM gong_Sound deviceMsg: on (to HMLAN1)
2014-03-15 17:23:50 CUL_HM gong_Sound on
2014-03-15 17:23:50 CUL_HM gong_Sound timedOn: running
2014-03-15 17:23:52 CUL_HM eingang_tuer closed
2014-03-15 17:23:52 CUL_HM eingang_tuer contact: closed (to broadcast)
2014-03-15 17:24:00 CUL_HM gong_Sound level: 0
2014-03-15 17:24:00 CUL_HM gong_Sound pct: 0
2014-03-15 17:24:00 CUL_HM gong_Sound deviceMsg: off (to broadcast)
2014-03-15 17:24:00 CUL_HM gong_Sound off
2014-03-15 17:24:00 CUL_HM gong_Sound timedOn: off
2014-03-15 17:24:00 CUL_HM gong_Sound level: 100
2014-03-15 17:24:00 CUL_HM gong_Sound pct: 100
2014-03-15 17:24:00 CUL_HM gong_Sound deviceMsg: on (to HMLAN1)
2014-03-15 17:24:00 CUL_HM gong_Sound on
2014-03-15 17:24:00 CUL_HM gong_Sound timedOn: running
2014-03-15 17:24:08 CUL_HM gong_Sound level: 0
2014-03-15 17:24:08 CUL_HM gong_Sound pct: 0
2014-03-15 17:24:08 CUL_HM gong_Sound deviceMsg: off (to broadcast)
2014-03-15 17:24:08 CUL_HM gong_Sound off
2014-03-15 17:24:08 CUL_HM gong_Sound timedOn: off
2014-03-15 17:24:08 CUL_HM gong_Sound levelMissed: desired:100

Weisst du wie ich auch noch mitgeben kann, das der Gong nur einmal ertönt?
Mit set gong_Sound on, erhalte ich im Log immer noch ein "HM eingang_signal repeat, level 00 instead of C8"

Danke für deine Hilfe.
Titel: Antw:Notify Befehl wird doppelt ausgeführt
Beitrag von: Deudi am 16 März 2014, 22:16:17
Hallo,

das:

2014-03-15 17:17:47 CUL_HM eingang_tuer open
2014-03-15 17:17:47 CUL_HM eingang_tuer contact: open (to broadcast)


löst dein Notify zweimal aus.
Machs wie sw geschrieben hat und probier es mal so:

define eingang_tuer_Notify notify eingang_tuer:open set gong_Sound on

Gute N8
Deudi
Titel: Antw:Notify Befehl wird doppelt ausgeführt
Beitrag von: noesberger am 18 März 2014, 00:03:50
Sorry, habe es vielleicht zu wenig gut erwähnt, dass nach der Umstellung nur noch einmal der Gong Befehl ausgelöst hat.
define eingang_tuer_Notify notify eingang_tuer:open { fhem("set gong_Sound on") }

Aber wenn ich aktuell (auch manuell) einmal "set gong_Sound on" ausführe, ertönt es zweimal nacheinander und ich sehe folgendes "CUL_HM eingang_signal repeat, level 00 instead of C8"
Kann ich irgendwie die Anzahl der Gongs steuern (Intervall), die Dauer, die Lautstärke?

Danke für die Hilfe.