Hallöchen,
bin mittlerweile etwas ratlos; Google, Forum und Wiki haben nicht wirklich die Lösung gebracht.
Ich habe ein DOIF das einen 6-fach-Schalter steuert, die Taste 3 soll mehrere Aktionen auslösen:
defmod doif_HMIP_UG_Buero_6f_Schalter_1 DOIF ([HMIP_UG_Buero_6f_Schalter:"^1.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_14 toggle)\
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^1.PRESS_LONG:.pressed$"]) ()
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^2.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_13 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^2.PRESS_LONG:.pressed$"]) ()
##
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"0|3") (set HUEDevice13 on, set HUEDevice14 on) ()
DOELSEIF(["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"1") (set HUEDevice13 rgb F01914, set HUEDevice14 rgb F01914) ()
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"2") (set HUEDevice13 off, set HUEDevice14 off)
##
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_LONG:.pressed$"]) ()
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^4.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_3 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^4.PRESS_LONG:.pressed$"]) ()
DOELSEIF (([HMIP_UG_Buero_6f_Schalter:"^5.PRESS_SHORT:.pressed$"]) and ([ECHO_G090XG0794221J1D:playStatus] ne "playing")) (set ECHO_G090XG0794221J1D tunein s42824)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^5.PRESS_LONG:.pressed$"]) ()
DOELSEIF (([HMIP_UG_Buero_6f_Schalter:"^6.PRESS_SHORT:.pressed$"]) and ([ECHO_G090XG0794221J1D:playStatus] eq "playing")) (set ECHO_G090XG0794221J1D pause)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^6.PRESS_LONG:.pressed$"]) ()
Folgende Attribute sind gesetzt:
attr doif_HMIP_UG_Buero_6f_Schalter_1 do always
attr doif_HMIP_UG_Buero_6f_Schalter_1 icon helper_doif
attr doif_HMIP_UG_Buero_6f_Schalter_1 room 99 DOIF/NOTIFY
attr doif_HMIP_UG_Buero_6f_Schalter_1 wait 0,1:0,1:0,1
Kann mir bitte jemand verraten wo ich etwas falsch mache?
VG
Thorsten
Du bist nicht im Perl-Modus. Vielleicht solltest du statt $cmd deswegen [$SELF:cmd] verwenden.
Weiterhin würde ich die Bedingung "0|3" durch "(0|3)" ersetzen.
Bitte "list" vom DOIF wenn er sich im "falschen" Zustand befindet, und Code-Tags (das # Zeichen im Editormenü benutzen.
Hier das Listing:
Internals:
DEF ([HMIP_UG_Buero_6f_Schalter:"^1.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_14 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^1.PRESS_LONG:.pressed$"]) ()
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^2.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_13 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^2.PRESS_LONG:.pressed$"]) ()
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"0|3") (set HUEDevice13 on, set HUEDevice14 on) ()
DOELSEIF(["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"1") (set HUEDevice13 rgb F01914, set HUEDevice14 rgb F01914) ()
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"2") (set HUEDevice13 off, set HUEDevice14 off)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_LONG:.pressed$"]) ()
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^4.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_3 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^4.PRESS_LONG:.pressed$"]) ()
DOELSEIF (([HMIP_UG_Buero_6f_Schalter:"^5.PRESS_SHORT:.pressed$"]) and ([ECHO_G090XG0794221J1D:playStatus] ne "playing")) (set ECHO_G090XG0794221J1D tunein s42824)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^5.PRESS_LONG:.pressed$"]) ()
DOELSEIF (([HMIP_UG_Buero_6f_Schalter:"^6.PRESS_SHORT:.pressed$"]) and ([ECHO_G090XG0794221J1D:playStatus] eq "playing")) (set ECHO_G090XG0794221J1D pause)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^6.PRESS_LONG:.pressed$"]) ()
DOIFDEV ^global$|^ECHO_G090XG0794221J1D$|^HMIP_UG_Buero_6f_Schalter$|HMIP_UG_Buero_6f_Schalter
FUUID 5e521a7e-f33f-e7fd-329f-e65354edfd39303a
MODEL FHEM
NAME doif_HMIP_UG_Buero_6f_Schalter_1
NR 564
NTFY_ORDER 50-doif_HMIP_UG_Buero_6f_Schalter_1
STATE initialized
TYPE DOIF
VERSION 22735 2020-09-05 11:05:46
READINGS:
2020-09-13 20:12:24 cmd 0
2020-09-13 20:12:24 mode enabled
2020-09-13 20:12:24 state initialized
Regex:
accu:
cond:
:
4:
"HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$" HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$
5:
"HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$" HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$
6:
"HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$" HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$
ECHO_G090XG0794221J1D:
10:
playStatus ^ECHO_G090XG0794221J1D$:^playStatus:
12:
playStatus ^ECHO_G090XG0794221J1D$:^playStatus:
HMIP_UG_Buero_6f_Schalter:
0:
&STATE ^HMIP_UG_Buero_6f_Schalter$
1:
&STATE ^HMIP_UG_Buero_6f_Schalter$
10:
&STATE ^HMIP_UG_Buero_6f_Schalter$
11:
&STATE ^HMIP_UG_Buero_6f_Schalter$
12:
&STATE ^HMIP_UG_Buero_6f_Schalter$
13:
&STATE ^HMIP_UG_Buero_6f_Schalter$
2:
&STATE ^HMIP_UG_Buero_6f_Schalter$
3:
&STATE ^HMIP_UG_Buero_6f_Schalter$
7:
&STATE ^HMIP_UG_Buero_6f_Schalter$
8:
&STATE ^HMIP_UG_Buero_6f_Schalter$
9:
&STATE ^HMIP_UG_Buero_6f_Schalter$
attr:
cmdState:
cmdpause:
wait:
waitdel:
condition:
0 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^1.PRESS_SHORT:.pressed$',1)
1 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^1.PRESS_LONG:.pressed$',1)
10 (::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^5.PRESS_SHORT:.pressed$',1)) and (::ReadingValDoIf($hash,'ECHO_G090XG0794221J1D','playStatus') ne "playing")
11 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^5.PRESS_LONG:.pressed$',1)
12 (::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^6.PRESS_SHORT:.pressed$',1)) and (::ReadingValDoIf($hash,'ECHO_G090XG0794221J1D','playStatus') eq "playing")
13 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^6.PRESS_LONG:.pressed$',1)
2 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^2.PRESS_SHORT:.pressed$',1)
3 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^2.PRESS_LONG:.pressed$',1)
4 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',0) and $cmd =~"0|3"
5 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',0) and $cmd =~"1"
6 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',0) and $cmd =~"2"
7 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_LONG:.pressed$',1)
8 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^4.PRESS_SHORT:.pressed$',1)
9 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^4.PRESS_LONG:.pressed$',1)
do:
0:
0 set MQTT2_Steckdose_14 toggle
1:
0
10:
0 set ECHO_G090XG0794221J1D tunein s42824
11:
0
12:
0 set ECHO_G090XG0794221J1D pause
13:
0
14:
2:
0 set MQTT2_Steckdose_13 toggle
3:
0
4:
0 set HUEDevice13 on, set HUEDevice14 on
1
5:
0 set HUEDevice13 rgb F01914, set HUEDevice14 rgb F01914
1
6:
0 set HUEDevice13 off, set HUEDevice14 off
7:
0
8:
0 set MQTT2_Steckdose_3 toggle
9:
0
helper:
DEVFILTER ^global$|^ECHO_G090XG0794221J1D$|^HMIP_UG_Buero_6f_Schalter$|HMIP_UG_Buero_6f_Schalter
NOTIFYDEV global|ECHO_G090XG0794221J1D|HMIP_UG_Buero_6f_Schalter|.*HMIP_UG_Buero_6f_Schalter.*
globalinit 1
last_timer 0
sleeptimer -1
readings:
all ECHO_G090XG0794221J1D:playStatus
trigger:
all HMIP_UG_Buero_6f_Schalter
uiState:
uiTable:
Attributes:
do always
icon helper_doif
room 99 DOIF/NOTIFY
Da ist aber nix passiert, das DOIF ist noch im "initialized" Zustand.
Bite Code Tags benutzen. Das # Zeichen im Editor-Menü. Du kannst deine vorherige Posts editieren.
Hier das Listing nach einem Versuch:
Internals:
DEF ([HMIP_UG_Buero_6f_Schalter:"^1.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_14 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^1.PRESS_LONG:.pressed$"]) ()
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^2.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_13 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^2.PRESS_LONG:.pressed$"]) ()
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"0|3") (set HUEDevice13 on, set HUEDevice14 on) ()
DOELSEIF(["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"1") (set HUEDevice13 rgb F01914, set HUEDevice14 rgb F01914) ()
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"2") (set HUEDevice13 off, set HUEDevice14 off)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_LONG:.pressed$"]) ()
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^4.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_3 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^4.PRESS_LONG:.pressed$"]) ()
DOELSEIF (([HMIP_UG_Buero_6f_Schalter:"^5.PRESS_SHORT:.pressed$"]) and ([ECHO_G090XG0794221J1D:playStatus] ne "playing")) (set ECHO_G090XG0794221J1D tunein s42824)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^5.PRESS_LONG:.pressed$"]) ()
DOELSEIF (([HMIP_UG_Buero_6f_Schalter:"^6.PRESS_SHORT:.pressed$"]) and ([ECHO_G090XG0794221J1D:playStatus] eq "playing")) (set ECHO_G090XG0794221J1D pause)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^6.PRESS_LONG:.pressed$"]) ()
DOIFDEV ^global$|HMIP_UG_Buero_6f_Schalter|^ECHO_G090XG0794221J1D$|^HMIP_UG_Buero_6f_Schalter$
FUUID 5e521a7e-f33f-e7fd-329f-e65354edfd39303a
MODEL FHEM
NAME doif_HMIP_UG_Buero_6f_Schalter_1
NR 564
NTFY_ORDER 50-doif_HMIP_UG_Buero_6f_Schalter_1
STATE cmd_7
TYPE DOIF
VERSION 22735 2020-09-05 11:05:46
READINGS:
2020-09-13 20:47:54 Device HMIP_UG_Buero_6f_Schalter
2020-09-13 20:47:50 cmd 7
2020-09-13 20:47:50 cmd_event HMIP_UG_Buero_6f_Schalter
2020-09-13 20:47:50 cmd_nr 7
2020-09-13 20:47:54 e_HMIP_UG_Buero_6f_Schalter_events 3.PRESS_SHORT: pressed
2020-09-13 20:47:47 mode enabled
2020-09-13 20:47:50 state cmd_7
Regex:
accu:
cond:
:
4:
"HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$" HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$
5:
"HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$" HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$
6:
"HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$" HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$
ECHO_G090XG0794221J1D:
10:
playStatus ^ECHO_G090XG0794221J1D$:^playStatus:
12:
playStatus ^ECHO_G090XG0794221J1D$:^playStatus:
HMIP_UG_Buero_6f_Schalter:
0:
&STATE ^HMIP_UG_Buero_6f_Schalter$
1:
&STATE ^HMIP_UG_Buero_6f_Schalter$
10:
&STATE ^HMIP_UG_Buero_6f_Schalter$
11:
&STATE ^HMIP_UG_Buero_6f_Schalter$
12:
&STATE ^HMIP_UG_Buero_6f_Schalter$
13:
&STATE ^HMIP_UG_Buero_6f_Schalter$
2:
&STATE ^HMIP_UG_Buero_6f_Schalter$
3:
&STATE ^HMIP_UG_Buero_6f_Schalter$
4:
5:
6:
7:
&STATE ^HMIP_UG_Buero_6f_Schalter$
8:
&STATE ^HMIP_UG_Buero_6f_Schalter$
9:
&STATE ^HMIP_UG_Buero_6f_Schalter$
attr:
cmdState:
cmdpause:
wait:
waitdel:
condition:
0 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^1.PRESS_SHORT:.pressed$',1)
1 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^1.PRESS_LONG:.pressed$',1)
10 (::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^5.PRESS_SHORT:.pressed$',1)) and (::ReadingValDoIf($hash,'ECHO_G090XG0794221J1D','playStatus') ne "playing")
11 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^5.PRESS_LONG:.pressed$',1)
12 (::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^6.PRESS_SHORT:.pressed$',1)) and (::ReadingValDoIf($hash,'ECHO_G090XG0794221J1D','playStatus') eq "playing")
13 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^6.PRESS_LONG:.pressed$',1)
2 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^2.PRESS_SHORT:.pressed$',1)
3 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^2.PRESS_LONG:.pressed$',1)
4 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',0) and $cmd =~"0|3"
5 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',0) and $cmd =~"1"
6 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',0) and $cmd =~"2"
7 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_LONG:.pressed$',1)
8 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^4.PRESS_SHORT:.pressed$',1)
9 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^4.PRESS_LONG:.pressed$',1)
do:
0:
0 set MQTT2_Steckdose_14 toggle
1:
0
10:
0 set ECHO_G090XG0794221J1D tunein s42824
11:
0
12:
0 set ECHO_G090XG0794221J1D pause
13:
0
14:
2:
0 set MQTT2_Steckdose_13 toggle
3:
0
4:
0 set HUEDevice13 on, set HUEDevice14 on
1
5:
0 set HUEDevice13 rgb F01914, set HUEDevice14 rgb F01914
1
6:
0 set HUEDevice13 off, set HUEDevice14 off
7:
0
8:
0 set MQTT2_Steckdose_3 toggle
9:
0
helper:
DEVFILTER ^global$|HMIP_UG_Buero_6f_Schalter|^ECHO_G090XG0794221J1D$|^HMIP_UG_Buero_6f_Schalter$
NOTIFYDEV global|.*HMIP_UG_Buero_6f_Schalter.*|ECHO_G090XG0794221J1D|HMIP_UG_Buero_6f_Schalter
event 3.PRESS_SHORT: pressed
globalinit 1
last_timer 0
sleeptimer -1
timerdev HMIP_UG_Buero_6f_Schalter
timerevent 3.PRESS_SHORT: pressed
triggerDev HMIP_UG_Buero_6f_Schalter
timerevents:
3.PRESS_SHORT: pressed
0.UNREACH: 0
0.LOW_BAT: Battery OK
timereventsState:
3.PRESS_SHORT: pressed
0.UNREACH: 0
0.LOW_BAT: Battery OK
triggerEvents:
3.PRESS_SHORT: pressed
triggerEventsState:
3.PRESS_SHORT: pressed
internals:
readings:
all ECHO_G090XG0794221J1D:playStatus
trigger:
all HMIP_UG_Buero_6f_Schalter
uiState:
uiTable:
Attributes:
do always
icon helper_doif
room 99 DOIF/NOTIFY
Hier noch das Listing nach 3maligem Drücken vom Taster 3:
Internals:
DEF ([HMIP_UG_Buero_6f_Schalter:"^1.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_14 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^1.PRESS_LONG:.pressed$"]) ()
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^2.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_13 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^2.PRESS_LONG:.pressed$"]) ()
##DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_SHORT:.pressed$"]) (set HUEDevice13 toggle, set HUEDevice14 toggle)
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"0|3") (set HUEDevice13 on, set HUEDevice14 on) ()
DOELSEIF(["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"1") (set HUEDevice13 rgb F01914, set HUEDevice14 rgb F01914) ()
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"2") (set HUEDevice13 off, set HUEDevice14 off)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_LONG:.pressed$"]) ()
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^4.PRESS_SHORT:.pressed$"]) (set MQTT2_Steckdose_3 toggle)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^4.PRESS_LONG:.pressed$"]) ()
DOELSEIF (([HMIP_UG_Buero_6f_Schalter:"^5.PRESS_SHORT:.pressed$"]) and ([ECHO_G090XG0794221J1D:playStatus] ne "playing")) (set ECHO_G090XG0794221J1D tunein s42824)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^5.PRESS_LONG:.pressed$"]) ()
DOELSEIF (([HMIP_UG_Buero_6f_Schalter:"^6.PRESS_SHORT:.pressed$"]) and ([ECHO_G090XG0794221J1D:playStatus] eq "playing")) (set ECHO_G090XG0794221J1D pause)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^6.PRESS_LONG:.pressed$"]) ()
DOIFDEV ^global$|^HMIP_UG_Buero_6f_Schalter$|^ECHO_G090XG0794221J1D$|HMIP_UG_Buero_6f_Schalter
FUUID 5e521a7e-f33f-e7fd-329f-e65354edfd39303a
MODEL FHEM
NAME doif_HMIP_UG_Buero_6f_Schalter_1
NR 564
NTFY_ORDER 50-doif_HMIP_UG_Buero_6f_Schalter_1
STATE cmd_7
TYPE DOIF
VERSION 22735 2020-09-05 11:05:46
READINGS:
2020-09-13 21:05:46 Device HMIP_UG_Buero_6f_Schalter
2020-09-13 21:05:45 cmd 7
2020-09-13 21:05:45 cmd_event HMIP_UG_Buero_6f_Schalter
2020-09-13 21:05:45 cmd_nr 7
2020-09-13 21:05:46 e_HMIP_UG_Buero_6f_Schalter_events 3.PRESS_SHORT: pressed
2020-09-13 21:05:41 mode enabled
2020-09-13 21:05:45 state cmd_7
Regex:
accu:
cond:
:
0:
1:
10:
11:
12:
13:
2:
3:
4:
"HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$" HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$
5:
"HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$" HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$
6:
"HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$" HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$
7:
8:
9:
ECHO_G090XG0794221J1D:
10:
playStatus ^ECHO_G090XG0794221J1D$:^playStatus:
12:
playStatus ^ECHO_G090XG0794221J1D$:^playStatus:
HMIP_UG_Buero_6f_Schalter:
0:
&STATE ^HMIP_UG_Buero_6f_Schalter$
1:
&STATE ^HMIP_UG_Buero_6f_Schalter$
10:
&STATE ^HMIP_UG_Buero_6f_Schalter$
11:
&STATE ^HMIP_UG_Buero_6f_Schalter$
12:
&STATE ^HMIP_UG_Buero_6f_Schalter$
13:
&STATE ^HMIP_UG_Buero_6f_Schalter$
2:
&STATE ^HMIP_UG_Buero_6f_Schalter$
3:
&STATE ^HMIP_UG_Buero_6f_Schalter$
4:
5:
6:
7:
&STATE ^HMIP_UG_Buero_6f_Schalter$
8:
&STATE ^HMIP_UG_Buero_6f_Schalter$
9:
&STATE ^HMIP_UG_Buero_6f_Schalter$
attr:
cmdState:
cmdpause:
wait:
waitdel:
condition:
0 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^1.PRESS_SHORT:.pressed$',1)
1 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^1.PRESS_LONG:.pressed$',1)
10 (::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^5.PRESS_SHORT:.pressed$',1)) and (::ReadingValDoIf($hash,'ECHO_G090XG0794221J1D','playStatus') ne "playing")
11 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^5.PRESS_LONG:.pressed$',1)
12 (::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^6.PRESS_SHORT:.pressed$',1)) and (::ReadingValDoIf($hash,'ECHO_G090XG0794221J1D','playStatus') eq "playing")
13 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^6.PRESS_LONG:.pressed$',1)
2 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^2.PRESS_SHORT:.pressed$',1)
3 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^2.PRESS_LONG:.pressed$',1)
4 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',0) and $cmd =~"0|3"
5 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',0) and $cmd =~"1"
6 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',0) and $cmd =~"2"
7 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_LONG:.pressed$',1)
8 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^4.PRESS_SHORT:.pressed$',1)
9 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^4.PRESS_LONG:.pressed$',1)
do:
0:
0 set MQTT2_Steckdose_14 toggle
1:
0
10:
0 set ECHO_G090XG0794221J1D tunein s42824
11:
0
12:
0 set ECHO_G090XG0794221J1D pause
13:
0
14:
2:
0 set MQTT2_Steckdose_13 toggle
3:
0
4:
0 set HUEDevice13 on, set HUEDevice14 on
1
5:
0 set HUEDevice13 rgb F01914, set HUEDevice14 rgb F01914
1
6:
0 set HUEDevice13 off, set HUEDevice14 off
7:
0
8:
0 set MQTT2_Steckdose_3 toggle
9:
0
helper:
DEVFILTER ^global$|^HMIP_UG_Buero_6f_Schalter$|^ECHO_G090XG0794221J1D$|HMIP_UG_Buero_6f_Schalter
NOTIFYDEV global|HMIP_UG_Buero_6f_Schalter|ECHO_G090XG0794221J1D|.*HMIP_UG_Buero_6f_Schalter.*
event 3.PRESS_SHORT: pressed
globalinit 1
last_timer 0
sleeptimer -1
timerdev HMIP_UG_Buero_6f_Schalter
timerevent 3.PRESS_SHORT: pressed
triggerDev HMIP_UG_Buero_6f_Schalter
timerevents:
0.UNREACH: 0
0.LOW_BAT: Battery OK
3.PRESS_SHORT: pressed
timereventsState:
0.UNREACH: 0
0.LOW_BAT: Battery OK
3.PRESS_SHORT: pressed
triggerEvents:
3.PRESS_SHORT: pressed
triggerEventsState:
3.PRESS_SHORT: pressed
internals:
readings:
all ECHO_G090XG0794221J1D:playStatus
trigger:
all HMIP_UG_Buero_6f_Schalter
uiState:
uiTable:
Attributes:
do always
icon helper_doif
room 99 DOIF/NOTIFY
Das seltsame ist; wenn ich Schalter 3 1x drücke: Licht geht an (cmd_5) nochmaliges drücken: Light geht aus (cmd_7); dann kann ich drücken sooft ich will - es passiert gar nix mehr.
Und was ist im ersten "list" falsch? Der ist bei cmd_7
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"2") (set HUEDevice13 off, set HUEDevice14 off)
und das passt zu dem triggernden Event.
Zitat von: smeagel am 13 September 2020, 21:08:21
Das seltsame ist; wenn ich Schalter 3 1x drücke: Licht geht an (cmd_5) nochmaliges drücken: Light geht aus (cmd_7); dann kann ich drücken sooft ich will - es passiert gar nix mehr.
Mit welcher Version vom DOIF, die mit auskommentiertem 5. Befehl?
Zum Ablauf musst Du denken, dass die Bedingungen von oben nach unten (in CommandRef steht von links nach rechts) bewertet werden. Die erste wahre wird benutzt
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"0|3") (set HUEDevice13 on, set HUEDevice14 on) ()
DOELSEIF(["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"1") (set HUEDevice13 rgb F01914, set HUEDevice14 rgb F01914) ()
DOELSEIF (["HMIP_UG_Buero_6f_Schalter:^3.PRESS_SHORT:.pressed$"] and $cmd =~"2") (set HUEDevice13 off, set HUEDevice14 off)
Das sind die 3 betroffene Bedingungen.
Also, wenn Du drückst, wird auch getestet in welchem Zustand das DOIF vorher war ($cmd). Wenn nichts stimmt, wird nichst ausgeführt.
Guten Morgen,
es scheint nur zu funktionieren wenn der Taster 3 short ein eigenes DOIF bekommt.
Sobald er sich in dem DOIF mit den anderen schaltern befindet - geht es nicht.
Gibt es die Möglichkeit das er nach einer Zeit den Cmd-Satus auf null setzt?
Im Moment lasse ich das DOIF beim ausschalten neu initialisieren.
Internals:
CFGFN
DEF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_SHORT:.pressed$"] and $cmd =~"0|6") (set HUEDevice13 on, set HUEDevice14 on)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_SHORT:.pressed$"] and $cmd =="1") (set HUEDevice13 rgb 0905F9, set HUEDevice14 rgb 0905F9)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_SHORT:.pressed$"] and $cmd =="2") (set HUEDevice13 rgb EF1914, set HUEDevice14 rgb EF1914)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_SHORT:.pressed$"] and $cmd =="3") (set HUEDevice13 rgb 38FF04, set HUEDevice14 rgb 38FF04)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_SHORT:.pressed$"] and $cmd =="4") (set HUEDevice13 rgb FFDEC3, set HUEDevice14 rgb FFDEC3)
DOELSEIF ([HMIP_UG_Buero_6f_Schalter:"^3.PRESS_SHORT:.pressed$"] and $cmd =="5") (set HUEDevice13 off, set HUEDevice14 off)
FUUID 5f5f071e-f33f-e7fd-889d-ade6905822bd2738
MODEL FHEM
NAME doif_HMIP_UG_Buero_6f_Schalter_3
NOTIFYDEV global,HMIP_UG_Buero_6f_Schalter
NR 18348
NTFY_ORDER 50-doif_HMIP_UG_Buero_6f_Schalter_3
STATE cmd_1
TYPE DOIF
VERSION 22735 2020-09-05 11:05:46
READINGS:
2020-09-14 08:04:12 Device HMIP_UG_Buero_6f_Schalter
2020-09-14 08:04:12 cmd 1
2020-09-14 08:04:12 cmd_event HMIP_UG_Buero_6f_Schalter
2020-09-14 08:04:12 cmd_nr 1
2020-09-14 08:04:12 e_HMIP_UG_Buero_6f_Schalter_events 3.PRESS_SHORT: pressed
2020-09-14 08:03:59 mode enabled
2020-09-14 08:04:12 state cmd_1
Regex:
accu:
cond:
HMIP_UG_Buero_6f_Schalter:
0:
&STATE ^HMIP_UG_Buero_6f_Schalter$
1:
&STATE ^HMIP_UG_Buero_6f_Schalter$
2:
&STATE ^HMIP_UG_Buero_6f_Schalter$
3:
&STATE ^HMIP_UG_Buero_6f_Schalter$
4:
&STATE ^HMIP_UG_Buero_6f_Schalter$
5:
&STATE ^HMIP_UG_Buero_6f_Schalter$
attr:
cmdState:
wait:
waitdel:
condition:
0 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',1) and $cmd =~"0|6"
1 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',1) and $cmd =="1"
2 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',1) and $cmd =="2"
3 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',1) and $cmd =="3"
4 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',1) and $cmd =="4"
5 ::EventDoIf('HMIP_UG_Buero_6f_Schalter',$hash,'^3.PRESS_SHORT:.pressed$',1) and $cmd =="5"
do:
0:
0 set HUEDevice13 on, set HUEDevice14 on
1:
0 set HUEDevice13 rgb 0905F9, set HUEDevice14 rgb 0905F9
2:
0 set HUEDevice13 rgb EF1914, set HUEDevice14 rgb EF1914
3:
0 set HUEDevice13 rgb 38FF04, set HUEDevice14 rgb 38FF04
4:
0 set HUEDevice13 rgb FFDEC3, set HUEDevice14 rgb FFDEC3
5:
0 set HUEDevice13 off, set HUEDevice14 off
6:
helper:
DEVFILTER ^global$|^HMIP_UG_Buero_6f_Schalter$
NOTIFYDEV global|HMIP_UG_Buero_6f_Schalter
event 3.PRESS_SHORT: pressed
globalinit 1
last_timer 0
sleeptimer -1
timerdev HMIP_UG_Buero_6f_Schalter
timerevent 3.PRESS_SHORT: pressed
triggerDev HMIP_UG_Buero_6f_Schalter
DOIF_eventa:
cmd_nr: 1
cmd: 1
cmd_event: HMIP_UG_Buero_6f_Schalter
cmd_1
DOIF_eventas:
cmd_nr: 1
cmd: 1
cmd_event: HMIP_UG_Buero_6f_Schalter
state: cmd_1
timerevents:
3.PRESS_SHORT: pressed
timereventsState:
3.PRESS_SHORT: pressed
triggerEvents:
3.PRESS_SHORT: pressed
triggerEventsState:
3.PRESS_SHORT: pressed
internals:
readings:
trigger:
all HMIP_UG_Buero_6f_Schalter
uiState:
uiTable:
Attributes:
Zitat von: smeagel am 14 September 2020, 07:45:09
Gibt es die Möglichkeit das er nach einer Zeit den Cmd-Satus auf null setzt?
Ja, siehe Beispiel hier: https://forum.fhem.de/index.php/topic,114068.msg1083365.html#msg1083365