FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: Kiter1988 am 05 Oktober 2017, 12:01:44

Titel: [GELÖST]einfaches notify NodeMCU
Beitrag von: Kiter1988 am 05 Oktober 2017, 12:01:44
Hallo,

ich scheitere an einem einfachen notify, ich habe einen Testdummy erstellt der entweder auf on oder off ist.
Das Notify überwacht einen NodeMCU. Beim Reading "on" soll der Dummy auch auf "on" schalten, leider tut sich gar nichts.
Das Notify soll auf das Reading "Melder" reagieren, hierfür habe ich auch "stateformat" als attribut gesetzt.
Hier mal "list" von dem NodeMcu

Internals:
   DEF        192.168.1.16 80 espBridge NodeMCU_Melder
   ESP_BUILD  20000
   ESP_BUILD_GIT v2.0.0-dev10
   ESP_BUILD_NOTES  - Mega
   ESP_NODE_TYPE_ID 17: ESP Easy Mega
   ESP_SLEEP  0
   ESP_UNIT   1
   ESP_VERSION 2
   HOST       192.168.1.16
   IDENT      NodeMCU_Melder
   INTERVAL   10
   IODev      espBridge
   LASTInputDev espBridge
   MSGCNT     18
   NAME       Melder
   NOTIFYDEV  global
   NR         28
   NTFY_ORDER 50-Melder
   PORT       80
   STATE      off
   SUBTYPE    device
   TYPE       ESPEasy
   VERSION    1.33
   espBridge_MSGCNT 18
   espBridge_TIME 2017-10-05 11:53:18
   READINGS:
     2017-10-05 11:53:18   Melder          off
     2017-10-05 11:53:37   presence        absent
     2017-10-05 11:53:37   state           absent
   helper:
     fpc        1507160584.56875
     pm:
       Encode     1
       JSON       1
     received:
       Melder     1507197198.812
Attributes:
   IODev      espBridge
   Interval   10 
   group      ESPEasy Device
   icon       Heizung_Hauptschalter.on
   room       90_Devices
   setState   7
   stateFormat Melder


Hier mein Notify:
Melder:on {
fhem ("set Melderdummy on")
}
Titel: Antw:einfaches notify NodeMCU
Beitrag von: CoolTux am 05 Oktober 2017, 12:30:07
Wozu gehst Du auf Perlebene?


Melder.on set Melderdummy $EVENT
Titel: Antw:einfaches notify NodeMCU
Beitrag von: Kiter1988 am 05 Oktober 2017, 12:59:42
Zitat von: CoolTux am 05 Oktober 2017, 12:30:07
Wozu gehst Du auf Perlebene?

Habe es so in einem Beispiel gesehen  :o

Leider wird der Dummy immer noch nicht geschaltet, muss ich noch Attribute hinzufügen ?

Internals:
   NAME       Melderdummy
   NR         31
   STATE      off
   TYPE       dummy
   READINGS:
     2017-10-05 12:55:30   state           off
Attributes:
   devStateIcon on:FS20.on off:FS20.off
   group      ESPEasy Device
   room       90_Devices
   setList    on off
   webCmd     on:off

Titel: Antw:einfaches notify NodeMCU
Beitrag von: CoolTux am 05 Oktober 2017, 13:04:23
list vom notify bitte
Titel: Antw:einfaches notify NodeMCU
Beitrag von: Kiter1988 am 05 Oktober 2017, 13:06:39
Zitat von: CoolTux am 05 Oktober 2017, 13:04:23
list vom notify bitte

Internals:
   DEF        Melder:on set Melderdummy $EVENT
   NAME       MelderNotify
   NOTIFYDEV  Melder
   NR         32
   NTFY_ORDER 50-MelderNotiy
   REGEXP     Melder:on
   STATE      active
   TYPE       notify
   READINGS:
     2017-10-05 13:04:51   state           active
Attributes:
   group      ESPEasy Device
   room       90_Devices
Titel: Antw:einfaches notify NodeMCU
Beitrag von: CoolTux am 05 Oktober 2017, 13:14:39
Bitte übernehme meine Beispiele richtig

Melder:on set Melderdummy $EVENT

ist nicht

Melder.on set Melderdummy $EVENT

und wenn du off auch haben willst dann

Melder.(on|off) set Melderdummy $EVENT
Titel: Antw:einfaches notify NodeMCU
Beitrag von: Kiter1988 am 05 Oktober 2017, 13:22:11
Hatte ich gemacht, blieb auch ohne Funktion. Der Dummy wird nicht geschaltet.
Habs nochmal neu angelegt, aber auch hier funktioniert es nicht.

Internals:
   CFGFN
   DEF        Melder.on set Melderdummy $EVENT
   NAME       MelderNotify
   NR         56
   NTFY_ORDER 50-MelderNotify
   REGEXP     Melder.on
   STATE      active
   TYPE       notify
   READINGS:
     2017-10-05 13:19:36   state           active
Attributes:
   group      ESPEasy Device
   room       90_Devices
Titel: Antw:einfaches notify NodeMCU
Beitrag von: Otto123 am 05 Oktober 2017, 13:23:48
Hi,

ist das nicht entweder oder? Wird denn überhaupt der Event erzeugt? Was sagt der Event Monitor?
ZitatsetState
Summarize received values in state reading.
A positive number determines the number of characters used for abbreviated reading names. Only readings with an age less than interval will be considered. If your are not satisfied with format or behavior of setState then disable this attribute (set to 0) and use global attributes userReadings and/or stateFormat to get what you want.
Possible values: integer >=0
Default: 3 (enabled with 3 characters abbreviation)

The following two attributes should only be use in cases where ESPEasy software do not send data on status changes and no rule/dummy can be used to do that. Useful for commands like PWM, STATUS, ...

Du hast    ->
setState   7
stateFormat Melder

ich denke es ist kein notify Problem sondern eines vom Event. Tipp -> https://wiki.fhem.de/wiki/Event_monitor#Ger.C3.A4te_anlegen.2F.C3.A4ndern
Da sieht man was man hat und nicht was man gerne möchte  ;D
Gruß Otto
Titel: Antw:einfaches notify NodeMCU
Beitrag von: Kiter1988 am 05 Oktober 2017, 16:43:39
Zitat von: Otto123 am 05 Oktober 2017, 13:23:48
ich denke es ist kein notify Problem sondern eines vom Event. Tipp -> https://wiki.fhem.de/wiki/Event_monitor#Ger.C3.A4te_anlegen.2F.C3.A4ndern
Da sieht man was man hat und nicht was man gerne möchte  ;D
Gruß Otto

Vielen dank für die Hilfe , dein Tipp hat nun funktioniert.
Hier der mal list vom generierten Notify, mit "set Melderdummy on" hab ich's nun gelöst. Super !!

Internals:
   DEF        Melder:Melder:.on set Melderdummy on
   NAME       Melder_notify_1
   NOTIFYDEV  Melder
   NR         41
   NTFY_ORDER 50-Melder_notify_1
   REGEXP     Melder:Melder:.on
   STATE      2017-10-05 16:41:10
   TYPE       notify
   READINGS:
     2017-10-05 16:39:16   state           active
Attributes:
   group      ESPEasy Device
   room       90_Devices


Der Tipp mit dem Anlegen eines Gerätes per EventMonitor ist übrigens super praktisch.