Mein notify mit oder, if und else funktioniert nicht

Begonnen von cocojambo, 10 Februar 2025, 09:02:51

Vorheriges Thema - Nächstes Thema

Otto123

naja Du bist aber viel ausführlicher, Du hast gleich noch das mapping gelöst  ;D
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

cocojambo

Ich habe die structure mal auf meine Installation übertragen:

define Laptop_structure structure Laptop_Presence_LAN Laptop_Presence_WLAN
attr Laptop_structure clientstate_behavior relative
attr Laptop_structure clientstate_priority Ein|present|present Ein|present|absent Ein|absent|present Aus|absent|absent
attr Laptop_structure room Test

Ich kann die LAN und WLAN Adressen von present und absent hin und herschalten, was auch im Event Monitor zu sehen ist, aber im state von Laptop_structure ändert sich nix. Es steht immer aktive drin.
FHEM6.2 FB7490 FB7430 3xraspi2+3+4 2xHM-LAN-CFG 2xESP CUL868 CUNO868 HUE-Bridge Harmony-Hub 5xHM-LC-Sw-PI-2 3xHM-WDS30-T2-SN 1xHM-LC_Sw4-DR 3xHM-ES-PMSw1-PI 7xFS20SIG2 6xFS20KSE 2xHM-ES-PMSW1-PL 5xS300TH 1xASH2200 1xEM1000

Otto123

#17
siehst Du den Unterschied?
Zitatdefmod st_test structure st_test d_lan d_wlan
Kennst Du den help Befehl? in der FHEM Kommandozeile ;)
help structure
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

cocojambo

#18
JA ICH SEHE DEN UNTERSCHIED.
und schon geändert.
Und so sieht es jetzt aus:

defmod Laptop_structure structure Laptop_structure Laptop_Presence_LAN Laptop_Presence_WLAN
attr Laptop_structure clientstate_behavior relative
attr Laptop_structure clientstate_priority Ein|present|present Ein|present|absent Ein|absent|present Aus|absent|absent
attr Laptop_structure room Test
defmod Laptop_structure_notify notify Laptop_structure set Laptop_Sw_02 $EVENT
attr Laptop_structure_notify room Test

und es scheint sogar zu funktionieren, zumindest haben die ersten Versuche geklappt.
eine tolle Lösung.

Gruß
Nobbi
FHEM6.2 FB7490 FB7430 3xraspi2+3+4 2xHM-LAN-CFG 2xESP CUL868 CUNO868 HUE-Bridge Harmony-Hub 5xHM-LC-Sw-PI-2 3xHM-WDS30-T2-SN 1xHM-LC_Sw4-DR 3xHM-ES-PMSw1-PI 7xFS20SIG2 6xFS20KSE 2xHM-ES-PMSW1-PL 5xS300TH 1xASH2200 1xEM1000