Poolpumpe mit Temperatur-Differenzen ein und ausschalten mit DOIF

Begonnen von Mohmy, 12 Juli 2020, 18:23:07

Vorheriges Thema - Nächstes Thema

Mohmy

Hallo Leute,

ich möchte meine Poolpumpe anhand Temperatur-Differenzen von der Temperatur an der Solar-Heizung und der Aussentemperatur automatisch ein und ausschalten und das in einem bestimmten Zeitfenster.

Die Anforderungen:
- Der relevante Zeitraum soll 9 bis 18 Uhr sein
- Wenn Temperaturfühler an der Solarheizung (TL12__Solar-Heizung:temperature2) 10 Grad größer als Aussentemperatur (TL11__Aussen:temperature) dann Poolpumpe ein
- Die Pumpe soll so lange an bleiben bis folgende Bedingung zutrifft:
- Wenn Temperaturfühler an der Solarheizung kleiner als 3 Grad wie die Aussentemperatur, dann Poolpumpe aus

Ich habe versucht dies über folgendes DOIF einzustellen:

define dif_Poolsteuerung DOIF ( [8:00-18:00] and [TL12__Solar-Heizung:temperature2]-[TL11__Aussen:temperature] > 10 ) (set Shelly_Poolpumpe on-for-timer 600) DOELSEIF ( [8:00-18:00] and [TL12__Solar-Heizung:temperature2]-[TL11__Aussen:temperature] < 3 ) (set Shelly_Poolpumpe off)

...allerdings haben die Timer in DOIF sich mit Fehlern eingestellt:

timer_01_c01 13.07.2020 08:00:00
timer_02_c01 13.07.2020 18:00:00
timer_03_c01 error: Wrong timespec TL12__Solar: either HH:MM:SS or {perlcode}
timer_04_c01 error: Wrong timespec Heizung:temperature2: either HH:MM:SS or {perlcode}
timer_05_c02 13.07.2020 08:00:00
timer_06_c02 13.07.2020 18:00:00
timer_07_c02 error: Wrong timespec TL12__Solar: either HH:MM:SS or {perlcode}
timer_08_c02 error: Wrong timespec Heizung:temperature2: either HH:MM:SS or {perlcode}


Was habe ich denn da falsche gemacht?? **grübel**

Für Hilfe wäre ich dankbar.
LG Mohmy

Otto123

Hi,

er meint offenbar der Ausdruck soll eine Zeit sein:
[TL12__Solar-Heizung:temperature2]-[TL11__Aussen:temperature]
Mach die Strichrechnung mal in Klammern:
([TL12__Solar-Heizung:temperature2] - [TL11__Aussen:temperature])

Und verwende in Zukunft bitte Codetags :) https://forum.fhem.de/index.php/topic,71806.0.html

Gruß Otto
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

Mohmy

Danke Otto!

Das DOIF schaut jetzt dann so aus:

define dif_Poolsteuerung DOIF ( [8:00:00-18:00:00] and ([TL12__Solar-Heizung:temperature2] - [TL11__Aussen:temperature]) > 10 ) (set Shelly_Poolpumpe on-for-timer 600) DOELSEIF ( [8:00:00-18:00:00] and ([TL12__Solar-Heizung:temperature2] - [TL11__Aussen:temperature]) < 3 ) (set Shelly_Poolpumpe off)

Aber keine Veränderung.
Hier mal Codetags und ein Logfile-Auszug nach hochsetzen von VERBOSE ...


list dif_Poolsteuerung :

Internals:
   CFGFN     
   DEF        ( [8:00-18:00] and ([TL12__Solar-Heizung:temperature2] - [TL11__Aussen:temperature]) > 10 ) (set Shelly_Poolpumpe on-for-timer 600) DOELSEIF ( [8:00-18:00] and ([TL12__Solar-Heizung:temperature2] - [TL11__Aussen:temperature]) < 3 ) (set Shelly_Poolpumpe off)
   DOIFDEV    ^global$|^TL11__Aussen$
   FUUID      5f0b34ed-f33f-4701-0242-229dfec036e2b4d7
   MODEL      FHEM
   NAME       dif_Poolsteuerung
   NR         1340
   NTFY_ORDER 50-dif_Poolsteuerung
   STATE      initialized
   TYPE       DOIF
   VERSION    22195 2020-06-18 16:38:55
   READINGS:
     2020-07-12 19:19:09   cmd             0
     2020-07-12 19:19:26   mode            enabled
     2020-07-12 19:19:26   state           initialized
     2020-07-12 19:19:09   timer_01_c01    13.07.2020 08:00:00
     2020-07-12 19:19:09   timer_02_c01    13.07.2020 18:00:00
     2020-07-12 19:19:09   timer_03_c01    error: Wrong timespec TL12__Solar: either HH:MM:SS or {perlcode}
     2020-07-12 19:19:09   timer_04_c01    error: Wrong timespec Heizung:temperature2: either HH:MM:SS or {perlcode}
     2020-07-12 19:19:09   timer_05_c02    13.07.2020 08:00:00
     2020-07-12 19:19:09   timer_06_c02    13.07.2020 18:00:00
     2020-07-12 19:19:09   timer_07_c02    error: Wrong timespec TL12__Solar: either HH:MM:SS or {perlcode}
     2020-07-12 19:19:09   timer_08_c02    error: Wrong timespec Heizung:temperature2: either HH:MM:SS or {perlcode}
   Regex:
     accu:
     cond:
       TL11__Aussen:
         0:
           temperature ^TL11__Aussen$:^temperature:
         1:
           temperature ^TL11__Aussen$:^temperature:
   condition:
     0           ::DOIF_time($hash,0,1,$wday,$hms) and (::DOIF_time($hash,2,3,$wday,$hms) - ::ReadingValDoIf($hash,'TL11__Aussen','temperature')) > 10
     1           ::DOIF_time($hash,4,5,$wday,$hms) and (::DOIF_time($hash,6,7,$wday,$hms) - ::ReadingValDoIf($hash,'TL11__Aussen','temperature')) < 3
   days:
   do:
     0:
       0          set Shelly_Poolpumpe on-for-timer 600
     1:
       0          set Shelly_Poolpumpe off
     2:
   helper:
     DEVFILTER  ^global$|^TL11__Aussen$
     NOTIFYDEV  global|TL11__Aussen
     globalinit 1
     last_timer 8
     sleeptimer -1
     triggerDev
   interval:
     0          -1
     1          0
     2          -1
     3          2
     4          -1
     5          4
     6          -1
     7          6
   intervalfunc:
   localtime:
     0          1594620000
     1          1594656000
     4          1594620000
     5          1594656000
   readings:
     all         TL11__Aussen:temperature
   realtime:
     0          08:00:00
     1          18:00:00
     4          08:00:00
     5          18:00:00
   time:
     0          8:00
     1          18:00:00
     2          TL12__Solar
     3          Heizung:temperature2
     4          8:00
     5          18:00:00
     6          TL12__Solar
     7          Heizung:temperature2
   timeCond:
     0          0
     1          0
     2          0
     3          0
     4          1
     5          1
     6          1
     7          1
   timer:
     0          0
     1          0
     2          0
     3          0
     4          0
     5          0
     6          0
     7          0
   timers:
     0           0  1  2  3
     1           4  5  6  7
   triggertime:
     1594620000:
       localtime  1594620000
       hash:
     1594656000:
       localtime  1594656000
       hash:
   uiTable:
Attributes:
   room       000__Startseite,12__Pool
   verbose    5





Im FHEM Logfile :

2020.07.12 19:18:28 1: PERL WARNING: Use of uninitialized value $value in string eq at fhem.pl line 4794.
2020.07.12 19:18:28 1: stacktrace:
2020.07.12 19:18:28 1:     main::__ANON__                      called by fhem.pl (4794)
2020.07.12 19:18:28 1:     main::readingsBulkUpdateIfChanged   called by ./FHEM/36_Shelly.pm (925)
2020.07.12 19:18:28 1:     main::Shelly_status                 called by ./FHEM/36_Shelly.pm (879)
2020.07.12 19:18:28 1:     main::__ANON__                      called by FHEM/HttpUtils.pm (634)
2020.07.12 19:18:28 1:     main::__ANON__                      called by fhem.pl (759)
2020.07.12 19:19:28 1: PERL WARNING: Use of uninitialized value $value in string eq at fhem.pl line 4794.
2020.07.12 19:19:28 1: stacktrace:
2020.07.12 19:19:28 1:     main::__ANON__                      called by fhem.pl (4794)
2020.07.12 19:19:28 1:     main::readingsBulkUpdateIfChanged   called by ./FHEM/36_Shelly.pm (925)
2020.07.12 19:19:28 1:     main::Shelly_status                 called by ./FHEM/36_Shelly.pm (879)
2020.07.12 19:19:28 1:     main::__ANON__                      called by FHEM/HttpUtils.pm (634)
2020.07.12 19:19:28 1:     main::__ANON__                      called by fhem.pl (759)
2020.07.12 19:20:29 1: PERL WARNING: Use of uninitialized value $value in string eq at fhem.pl line 4794.
2020.07.12 19:20:29 1: stacktrace:
2020.07.12 19:20:29 1:     main::__ANON__                      called by fhem.pl (4794)
2020.07.12 19:20:29 1:     main::readingsBulkUpdateIfChanged   called by ./FHEM/36_Shelly.pm (925)
2020.07.12 19:20:29 1:     main::Shelly_status                 called by ./FHEM/36_Shelly.pm (879)
2020.07.12 19:20:29 1:     main::__ANON__                      called by FHEM/HttpUtils.pm (634)
2020.07.12 19:20:29 1:     main::__ANON__                      called by fhem.pl (759)
2020.07.12 19:21:29 1: PERL WARNING: Use of uninitialized value $value in string eq at fhem.pl line 4794.
2020.07.12 19:21:29 1: stacktrace:
2020.07.12 19:21:29 1:     main::__ANON__                      called by fhem.pl (4794)
2020.07.12 19:21:29 1:     main::readingsBulkUpdateIfChanged   called by ./FHEM/36_Shelly.pm (925)
2020.07.12 19:21:29 1:     main::Shelly_status                 called by ./FHEM/36_Shelly.pm (879)
2020.07.12 19:21:29 1:     main::__ANON__                      called by FHEM/HttpUtils.pm (634)
2020.07.12 19:21:29 1:     main::__ANON__                      called by fhem.pl (759)



Hmm, ich komm noch nicht dahinter :-/
Gruß, Mohmy

Mohmy


Otto123

Du kannst Deinen Beitrag jederzeit editieren und die Codetags einfügen. Einfach den Code markieren den Button # über dem  :-X drücken speichern fertig.

Deine Geräte heissen TL12__Solar-Heizung den Strich mag DOIF offenbar nicht. Sieht man hier:
Zitattime:
     0          8:00
     1          18:00:00
     2          TL12__Solar
     3          Heizung:temperature2
     4          8:00
     5          18:00:00
     6          TL12__Solar
     7          Heizung:temperature2

Bin ich etwas überfragt ... Musst Du mal die Doku studieren, was man in einem solchen Fall tun kann.

Gruß Otto
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

Mohmy

Volltreffer !! :-)
Der Bindestrich war es.
Entfernt, dann das DOIF disabled und erneut enabled und dann haben sich die Timer korrigiert:

cmd 0 2020-07-12 20:34:55
mode enabled 2020-07-12 20:34:55
state initialized 2020-07-12 20:34:55
timer_01_c01 13.07.2020 08:00:00 2020-07-12 20:34:55
timer_02_c01 13.07.2020 18:00:00 2020-07-12 20:34:55
timer_03_c02 13.07.2020 08:00:00 2020-07-12 20:34:55
timer_04_c02 13.07.2020 18:00:00 2020-07-12 20:34:55


Ich bin begeistert und gespannt, was morgen zwischen 8 und 18 Uhr passiert. Ich werde berichten :-)
DANKE!! Mohmy

PS: CodeTags sind korrigiert.

Otto123

Die Frage wäre noch: Wie Du diesen Namen in FHEM "rein" bekommen hast?! Bindestriche sind in der Tat ungültig.
define Solar-Heizung dummy
ergibt als Antwort:
ZitatInvalid characters in name (not A-Za-z0-9._): Solar-Heizung

Gruß Otto
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

Mohmy

Guten Morgen,

@Otto: Das ist wirklich ne gute Frage ... muss beim umbenennen passiert sein. Ich glaube ich habe es in der "FHEMobile App" gemacht.

Tja, leider haut das DOIF noch nicht hin. So sieht es aktuell aus, dass ich die Meldung "condition c02: Argument "" isn't numeric in subtraction" erhalte. ALso erkennt er die Temperaturwerte offensichtlich nicht als numerisch an, oder?

Hier mal ein LIST:

Internals:
   CFGFN     
   DEF        ([8:00-18:00] and ([TL12__SolarHeizung:temperature2]-[TL11__Aussen:temperature])>= 10) (set Shelly_Poolpumpe on-for-timer 600) DOELSEIF ([8:00-18:00] and ([TL12__SolarHeizung:temperature2]-[TL11__Aussen:temperature])< 3) (set Shelly_Poolpumpe off)
   DOIFDEV    ^global$|^TL11__Aussen$|^TL12__SolarHeizung$
   FUUID      5f0b34ed-f33f-4701-0242-229dfec036e2b4d7
   MODEL      FHEM
   NAME       dif_Poolsteuerung
   NR         1340
   NTFY_ORDER 50-dif_Poolsteuerung
   STATE      cmd_2
   TYPE       DOIF
   VERSION    22195 2020-06-18 16:38:55
   READINGS:
     2020-07-13 10:04:29   cmd             2
     2020-07-13 10:04:29   cmd_event       dif_Poolsteuerung
     2020-07-13 10:04:29   cmd_nr          2
     2020-07-13 10:02:56   mode            enabled
     2020-07-13 10:04:29   state           cmd_2
     2020-07-13 10:02:56   timer_01_c01    14.07.2020 08:00:00
     2020-07-13 10:02:56   timer_02_c01    13.07.2020 18:00:00
     2020-07-13 10:02:56   timer_03_c02    14.07.2020 08:00:00
     2020-07-13 10:02:56   timer_04_c02    13.07.2020 18:00:00
     2020-07-13 10:04:29   warning         condition c02: Argument "" isn't numeric in subtraction (-)

   Regex:
     accu:
     cond:
       TL11__Aussen:
         0:
           temperature ^TL11__Aussen$:^temperature:
         1:
           temperature ^TL11__Aussen$:^temperature:
       TL12__SolarHeizung:
         0:
           temperature2 ^TL12__SolarHeizung$:^temperature2:
         1:
           temperature2 ^TL12__SolarHeizung$:^temperature2:
   attr:
     cmdState:
     wait:
     waitdel:
   condition:
     0          ::DOIF_time($hash,0,1,$wday,$hms) and (::ReadingValDoIf($hash,'TL12__SolarHeizung','temperature2')-::ReadingValDoIf($hash,'TL11__Aussen','temperature'))>= 10
     1          ::DOIF_time($hash,2,3,$wday,$hms) and (::ReadingValDoIf($hash,'TL12__SolarHeizung','temperature2')-::ReadingValDoIf($hash,'TL11__Aussen','temperature'))< 3
   days:
   do:
     0:
       0          set Shelly_Poolpumpe on-for-timer 600
     1:
       0          set Shelly_Poolpumpe off
     2:
   helper:
     DEVFILTER  ^global$|^TL11__Aussen$|^TL12__SolarHeizung$
     NOTIFYDEV  global|TL11__Aussen|TL12__SolarHeizung
     globalinit 1
     last_timer 4
     sleeptimer -1
     timerdev   
     timerevent
     timerevents
     timereventsState
     triggerDev
     DOIF_eventa:
       cmd_nr: 2
       cmd: 2
       cmd_event: dif_Poolsteuerung
       cmd_2
     DOIF_eventas:
       cmd_nr: 2
       cmd: 2
       cmd_event: dif_Poolsteuerung
       state: cmd_2
   interval:
     0          -1
     1          0
     2          -1
     3          2
   intervalfunc:
   localtime:
     0          1594706400
     1          1594656000
     2          1594706400
     3          1594656000
   readings:
     all         TL12__SolarHeizung:temperature2 TL11__Aussen:temperature
   realtime:
     0          08:00:00
     1          18:00:00
     2          08:00:00
     3          18:00:00
   time:
     0          8:00
     1          18:00:00
     2          8:00
     3          18:00:00
   timeCond:
     0          0
     1          0
     2          1
     3          1
   timer:
     0          0
     1          0
     2          0
     3          0
   timers:
     0           0  1
     1           2  3
   triggertime:
     1594656000:
       localtime  1594656000
       hash:
     1594706400:
       localtime  1594706400
       hash:
   uiState:
   uiTable:
Attributes:
   room       000__Startseite,12__Pool
   verbose    5


Habt ihr Ideen?
Viele Grüße, Mohmy

Damian

Argument "" isn't numeric in subtraction (-)

bedeutet, dass eines deiner Readings leer ist
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

Otto123

Wie Damian sagt, ist leer. ;)
Du kannst entweder in die Device schauen, oder mal eine Abfrage machen:
{' TL12  '.ReadingsVal('TL12__SolarHeizung','temperature2','Error').' TL11  '.ReadingsVal('TL11__Aussen','temperature','Error')}

Wenn ich mich jetzt nicht vertippt habe :)
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

Mohmy

So, ich hatte den Kopf unter dem Arm und Tippfehler drin. Jetzt läuft es und zwar schon echt gut. DANKE an alle für die gute Hilfe !!

Wenn die Temepratur Differenz (an der Pool-Solarheizung zur AussenTemperatur) >= 6 Grad ist, dann schaltet sich die Pumpe ein.
Wenn die Temperatur Differenz <= 2 Grad ist, dann geht die Pumpe wieder aus.

So ist derzeit mein DOIF (sicherlich noch optimierbar, aber läuft momentan passabel):

([08:00:00-18:00:00] and [T12:temperature2]-[T11:temperature] >= 6
and (ReadingValDoIf($hash,'Shelly_Poolpumpe','relay') eq "off"))
(set Shelly_Poolpumpe on)

DOELSEIF ([08:00:00-18:00:00] and [T12:temperature2]-[T11:temperature] <= 2
and (ReadingValDoIf($hash,'Shelly_Poolpumpe','relay') eq "on"))
(set Shelly_Poolpumpe off)


Wenn noch jemand Ideen für Verbesserungen hat ... ich bin dankbar dafür.
Ich würde auch gerne die Laufzeit der Pumpe (Shelly als Aktor) mal z.B. in Minunten messen in einer Variable und diese abends dann wieder auf null setzen für den nächsten Tag ... aber da hab ich noch keine.

LG Mohmy

Helmi55

Hallo Mohmy

ich habe seit Jahren folgende Poolsteuerung erfolgreich (danke dem Forum hier am Laufen)

Ich habe eine PoolPumpe und eine SolarPumpe (Poolpumpe hängt am Schimmer, SolarPumpe am Bodenablauf)
Solarmatten liegen am GaragenDach und Temp Fühler am Dach und diverse in den PoolLeitungen

Mit Hysterese kann ich die Differenz zwischen Solar und Pool Temperatur einstellen (der Begriff ist nicht ganz richtig - aber ich weiß worum es geht!)

Folgende doif`s sind im Einsatz:

PoolPumpe zeitgesteuert an:
defmod di_PoolPumpe DOIF ([09:00] and [PoolMaster] eq "on") (set PoolPumpe on) DOELSEIF ([19:00] and [PoolMaster] eq "on") (set PoolPumpe off)
attr di_PoolPumpe do always
attr di_PoolPumpe room Steuerung


und weiters:
defmod Hysterese dummy
attr Hysterese fm_type state
attr Hysterese group Schalter
attr Hysterese room Poolsteuerung
attr Hysterese setList 0 1 2 3 4 5 7 10 15

defmod SolarDiff DOIF ##
attr SolarDiff room Steuerung
attr SolarDiff state {([SolarSensor:temperature]-[PoolSensor:temperature])}
attr SolarDiff stateFormat {sprintf("%.1f",ReadingsVal("SolarDiff","state",0))}

defmod di_SOLAR DOIF ([08:00-22:00] and [PoolMaster] eq "on" and [du_Poolheizung] eq "Solar" and ([SolarDiff]>[Hysterese:state])) (set SolarPumpe on) DOELSE (set SolarPumpe off)
attr di_SOLAR room Steuerung
attr di_SOLAR wait 0:60





PoolMaster ist mein dummy für "alles aus" quasi  Winterberieb


Vielleicht nützt es dir ja was zum abkupfern

Gruß
helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/