Hauptmenü

DOIF für Poolpumpe

Begonnen von mfeske, 06 Juli 2015, 21:50:32

Vorheriges Thema - Nächstes Thema

mfeske

Hallo zusammen,

ich wollte mit dem DOIF die Poolpumpe steuer und habe vermutlich irgendwo einen kleinen Fehler eingebaut. Es gelingt mir zum Beispiel nicht, die Poolpumpe im Dauerbetrieb zu betreiben. Im log kommt dann:
2015.07.06 20:53:13 2: IT set Poolpumpe on
2015.07.06 21:00:00 2: IT set Poolpumpe off
2015.07.06 21:00:00 2: Poolpumpe_DOIF:  delete Poolpumpe_Schalter_off: Please define Poolpumpe_Schalter_off first
2015.07.06 21:15:00 2: IT set Poolpumpe on
2015.07.06 21:17:00 2: IT set Poolpumpe off
2015.07.06 21:17:01 2: IT set Poolpumpe off

Was eher auf die Intervallschaltung hindeuten würde. Aber nach dem was ich vor habe sollte die natürlich nicht greifen, wenn es zwischen 8 und 22 Uhr ist und ich Poolpumpe_Schalter auf on stelle.
Poolpumpe_Schalter:
define Poolpumpe_Schalter dummy
attr Poolpumpe_Schalter devStateIcon on:set_on off:off intervall:general_an_fuer_zeit countdown:hourglass
attr Poolpumpe_Schalter icon sani_domestic_waterworks
attr Poolpumpe_Schalter room Garten
attr Poolpumpe_Schalter setList state:on,off,intervall,countdown
attr Poolpumpe_Schalter webCmd state

Poolpumpe_DOIF DOIF:
define Poolpumpe_DOIF DOIF ([08:00-22:00] and [Poolpumpe_Schalter] eq "on") (set Poolpumpe on) DOELSEIF ([08:00-20:00] and [+[1]:00] or [+[1]:15] or [+[1]:30] or [+[1]:45] and [Poolpumpe_Schalter] eq "intervall" ) (set Poolpumpe on-for-timer 120, define Poolpumpe_Schalter_off at +00:02:00 set Poolpumpe off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSEIF ([Poolpumpe_Schalter] eq "countdown") (set Poolpumpe on-for-timer 300, define Poolpumpe_Schalter_off at +00:05:00 set Poolpumpe_Schalter off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSE (set Poolpumpe off, delete Poolpumpe_Schalter_off)
attr Poolpumpe_DOIF room Garten

Poolpumpe:
define Poolpumpe IT 00111100010111111001011010 0 0000
attr Poolpumpe IODev CUL433
attr Poolpumpe devStateIcon on:black_Steckdose.on off:black_Steckdose.off
attr Poolpumpe model itswitch
attr Poolpumpe room Garten


in einer witeren Ausbaustufe wollte ich dann über eine it-1500 Fernbedienung die unterscheidlichen Modis einstellen; das ist mir aber bisher so noch gar nciht gelungen.
Fernbedienung:
#Poolpumenschalter aber noch nicht belegt
define Pool_FB_01 IT 00111100010111111001011010 0 0000
attr Pool_FB_01 IODev CUL433
attr Pool_FB_01 icon it_remote
attr Pool_FB_01 room Garten
define Pool_FB_02 IT 00111100010111111001011010 0 0001
attr Pool_FB_02 IODev CUL433
attr Pool_FB_02 icon it_remote
attr Pool_FB_02 room Garten
define Pool_FB_03 IT 00111100010111111001011010 0 0010
attr Pool_FB_03 IODev CUL433
attr Pool_FB_03 icon it_remote
attr Pool_FB_03 room Garten
define Pool_FB_0ff IT 00111100010111111001011010 1 0000
attr Pool_FB_0ff IODev CUL433
attr Pool_FB_0ff icon it_remote
attr Pool_FB_0ff room Garten


Auswahl Modus
define Poolpumpe_DOIF DOIF ([08:00-22:00] and [Poolpumpe_Schalter] eq "on") (set Poolpumpe on) DOELSEIF ([08:00-20:00] and [+[1]:00] or [+[1]:15] or [+[1]:30] or [+[1]:45] and [Poolpumpe_Schalter] eq "intervall" ) (set Poolpumpe on-for-timer 120, define Poolpumpe_Schalter_off at +00:02:00 set Poolpumpe off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSEIF ([Poolpumpe_Schalter] eq "countdown") (set Poolpumpe on-for-timer 300, define Poolpumpe_Schalter_off at +00:05:00 set Poolpumpe_Schalter off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSE (set Poolpumpe off, delete Poolpumpe_Schalter_off)
attr Poolpumpe_DOIF room Gartem


Ich würde gerne mit dem Problem anfangen, warum das Dauer an einfach abgeschalktet wird, obwohl es zwischen 8 und 22 Uhr ist und Poolpumpe_Schalter auf on ist. Warum rutsche icxh trotzdem in cmd2 bis cmd4 und bleibe nicht in cmd1

Gruß
Micha
Hardware:
1 x Raspberry Pi Mod. B 512 MB
eq-3 2 x MAX! eTRV Heizungssteller, 1 x MAX! Fensterkontakt, 1 x MAX! Cube - LAN Gateway (ausser Betrieb)
Intertechno 1x ITZ-500, 3x ITT-1500, 9x ITR-1500, 3 x ITDL-1000, 2 x ITL-500
1 x CC1101-USB-Lite 433MHz (CUL433)  V3 1 x CC1101-USB-Lite 868MHz (CUL868)

Starkstrombastler

Vorschlag: die Bedingung nach 'and' in Klammern ( ) setzen.
IPC\Ubuntu + Fhem, 1wire, Shellies, Siemens Logo!, Z-Wave, PhilipsTV, Vu+duo2, KM200

flurin

Versuchs mal so:


define Poolpumpe_DOIF DOIF ([?08:00-22:00] and [Poolpumpe_Schalter] eq "on") (...)

mfeske

Danke an Euch, hat aber leider beides nichts gebracht :-(
([?08:00-22:00] and ([Poolpumpe_Schalter] eq "on")) (set Poolpumpe on) DOELSEIF ([?08:00-20:00] and [+[1]:00] or [+[1]:15] or [+[1]:30] or [+[1]:45] and ([Poolpumpe_Schalter] eq "intervall")) (set Poolpumpe on-for-timer 120, define Poolpumpe_Schalter_off at +00:02:00 set Poolpumpe off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSEIF (([Poolpumpe_Schalter] eq "countdown")) (set Poolpumpe on-for-timer 300, define Poolpumpe_Schalter_off at +00:05:00 set Poolpumpe_Schalter off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSE (set Poolpumpe off, delete Poolpumpe_Schalter_off)
Hardware:
1 x Raspberry Pi Mod. B 512 MB
eq-3 2 x MAX! eTRV Heizungssteller, 1 x MAX! Fensterkontakt, 1 x MAX! Cube - LAN Gateway (ausser Betrieb)
Intertechno 1x ITZ-500, 3x ITT-1500, 9x ITR-1500, 3 x ITDL-1000, 2 x ITL-500
1 x CC1101-USB-Lite 433MHz (CUL433)  V3 1 x CC1101-USB-Lite 868MHz (CUL868)

Otto123

Hallo Micha,

ehrlich gesagt erscheint mir Dein DOIF auch wie ein Intervallschalter, ich verstehe den komplexen Wunsch nicht. Versuch doch mal ganz langsam etwas aufzubauen.
Als Start sowas wie bei mir. Mein DOIF:
([05:00-07:00] or [15:00-17:00]) (set LichtKeSW1_Sw01 on) DOELSE (set LichtKeSW1_Sw01 off)
Damit läuft mein Pool zweimal 2h am Tag und mir reicht das 8)

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

flurin

#5
Wozu noch at? so sollte eigentlich auch funktionieren:

define Poolpumpe_DOIF DOIF ([?08:00-22:00] and [Poolpumpe_Schalter] eq "on") (set Poolpumpe on)
DOELSEIF ([?08:00-20:00] and [+[1]:00] or [+[1]:15] or [+[1]:30] or [+[1]:45] and [Poolpumpe_Schalter] eq "intervall" ) (set Poolpumpe on-for-timer 120)
DOELSEIF ([Poolpumpe_Schalter] eq "countdown") (set Poolpumpe on-for-timer 300)
DOELSE (set Poolpumpe off)

mfeske

Selbst in der einfachen Variante funktioniert der Daerbetrieb nicht. Wenn ich den aktiviere springt er irgendwann in cmd2 :-(
([Poolpumpe_Schalter] eq "on") (set Poolpumpe on) DOELSEIF ([+[1]:00] or [+[1]:15] or [+[1]:30] or [+[1]:45] and ([Poolpumpe_Schalter] eq "intervall")) (set Poolpumpe on-for-timer 120, define Poolpumpe_Schalter_off at +00:02:00 set Poolpumpe off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSEIF (([Poolpumpe_Schalter] eq "countdown")) (set Poolpumpe on-for-timer 300, define Poolpumpe_Schalter_off at +00:05:00 set Poolpumpe_Schalter off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSE (set Poolpumpe off, delete Poolpumpe_Schalter_off)

@Otto123 ich wollte verschiedene Schaltungen haben. da ich ein paar Solarschläuche ausgelegt habe damit dort das Wasser zu jeder 1/4 Stunde für zwei Minuten gepumpt wird. Ich wollte aber auch sagen so jetzt mal schnell fünf Minuten Pumpen oder halt Dauerbetrieb. Damit ich nicht vergesse die Pumpe abends auszuschalten wollte ich das auf 8-20 Uhr eingrenzen.
Hardware:
1 x Raspberry Pi Mod. B 512 MB
eq-3 2 x MAX! eTRV Heizungssteller, 1 x MAX! Fensterkontakt, 1 x MAX! Cube - LAN Gateway (ausser Betrieb)
Intertechno 1x ITZ-500, 3x ITT-1500, 9x ITR-1500, 3 x ITDL-1000, 2 x ITL-500
1 x CC1101-USB-Lite 433MHz (CUL433)  V3 1 x CC1101-USB-Lite 868MHz (CUL868)

flurin

#7
da fehlen noch die runden Klammern:


([Poolpumpe_Schalter] eq "on") (set Poolpumpe on) DOELSEIF (([+[1]:00] or [+[1]:15] or [+[1]:30] or [+[1]:45]) and ([Poolpumpe_Schalter] eq "intervall")) ...


Bemerkung:

[+[1]:00] or [+[1]:15] or [+[1]:30] or [+[1]:45]


ist gleich wie:


[+:15]


Bezogen auf meinen oberen Vorschlag folgt:

define Poolpumpe_DOIF DOIF ([?08:00-22:00] and [Poolpumpe_Schalter] eq "on") (set Poolpumpe on)
DOELSEIF ([?08:00-20:00] and [+:15] and [Poolpumpe_Schalter] eq "intervall" ) (set Poolpumpe on-for-timer 120)
DOELSEIF ([Poolpumpe_Schalter] eq "countdown") (set Poolpumpe on-for-timer 300)
DOELSE (set Poolpumpe off)

Otto123

Hallo Micha,

jetzt habe ich Dein Ansinnen verstanden :)
Also das mit den temporären at macht die Sache zwar spannend aber hilft eigentlich nicht wirklich. Hier würde ich generell on-for-timer nehmen! In Deiner letzten DEF ist ja alles durcheinander geraten
Zitatset Poolpumpe on-for-timer 120, define Poolpumpe_Schalter_off at +00:02:00 set Poolpumpe off ...
Also fang am Besten nochmal separat an!
DOIF DEF
([8:00 -20:00] and [+:15]) (set Poolpumpe on-for-timer 120)

schaltet Dir erstmal von 8:00 bis 20:00 alle viertel Stunde die Pumpe an. Damit das funktioniert musst Du aber das attr do always setzen. DOIF reagiert in der Konstellation auf Status wechsel und nicht auf Ereignisse.

Dann müssen wir noch Deine Abfrage Schalter einbauen.

Gruß Otto

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

mfeske

Hallo Otto,

attr do allways habe ich gesetzt und den Code hoffentlich richtig angepasst:
([Poolpumpe_Schalter] eq "on") (set Poolpumpe on) DOELSEIF ([8:00 -20:00] and [+:15] and ([Poolpumpe_Schalter] eq "intervall")) (set Poolpumpe on-for-timer 120, define Poolpumpe_Schalter_off at +00:02:00 set Poolpumpe off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSEIF (([Poolpumpe_Schalter] eq "countdown")) (set Poolpumpe on-for-timer 300, define Poolpumpe_Schalter_off at +00:05:00 set Poolpumpe_Schalter off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSE (set Poolpumpe off, delete Poolpumpe_Schalter_off)


oder wie meintest Du es ?

Gruß
Micha
Hardware:
1 x Raspberry Pi Mod. B 512 MB
eq-3 2 x MAX! eTRV Heizungssteller, 1 x MAX! Fensterkontakt, 1 x MAX! Cube - LAN Gateway (ausser Betrieb)
Intertechno 1x ITZ-500, 3x ITT-1500, 9x ITR-1500, 3 x ITDL-1000, 2 x ITL-500
1 x CC1101-USB-Lite 433MHz (CUL433)  V3 1 x CC1101-USB-Lite 868MHz (CUL868)

Otto123

Hallo Micha,

(set Poolpumpe on-for-timer 120, define Poolpumpe_Schalter_off at +00:02:00 set Poolpumpe off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass)
Das ist doch doppelt gemoppelt!?
on-for-timer 120entspricht doch
define Poolpumpe_Schalter_off at +00:02:00 set Poolpumpe off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass

Also so eventuell:
([Poolpumpe_Schalter] eq "on") (set Poolpumpe on) DOELSEIF ([8:00 -20:00] and [+:15] and ([Poolpumpe_Schalter] eq "intervall")) (set Poolpumpe on-for-timer 120) DOELSEIF (([Poolpumpe_Schalter] eq "countdown")) (set Poolpumpe on-for-timer 300) DOELSE (set Poolpumpe off)

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

mfeske

Hallo Otto,

ich hatte das zweite drin gelassen, weil ich mir im Webinterface immer die Sanduhr anzeigen lassen wollte mit der Zeit wann abgeschaltet wird.

Ich verwende jetzt:
([Poolpumpe_Schalter] eq "on") (set Poolpumpe on) DOELSEIF ([8:00 -20:00] and [+:15] and ([Poolpumpe_Schalter] eq "intervall")) (set Poolpumpe on-for-timer 120, define Poolpumpe_Schalter_off at +00:02:00 set Poolpumpe off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSEIF (([Poolpumpe_Schalter] eq "countdown")) (set Poolpumpe on-for-timer 300, define Poolpumpe_Schalter_off at +00:05:00 set Poolpumpe_Schalter off, attr Poolpumpe_Schalter_off room Garten, attr Poolpumpe_Schalter_off icon hourglass) DOELSE (set Poolpumpe off, delete Poolpumpe_Schalter_off)

Der Schalter bleibt aber weiter auf on.
Wenn ich den Schalter auf on schalte, dann springt mein DOIF auch in cmd 1, aber um 0:15 wieder auf off
2015.07.11 16:14:25 2: IT set Poolpumpe on
...
2015.07.11 16:15:00 2: IT set Poolpumpe off
Hardware:
1 x Raspberry Pi Mod. B 512 MB
eq-3 2 x MAX! eTRV Heizungssteller, 1 x MAX! Fensterkontakt, 1 x MAX! Cube - LAN Gateway (ausser Betrieb)
Intertechno 1x ITZ-500, 3x ITT-1500, 9x ITR-1500, 3 x ITDL-1000, 2 x ITL-500
1 x CC1101-USB-Lite 433MHz (CUL433)  V3 1 x CC1101-USB-Lite 868MHz (CUL868)

Otto123

Hallo Micha,

ich habe mir das nochmal angeschaut und bei mir nachgestellt. Du musst das DOELSE am Ende weglassen, dann funktioniert alles wie gewollt.
Beobachtung von mir:
Das DOIF setzt einen Timer_3_2 für die aktuelle Zeit plus den Betrag der in der Klammer [+:15] steht. Zu diesem Zeitpunkt wird DOELSE ausgeführt.

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