Hallo zusammen, ich benötige mal von ein paar erfahrenen Leute ein bissl Unterstützung, da ich irgendwie auf dem Schlauch stehe. Vllt hab ich mich auch einfach zu sehr verhaspelt und sehe den Wald vor lauter Bäumen nicht mehr.
Mein Plan meiner Lüftungssteuerung soll folgendermaßen ablaufen:
Wenn der Schalter außen vom Bad betätigt wird und das Licht angeht, soll nach einer Minute die Lüftung angehen. Wird vorher der Schaltet wieder betätigt und das Licht geht wieder aus, soll die Lüftung nicht angehen.
Bleibt das Licht an, geht der Lüfter an und das auch solange das Licht an ist.
Nun soll jedoch der Lüfter für 5 minuten an bleiben, wenn:
Die Variable automatik 1 ist,
das Manuelle Lüften nicht angesteuert wurde,
der Luftfeuchtewert über 50% ist,
Die Uhrzeit zwischen 6 und 22 Uhr liegt
und eine Zählervariable noch nicht bei 37 angekommen ist.
sind diese Parameter immer noch logisch 1, so soll der Counter eins hoch gezählt und der Lüfter für weitere 5 Minuten aktiv sein.
Dies wiederholt sich für maximal 3 Stunden.
Irgendwie läuft jedoch mit den Timeouts etwas nicht wie gewünscht. Ich habe Debug-Outputs eingefügt, um mir Meldungen zur Prüfung auszugeben.
Jedoch habe ich manchmal ohne Meldungen Phänomene, das der Lüfter einfach angeht. Ohne einen vorherigen Schaltbefehl.
Anbei einmal mein Blockly Script mit der Bitte, mir ein paar Denkanstöße zu geben.
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable type="timeout" id="timeout_einschaltverz">timeout_einschaltverz</variable>
<variable id="V4_qlg;z3roE#ouGP`;8">Counter</variable>
<variable type="timeout" id="timeout_3h">timeout_3h</variable>
<variable type="interval" id="alle 5 min">alle 5 min</variable>
</variables>
<block type="on" id="Y1{?SDwMglLLF@5r}H-6" x="-312" y="-363">
<field name="OID">zwave2.0.Node_017.Binary_Switch.currentValue_002</field>
<field name="CONDITION">false</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="timeouts_cleartimeout" id="epbi3=vSS(NEB/p#91}_">
<field name="NAME">timeout_einschaltverz</field>
<next>
<block type="timeouts_clearinterval" id="_-mp]=;)v${qic;lFAa[">
<field name="NAME">alle 5 min</field>
<next>
<block type="controls_if" id="jx#i-|^52m6CQ4GO{=%]">
<value name="IF0">
<block type="logic_compare" id="@H)gV=y:q~}aqD|HnhjI">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="]=0t7cmPU|qqI^QDj~kP">
<field name="ATTR">val</field>
<field name="OID">zwave2.0.Node_017.Binary_Switch.currentValue_001</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="!i[39!z*wp8YX)TO/*:]">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id=".K#NN]C3c7LW4^ExOZM^">
<field name="VAR" id="V4_qlg;z3roE#ouGP`;8">Counter</field>
<value name="VALUE">
<block type="math_number" id="8BORu,!=a0(}|re;n3Bk">
<field name="NUM">1</field>
</block>
</value>
<next>
<block type="timeouts_setinterval" id="E5cY6Gy-m;3@U::xJ*J#">
<field name="NAME">alle 5 min</field>
<field name="INTERVAL">5</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="controls_if" id="aY;`c=T-ty.RlJ2uO5!E">
<mutation elseif="1" else="1"></mutation>
<value name="IF0">
<block type="logic_operation" id="U:cfuKbH=Ju@HztQrTcH" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="get_value" id="-O[xT*)9qAv,%1|~9dX+">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Badezimmer.Lüfterautomatik</field>
</block>
</value>
<value name="B">
<block type="logic_operation" id="`;tcZ4+Sg:#I)Fa)g0bm" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_negate" id="?;HjwI_))BQM@+|EOV_@">
<value name="BOOL">
<block type="get_value" id="45EVzi|kduoJ6~HftIQ@">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Badezimmer.Nachlauf_manuell</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_operation" id=":S]h[)uY-%Xl8Qj+rX9w" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="CdG_*/V;@aK9=(l@k,_g">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="Q/m^+EE9_*ukS`GaXhE8">
<field name="ATTR">val</field>
<field name="OID">zwave2.0.Node_017.Binary_Switch.currentValue_002</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="|9%dzfd~B|zE;UY.P_r9">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_operation" id="5Cmtq?)S[N/~g$iYKeCB" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="-M#YoVo]$g(|~EFjbKsB">
<field name="OP">LT</field>
<value name="A">
<block type="variables_get" id="7@zC%iwGPNB)RP%~kwi;">
<field name="VAR" id="V4_qlg;z3roE#ouGP`;8">Counter</field>
</block>
</value>
<value name="B">
<block type="math_number" id="G+PMO$Z57{X%N|-N+IcQ">
<field name="NUM">37</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_operation" id="1o0Q:`SE28@4+)B{[[`l" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="time_compare_ex" id="jtPRR;vIhdLuVQrL,HN#">
<mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true" actual_time="true"></mutation>
<field name="USE_ACTUAL_TIME">TRUE</field>
<field name="OPTION">between</field>
<value name="START_TIME">
<shadow type="text" id="yH}`w9D4?jDG4#;fsEIB">
<field name="TEXT">06:00</field>
</shadow>
</value>
<value name="END_TIME">
<shadow type="text" id="=oY-e#ZAQLa7;?2y+I?4">
<field name="TEXT">22:00</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="%(BNCVeJ()`WGHT$]6+/" inline="false">
<field name="OP">GT</field>
<value name="A">
<block type="get_value" id="b~PIZRVjne@n=o/7MaKq">
<field name="ATTR">val</field>
<field name="OID">hm-rpc.0.OEQ1665908.1.HUMIDITY</field>
</block>
</value>
<value name="B">
<block type="math_number" id="PVW0}s#A!SqeiF-}0G;M">
<field name="NUM">50</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="debug" id="d1UfE?0@P:nQtfTH^iJj">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="T~OM1W]1k,2w$?5NW(*Q">
<field name="TEXT">Luft > 50%, Lüfter bleibt für 5 Minuten an</field>
</shadow>
</value>
<next>
<block type="debug" id="(:GEsOW8ekiY,Cv[F0*!">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text">
<field name="TEXT">Luft > 48%, Lüfter war aus, licht war aus</field>
</shadow>
<block type="variables_get" id="lD5WO34e3wi.T7qnD+gj">
<field name="VAR" id="V4_qlg;z3roE#ouGP`;8">Counter</field>
</block>
</value>
<next>
<block type="math_change" id="RWb9[G_#NcY8)Y]}le~F">
<field name="VAR" id="V4_qlg;z3roE#ouGP`;8">Counter</field>
<value name="DELTA">
<shadow type="math_number" id="528NRV40#UL8nvrZ]}r=">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="logic_operation" id="K/TOMX^h.P|D$L@{tayo" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="get_value" id=".e$.3Q-7+GWl]QMmJQrc">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Badezimmer.Lüfterautomatik</field>
</block>
</value>
<value name="B">
<block type="logic_operation" id="9%du(lC+f~.|ZOrx~Myv" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_negate" id=":+4X!T.W+p=FeD4Sk|S,">
<value name="BOOL">
<block type="get_value" id="TRQ2*:kIip1FYoNX,q6]">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Badezimmer.Nachlauf_manuell</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_operation" id="u5;~?8^N4W#mpmsj([V6" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="h5]od?/3CL,M6pMm{IC9">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="h*LAk)M.8?`YO~WGjjUd">
<field name="ATTR">val</field>
<field name="OID">zwave2.0.Node_017.Binary_Switch.currentValue_002</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="{bpL`Hy,[#/poN*MK[:S">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_operation" id="fp,W;t6%ZfuJ-D4Oq#tQ" inline="false">
<field name="OP">OR</field>
<value name="A">
<block type="logic_compare" id="rWWeE@?,ci-db^T1RSsx">
<field name="OP">GTE</field>
<value name="A">
<block type="variables_get" id="(Q-K(2}[5-yHj_#dK@]g">
<field name="VAR" id="V4_qlg;z3roE#ouGP`;8">Counter</field>
</block>
</value>
<value name="B">
<block type="math_number" id="lvK[qF#20_vWRP;9!C^z">
<field name="NUM">37</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_operation" id="Tuq6O{*9upq(Lb,NeHp3" inline="false">
<field name="OP">OR</field>
<value name="A">
<block type="time_compare_ex" id="$Bg!S-e4ly/6u);5q!_(">
<mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true" actual_time="true"></mutation>
<field name="USE_ACTUAL_TIME">TRUE</field>
<field name="OPTION">not between</field>
<value name="START_TIME">
<shadow type="text" id="za{jIUK`O]~A_;qY]TJh">
<field name="TEXT">06:00</field>
</shadow>
</value>
<value name="END_TIME">
<shadow type="text" id="(;*iIER7_d[7iC9M}A1F">
<field name="TEXT">22:00</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="LzNr$(#[5B$0H*nU]#y9" inline="false">
<field name="OP">LT</field>
<value name="A">
<block type="get_value" id="zG:z1VKLhGod{e`d=MV|">
<field name="ATTR">val</field>
<field name="OID">hm-rpc.0.OEQ1665908.1.HUMIDITY</field>
</block>
</value>
<value name="B">
<block type="math_number" id="jOp@h?/*kV0f!s36D:nm">
<field name="NUM">50</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="debug" id="jpqfQAt3z:LUs6x;FjGH">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="1)fTLnQL%KoXZCvn;dw]">
<field name="TEXT">Luft <50% oder Timer zuende</field>
</shadow>
</value>
<next>
<block type="control" id="jw*03b~{K/p6?K#t44.D">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zwave2.0.Node_017.Binary_Switch.targetValue_001</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="+9tU)|CU_Or^)p$?KCc5">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="timeouts_clearinterval" id="(h;?0V7X(Bnh[QqFlhP3">
<field name="NAME">alle 5 min</field>
<next>
<block type="timeouts_cleartimeout" id="[JH2yQwv.n($lZ!70Ifh">
<field name="NAME">timeout_einschaltverz</field>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="debug" id="oHakMV{!j2}WXb!,03QX">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="~U4g-b!Is,j@9x3-ZrVR">
<field name="TEXT">Lüfter deaktiviert</field>
</shadow>
</value>
<next>
<block type="control" id="1;|ni!k#InBACVw`/EGY">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zwave2.0.Node_017.Binary_Switch.targetValue_001</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="b|[$]MuOMz6^Vt;.1HN]">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="timeouts_clearinterval" id=":@n1Hx/O;W+V4}%PR9o9">
<field name="NAME">alle 5 min</field>
<next>
<block type="timeouts_cleartimeout" id="6.%YS6=gHZl=[(4]N0~0">
<field name="NAME">timeout_einschaltverz</field>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="on" id="4a+x8)yI.k6b{vHz@O-w" x="1013" y="-413">
<field name="OID">zwave2.0.Node_017.Binary_Switch.currentValue_002</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="timeouts_cleartimeout" id="@ix0/ZC#bz4-rk(,_cU9">
<field name="NAME">timeout_einschaltverz</field>
<next>
<block type="timeouts_clearinterval" id="+MRM^uh3|VuR#k*Tw;E5">
<field name="NAME">alle 5 min</field>
<next>
<block type="controls_if" id="=?deL$c,PKm}N))ceEeS">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="yjC3:e!6?S9wfT9_8d(X">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id=".X~b`?_$Xwr1fm=|=78+">
<field name="ATTR">val</field>
<field name="OID">zwave2.0.Node_017.Binary_Switch.currentValue_002</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id=")N)X1uVWeAAY42*K/y5K">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="procedures_callnoreturn" id="[3`bf4Fi50.asD=lGV`P">
<mutation name="Lüfter_ein nach_1_min"></mutation>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="on" id="nGU|iiPQjMGWcPvgL74=">
<field name="OID">0_userdata.0.Badezimmer.Nachlauf_manuell</field>
<field name="CONDITION">true</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="timeouts_cleartimeout" id="t`i,=UG#Ki1Lgj+SM(IY">
<field name="NAME">timeout_einschaltverz</field>
<next>
<block type="timeouts_cleartimeout" id="Oa|TV_=+P(UDL;h=%z)L">
<field name="NAME">timeout_3h</field>
<next>
<block type="procedures_callnoreturn" id="}LcoB_YDq;/-rao)v+wO">
<mutation name="Nachlauf_manuell_3h"></mutation>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
<block type="procedures_defnoreturn" id="b6M55N^fzF-fel}@6Ajm" x="1412" y="-188">
<field name="NAME">Lüfter_ein nach_1_min</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="timeouts_settimeout" id="){8@`%.@.2n%)i+.7Ay^">
<field name="NAME">timeout_einschaltverz</field>
<field name="DELAY">1</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="controls_if" id=".Hfz6F_b2nViMJ!d6qOf">
<value name="IF0">
<block type="logic_operation" id="lmap2{aA4|dv#Ff_8FqP" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_negate" id="H)n]ZV4k]%!8*$~@1[-5">
<value name="BOOL">
<block type="get_value" id="rM3cU`6/u$eeYDbJi)K;">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Badezimmer.Nachlauf_manuell</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_negate" id="+^:b^OvL?B/V9YYO|plh">
<value name="BOOL">
<block type="get_value" id="d=sZC,F1.YzIeI1.0}/#">
<field name="ATTR">val</field>
<field name="OID">zwave2.0.Node_017.Binary_Switch.currentValue_001</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="0(`@)oa6F3S_5fK]/4fF">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zwave2.0.Node_017.Binary_Switch.targetValue_001</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="Y,[nh0WiOij*dH]8h)85">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="debug" id="FQ=)2LLWq7E;A(F9aL0t">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="d#b~:-mHvkz9IX7r+mea">
<field name="TEXT">Lüfter eingeschaltet</field>
</shadow>
</value>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="aex@}bgnOq(R`F;?oqr|" x="1412" y="87">
<field name="NAME">Nachlauf_manuell_3h</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="controls_if" id="u7jn@IbD;w2c=L74d?z1">
<value name="IF0">
<block type="logic_operation" id="u(A%p$q~r[GBsq8krWH`" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="get_value" id="hjU*GpPhHlZn~0*=jtMv">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.Badezimmer.Nachlauf_manuell</field>
</block>
</value>
<value name="B">
<block type="time_compare_ex" id="y~ce^U[cnP+*M.o39Kh1">
<mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true" actual_time="true"></mutation>
<field name="USE_ACTUAL_TIME">TRUE</field>
<field name="OPTION">between</field>
<value name="START_TIME">
<shadow type="text" id=";WAMv30p0L2z=BH]nY5/">
<field name="TEXT">06:00</field>
</shadow>
</value>
<value name="END_TIME">
<shadow type="text" id="@;RZ,Sp]rx3tGr]?v{e,">
<field name="TEXT">21:00</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id=":|?jv6d#n|3*ldgTe-NY">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zwave2.0.Node_017.Binary_Switch.targetValue_001</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="nOr;k}P$T~*5luv(_^sm">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="timeouts_clearinterval" id="6a_lfIR/`X4!,Bc#dPe,">
<field name="NAME">alle 5 min</field>
<next>
<block type="timeouts_settimeout" id="Nl499q$#8]:=$dlXf/=]">
<field name="NAME">timeout_3h</field>
<field name="DELAY">180</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="control" id="!O4b2Wovrl.^e]nI?H2m">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zwave2.0.Node_017.Binary_Switch.targetValue_001</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="W+EXN=i_Mif(bhVr;6+6">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="control" id="OO`N$kpE~YW,b?+sp`w.">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.Badezimmer.Nachlauf_manuell</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="]^N]S#-@!J+|}dvFi%4}">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
PS: mit der Schleifenfunktion hat es gar nicht geklappt, da mir da mehrfach direkt hintereinander Debugs ausgegeben wurden und der Counter viel zu schnell hoch lief.
Danke und Gruß