FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: cornelius fillmore am 26 August 2014, 12:37:59

Titel: notify mit PRESENCE
Beitrag von: cornelius fillmore am 26 August 2014, 12:37:59
Hallo Forum,
ich möchte gerne mit 3 Presence-Teilnehmer einen vierten Schalten.

Bekomme es aber leider nicht hin.
Vieleicht kann ja mal einer drüberschauen.
Danke
## Linux Receiver ##
#Dreambox Wohnzimmer#
define Dream PRESENCE lan-ping 192.168.0.10
attr Dream eventMap present:on absent:off
attr Dream webCmd on:off
attr Dream devStateIcon absent:black_Steckdose.off present:black_Steckdose.on
attr Dream room Wohnzimmer
#attr Dream dummy 1

#Dreambox Schlafzimmer#
define Dream_2 PRESENCE lan-ping 192.168.0.14
attr Dream_2 eventMap present:on absent:off
attr Dream_2 webCmd on:off
attr Dream_2 devStateIcon off:black_Steckdose.off on:black_Steckdose.on
attr Dream_2 room Schlafzimmer
#attr Dream_2 dummy 1

#Kathrein#
define Kathi PRESENCE lan-ping 192.168.0.51
attr Kathi eventMap present:on absent:off
attr Kathi webCmd on:off
attr Kathi devStateIcon off:black_Steckdose.off on:black_Steckdose.on
attr Kathi room Moritz
#attr Kathi dummy 1

#Linux-Boxen schalten CS_Steckdosenleiste#

define Schalter1_on notify (Dream|Dream_2|Kathi)
if (Value("Dream") eq "off" && Value("Dream_2") eq "off" && Value("Kathi") eq "off") {
  fhem "set Leiste_HAS off"
} else {
  fhem "set Leiste_HAS on"
}
Titel: Antw:notify mit PRESENCE
Beitrag von: marvin78 am 26 August 2014, 13:00:14

(Dream|Dream_2|Kathi) {if (Value("Dream") eq "off" && Value("Dream_2") eq "off" && Value("Kathi") eq "off") {fhem ("set Leiste_HAS off")} else {fhem ("set Leiste_HAS on")}}


Du musst fhem sagen, dass PERL Code kommt. Das geht mit den {}.

Ich würde hier eine structure empfehlen um das ganze zu vereinfachen.

(Code für den DEF Bereich im Device im Frontend)
Titel: Antw:notify mit PRESENCE
Beitrag von: cornelius fillmore am 26 August 2014, 13:30:58
 :) :) :)
Titel: Antw:notify mit PRESENCE
Beitrag von: Puschel74 am 26 August 2014, 14:42:13
Hallo,

im FHEM Logfile steht nichts drinnen  :o
Das wundert mich aber.

Grüße