Ich habe ein einfaches notify zum Öffnen und Schließen.
notify
Internals:
CFGFN /media/hdd/fhem/myprogram/solarthermie_rasp02.pm
DEF AB_P_ST_V2D set AB_P_ST_V2 $EVENT
FUUID 5c4500fc-f33f-9ca1-be27-0abf8ac0718b5579
NAME AB_P_ST_V2N
NOTIFYDEV AB_P_ST_V2D
NR 1201
NTFY_ORDER 50-AB_P_ST_V2N
REGEXP AB_P_ST_V2D
STATE 2019-08-29 11:42:25
TRIGGERTIME 1567071745.48098
TYPE notify
READINGS:
2019-08-29 11:18:19 state active
Attributes:
alias AB Pool - SolarThermie - Pool primär Ventile V2
group AB Pool - SolarThermie
icon sani_pump
room AB-Pool,SolarThermie
sortby 07.04
dummy
Internals:
CFGFN /media/hdd/fhem/myprogram/solarthermie_rasp02.pm
FUUID 5c4500fc-f33f-6dcc-5d4c-74d62dbb1f780ea5
NAME AB_P_ST_V2D
NR 1199
STATE OEFFNEN
TYPE dummy
READINGS:
2019-08-29 11:42:25 state on
Attributes:
alias AB Pool - SolarThermie - Pool primär Ventile V2
cmdIcon OEFFNEN:remotecontrol/black_btn_CHUP SCHLIESEN:remotecontrol/black_btn_CHDOWN
devStateIcon OEFFNEN:control_arrow_up@yellow SCHLIESEN:control_arrow_down@yellow
devStateStyle style="text-align:left;;font-weight:bold;;"
eventMap on:OEFFNEN off:SCHLIESEN
fp_SolarThermie 335,364,0,OG2_HZR_ST_V2D,
group AB Pool - SolarThermie
icon sani_pump
room AB-Pool,SolarThermie
sortby 07.03
webCmd ::OEFFNEN:SCHLIESEN
Dabei kommt es häufiger vor das das Ventil nicht geöffnet wird.
Betätige ich den Dummy funktioniert das notify zum Öffnen und Schließen erst bei der zweiten Betätigung.
Nur warum ist das so?
Ein notify ohne Trigger macht m.E. keinen Sinn, besonders nicht wenn man dann $EVENT einfach weiterreicht.
Ich würde das notify so anpassen:
define AB_P_ST_V2N notify AB_P_ST_V2D:.(on|off) set AB_P_ST_V2 $EVENT
Gruß
Dan
Danke für den Tipp.
Nur so funktioniert das notify gar nicht mehr.
Internals:
CFGFN /media/hdd/fhem/myprogram/solarthermie_rasp02.pm
DEF AB_P_ST_V2D:.(OEFFNEN|SCHLIESEN) set AB_P_ST_V2 $EVENT
FUUID 5c4500fc-f33f-9ca1-be27-0abf8ac0718b5579
NAME AB_P_ST_V2N
NR 1201
NTFY_ORDER 50-AB_P_ST_V2N
REGEXP AB_P_ST_V2D:.(OEFFNEN|SCHLIESEN)
STATE active
TRIGGERTIME 1567078279.10713
TYPE notify
READINGS:
2019-08-29 13:34:33 state active
Attributes:
alias AB Pool - SolarThermie - Pool primär Ventile V2
group AB Pool - SolarThermie
icon sani_pump
room AB-Pool,SolarThermie
sortby 07.04
Ich habe es auch mit define AB_P_ST_V2N notify AB_P_ST_V2D:.(on|off) set AB_P_ST_V2 $EVENT
versucht, aber diese schreibweise funktioniert auch nicht.
Das notify funktioniert nur wenn ich es so definiere.
define AB_P_ST_V2N notify AB_P_ST_V2D.(on|off) set AB_P_ST_V2 $EVENT
oder
define AB_P_ST_V2N notify AB_P_ST_V2D.(OEFFNEN|SCHLIESEN) set AB_P_ST_V2 $EVENT
Eventmonitor aufmachen, warten bis das gewünschte Event kommt (oder "provozieren"), Zeile markieren und auf create/modify -> fertig.
Dann noch entsprechend anpassen...
https://wiki.fhem.de/wiki/Event_monitor
Wie wäre ein list von dem Device von dem die Events kommen, sonst kann man nur raten...
Und generell (wurde schon geschrieben): Regex möglichst "eng fassen", sonst wird alles "weitergegeben"!
Evtl. auch erst mal mit einer Logausgabe "prüfen" was da so kommt (hilft auch zu sehen, ob getriggert wird/wurde):
Log3(undef,3,"Notify Event: $EVENT");
Gruß, Joachim
Zitat von: DeeSPe am 29 August 2019, 13:13:42
Ich würde das notify so anpassen:
define AB_P_ST_V2N notify AB_P_ST_V2D:.(on|off) set AB_P_ST_V2 $EVENT
Sorry, der Punkt war zu viel:
define AB_P_ST_V2N notify AB_P_ST_V2D:(on|off) set AB_P_ST_V2 $EVENT
Gruß
Dan
ZitatWie wäre ein list von dem Device von dem die Events kommen, sonst kann man nur raten...
Der Dummy wurde ganz am Anfang schon angeführt woher die Befehle für das notify kommen.
Da ging nur etwas mit der Code Definition daneben. Ich habe das jetzt richtig gestellt.
ZitatUnd generell (wurde schon geschrieben): Regex möglichst "eng fassen", sonst wird alles "weitergegeben"!
Das hatte ich nicht bedacht. Ich werde das gleich bei allen restlichen notifys nachholen.
Ich werde das noch genauer mit dem Monitor betrachten.
Funktioniert es denn nun mit dem Code aus #4 (https://forum.fhem.de/index.php/topic,103358.msg970444.html#msg970444)?
Gruß
Dan
Ich habe jetzt viel damit herumgespielt, und ich denke das der Fehler doch nicht am notify liegt.
Das notify setzt den Befehl richtig ab und kommt auch bei dem Device an, nur wird der Befehl nicht immer vom I2C_MCP23017 ausgeführt.
Einer solcher Fälle habe ich notitiert.
list AB_P_ST_V2N
Internals:
CFGFN /media/hdd/fhem/myprogram/solarthermie_rasp02.pm
DEF AB_P_ST_V2D:(OEFFNEN|SCHLIESEN) set AB_P_ST_V2 $EVENT
FUUID 5c4500fc-f33f-9ca1-be27-0abf8ac0718b5579
NAME AB_P_ST_V2N
NR 1219
NTFY_ORDER 50-AB_P_ST_V2N
REGEXP AB_P_ST_V2D:(OEFFNEN|SCHLIESEN)
STATE 2019-09-03 16:11:22
TRIGGERTIME 1567519882.85844
TYPE notify
READINGS:
2019-09-03 00:15:13 state active
Attributes:
alias AB Pool - SolarThermie - Pool primär Ventile V2
group AB Pool - SolarThermie
icon sani_pump
room AB-Pool,SolarThermie
sortby 07.04
list AB_P_ST_V2
Internals:
CFGFN /media/hdd/fhem/mycfg/AD_Controller/I2C_MCP23017_rasp02.cfg
DEF mcp23017_B2_HZR:PortA6
DEVICE mcp23017_B2_HZR
FUUID 5c4500f9-f33f-b4eb-b1f5-6dc6dfe6b2a31fb1
NAME AB_P_ST_V2
NOTIFYDEV mcp23017_B2_HZR,global
NR 406
NTFY_ORDER 50-AB_P_ST_V2
READING PortA6
STATE SCHLIESEN
TYPE readingsProxy
CONTENT:
mcp23017_B2_HZR 1
READINGS:
2019-09-03 13:08:48 lastCmd on
2019-09-03 13:08:48 state off
Attributes:
alias AB Pool - SolarThermie - Pool primär Ventile V2
cmdIcon OEFFNEN:remotecontrol/black_btn_CHUP SCHLIESEN:remotecontrol/black_btn_CHDOWN
devStateIcon OEFFNEN:control_arrow_up@yellow SCHLIESEN:control_arrow_down@yellow
devStateStyle style="text-align:left;;font-weight:bold;;"
eventMap on:OEFFNEN off:SCHLIESEN
group AB Pool - SolarThermie
icon sani_pump
room AB-Pool,SolarThermie,_IO
setFn {($CMD eq "off")?"PortA6 on":"PortA6 off"}
setList on off
sortby 07.05
valueFn {($VALUE eq "off")?"on":"off"}
webCmd ::OEFFNEN:SCHLIESEN
Man sieht das der Befehl angekommen ist, 2019-09-03 13:08:48 lastCmd on
aber vom Device nicht ausgeführt wurde. 2019-09-03 13:08:48 state off
Dieser Status wiederspricht sich.
Es liegt nicht am notify.