NEWS
Blockly warten mit Bedingung
-
Hallo zusammen
Bin gerade am Blockly Script für meinen Storen am erstellen. Darin will ich, zB dass der Storen auf 65% geöffnet wird, sobald das geschehen, dann soll er auf 66% (so dass die Lamellen ein wenig offen sind). Nun wie kann ich ein Bedingtes Warten einbauen, ich weiss wie ich Wait nach Zeit mache. aber nach Bedingung?
Meine Idee war mal zB den Wert Stromverbrauch zu überwachen. Dh beim Runtergehen ist dieser auf >50W. sobald dieser wieder auf 0ist würde dann der Befehl auf 66% ausgelöst. doch schaff ich das nicht
Danke und Gruss
p.s. hier noch das ganze Skript das ich bis jetzt hab (noch mit TestMessage und nicht direkt Steuerung)
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="Dr25T)IlRH$33_O`fp$k">Position</variable> <variable id="L#_Z!jvNF+T{o8N,sKli">AutmatischAusgeloest</variable> <variable type="timeout" id="timeout">timeout</variable> <variable type="timeout" id="timeout2">timeout2</variable> <variable id="K?/[1/Pn;ja@zkU.DW!E">Position_Storen_Rechts</variable> <variable id="R5xp9QwiRx2/.Rwex!w8">Elevation</variable> <variable id="z|Ub{YcbzD?VL~9-KJ-G">Azimut</variable> <variable id="%P/QoE=}XP[HY2i5SyLe">Position_Storen_Links</variable> <variable id="]2:45k`WPLDb%Ko90qD_">Lux</variable> <variable id="-^+yZc*m@?GGjBGG;$c9">Innentemperatur</variable> <variable id="i!ECWb{f-SjfWbop5ek9">Aussentemperatur</variable> <variable type="timeout" id="Pause_Storenrunter">Pause_Storenrunter</variable> </variables> <block type="comment" id="(84fObs66elq9l8A!x^g" x="-63" y="-338"> <field name="COMMENT">Ausführen alle 10Min</field> <next> <block type="schedule" id="!{n))uywKqWMA]`T54NA"> <field name="SCHEDULE">*/10 13-20 * * *</field> <statement name="STATEMENT"> <block type="comment" id="1_!6lwfwef~v(0N.trPE"> <field name="COMMENT">Variablen Setzen</field> <next> <block type="variables_set" id="$0SR~}:2#HRWYm01wO#x"> <field name="VAR" id="K?/[1/Pn;ja@zkU.DW!E">Position_Storen_Rechts</field> <value name="VALUE"> <block type="get_value" id="Q-GwG?~oaXtV~D_eo_[k"> <field name="ATTR">val</field> <field name="OID">shelly.0.SHSW-25#10A1A0#1.Shutter.Position</field> </block> </value> <next> <block type="variables_set" id="#-#|/8UQo7cX:N}yQR8Z"> <field name="VAR" id="%P/QoE=}XP[HY2i5SyLe">Position_Storen_Links</field> <value name="VALUE"> <block type="get_value" id="FSHv){p6FxXX78jg)vb+"> <field name="ATTR">val</field> <field name="OID">shelly.0.SHSW-25#BA6DC5#1.Shutter.Position</field> </block> </value> <next> <block type="variables_set" id="*lgZSm9H{,?_7%p42u52"> <field name="VAR" id="]2:45k`WPLDb%Ko90qD_">Lux</field> <value name="VALUE"> <block type="get_value" id="t33R/cNUF*P$dhXI4.u]"> <field name="ATTR">val</field> <field name="OID">deconz.0.Sensors.25.lux</field> </block> </value> <next> <block type="variables_set" id="/d.DAjMvOIrZ`G=JRD5f"> <field name="VAR" id="R5xp9QwiRx2/.Rwex!w8">Elevation</field> <value name="VALUE"> <block type="get_value" id="#lMwLce##cUz2~9^EHIS"> <field name="ATTR">val</field> <field name="OID">javascript.0.Steuerungsflags.Elevation</field> </block> </value> <next> <block type="variables_set" id="jvmYu|_eL[DF$v3EZSn}"> <field name="VAR" id="z|Ub{YcbzD?VL~9-KJ-G">Azimut</field> <value name="VALUE"> <block type="get_value" id="lCC^HD3}@Ews?wgWf0SK"> <field name="ATTR">val</field> <field name="OID">javascript.0.Steuerungsflags.Azimut</field> </block> </value> <next> <block type="variables_set" id="4%(bIIgh(a}s9!+[0)hT"> <field name="VAR" id="-^+yZc*m@?GGjBGG;$c9">Innentemperatur</field> <value name="VALUE"> <block type="get_value" id="m)x/ND^mYj2S+GOiIS;i"> <field name="ATTR">val</field> <field name="OID">deconz.0.Sensors.13.temperature</field> </block> </value> <next> <block type="variables_set" id="or%KU_NTpF7wBxYouHSU"> <field name="VAR" id="i!ECWb{f-SjfWbop5ek9">Aussentemperatur</field> <value name="VALUE"> <block type="get_value" id="f8Ql9VPhUgFg)KgZXfLz"> <field name="ATTR">val</field> <field name="OID">deconz.0.Sensors.10.temperature</field> </block> </value> <next> <block type="comment" id="QOV?,2d7o)VmkK60ve8z"> <field name="COMMENT">Trigger</field> <next> <block type="procedures_callnoreturn" id="SNj0dstl~_3+*ELO9M[0"> <mutation name="SchliessTrigger"></mutation> <next> <block type="procedures_callnoreturn" id="#VGAJl)X#Y8(psx3@4`3"> <mutation name="OeffnungTrigger"></mutation> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> <block type="procedures_defnoreturn" id="Cz7R*E:.D;6h#kYn:Ef|" x="663" y="37"> <field name="NAME">SchliessTrigger</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="controls_if" id="*i+YV,tSf6D?hMtV~Mrw"> <value name="IF0"> <block type="logic_operation" id="}4=@-A;e2iTUkR.W{`oT" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="#QXpY]1#C/j{@rd#u~m0"> <field name="OP">GTE</field> <value name="A"> <block type="variables_get" id="[RA+0bA$r8`tQ9g!({J7"> <field name="VAR" id="]2:45k`WPLDb%Ko90qD_">Lux</field> </block> </value> <value name="B"> <block type="math_number" id="V/balf1vyru9B_r)r4-("> <field name="NUM">25000</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="]%.H:g{Y=}hq;W*=.ao3" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="aO(hH3MT0HM/c1zzJ+vG"> <field name="OP">GTE</field> <value name="A"> <block type="variables_get" id="^yU#w,|)[CzCll/kLKTQ"> <field name="VAR" id="-^+yZc*m@?GGjBGG;$c9">Innentemperatur</field> </block> </value> <value name="B"> <block type="math_number" id="k8#MO+;jJlc1S0KBx3r@"> <field name="NUM">22</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="~4%22Wr.ySvn3jUI|q%)" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="Xx.NAb(CKc@i.,xRHfs^"> <field name="OP">GTE</field> <value name="A"> <block type="variables_get" id="5nPxxVkj,5~HjKqU5L?F"> <field name="VAR" id="i!ECWb{f-SjfWbop5ek9">Aussentemperatur</field> </block> </value> <value name="B"> <block type="math_number" id="nqO}NyXL6x-|!}mXv]}d"> <field name="NUM">15</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="*dBJ8w@^|^=gNO.XnEyh" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="}|kat7cKO+8nv2U*[2Sc"> <field name="OP">GTE</field> <value name="A"> <block type="variables_get" id="+{HO(4eOX!h3jea?+WS:"> <field name="VAR" id="z|Ub{YcbzD?VL~9-KJ-G">Azimut</field> </block> </value> <value name="B"> <block type="math_number" id="|$vaA]x{h%[$8VpEi7eB"> <field name="NUM">180</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id=")Yp!KW79sqYOTVcqc/S+" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="prLsh1%bEo9]RZ1z*}Z["> <field name="OP">LT</field> <value name="A"> <block type="variables_get" id="_kYQ[Ux!2V8mAiRLvPFB"> <field name="VAR" id="z|Ub{YcbzD?VL~9-KJ-G">Azimut</field> </block> </value> <value name="B"> <block type="math_number" id="G2fKuGh*sl;+p^hE.oKP"> <field name="NUM">300</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="Oo$7Q}N,=.p]-wFtQ_wj"> <field name="OP">LT</field> <value name="A"> <block type="variables_get" id="-.#XuB!=55O3`O*}I,*7"> <field name="VAR" id="R5xp9QwiRx2/.Rwex!w8">Elevation</field> </block> </value> <value name="B"> <block type="math_number" id="-n%VUJz1-+H^+v.Rs|kg"> <field name="NUM">65</field> </block> </value> </block> </value> </block> </value> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="s=2XC+A40sv/LrXl7G[B"> <field name="NAME">timeout</field> <field name="DELAY">5</field> <field name="UNIT">min</field> <statement name="STATEMENT"> <block type="controls_if" id="=96[B51Tm3oWu%Oe-}Fq"> <value name="IF0"> <block type="logic_compare" id="!j~_}nU9bKUyu/ISOat["> <field name="OP">GTE</field> <value name="A"> <block type="get_value" id="?R2i|0fDO5Bf?a2]^DY~"> <field name="ATTR">val</field> <field name="OID">deconz.0.Sensors.25.lux</field> </block> </value> <value name="B"> <block type="math_number" id="7T[v^8PS]CJ~v{FH7+3b"> <field name="NUM">25000</field> </block> </value> </block> </value> <statement name="DO0"> <block type="procedures_callnoreturn" id="g{F1Ea4yNOn+[5A4[pBF"> <mutation name="SchliessennachSonnenstand"></mutation> <next> <block type="timeouts_cleartimeout" id="MLt1^}bYst/K}p81-BB5"> <field name="NAME">timeout</field> </block> </next> </block> </statement> </block> </statement> </block> </statement> </block> </statement> </block> <block type="procedures_defnoreturn" id="cye$W)9.k_)3+qgm-!Zz" x="-87" y="187"> <field name="NAME">OeffnungTrigger</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="controls_if" id="xb:kq;MwCPig^7/CB{Q|"> <value name="IF0"> <block type="logic_operation" id="uMq9OI$%l#)-,dgWR61!" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="b1;7?FXch(e)yWX{6?5L" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_compare" id="M[{{Dryi_E|Me!uQ}b9K"> <field name="OP">LT</field> <value name="A"> <block type="variables_get" id="w:hA#+ls0zo0{N+vDV,7"> <field name="VAR" id="]2:45k`WPLDb%Ko90qD_">Lux</field> </block> </value> <value name="B"> <block type="math_number" id="0P~wzFV7MKX2)/sjnyYa"> <field name="NUM">20000</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="SpVNxhP{-O(izS6@6u,*"> <field name="OP">LT</field> <value name="A"> <block type="variables_get" id="R|RT}9)StU^]iZ9=4FY^"> <field name="VAR" id="i!ECWb{f-SjfWbop5ek9">Aussentemperatur</field> </block> </value> <value name="B"> <block type="variables_get" id=";yB7k9W~1rimPl@:q97L"> <field name="VAR" id="-^+yZc*m@?GGjBGG;$c9">Innentemperatur</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="epmSBQJu-zgr0B5X1594" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="=06uy4,x{U4aYY{.[0]G"> <field name="OP">NEQ</field> <value name="A"> <block type="variables_get" id="n3WQ;Nn;irH{F41|B;92"> <field name="VAR" id="%P/QoE=}XP[HY2i5SyLe">Position_Storen_Links</field> </block> </value> <value name="B"> <block type="math_number" id=";Rne#?fmI6TN0;_4D~#-"> <field name="NUM">100</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="GS+v;L3E;rJ5[28#YA*p"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id=":C[NbA0UMVvLN+rIB}6q"> <field name="VAR" id="L#_Z!jvNF+T{o8N,sKli">AutmatischAusgeloest</field> </block> </value> <value name="B"> <block type="math_number" id=",.nlyk|Zn9ma2%,4ru}x"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="4ne4Jbt|-EINH^jO$km1"> <field name="NAME">timeout2</field> <field name="DELAY">5</field> <field name="UNIT">min</field> <statement name="STATEMENT"> <block type="controls_if" id="I^bhtml0hnteSGw8RJUU"> <value name="IF0"> <block type="logic_operation" id="}4r2.:HMC8im~`LPm);X" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="kw0tS+t=drR@|gFVpc:x"> <field name="OP">LT</field> <value name="A"> <block type="get_value" id="N-j^w^8SXKkwIZSO*gUk"> <field name="ATTR">val</field> <field name="OID">deconz.0.Sensors.25.lux</field> </block> </value> <value name="B"> <block type="math_number" id="nB`V+Q6=l4^YWO9`2N@R"> <field name="NUM">15000</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="+_m9M3RHCo|+sN@1,~yQ"> <field name="OP">NEQ</field> <value name="A"> <block type="variables_get" id="{G~?3T3#CNL:|]SJ*W`@"> <field name="VAR" id="%P/QoE=}XP[HY2i5SyLe">Position_Storen_Links</field> </block> </value> <value name="B"> <block type="math_number" id="c+H=PRB3~bvMb%i2)aK0"> <field name="NUM">100</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="procedures_callnoreturn" id="|pXc$Dq),zZ%I9ttyok|"> <mutation name="Storen_Up"></mutation> <next> <block type="timeouts_cleartimeout" id="alMPF3)yL)3o03)*@7Xk"> <field name="NAME">timeout2</field> </block> </next> </block> </statement> </block> </statement> </block> </statement> </block> </statement> </block> <block type="procedures_defnoreturn" id="W3?IMp)[DW_GcKrO?i/H" x="637" y="513"> <field name="NAME">SchliessennachSonnenstand</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="variables_set" id="wA(ZJlR|Ig7ydJ0%Ukvw"> <field name="VAR" id="L#_Z!jvNF+T{o8N,sKli">AutmatischAusgeloest</field> <value name="VALUE"> <block type="math_number" id="IDI4K{f!`TGaVnY[NrfJ"> <field name="NUM">1</field> </block> </value> <next> <block type="controls_if" id="Ro;+R]aDf@DoC16j,Yv#"> <mutation elseif="2"></mutation> <value name="IF0"> <block type="logic_operation" id="8XN_i#`yGYCLtYRUS!jl" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="d6-$Bn-%e27PEF}~8;cA"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="9Re?ER({9bcsPK4fhUo@"> <field name="OP">GTE</field> <value name="A"> <block type="variables_get" id="ixk#j%9!Qk?,*pQq#@-E"> <field name="VAR" id="R5xp9QwiRx2/.Rwex!w8">Elevation</field> </block> </value> <value name="B"> <block type="math_number" id="nE12EvLhazUXUftTPrIu"> <field name="NUM">64</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="i;H%HEKc`^M1+J=2+8G6"> <field name="OP">LT</field> <value name="A"> <block type="variables_get" id="W=0;H-gF~9pRmJmNSZNU"> <field name="VAR" id="R5xp9QwiRx2/.Rwex!w8">Elevation</field> </block> </value> <value name="B"> <block type="math_number" id="PI%kMt8r:~8(%s)}H@r4"> <field name="NUM">65</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="tREMvEfbH?iPorl(Tf01"> <field name="OP">NEQ</field> <value name="A"> <block type="variables_get" id="pqFeLCiicMeKzbnI;lk7"> <field name="VAR" id="Dr25T)IlRH$33_O`fp$k">Position</field> </block> </value> <value name="B"> <block type="math_number" id="zJE0BB#W=^WOo/L;}~~}"> <field name="NUM">66</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id="4,3jq[txiW~ijbS^aFm4"> <field name="COMMENT">Storen auf 65</field> <next> <block type="procedures_callnoreturn" id="wpz[K}Dl;w6r0Dwb{}u|"> <mutation name="Storen_Down"> <arg name="Position"></arg> </mutation> <value name="ARG0"> <block type="math_number" id=".CSc8~SB:zAd,33A2VJJ"> <field name="NUM">65</field> </block> </value> </block> </next> </block> </statement> <value name="IF1"> <block type="logic_operation" id="Rok*bul~QNu1dU[zC0u5" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="M^CWBnNq72+RE5^M/gE2"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="Y8Bbs{;#=hisfpg1nG;P"> <field name="OP">GTE</field> <value name="A"> <block type="variables_get" id="%Uq;mH314i4U5G}BD2tr"> <field name="VAR" id="R5xp9QwiRx2/.Rwex!w8">Elevation</field> </block> </value> <value name="B"> <block type="math_number" id="CYx!H?*s70Mt_BMmd*aG"> <field name="NUM">56</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="S7HA+`3+lBvw#VjHM3V}"> <field name="OP">LT</field> <value name="A"> <block type="variables_get" id="s2WQop[8.-|^L?j8wSi}"> <field name="VAR" id="R5xp9QwiRx2/.Rwex!w8">Elevation</field> </block> </value> <value name="B"> <block type="math_number" id="(|N@Cg~ol!d5Y2y6cZgb"> <field name="NUM">64</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="L~vEYz=}6yxtRfokkD^^"> <field name="OP">NEQ</field> <value name="A"> <block type="variables_get" id="1SwX1`}pjmv{hHN4~:rf"> <field name="VAR" id="Dr25T)IlRH$33_O`fp$k">Position</field> </block> </value> <value name="B"> <block type="math_number" id=";czgO|}[Bt_%F;0Nu{zX"> <field name="NUM">51</field> </block> </value> </block> </value> </block> </value> <statement name="DO1"> <block type="comment" id="82AGXbzdg~CX@;bxI$S2"> <field name="COMMENT">Storen auf 50</field> <next> <block type="procedures_callnoreturn" id="Qpd[eV.Ay}3YKub,*`SZ"> <mutation name="Storen_Down"> <arg name="Position"></arg> </mutation> <value name="ARG0"> <block type="math_number" id="/j?Oy*06Q*YynX(1/U?E"> <field name="NUM">50</field> </block> </value> </block> </next> </block> </statement> <value name="IF2"> <block type="logic_operation" id="dHn7v(iNdyb#wLe^_uuX" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="k^s.?tjks]),Q#/cPwO~"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="-Hor/L/T2tz@@mEyjZ^1"> <field name="OP">GTE</field> <value name="A"> <block type="variables_get" id="dMs;_w+,anmGt2~^m7A{"> <field name="VAR" id="R5xp9QwiRx2/.Rwex!w8">Elevation</field> </block> </value> <value name="B"> <block type="math_number" id="k+;`5=r-qTVlN9kC{X,T"> <field name="NUM">40</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="sjK{8%jyUzoqN+PO^Slu"> <field name="OP">LT</field> <value name="A"> <block type="variables_get" id="}jDEkBPjovuS|bt+PIl#"> <field name="VAR" id="R5xp9QwiRx2/.Rwex!w8">Elevation</field> </block> </value> <value name="B"> <block type="math_number" id="Bw]KiyreucM~2#B+0O9Q"> <field name="NUM">56</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="wlJ1|+V#U)LmrA0o)f:("> <field name="OP">NEQ</field> <value name="A"> <block type="variables_get" id="UY,=~}h7AFjbpuaZ5at7"> <field name="VAR" id="Dr25T)IlRH$33_O`fp$k">Position</field> </block> </value> <value name="B"> <block type="math_number" id="#v|,QKwnyNptX32R8_AU"> <field name="NUM">30</field> </block> </value> </block> </value> </block> </value> <statement name="DO2"> <block type="comment" id="*0[?_+[?siwkR2Aoo%q3"> <field name="COMMENT">Storen auf 29</field> <next> <block type="procedures_callnoreturn" id="%7}*h8yb=xlWo15a,BS5"> <mutation name="Storen_Down"> <arg name="Position"></arg> </mutation> <value name="ARG0"> <block type="math_number" id="T_dK=gD,G`nC%h!LHX~U"> <field name="NUM">29</field> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </statement> </block> <block type="logic_operation" id="oX/f-!Z/mY#mJq:LE#Nh" inline="false" disabled="true" x="262" y="587"> <field name="OP">OR</field> <value name="B"> <block type="logic_operation" id="W9#A|,{^`:?R1+[scqHy" inline="false" disabled="true"> <field name="OP">OR</field> <value name="A"> <block type="logic_compare" id="BN$H4xq;;j.BwAu6ujmV"> <field name="OP">LT</field> <value name="A"> <block type="variables_get" id="He4p}!QfQ29EDNIH{=ko"> <field name="VAR" id="R5xp9QwiRx2/.Rwex!w8">Elevation</field> </block> </value> <value name="B"> <block type="math_number" id="unOwzi2TBBkP0zcb..0X"> <field name="NUM">20</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="?bS`tk02l,mGwhv*e?M~"> <field name="OP">GT</field> <value name="A"> <block type="variables_get" id="cG:P^))_}/iG216Cc{d}"> <field name="VAR" id="z|Ub{YcbzD?VL~9-KJ-G">Azimut</field> </block> </value> <value name="B"> <block type="math_number" id="9idk4*=@Cv1v/F1wiK`~"> <field name="NUM">280</field> </block> </value> </block> </value> </block> </value> </block> <block type="procedures_defnoreturn" id="4,Zm@fditO.?jQNhW-xi" x="-88" y="638"> <field name="NAME">Storen_Up</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="variables_set" id="?a-S*APsE.Xg2WoJ50I^"> <field name="VAR" id="L#_Z!jvNF+T{o8N,sKli">AutmatischAusgeloest</field> <value name="VALUE"> <block type="math_number" id="eT+97R~/MC#~Rb%q=sAq"> <field name="NUM">0</field> </block> </value> <next> <block type="telegram" id="F_DQ}Md?Jl^Tb?Aa3+#X"> <field name="INSTANCE"></field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="hOx#MilDD6RH}3F}z[_H"> <field name="TEXT">Jetzt würde Storen geöffnet - TESTING</field> </shadow> </value> <next> <block type="debug" id="]:y0zq%p^QVq9,?17|~L"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id=";`7Q}sBplze+o6L`e(aC"> <field name="TEXT">Jetzt würde Storen geöffnet -TESTING</field> </shadow> </value> </block> </next> </block> </next> </block> </statement> </block> <block type="procedures_defnoreturn" id="fQF/@12f|(%K`.A^zEg5" x="881" y="1220"> <mutation> <arg name="Position" varid="Dr25T)IlRH$33_O`fp$k"></arg> </mutation> <field name="NAME">Storen_Down</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="comment" id="^p9Wy$q73Z!s0T0gGraA"> <field name="COMMENT">links</field> <next> <block type="debug" id="MkQ*zxEx/1v]G,(|[YX]"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="*?*t9lnXcRG2;n/oJg)7"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="XN.)EeI#l2Acv+A8~d7="> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="Nbl8q7V[g+kz(8gP)1vp"> <field name="TEXT">Storen würde jetzt auf</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="q:3D{a,GCMpsS)nU./@V"> <field name="VAR" id="Dr25T)IlRH$33_O`fp$k">Position</field> </block> </value> <value name="ADD2"> <block type="text" id="x_*#z-%^qs#d{3taU,[e"> <field name="TEXT">+1 gesteuert - TESTing</field> </block> </value> </block> </value> <next> <block type="telegram" id="EGd?Q|OIW*+k.c9oEMOW"> <field name="INSTANCE"></field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="vRqFUd_X7K`M9~rP=VNy"> <field name="TEXT">text</field> </shadow> <block type="text_join" id="G.vR6$C!Rgq^=ccJ^l1c"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="c|Bu~eW(vA3lORcpMf6F"> <field name="TEXT">Storen würde jetzt auf</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="EdE*FBCo[~+vzlqP}jq."> <field name="VAR" id="Dr25T)IlRH$33_O`fp$k">Position</field> </block> </value> <value name="ADD2"> <block type="text" id="GDNDK:*.:A*sBfe!v_kq"> <field name="TEXT">+1 gesteuert</field> </block> </value> </block> </value> <next> <block type="comment" id="5BulF^P;;De[4^3#KHDN"> <field name="COMMENT">link</field> <next> <block type="control" id="*[MEin6#I|U/c?s`Yd*X" disabled="true"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">shelly.0.SHSW-25#BA6DC5#1.Shutter.Position</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="EYxP8:LQ,u:w}y[STfcI"> <field name="VAR" id="Dr25T)IlRH$33_O`fp$k">Position</field> </block> </value> <next> <block type="comment" id="k1Lk{9$4UJfi=q82k7wu"> <field name="COMMENT">rechts</field> <next> <block type="control" id="C|Ch](6WI1KyUN=:d4+A" disabled="true"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation> <field name="OID">shelly.0.SHSW-25#10A1A0#1.Shutter.Position</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">2</field> <field name="UNIT">sec</field> <field name="CLEAR_RUNNING">FALSE</field> <value name="VALUE"> <block type="variables_get" id="nX`XZQgIC00kzGa|Dl/a"> <field name="VAR" id="Dr25T)IlRH$33_O`fp$k">Position</field> </block> </value> <next> <block type="timeouts_settimeout" id="o!2a06x~5?dqvaKOdF9@" disabled="true"> <field name="NAME">Pause_Storenrunter</field> <field name="DELAY">40</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="comment" id="oIO[CC,VCk9{F*SbrHJI"> <field name="COMMENT">links</field> <next> <block type="control" id="V]z%4I+V{1lYw}e3JH^p"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">shelly.0.SHSW-25#BA6DC5#1.Shutter.Position</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_arithmetic" id="7%`V,Q)Xp[bd[a)Owz`o"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="[CuJl;f-ZV#:NO2g]3X@"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="ItlHeuaiHjcVJNxIY8i@"> <field name="VAR" id="Dr25T)IlRH$33_O`fp$k">Position</field> </block> </value> <value name="B"> <shadow type="math_number" id="tF@ZQhkKRoKG6.gh/XTQ"> <field name="NUM">1</field> </shadow> </value> </block> </value> <next> <block type="comment" id="`Up3#~j-+=uDi%aDMY{K"> <field name="COMMENT">rechts</field> <next> <block type="control" id="NX=%l8y)`rwLHm7b2kNf"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation> <field name="OID">shelly.0.SHSW-25#10A1A0#1.Shutter.Position</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">2</field> <field name="UNIT">sec</field> <field name="CLEAR_RUNNING">FALSE</field> <value name="VALUE"> <block type="math_arithmetic" id="4dgx*hvdD3$JmmCk7:_J"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="ip(pE/0fu[iRs]l*)eV["> <field name="VAR" id="Dr25T)IlRH$33_O`fp$k">Position</field> </block> </value> <value name="B"> <shadow type="math_number" id="3l6MYt9N=0kj8oY|D^;G"> <field name="NUM">1</field> </shadow> </value> </block> </value> <next> <block type="timeouts_cleartimeout" id="ZxgUtZ/NqH$#`Ivf`r08"> <field name="NAME">Pause_Storenrunter</field> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </xml>
-
wäre das einen Ansatz:
-
@cainam sagte: wäre das einen Ansatz:
Nein, das erzeugt eine Endlosschleife, die zum Absturz führt.
-
@cainam sagte: Nun wie kann ich ein Bedingtes Warten einbauen
Liefern die Shellys nicht die aktuelle Ist-Position?
@cainam sagte in Blockly warten mit Bedingung:
hier noch das ganze Skript
Wozu sollen die 5-Minuten-Verzögerungen bei einem Trigger-Intervall von 10 Minuten gut sein?
-
@paul53 said in Blockly warten mit Bedingung:
Liefern die Shellys nicht die aktuelle Ist-Position?
doch eigentlich schon.. aber dann müsste ich ja auch ein "warten" bis diese Position erreicht ist... how?
@paul53 said in Blockly warten mit Bedingung:
Wozu sollen die 5-Minuten-Verzögerungen bei einem Trigger-Intervall von 10 Minuten gut sein?
Damit nicht jede Wolke ein rauf und runter auslöst, dh es triggert, dann warten wir 5min und wenn dann immer noch hell dann runter... gleiches beim raufgehen...
-
@cainam sagte: "warten" bis diese Position erreicht ist... how?
Auf die Ist-Position triggern und mit der Soll-Position vergleichen.
-
@paul53 said in Blockly warten mit Bedingung:
@cainam sagte: "warten" bis diese Position erreicht ist... how?
Auf die Ist-Position triggern und mit der Soll-Position vergleichen.
trigger innerhalb eines triggers sollte man doch nicht brauchen oder ist das kein problem da der erste trigger ein Zeittrigger ist?
und wie mache ich das, ich muss ja ca 40sec lange immer wieder schauen ob erreicht und dann ausführen und dann aber nicht mehr weiter triggern (erstens soll das ja dann nicht 24h triggern und zweitens wenn ich den storen mal manuell auf 65% oder so schalte soll das +1% ja nicht ausgführt werden) - somit müsste es ja eine art wiederholung (überwachung) geben bis die ist position auf x ist... und dann auslösen
-
@cainam sagte: trigger innerhalb eines triggers sollte man doch nicht brauchen
Richtig: Außerhalb des Zeitplanes auf die Ist-Position triggern!
@cainam sagte in Blockly warten mit Bedingung:
manuell auf 65% oder so schalte soll das +1% ja nicht ausgführt werden
Dann ist die Bedingung Ist-Position = Soll-Position nicht erfüllt.
@cainam sagte in Blockly warten mit Bedingung:
ich will ja nicht nicht 24h triggern
Weshalb nicht? Der Trigger löst nur aus, wenn sich die Position ändert.
-
@paul53 said in Blockly warten mit Bedingung:
@cainam sagte: trigger innerhalb eines triggers sollte man doch nicht brauchen
Richtig: Außerhalb des Zeitplanes auf die Ist-Position triggern!
Wie mache ich diesen Trigger aber nur dann wenn shelly angesteuert wurde durch mein Skript... ca. 40sec lange überwachen und erst dann +1 machen... ich will ja nicht nicht 24h triggern und zweitens wenn ich den storen mal manuell auf 65% oder so schalte soll das +1% ja nicht ausgführt werden - somit müsste es ja eine art wiederholung (überwachung) geben bis die ist position auf x ist... und dann auslösen
-
@cainam sagte: ca. 40sec lange überwachen
Mann kann auch einen 40-s-Timer starten
und diesen zusätzlich auswerten:
-
@paul53 said in Blockly warten mit Bedingung:
@cainam sagte: ca. 40sec lange überwachen
Mann kann auch einen 40-s-Timer starten
und diesen zusätzlich auswerten:
das ist ja genau das ursprungsprobelm... ich will nicht immer 40sec warten... ab und zu (jenachdem wo der storen ist), geht es nur 10sec und ab und zu geht es halt 40 bis er an der position ist. Ich will einfach nur solange warten bis der erste wert erreicht ist und dann die position um 1% erhöhen...
-
@cainam sagte: ich will nicht immer 40sec warten
Genau das muss man durch den Trigger nicht: In dem Moment, in dem die Sollposition erreicht ist, wird Position+1 gesendet. Der Timer begrenzt nur die Auswertung der Ist-Position auf max. 40 s.
-
@paul53 said in Blockly warten mit Bedingung:
tion+
hmm... so ganz verstehe ich es noch nicht... doch habe gerade festgestellt, shelly gibt kein "ist-position" raus. sondern nur eine sollposition (die die ich ändere wenn der storen dahin soll..) ich muss es also über eine andern Wert machen
-
@cainam sagte: ich muss es also über eine andern Wert machen
Welche Werte stehen zur Verfügung (bitte zeigen)?
-
p.s. bei deinem blockly was hat die variable "timeout3" für einen einfluss beim "falls - mache" block?
-
@cainam sagte: was hat die variable "timeout3" für einen einfluss beim "falls - mache" block?
Sie erlaubt das Senden von "Position+1" nur innerhalb von 40 s nach dem Senden von "Position". Siehe:
@cainam sagte in Blockly warten mit Bedingung:
Meine Idee war mal zB den Wert Stromverbrauch zu überwachen.
-
@paul53
aber so triggert es doch im moment wo ich die neue position eingebe.
Zb:
Wert jetzt 100%
Wert Zielwert 29% (vor +1%)
Kriterium <30 und vorheriger wert >=30 ist ja erfüllt in dem moment wo ich den wert 30 schreibe in Position... -
@cainam
Der Trigger-Datenpunkt "Shutter.Power" hat nichts mit der Position zu tun, sondern indiziert Bewegung. -
@paul53
das habe ich übersehen... okey ich probiere es mal so - tausend dankalso ich machen das
als eigenständige trigger welche alle 10min ausgeführt werden
das:
tue ich in mein steuerungsfunktion?
-
@cainam sagte: als eigenständige trigger welche alle 10min ausgeführt werden
Als eigenständige Trigger, die unabhängig vom 10-Minunten-Trigger ausgeführt werden.
Ich hoffe, dass eine Sperrzeit von 2 s genügt, damit "Position+1" nur einmal gesendet wird.@cainam sagte in Blockly warten mit Bedingung:
tue ich in mein steuerungsfunktion?
Ja. Die müssen nur wieder aktiviert und um den Timeout ergänzt werden.