Hallo,
Ich versuche seite graumer Zeit zwei Netztwerkgeräte mit dem Licht/Schaltsteckdose zu verknüpfen.
Einzeln klappt das auch, doch ich bekomme die beiden States nicht verknüpft.
Es wäre nett wenn jemand mir mein Denkfehler/Fehler verraten kann.
Hier einmal der komplette Code direkt aus der fhem.cfg kopiert.
Vielleicht kann jemand einmal rüber schauen wie ich Coolstream und Petra_Handy zusammen bekomme, damit das Licht ausgeht.
define Coolstream PRESENCE fritzbox Torsten-TV-WZ
attr Coolstream event-on-change-reading state
define Coolstream_Licht_AN notify Coolstream:present {if ((localtime)[2]~~[10..21]) {fhem("set Weihnachts_Beleuchtung3 off-for-timer 1")}}
define Coolstream_Licht_Aus notify Coolstream:absent set Weihnachts_Beleuchtung3 on-for-timer 1
attr Coolstream_Licht_Aus verbose 5
define Petra_Handy PRESENCE lan-ping Petra-Handy-S3
attr Petra_Handy event-on-change-reading state
define Petra_Handy_Licht_AN notify Petra_Handy:present {if ((localtime)[2]~~[6..21]) {fhem("set Weihnachts_Beleuchtung3 off-for-timer 1")}}
define Petra_Handy_Licht_Aus notify Petra_Handy:absent set Weihnachts_Beleuchtung3 on-for-timer 1
Eine structure für die Telefone anlegen, und den notify mit dieser verknüpfen.
Hallo,
wie kann ich denn eine Structure mit dem Status der beiden Geräte (absent und present) verknüpfen?
Vielen Dank schon mal
So cirka (aus dem Kopf von unterwegs)
define handy_da structure room Coolstream Petra_Handy
attr handy_da clientstate_behavior relative
attr handy_da clientstate_priority present absent
define Coolstream_Licht_AN notify handy_da:present {if ((localtime)[2]~~[10..21]) {fhem("set Weihnachts_Beleuchtung3 off-for-timer 1")}}
define Coolstream_Licht_Aus notify handy_da:absent set Weihnachts_Beleuchtung3 on-for-timer 1
Vielen lieben Dank.
Das hat funktioniert.
Danke