Hallo,
vielleicht kann jemand helfen. Ich habe eine DOIF Funktion im Einsatz. Sobald ich innerhalb einer Bedingung eine Prüfung ">= 0" auf einen negativen Wert der aus einem userReading kommt mache, steigt die gesamte Bedigungsfolge der DOIFs aus und die Funktion geht auf das letzte DOELSE.
So funktioniert die Abfrage (ab 20:50 Uhr geht es nach cmd_2 wenn die anderen Bedingungen stimmen):
([05:45-06:58] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 0 and [mqtt2_victron:Battery-SoC] >= 25 and ( $month >= 2 || $month <= 10 ) and ([DWD:fc0_12_SunD3] >= 1100 or [DWD:fc0_15_SunD3] >= 1100)) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400) DOELSEIF ([20:50-22:45] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 0 and [mqtt2_victron:Battery-SoC] >= 58 and ( $month >= 2 || $month <= 10 ) and ([DWD:fc1_12_SunD3] >= 1100 or [DWD:fc1_15_SunD3] >= 1100)) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400) DOELSEIF ([07:00-15:45] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 400 and ( $month >= 2 || $month <= 10 ) and [mqtt2_victron:Battery-SoC] >= 25 and [mqtt2_openwb:LP-ChargeState] == 0 and [DWD:fc0_15_SunD3] >= 800 and [DWD:fc0_15_SunD3] <= 2100) (sleep 0.1;setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet:d0]) * -1 + 200)}) DOELSEIF ([07:00-16:10] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 400 and [mqtt2_openwb:LP-ChargeState] == 0 and ( $month >= 2 || $month <= 10 ) and [mqtt2_victron:Battery-SoC] >= 25 and [DWD:fc0_15_SunD3] >= 2101) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet2:d0]) * -1 + 150)}) DOELSE (sleep 0.1;setreading mqtt2_victron AcPowerSetPoint 0.0)
Sobald ich folgenden Vergleich in cmd_4 einfüge, steigt es auf cmd_5 (DOELSE) aus, obwohl noch nicht mal die Uhrzeit-Abfrage in in cmd_4 überhaupt stimmt.
[mqtt2_victron:ACSetPointSet2:d0] >= 0
bzw. hier der DOELSEIF-Zweig (cmd_4):
DOELSEIF ([07:00-16:10] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 400 and [mqtt2_openwb:LP-ChargeState] == 0 and ( $month >= 2 || $month <= 10 ) and [mqtt2_victron:Battery-SoC] >= 25 and [DWD:fc0_15_SunD3] >= 2101 and [mqtt2_victron:ACSetPointSet2:d0] >= 0) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet2:d0]) * -1 + 150)})
AcSetPointSet2 hat zu diesem Zeitpunkt einen Wert von bspw. == -793.8
Hat jemand eine Idee?
Danke vorab
Mit >= 0 fragst du nach positiven Zahlen ab, bei negativen Zahlen ist die Abfrage unwahr.
Danke. Ja, in diesem Fall soll es auch unwahr sein. So wäre es ja deterministisch bzw. das will ich in dem Fall auch.
Was aber passiert, ist, dass es trotz mehrerer Bedingungen die verundet sind und in unwahr enden innerhalb dieses DOELSEIF, die vorläufigen Abfragen (die in wahr enden) scheinbar ausgehebelt werden. Es geht dann zuletzt in das DOELSE. Sobald ich diese Abfrage herausstreiche, greifen die Bedingungen davor wieder.
Gar nicht so leicht zu beschreiben :)
Also noch mal, das hier ist alles "wahr"?
Zitat von: dmq am 18 Mai 2023, 23:08:54DOELSEIF ([07:00-16:10] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 400 and [mqtt2_openwb:LP-ChargeState] == 0 and ( $month >= 2 || $month <= 10 ) and [mqtt2_victron:Battery-SoC] >= 25 and [DWD:fc0_15_SunD3] >= 2101
Das hier ist bei -793.8 natürlich NICHT wahr:
Zitat von: dmq am 18 Mai 2023, 23:08:54[mqtt2_victron:ACSetPointSet2:d0] >= 0)
Da alles mit and/UND verknüpft ist, muss ja auch ALLES wahr sein.
Wenn eines davon nicht wahr ist (und die von dir als "komisch" benannte Bedingung ist eben NICHT wahr), dann ist der ganze Zweig "unwahr" und es wird eben weiter versucht, ob noch ein weiterer Zweig wahr ist.
Wenn nicht: DOELSE
Gruß, Joachim
Danke Joachim.
Alles richtig und ich folge Dir voll und ganz.
Was aber passiert, ist, dass auch diese Bedingung, die davor kommt nicht mehr gesetzt wird, obwohl sie "wahr" ist:
DOELSEIF ([20:50-22:45] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 0 and [mqtt2_victron:Battery-SoC] >= 58 and ( $month >= 2 || $month <= 10 ) and ([DWD:fc1_12_SunD3] >= 1100 or [DWD:fc1_15_SunD3] >= 1100)) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400)
Diese Bedingung (cmd_2), hat gar nichts mit der neuen Abfrage innerhalb Bedingung cmd_4 zu tun, alle Inhalte sind (bzw. waren zu dem Zeitpunkt)"wahr". Sobald ich die Abfrage aus der anderen Abfrage herausnehme, wird dort auch alles wieder war und er setzt cmd_2 (die 2. Bedinung) und nicht cmd_5 (das DOELSE). Ich verstehe DOIF so, dass es sequenziell durch die Bedingungen geht und dort aussteigt, was als erstes wahr ist und die anderen Bedingungen werden nicht mehr betrachtet und das dann eben als paramteriersierbare zeitliche Schleife.
In der Hoffnung das ich nicht völlig auf dem Schlauch stehen - lieben Gruß, Christian
Dann poste doch mal ein list des DOIF und zwar KOMPLETT, wenn der Fall eingetreten ist...
(mit stückchenweisen Auszügen und "mündlichen" Erläuterungen kann man hier nicht wirklich helfen)
Gruß, Joachim
Anbei die lists.
1) Funktional ohne die Anpassung. Bedignung führt planmäßig zu cmd_2.
2) Nicht-Funktional nach Änderung innerhalb cmd_4. Führt dann fehlerhaft zu cmd_5 (DOELSE) und nicht zu cmd_2.
1) -------------------------
Internals:
DEF ([05:45-06:58] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 0 and [mqtt2_victron:Battery-SoC] >= 25 and ( $month >= 2 || $month <= 10 ) and ([DWD:fc0_12_SunD3] >= 1100 or [DWD:fc0_15_SunD3] >= 1100)) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400) DOELSEIF ([20:50-22:45] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 0 and [mqtt2_victron:Battery-SoC] >= 58 and ( $month >= 2 || $month <= 10 ) and ([DWD:fc1_12_SunD3] >= 1100 or [DWD:fc1_15_SunD3] >= 1100)) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400) DOELSEIF ([07:00-15:45] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 400 and ( $month >= 2 || $month <= 10 ) and [mqtt2_victron:Battery-SoC] >= 25 and [mqtt2_openwb:LP-ChargeState] == 0 and [DWD:fc0_15_SunD3] >= 800 and [DWD:fc0_15_SunD3] <= 2100) (sleep 0.1;setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet:d0]) * -1 + 200)}) DOELSEIF ([07:00-16:10] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 400 and [mqtt2_openwb:LP-ChargeState] == 0 and ( $month >= 2 || $month <= 10 ) and [mqtt2_victron:Battery-SoC] >= 25 and [DWD:fc0_15_SunD3] >= 2101) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet2:d0]) * -1 + 150)}) DOELSE (sleep 0.1;setreading mqtt2_victron AcPowerSetPoint 0.0)
FUUID 608704f9-f33f-df05-6544-dd8bea958685e609
MODEL FHEM
NAME DOIF_mqtt2_victron_acsetpoint
NOTIFYDEV global,mqtt2_openwb,modbus_fronius_inverter_mppt,mqtt2_victron,DWD
NR 241
NTFY_ORDER 50-DOIF_mqtt2_victron_acsetpoint
STATE cmd_2
TYPE DOIF
VERSION 24330 2021-04-24 21:09:16
READINGS:
2023-05-19 21:13:14 Device mqtt2_victron
2023-05-19 21:13:45 cmd 2
2023-05-19 21:13:45 cmd_event modbus_fronius_inverter_mppt
2023-05-19 21:13:45 cmd_nr 2
2023-05-19 21:13:01 e_modbus_fronius_inverter_mppt_Power_String1__W 0
2023-05-19 21:13:14 e_mqtt2_victron_Battery-SoC 94
2023-05-18 22:24:51 mode enabled
2023-05-19 21:13:45 state cmd_2
2023-05-19 06:58:01 timer_01_c01 20.05.2023 05:45:00
2023-05-19 06:58:01 timer_02_c01 20.05.2023 06:58:00
2023-05-18 22:45:00 timer_03_c02 19.05.2023 20:50:00
2023-05-18 22:45:00 timer_04_c02 19.05.2023 22:45:00
2023-05-19 15:45:01 timer_05_c03 20.05.2023 07:00:00
2023-05-19 15:45:01 timer_06_c03 20.05.2023 15:45:00
2023-05-19 16:10:00 timer_07_c04 20.05.2023 07:00:00
2023-05-19 16:10:00 timer_08_c04 20.05.2023 16:10:00
2023-05-19 21:13:45 wait_timer 19.05.2023 21:13:50 cmd_2 modbus_fronius_inverter_mppt
Regex:
accu:
collect:
cond:
DWD:
0:
fc0_12_SunD3 ^DWD$:^fc0_12_SunD3:
fc0_15_SunD3 ^DWD$:^fc0_15_SunD3:
1:
fc1_12_SunD3 ^DWD$:^fc1_12_SunD3:
fc1_15_SunD3 ^DWD$:^fc1_15_SunD3:
2:
fc0_15_SunD3 ^DWD$:^fc0_15_SunD3:
3:
fc0_15_SunD3 ^DWD$:^fc0_15_SunD3:
modbus_fronius_inverter_mppt:
0:
Power_String1__W ^modbus_fronius_inverter_mppt$:^Power_String1__W:
1:
Power_String1__W ^modbus_fronius_inverter_mppt$:^Power_String1__W:
2:
Power_String1__W ^modbus_fronius_inverter_mppt$:^Power_String1__W:
3:
Power_String1__W ^modbus_fronius_inverter_mppt$:^Power_String1__W:
mqtt2_openwb:
2:
LP-ChargeState ^mqtt2_openwb$:^LP-ChargeState:
3:
LP-ChargeState ^mqtt2_openwb$:^LP-ChargeState:
mqtt2_victron:
0:
Battery-SoC ^mqtt2_victron$:^Battery-SoC:
1:
Battery-SoC ^mqtt2_victron$:^Battery-SoC:
2:
Battery-SoC ^mqtt2_victron$:^Battery-SoC:
3:
Battery-SoC ^mqtt2_victron$:^Battery-SoC:
attr:
cmdState:
repeatcmd:
5
5
5
5
5
wait:
0:
5
1:
5
2:
5
3:
5
4:
5
waitdel:
condition:
0 ::DOIF_time($hash,0,1,$wday,$hms) and ::ReadingValDoIf($hash,'modbus_fronius_inverter_mppt','Power_String1__W') >= 0 and ::ReadingValDoIf($hash,'mqtt2_victron','Battery-SoC') >= 25 and ( $month >= 2 || $month <= 10 ) and (::ReadingValDoIf($hash,'DWD','fc0_12_SunD3') >= 1100 or ::ReadingValDoIf($hash,'DWD','fc0_15_SunD3') >= 1100)
1 ::DOIF_time($hash,2,3,$wday,$hms) and ::ReadingValDoIf($hash,'modbus_fronius_inverter_mppt','Power_String1__W') >= 0 and ::ReadingValDoIf($hash,'mqtt2_victron','Battery-SoC') >= 58 and ( $month >= 2 || $month <= 10 ) and (::ReadingValDoIf($hash,'DWD','fc1_12_SunD3') >= 1100 or ::ReadingValDoIf($hash,'DWD','fc1_15_SunD3') >= 1100)
2 ::DOIF_time($hash,4,5,$wday,$hms) and ::ReadingValDoIf($hash,'modbus_fronius_inverter_mppt','Power_String1__W') >= 400 and ( $month >= 2 || $month <= 10 ) and ::ReadingValDoIf($hash,'mqtt2_victron','Battery-SoC') >= 25 and ::ReadingValDoIf($hash,'mqtt2_openwb','LP-ChargeState') == 0 and ::ReadingValDoIf($hash,'DWD','fc0_15_SunD3') >= 800 and ::ReadingValDoIf($hash,'DWD','fc0_15_SunD3') <= 2100
3 ::DOIF_time($hash,6,7,$wday,$hms) and ::ReadingValDoIf($hash,'modbus_fronius_inverter_mppt','Power_String1__W') >= 400 and ::ReadingValDoIf($hash,'mqtt2_openwb','LP-ChargeState') == 0 and ( $month >= 2 || $month <= 10 ) and ::ReadingValDoIf($hash,'mqtt2_victron','Battery-SoC') >= 25 and ::ReadingValDoIf($hash,'DWD','fc0_15_SunD3') >= 2101
days:
do:
0:
0 sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400
1:
0 sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400
2:
0 sleep 0.1;setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet:d0]) * -1 + 200)}
3:
0 sleep 0.1; setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet2:d0]) * -1 + 150)}
4:
0 sleep 0.1;setreading mqtt2_victron AcPowerSetPoint 0.0
helper:
DEVFILTER ^global$|^mqtt2_openwb$|^mqtt2_victron$|^modbus_fronius_inverter_mppt$|^DWD$
NOTIFYDEV global|mqtt2_openwb|mqtt2_victron|modbus_fronius_inverter_mppt|DWD
event Battery-SoC: 94,Battery-ConsumedAmpHours-ah: 48
globalinit 1
last_timer 8
sleepdevice modbus_fronius_inverter_mppt
sleepsubtimer 0
sleeptimer 1
timerdev mqtt2_victron
timerevent Battery-SoC: 94,Battery-ConsumedAmpHours-ah: 48
triggerDev mqtt2_victron
DOIF_eventa:
cmd_nr: 2
cmd: 2
cmd_event: modbus_fronius_inverter_mppt
cmd_2
DOIF_eventas:
cmd_nr: 2
cmd: 2
cmd_event: modbus_fronius_inverter_mppt
state: cmd_2
timerevents:
Battery-SoC: 94
Battery-ConsumedAmpHours-ah: 48
timereventsState:
Battery-SoC: 94
Battery-ConsumedAmpHours-ah: 48
triggerEvents:
Battery-SoC: 94
Battery-ConsumedAmpHours-ah: 48
triggerEventsState:
Battery-SoC: 94
Battery-ConsumedAmpHours-ah: 48
internals:
interval:
0 -1
1 0
2 -1
3 2
4 -1
5 4
6 -1
7 6
intervalfunc:
intervaltimer:
localtime:
0 1684554300
1 1684558680
2 1684522200
3 1684529100
4 1684558800
5 1684590300
6 1684558800
7 1684591800
readings:
all modbus_fronius_inverter_mppt:Power_String1__W mqtt2_victron:Battery-SoC DWD:fc0_12_SunD3 DWD:fc0_15_SunD3 DWD:fc1_12_SunD3 DWD:fc1_15_SunD3 mqtt2_openwb:LP-ChargeState
realtime:
0 05:45:00
1 06:58:00
2 20:50:00
3 22:45:00
4 07:00:00
5 15:45:00
6 07:00:00
7 16:10:00
time:
0 05:45:00
1 06:58:00
2 20:50:00
3 22:45:00
4 07:00:00
5 15:45:00
6 07:00:00
7 16:10: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:
1684529100:
localtime 1684529100
hash:
1684554300:
localtime 1684554300
hash:
1684558680:
localtime 1684558680
hash:
1684558800:
localtime 1684558800
hash:
1684590300:
localtime 1684590300
hash:
1684591800:
localtime 1684591800
hash:
uiState:
uiTable:
Attributes:
disable 0
do always
repeatcmd 5:5:5:5:5
wait 5:5:5:5:5
-------------------------
2) -------------------------
Änderung: "and [mqtt2_victron:ACSetPointSet2:d0] >= 0" innerhalb cmd_4. Aktueller Wert: "-987.9".
Internals:
DEF ([05:45-06:58] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 0 and [mqtt2_victron:Battery-SoC] >= 25 and ( $month >= 2 || $month <= 10 ) and ([DWD:fc0_12_SunD3] >= 1100 or [DWD:fc0_15_SunD3] >= 1100)) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400) DOELSEIF ([20:50-22:45] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 0 and [mqtt2_victron:Battery-SoC] >= 58 and ( $month >= 2 || $month <= 10 ) and ([DWD:fc1_12_SunD3] >= 1100 or [DWD:fc1_15_SunD3] >= 1100)) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400) DOELSEIF ([07:00-15:45] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 400 and ( $month >= 2 || $month <= 10 ) and [mqtt2_victron:Battery-SoC] >= 25 and [mqtt2_openwb:LP-ChargeState] == 0 and [DWD:fc0_15_SunD3] >= 800 and [DWD:fc0_15_SunD3] <= 2100) (sleep 0.1;setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet:d0]) * -1 + 200)}) DOELSEIF ([07:00-16:10] and [modbus_fronius_inverter_mppt:Power_String1__W] >= 400 and [mqtt2_openwb:LP-ChargeState] == 0 and ( $month >= 2 || $month <= 10 ) and [mqtt2_victron:Battery-SoC] >= 25 and [DWD:fc0_15_SunD3] >= 2101 and [mqtt2_victron:ACSetPointSet2:d0] >= 0) (sleep 0.1; setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet2:d0]) * -1 + 150)}) DOELSE (sleep 0.1;setreading mqtt2_victron AcPowerSetPoint 0.0)
FUUID 608704f9-f33f-df05-6544-dd8bea958685e609
MODEL FHEM
NAME DOIF_mqtt2_victron_acsetpoint
NOTIFYDEV DWD,mqtt2_victron,modbus_fronius_inverter_mppt,mqtt2_openwb,global
NR 241
NTFY_ORDER 50-DOIF_mqtt2_victron_acsetpoint
STATE cmd_5
TYPE DOIF
VERSION 24330 2021-04-24 21:09:16
READINGS:
2023-05-19 21:20:08 Device mqtt2_victron
2023-05-19 21:20:05 cmd 5
2023-05-19 21:20:05 cmd_event mqtt2_victron
2023-05-19 21:20:05 cmd_nr 5
2023-05-19 21:20:08 e_mqtt2_victron_ACSetPointSet2 -987.9
2023-05-19 21:19:54 mode enabled
2023-05-19 21:20:05 state cmd_5
2023-05-19 21:19:54 timer_01_c01 20.05.2023 05:45:00
2023-05-19 21:19:54 timer_02_c01 20.05.2023 06:58:00
2023-05-19 21:19:54 timer_03_c02 20.05.2023 20:50:00
2023-05-19 21:19:54 timer_04_c02 19.05.2023 22:45:00
2023-05-19 21:19:54 timer_05_c03 20.05.2023 07:00:00
2023-05-19 21:19:54 timer_06_c03 20.05.2023 15:45:00
2023-05-19 21:19:54 timer_07_c04 20.05.2023 07:00:00
2023-05-19 21:19:54 timer_08_c04 20.05.2023 16:10:00
2023-05-19 21:20:05 wait_timer 19.05.2023 21:20:10 cmd_5 mqtt2_victron
Regex:
accu:
collect:
cond:
DWD:
0:
fc0_12_SunD3 ^DWD$:^fc0_12_SunD3:
fc0_15_SunD3 ^DWD$:^fc0_15_SunD3:
1:
fc1_12_SunD3 ^DWD$:^fc1_12_SunD3:
fc1_15_SunD3 ^DWD$:^fc1_15_SunD3:
2:
fc0_15_SunD3 ^DWD$:^fc0_15_SunD3:
3:
fc0_15_SunD3 ^DWD$:^fc0_15_SunD3:
modbus_fronius_inverter_mppt:
0:
Power_String1__W ^modbus_fronius_inverter_mppt$:^Power_String1__W:
1:
Power_String1__W ^modbus_fronius_inverter_mppt$:^Power_String1__W:
2:
Power_String1__W ^modbus_fronius_inverter_mppt$:^Power_String1__W:
3:
Power_String1__W ^modbus_fronius_inverter_mppt$:^Power_String1__W:
mqtt2_openwb:
2:
LP-ChargeState ^mqtt2_openwb$:^LP-ChargeState:
3:
LP-ChargeState ^mqtt2_openwb$:^LP-ChargeState:
mqtt2_victron:
0:
Battery-SoC ^mqtt2_victron$:^Battery-SoC:
1:
Battery-SoC ^mqtt2_victron$:^Battery-SoC:
2:
Battery-SoC ^mqtt2_victron$:^Battery-SoC:
3:
ACSetPointSet2 ^mqtt2_victron$:^ACSetPointSet2:
Battery-SoC ^mqtt2_victron$:^Battery-SoC:
attr:
cmdState:
repeatcmd:
5
5
5
5
5
wait:
0:
5
1:
5
2:
5
3:
5
4:
5
waitdel:
condition:
0 ::DOIF_time($hash,0,1,$wday,$hms) and ::ReadingValDoIf($hash,'modbus_fronius_inverter_mppt','Power_String1__W') >= 0 and ::ReadingValDoIf($hash,'mqtt2_victron','Battery-SoC') >= 25 and ( $month >= 2 || $month <= 10 ) and (::ReadingValDoIf($hash,'DWD','fc0_12_SunD3') >= 1100 or ::ReadingValDoIf($hash,'DWD','fc0_15_SunD3') >= 1100)
1 ::DOIF_time($hash,2,3,$wday,$hms) and ::ReadingValDoIf($hash,'modbus_fronius_inverter_mppt','Power_String1__W') >= 0 and ::ReadingValDoIf($hash,'mqtt2_victron','Battery-SoC') >= 58 and ( $month >= 2 || $month <= 10 ) and (::ReadingValDoIf($hash,'DWD','fc1_12_SunD3') >= 1100 or ::ReadingValDoIf($hash,'DWD','fc1_15_SunD3') >= 1100)
2 ::DOIF_time($hash,4,5,$wday,$hms) and ::ReadingValDoIf($hash,'modbus_fronius_inverter_mppt','Power_String1__W') >= 400 and ( $month >= 2 || $month <= 10 ) and ::ReadingValDoIf($hash,'mqtt2_victron','Battery-SoC') >= 25 and ::ReadingValDoIf($hash,'mqtt2_openwb','LP-ChargeState') == 0 and ::ReadingValDoIf($hash,'DWD','fc0_15_SunD3') >= 800 and ::ReadingValDoIf($hash,'DWD','fc0_15_SunD3') <= 2100
3 ::DOIF_time($hash,6,7,$wday,$hms) and ::ReadingValDoIf($hash,'modbus_fronius_inverter_mppt','Power_String1__W') >= 400 and ::ReadingValDoIf($hash,'mqtt2_openwb','LP-ChargeState') == 0 and ( $month >= 2 || $month <= 10 ) and ::ReadingValDoIf($hash,'mqtt2_victron','Battery-SoC') >= 25 and ::ReadingValDoIf($hash,'DWD','fc0_15_SunD3') >= 2101 and ::ReadingValDoIf($hash,'mqtt2_victron','ACSetPointSet2','','d0') >= 0
days:
do:
0:
0 sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400
1:
0 sleep 0.1; setreading mqtt2_victron AcPowerSetPoint -1400
2:
0 sleep 0.1;setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet:d0]) * -1 + 200)}
3:
0 sleep 0.1; setreading mqtt2_victron AcPowerSetPoint {(([mqtt2_victron:ACSetPointSet2:d0]) * -1 + 150)}
4:
0 sleep 0.1;setreading mqtt2_victron AcPowerSetPoint 0.0
helper:
DEVFILTER ^global$|^mqtt2_openwb$|^mqtt2_victron$|^modbus_fronius_inverter_mppt$|^DWD$
NOTIFYDEV global|mqtt2_openwb|mqtt2_victron|modbus_fronius_inverter_mppt|DWD
event Battery-Power: -1359,Energy_HouseConsumption: 1005.0200003624,ACSetPointSet: -1005.0200003624,ACSetPointSet2: -987.9
globalinit 1
last_timer 8
sleepdevice mqtt2_victron
sleepsubtimer 0
sleeptimer 4
timerdev mqtt2_victron
timerevent Battery-Power: -1359,Energy_HouseConsumption: 1005.0200003624,ACSetPointSet: -1005.0200003624,ACSetPointSet2: -987.9
triggerDev mqtt2_victron
timerevents:
Battery-Power: -1359
Energy_HouseConsumption: 1005.0200003624
ACSetPointSet: -1005.0200003624
ACSetPointSet2: -987.9
timereventsState:
Battery-Power: -1359
Energy_HouseConsumption: 1005.0200003624
ACSetPointSet: -1005.0200003624
ACSetPointSet2: -987.9
triggerEvents:
Battery-Power: -1359
Energy_HouseConsumption: 1005.0200003624
ACSetPointSet: -1005.0200003624
ACSetPointSet2: -987.9
triggerEventsState:
Battery-Power: -1359
Energy_HouseConsumption: 1005.0200003624
ACSetPointSet: -1005.0200003624
ACSetPointSet2: -987.9
internals:
interval:
0 -1
1 0
2 -1
3 2
4 -1
5 4
6 -1
7 6
intervalfunc:
localtime:
0 1684554300
1 1684558680
2 1684608600
3 1684529100
4 1684558800
5 1684590300
6 1684558800
7 1684591800
readings:
all modbus_fronius_inverter_mppt:Power_String1__W mqtt2_victron:Battery-SoC DWD:fc0_12_SunD3 DWD:fc0_15_SunD3 DWD:fc1_12_SunD3 DWD:fc1_15_SunD3 mqtt2_openwb:LP-ChargeState mqtt2_victron:ACSetPointSet2
realtime:
0 05:45:00
1 06:58:00
2 20:50:00
3 22:45:00
4 07:00:00
5 15:45:00
6 07:00:00
7 16:10:00
time:
0 05:45:00
1 06:58:00
2 20:50:00
3 22:45:00
4 07:00:00
5 15:45:00
6 07:00:00
7 16:10: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:
1684529100:
localtime 1684529100
hash:
1684554300:
localtime 1684554300
hash:
1684558680:
localtime 1684558680
hash:
1684558800:
localtime 1684558800
hash:
1684590300:
localtime 1684590300
hash:
1684591800:
localtime 1684591800
hash:
1684608600:
localtime 1684608600
hash:
uiState:
uiTable:
Attributes:
disable 0
do always
repeatcmd 5:5:5:5:5
wait 5:5:5:5:5
-------------------------
Du musst bedenken, dass beim DOIF nur Zweige geprüft werden, in denen der Trigger vorkommt. Willst du, dass bei jedem Trigger alle Bedingungen geprüft werden, dann musst du das Attribut checkall setzen:
https://fhem.de/commandref_DE.html#DOIF_checkall
Danke. Das scheint zu greifen. Den Parameter kannte ich noch nicht. Ich beobachte es mal mit den anderen Bedingungen. Sollte aber nach der Beschreibung passen. Vielen Dank!