FHEM Forum

FHEM => Automatisierung => DOIF => Thema gestartet von: pcjogi am 28 April 2020, 18:01:01

Titel: [gelöst] DOIF für mehrere Devices mit Ausschluss eines Devices
Beitrag von: pcjogi am 28 April 2020, 18:01:01
Hallo zusammen,

ich bekomme es nicht hin ein DOIF zu erzeugen, welches mir für alle PRECENCE Devices (z.B. PRECENSE.server.name1, PRECENSE.gateway.name, ...)  bis auf Ausnahmen eine Telegrammessage schickt. Mein Code sieht im Moment so aus. Der sendet aber immer wenn einer der PRECENCE Devices auf absent steht. Also auch bei den PRECENCE.server.htpc01. defmod doif_PRECENCE_failure DOIF (["^PRECENCE:absent$"] and [$DEVICE] ne "PRECENCE.server_htpc01") (set SYSTEM.TELEGRAM message DoIf Precence failure $DEVICE)

Was mache ich falsch?

Hier noch das list vom DOIF
Internals:
   CFGFN     
   DEF        (["^PRECENCE:absent$"] and [$DEVICE] ne "PRECENCE.server_htpc01") (set SYSTEM.TELEGRAM message DoIf Precence failure $DEVICE)
   FUUID      5ea7f232-f33f-c573-6df0-cf3812392757bf84
   MODEL      FHEM
   NAME       doif_PRECENCE_failure
   NOTIFYDEV  global,PRECENCE.*
   NR         22455
   NTFY_ORDER 50-doif_PRECENCE_failure
   STATE      cmd_1
   TYPE       DOIF
   VERSION    21224 2020-02-18 18:45:49
   READINGS:
     2020-04-28 17:58:28   Device          PRECENCE.server_vsx923
     2020-04-28 17:58:28   cmd             1
     2020-04-28 17:58:28   cmd_event       PRECENCE.server_vsx923
     2020-04-28 17:58:28   cmd_nr          1
     2020-04-28 17:51:58   mode            enabled
     2020-04-28 17:58:28   state           cmd_1
   Regex:
     accu:
     cond:
       :
         0:
           "^PRECENCE:absent$" ^PRECENCE:absent$
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          ::EventDoIf('^PRECENCE',$hash,'absent$',0) and ::InternalDoIf($hash,'$DEVICE','STATE') ne "PRECENCE.server_htpc01"
   devices:
   do:
     0:
       0          set SYSTEM.TELEGRAM message DoIf Precence failure $DEVICE
     1:
   helper:
     DEVFILTER  ^global$|^PRECENCE
     NOTIFYDEV  global|PRECENCE.*
     event      absent
     globalinit 1
     last_timer 0
     sleeptimer -1
     timerdev   PRECENCE.server_vsx923
     timerevent absent
     triggerDev PRECENCE.server_vsx923
     timerevents:
       absent
       presence: absent
       css_presence: 0
     timereventsState:
       state: absent
       presence: absent
       css_presence: 0
     triggerEvents:
       absent
       presence: absent
       css_presence: 0
     triggerEventsState:
       state: absent
       presence: absent
       css_presence: 0
   internals:
     all         $DEVICE:STATE
   readings:
   trigger:
   uiState:
   uiTable:
Attributes:
   do         always
   room       precence
   verbose    5


und von dem htpc01

Internals:
   ADDRESS    192.168.1.21
   DEF        lan-ping 192.168.1.21
   FUUID      5e653a7b-f33f-c573-dc4f-80be6f2dc2c73a15
   FVERSION   73_PRESENCE.pm:0.207820/2019-12-19
   INTERVAL_NORMAL 30
   INTERVAL_PRESENT 30
   MODE       lan-ping
   NAME       PRECENCE.server_htpc01
   NOTIFYDEV  global
   NR         50
   NTFY_ORDER 50-PRECENCE.server_htpc01
   STATE      absent
   TYPE       PRESENCE
   READINGS:
     2020-04-28 17:59:23   css_presence    0
     2020-04-28 04:31:18   model           lan-ping
     2020-04-28 17:59:23   presence        absent
     2020-04-28 17:59:23   state           absent
   helper:
     ABSENT_COUNT 0
Attributes:
   mqttPublish css_presence:topic={"/CSS/IT/server_htpc01/Status/css_presence"}
   room       precence
   userReadings css_presence {if(ReadingsVal("PRECENCE.server_htpc01","state","") eq "present") {return 1}   else {return 0}},


Und ja PRECENCE ist falsch geschrieben!!

Danke
Titel: Antw:DOIF für mehrere Devices mit Ausschluss eines Devices
Beitrag von: Damian am 28 April 2020, 18:13:44
probiere mal:

defmod doif_PRECENCE_failure DOIF (["^PRECENCE:absent$"] and $device ne "PRECENCE.server_htpc01") (set SYSTEM.TELEGRAM message DoIf Precence failure $DEVICE)
Titel: Antw:[gelöst] DOIF für mehrere Devices mit Ausschluss eines Devices
Beitrag von: pcjogi am 28 April 2020, 22:01:33
DANKE!!!