Hallo zusammen und einen schönen Sonntag!
Ich steh gerade mal wieder auf dem Schlauch. Mit einem DOIF versuche ich eine "Zeitschaltuhr" zu basteln. Ich definiere einen Zeitrahmen in dem geschaltet werden darf (das funktioniert), dann habe ich dropdowns für Intervall (alle 15 Minuten) und Dauer (5 Minuten). Mein Gerät soll also alle 15 Minuten für 5 Minuten laufen. Gesteuert werden Relais, eine on-for-timer Möglichkeit habe ich nicht gesehen.
Das Listing sieht so aus:
EDIT: funktioniert, wenn die beiden defines mit ";;" getrennt werden... ::)
Internals:
CFGFN
DEF ([([$SELF:on])-([$SELF:off])])(define set_flowOn at +*[$SELF:xTemp] setreading ctl_pool mode Pumpe;;;; define set_flowOff at +[$SELF:durTemp] setreading ctl_pool mode Aus)
FUUID 60ea88f3-f33f-47f9-6cb2-3200f2837f72e58b
MODEL FHEM
NAME ctl_pumpAutomatic
NOTIFYDEV global,ctl_pumpAutomatic
NR 1134
NTFY_ORDER 50-ctl_pumpAutomatic
STATE cmd_1
TYPE DOIF
VERSION 24643 2021-06-16 07:26:15
READINGS:
2021-07-11 09:38:30 cmd 1
2021-07-11 09:38:30 cmd_event ctl_pumpAutomatic
2021-07-11 09:38:30 cmd_nr 1
2021-07-11 08:36:46 durFilter 01:00:00
2021-07-11 09:37:56 durTemp 00:01:00
2021-07-11 09:38:04 mode enabled
2021-07-11 08:07:16 off 21:00
2021-07-11 09:26:56 on 09:00
2021-07-11 09:38:30 state cmd_1
2021-07-11 09:38:05 timer_01_c01 12.07.2021 09:00:00
2021-07-11 09:38:05 timer_02_c01 11.07.2021 21:00:00
2021-07-11 08:37:39 xFilter 06:00:00
2021-07-11 09:37:55 xTemp 00:02:00
Regex:
accu:
collect:
itimer:
ctl_pumpAutomatic:
itimer:
off ^ctl_pumpAutomatic$:^off:
on ^ctl_pumpAutomatic$:^on:
attr:
cmdState:
wait:
waitdel:
condition:
0 ::DOIF_time($hash,0,1,$wday,$hms)
days:
do:
0:
0 define set_flowOn at +*[ctl_pumpAutomatic:xTemp] setreading ctl_pool mode Pumpe;;;; define set_flowOff at +[ctl_pumpAutomatic:durTemp] setreading ctl_pool mode Aus
1:
helper:
DEVFILTER ^global$|^ctl_pumpAutomatic$
NOTIFYDEV global|ctl_pumpAutomatic
globalinit 1
last_timer 2
sleeptimer -1
timerdev
timerevent
timerevents
timereventsState
triggerDev
interval:
0 -1
1 0
intervalfunc:
localtime:
0 1626073200
1 1626030000
realtime:
0 09:00:00
1 21:00:00
time:
0 ([ctl_pumpAutomatic:on])
1 ([ctl_pumpAutomatic:off])
timeCond:
0 0
1 0
timer:
0 0
1 0
timers:
0 0 1
triggertime:
1626030000:
localtime 1626030000
hash:
1626073200:
localtime 1626073200
hash:
uiState:
uiTable:
Attributes:
alias Filtration
group Pool
icon sani_pump
readingList on off durTemp durFilter xTemp xFilter
room Steuerung->Pool
setList on:time off:time durTemp:00:01:00,00:05:00,00:10:00,00:15:00 durFilter:00:30:00,00:45:00,01:00:00,01:15:00,01:30:00,01:45:00,02:00:00 xTemp:00:02:00,00:15:00,00:20:00,00:30:00 xFilter:03:00:00,04:00:00,06:00:00
webCmd on:off:durTemp:xTemp:durFilter:xFilter
webCmdLabel Start: Ende: Umwälzung: alle: Filtrierung: alle:
Das wird auch korrekt ausgeführt, also in 15 Minuten startet das Gerät das erste mal. Aber das at zum Ausschalten wird nicht erzeugt.
Hi,
wenn Du mit DOIF arbeitest solltest Du es auch konsequent verwenden.
Tipp: lass die Sache mit define und at und verwende stattdessen wait Timer vom DOIF.
Gruß Otto
Danke für den Tipp, das werde ich mir mal anschauen