Moin,
wer hat hierzu nen Tip.
Ich bastel gerade an eine Chlordosierung für meinen Pool.
Meines Erachtens ist die Bedingung1 = true, somit müsste CMD1(aka 600) ausgeführt werden. Alle anderen Bedingungen sind IMO false. Dennoch wird CMD4(aka 1200) ausgeführt.
"Chlor_Woche" ist ein Dummy mit 4 "states". (600,800,1000,1200)
defmod Do_ChlorWoche DOIF ([11:55-18:00]\
and [Temp_Pool:Temperatur] < 20)\
(set Chlor_Woche 600)\
DOELSEIF\
([11:55:02-18:00]\
and [Temp_Pool:Temperatur] => 20\
and [Temp_Pool:Temperatur] < 24)\
(set Chlor_Woche 800)\
DOELSEIF\
([11:55:04-18:00]\
and [Temp_Pool:Temperatur] => 24\
and [Temp_Pool:Temperatur] < 27)\
(set Chlor_Woche 1000)\
DOELSEIF\
([11:55:06-18:00]\
and [Temp_Pool:Temperatur] => 27)\
(set Chlor_Woche 1200)
attr Do_ChlorWoche cmdState 600|800|1000|1200
Hier mal das List:
Internals:
DEF ([11:55-18:00]
and [Temp_Pool:Temperatur] < 20)
(set Chlor_Woche 600)
DOELSEIF
([11:55:02-18:00]
and [Temp_Pool:Temperatur] => 20
and [Temp_Pool:Temperatur] < 24)
(set Chlor_Woche 800)
DOELSEIF
([11:55:04-18:00]
and [Temp_Pool:Temperatur] => 24
and [Temp_Pool:Temperatur] < 27)
(set Chlor_Woche 1000)
DOELSEIF
([11:55:06-18:00]
and [Temp_Pool:Temperatur] => 27)
(set Chlor_Woche 1200)
FUUID 5e9d6ca3-f33f-dcb4-e6ef-18fd8ee0a7c708c1
MODEL FHEM
NAME Do_ChlorWoche
NOTIFYDEV Temp_Pool,global
NR 1536
NTFY_ORDER 50-Do_ChlorWoche
STATE 1200
TYPE DOIF
VERSION 21224 2020-02-18 18:45:49
READINGS:
2020-04-24 10:48:51 Device Temp_Pool
2020-04-24 11:55:06 cmd 4
2020-04-24 11:55:06 cmd_event timer_7
2020-04-24 11:55:06 cmd_nr 4
2020-04-24 10:48:51 e_Temp_Pool_Temperatur 17.00
2020-04-23 14:14:43 mode enabled
2020-04-24 11:55:06 state 1200
2020-04-24 10:48:03 timer_01_c01 24.04.2020 11:55:00
2020-04-24 10:48:03 timer_02_c01 24.04.2020 18:00:00
2020-04-24 10:48:03 timer_03_c02 24.04.2020 11:55:02
2020-04-24 10:48:03 timer_04_c02 24.04.2020 18:00:00
2020-04-24 10:48:03 timer_05_c03 24.04.2020 11:55:04
2020-04-24 10:48:03 timer_06_c03 24.04.2020 18:00:00
2020-04-24 10:48:03 timer_07_c04 24.04.2020 11:55:06
2020-04-24 10:48:03 timer_08_c04 24.04.2020 18:00:00
Regex:
accu:
cond:
Temp_Pool:
0:
Temperatur ^Temp_Pool$:^Temperatur:
1:
Temperatur ^Temp_Pool$:^Temperatur:
2:
Temperatur ^Temp_Pool$:^Temperatur:
3:
Temperatur ^Temp_Pool$:^Temperatur:
attr:
cmdState:
0:
600
1:
800
2:
1000
3:
1200
waitdel:
condition:
0 ::DOIF_time($hash,0,1,$wday,$hms) and ::ReadingValDoIf($hash,'Temp_Pool','Temperatur') < 20
1 ::DOIF_time($hash,2,3,$wday,$hms) and ::ReadingValDoIf($hash,'Temp_Pool','Temperatur') => 20 and ::ReadingValDoIf($hash,'Temp_Pool','Temperatur') < 24
2 ::DOIF_time($hash,4,5,$wday,$hms) and ::ReadingValDoIf($hash,'Temp_Pool','Temperatur') => 24 and ::ReadingValDoIf($hash,'Temp_Pool','Temperatur') < 27
3 ::DOIF_time($hash,6,7,$wday,$hms) and ::ReadingValDoIf($hash,'Temp_Pool','Temperatur') => 27
days:
do:
0:
0 set Chlor_Woche 600
1:
0 set Chlor_Woche 800
2:
0 set Chlor_Woche 1000
3:
0 set Chlor_Woche 1200
4:
helper:
DEVFILTER ^global$|^Temp_Pool$
NOTIFYDEV global|Temp_Pool
event timer_7
globalinit 1
last_timer 8
sleeptimer -1
timerdev
timerevent timer_7
triggerDev
DOIF_eventa:
cmd_nr: 4
cmd: 4
cmd_event: timer_7
1200
DOIF_eventas:
cmd_nr: 4
cmd: 4
cmd_event: timer_7
state: 1200
timerevents:
timer_7
timereventsState:
timer_7
triggerEvents:
timer_7
triggerEventsState:
timer_7
internals:
interval:
0 -1
1 0
2 -1
3 2
4 -1
5 4
6 -1
7 6
intervalfunc:
intervaltimer:
localtime:
0 1587722100
1 1587744000
2 1587722102
3 1587744000
4 1587722104
5 1587744000
6 1587722106
7 1587744000
perlblock:
readings:
all Temp_Pool:Temperatur
realtime:
0 11:55:00
1 18:00:00
2 11:55:02
3 18:00:00
4 11:55:04
5 18:00:00
6 11:55:06
7 18:00:00
time:
0 11:55:00
1 18:00:00
2 11:55:02
3 18:00:00
4 11:55:04
5 18:00:00
6 11:55:06
7 18:00:00
timeCond:
0 0
1 0
2 1
3 1
4 2
5 2
6 3
7 3
timer:
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
timers:
0 0 1
1 2 3
2 4 5
3 6 7
trigger:
triggertime:
1587744000:
localtime 1587744000
hash:
uiState:
uiTable:
Attributes:
cmdState 600|800|1000|1200
Hi,
>= (https://perldoc.perl.org/perlop.html#Operator-Precedence-and-Associativity)
Gruß Otto
Danke Otto,
probier ich ::)
LG
Edith: Hat geklappt...... 8) :P...