NEWS
[Gelöst] Weihnachtsbeleuchtung mit Blockly
-
Hallo zusammen,
ich habe für Weihnachten jetzt unsere Beleuchtung am Fenster etc angebracht und an HomeMatic Steckdosen angeschlossen.
Jetzt würde ich gerne ein Blockly Programm schreiben, welches die Rolladen nicht zwischen Datum A (27.11) und Datum B (06.01) herunterfährt, sondern erst nach z.B. 22 Uhr.
Die Steckdosen selber werden das ganze Jahr verwendet, da darüber auch Lichtkugeln nach Sonnenuntergang angechaltet werden.
Daher brauche ich die Trennung über das Datum für meine Rolladen, damit sie vor und nach Weihnachten ganz normaler herunterfahren und in der Weihnchatszeit erst um 22 Uhr oder so.
Jemand eine Idee ???
-
Hast du im Moment ein blockly für deine rolladen? Stelle das Mal rein bitte mit Export dann wird es für uns leichter zu helfen
–-----------------------
Send from mobile device
-
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="comment" id="=0_)fBZeYn,J7H/oizL~" x="-362" y="-62"><field name="COMMENT">Rolladen morgens hoch fahren</field> <next><block type="astro" id="xzUMJLW9};/wc%%e^3T|"><field name="TYPE">sunrise</field> <field name="OFFSET">0</field> <statement name="STATEMENT"><block type="comment" id="CGYPgMOvU?PtHcOlb}a5"><field name="COMMENT">Arbeit oder Krank/Frei</field> <next><block type="controls_if" id="[)D/5k%pz0I40W65W6a0"><value name="IF0"><block type="logic_operation" id="BLEDFA[g5rJHS+v!ROm-"><field name="OP">OR</field> <value name="A"><block type="logic_compare" id="SbMikcr!:8qkf:9I*Hab"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="nbooEIn;Z-_t__S0NEaT"><field name="ATTR">val</field> <field name="OID">hm-rega.0.32541</field></block></value> <value name="B"><block type="math_number" id="HH/0sx}=9ChMZi5+28.w"><field name="NUM">0</field></block></value></block></value> <value name="B"><block type="logic_compare" id="n/07,~5ciOO)(!|-[-av"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="=TJX%@y0|d#+b`irCpQ%"><field name="ATTR">val</field> <field name="OID">hm-rega.0.32541</field></block></value> <value name="B"><block type="math_number" id="-b0I:%bLeHMN.euLn-p:"><field name="NUM">2</field></block></value></block></value></block></value> <statement name="DO0"><block type="comment" id="[66jy;^6W;hXiwL5gS89"><field name="COMMENT">Links</field> <next><block type="controls_if" id="SeS7s4nD%@YU/U^Tv:X6"><value name="IF0"><block type="logic_compare" id="e)#8tA*U?{m6T@|n87d:"><field name="OP">LT</field> <value name="A"><block type="get_value" id="bRym/*WmP8eN.k[}^S~y"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266972.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="@U,k^^#3D4Ai)_le77J;"><field name="NUM">100</field></block></value></block></value> <statement name="DO0"><block type="control" id="pMi!7cQ)^KxO?Ol{D6Fk"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266972.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="dU0Y)z@`)TrlqV!7u]17"><field name="NUM">100</field></block></value></block></statement> <next><block type="comment" id="t`]o5mCcj`6@H~(]wp:F"><field name="COMMENT">Front Links</field> <next><block type="controls_if" id="8yliRAt5d:?hYC`1-z2j"><value name="IF0"><block type="logic_compare" id="b,_@h]yw.H[6U@]b*H(T"><field name="OP">LT</field> <value name="A"><block type="get_value" id="9WQSmMr~m4[UJb+gQl8w"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266958.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="9RHL47CZ74*.ICQ(k%,H"><field name="NUM">100</field></block></value></block></value> <statement name="DO0"><block type="control" id="MDOdw%M=K(4_1[mn6Y,Q"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266958.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="gLSX~yatEP+7AIDBdApz"><field name="NUM">100</field></block></value></block></statement> <next><block type="comment" id="E=^r1t+IN(Xt0vEbpHDi"><field name="COMMENT">Front Rechts</field> <next><block type="controls_if" id="Xq(DsT9Yl*k_f8O4h{9A"><value name="IF0"><block type="logic_compare" id="+RK~UT[t9K+n#RKLtpK@"><field name="OP">LT</field> <value name="A"><block type="get_value" id="GKD`Fo1E3hQD=b26~4RT"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266962.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="/flLKw%7nGy:;Y/f*j-q"><field name="NUM">100</field></block></value></block></value> <statement name="DO0"><block type="control" id="T~Sgt~SC%a{bW{kdCDOX"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266962.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="P,6nz/,ETFc?G/TZp#Z?"><field name="NUM">100</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement> <next><block type="comment" id="klrrYiIYh/{;*)/#6KCR"><field name="COMMENT">Urlaub</field> <next><block type="controls_if" id="!r=^sV?zaE+Jpn%@iEf?"><value name="IF0"><block type="logic_compare" id="|Bfn^=~1#iwvr=3mR..("><field name="OP">EQ</field> <value name="A"><block type="get_value" id="luz|yA4cMB[[6Oa2cnk0"><field name="ATTR">val</field> <field name="OID">hm-rega.0.32541</field></block></value> <value name="B"><block type="math_number" id="^r%RL2U)v)n`!**Px:zv"><field name="NUM">1</field></block></value></block></value> <statement name="DO0"><block type="comment" id="`3!Wzg#/6}Wmnhgewn7S"><field name="COMMENT">Links</field> <next><block type="controls_if" id="H~b+^NV3pPGyg~6:/shH"><value name="IF0"><block type="logic_compare" id="+C,D*Q1PKC2mZDXHW2_n"><field name="OP">LT</field> <value name="A"><block type="get_value" id="xs1|t2isPvj)7cN3ms])"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266972.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="8[Gpo90i/uRtq^/K}b.i"><field name="NUM">80</field></block></value></block></value> <statement name="DO0"><block type="control" id="tU)][V4AeFg|3Qv#ifPp"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266972.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="2IOv6LYS#@wDr~w,{}Q~"><field name="NUM">80</field></block></value></block></statement> <next><block type="comment" id=":/-o2ULZm[l//Q^vd*(9"><field name="COMMENT">Front Links</field> <next><block type="controls_if" id="J6Z@;HT72iqqb!.RTd5}"><value name="IF0"><block type="logic_compare" id="4SmY2V!hQ3lB1rN]])Qe"><field name="OP">LT</field> <value name="A"><block type="get_value" id="7ZGdAXL{=`f49`NGx`)D"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266958.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id=")bl7ql[RsE;]UK{1xcP7"><field name="NUM">80</field></block></value></block></value> <statement name="DO0"><block type="control" id="_TpG:cV:Ypg}7(7D9O?a"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266958.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="gNc(WPvlZ:@i:#D*a{6V"><field name="NUM">80</field></block></value></block></statement> <next><block type="comment" id="n^o;U-E_7Wkirk-%l;jB"><field name="COMMENT">Front Rechts</field> <next><block type="controls_if" id="%mIv_qT@]4Zg_ks/jM)("><value name="IF0"><block type="logic_compare" id="_{q9c?ztre28)BX=o#pG"><field name="OP">LT</field> <value name="A"><block type="get_value" id="sR4Wv3qx(NmJ+B?!L_8f"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266962.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="Em^,^=X4{aqynO-o/cwS"><field name="NUM">80</field></block></value></block></value> <statement name="DO0"><block type="control" id="OVE-%Mok[^x]nnA8N]YO"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266962.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="A)Q@ZxM{.bcAX.;~pC8j"><field name="NUM">80</field></block></value></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement></block></next></block></next></block></next></block></statement> <next><block type="comment" id="aT]_RB!vi4bf{J~QxMFs"><field name="COMMENT">Rolladen Abends herunterfahren</field> <next><block type="astro" id="3C~DR`zhZzar8ESv(zGM"><field name="TYPE">sunset</field> <field name="OFFSET">45</field> <statement name="STATEMENT"><block type="comment" id="A_{6z!uaV:1wH*(gi:*X"><field name="COMMENT">Nur ganz herunterfahren, wenn Fenster zu</field> <next><block type="comment" id="EG7nX)C@nlf/+g`tjobA"><field name="COMMENT">Links</field> <next><block type="controls_if" id="buxK;bAwYw0?v=~p=[}?"><value name="IF0"><block type="logic_operation" id="D4xfqL}ZJQc@9,s[?w2?" inline="false"><field name="OP">AND</field> <value name="A"><block type="logic_compare" id="/td11xe*[gv])#8AJP/J"><field name="OP">EQ</field> <value name="A"><block type="get_value" id=":_K-er_sVnYkH-9X~+Bg"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0566021.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="RvS=F!OV}vG:_hv|6}mb"><field name="BOOL">FALSE</field></block></value></block></value> <value name="B"><block type="logic_compare" id="~NhG/3{3+j^?K]#l#U2E"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="Jy:-M~?2`?/4)#uF~fJG"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0565984.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="3,bfH*[=ZkPZAJCk(7m="><field name="BOOL">FALSE</field></block></value></block></value></block></value> <statement name="DO0"><block type="controls_if" id="iy:OECZ!#(lte7@]6N*b"><value name="IF0"><block type="logic_compare" id="o_an0ZZ@;@)kxMG{2UcO"><field name="OP">GT</field> <value name="A"><block type="get_value" id="9hN^Sxt9I7;+immwdCvI"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266972.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="3K/io#9|~rqjTw,WDm#@"><field name="NUM">20</field></block></value></block></value> <statement name="DO0"><block type="control" id="S,;}lnBnDgN35Zdfs,z{"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266972.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="?rfUaS%Harozu5]W}ea="><field name="NUM">0</field></block></value></block></statement></block></statement> <next><block type="comment" id="d9AysiFYT.erN#ryn:s;"><field name="COMMENT">Front-Links</field> <next><block type="controls_if" id="jpn2W2RaW@vO/AaFQ)Lk"><value name="IF0"><block type="logic_compare" id="59%{hGV{H8X`_#iYX^_-"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="s}Dgz2(l`0Dc=og{aR:}"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0564861.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="`++TltXx[YjBONBN!+EE"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="controls_if" id="jaQ5BIX|`qI{B3%k7z@/"><value name="IF0"><block type="logic_compare" id="%V,S1,5-_*01u2H}PpF;"><field name="OP">GT</field> <value name="A"><block type="get_value" id="Y[J3^NgH[a4]1:J?{s0^"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266958.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="=CJkW`:9ficvlH{~8uda"><field name="NUM">20</field></block></value></block></value> <statement name="DO0"><block type="control" id="%BTy*mU0T%v1t:JB77wg"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266958.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="m:F5VXD+SvcaM@KaA;/4"><field name="NUM">0</field></block></value></block></statement></block></statement> <next><block type="comment" id="JUkTB6F|zj7(it_eiXo@"><field name="COMMENT">Front-Rechts</field> <next><block type="controls_if" id="#n4bCrDy9*2asRK/`mZO"><value name="IF0"><block type="logic_compare" id="Vgb3idcy@b~qD:Gs2`D}"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="T[N:9[}E8ucMgWL;Mb;["><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0566663.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="hzJ9xsIx!iamXr:PE,sj"><field name="BOOL">FALSE</field></block></value></block></value> <statement name="DO0"><block type="controls_if" id="M7K)C!/-3t=_Naqbce);"><value name="IF0"><block type="logic_compare" id="3]XzpVpVuUM[T4KpJsLf"><field name="OP">GT</field> <value name="A"><block type="get_value" id="hcHJf1ZFe3iso:b2nRty"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266962.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="Kd/yOc:B{PmWXYw[x3SX"><field name="NUM">20</field></block></value></block></value> <statement name="DO0"><block type="control" id="2cW%fqSFzJ?HLU@vF4-*"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266962.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="2L(Bpo##0gF9{?RuQz+V"><field name="NUM">0</field></block></value></block></statement></block></statement> <next><block type="comment" id=")0c6t[Y=Gp{95Mt#1{5w"><field name="COMMENT">Auf Lüftung fahren</field> <next><block type="comment" id="0[oLd.xt-!je?`d!~Kwm"><field name="COMMENT">Links</field> <next><block type="controls_if" id="OL@b0Q,h`7:7Ct68!zQ?"><value name="IF0"><block type="logic_operation" id=",Q9[%a=uRpq+YZt)3@7B" inline="false"><field name="OP">AND</field> <value name="A"><block type="logic_compare" id="uPt~MKYIYn.DJV[9lIHL"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="Z/:_K}J_^k_p1ihSeLZ("><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0566021.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="+c|FAWg`(y`;`o8dH[RX"><field name="BOOL">TRUE</field></block></value></block></value> <value name="B"><block type="logic_compare" id=",#Mm[6QteGUC_EOP?B3["><field name="OP">EQ</field> <value name="A"><block type="get_value" id="t,?7hV-4y0y*n[O-7iM)"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0565984.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id=",rf0)dgtrcUAx#|Cj)ha"><field name="BOOL">TRUE</field></block></value></block></value></block></value> <statement name="DO0"><block type="controls_if" id="2j`oj/{@BXy7HrimX[iU"><value name="IF0"><block type="logic_compare" id="74Uf3TfK6RsHOBc(Yh,u"><field name="OP">GT</field> <value name="A"><block type="get_value" id="e{j4e!+9Un2AX{N+h4xF"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266972.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="xG*[=YMm{O@CgtmqQ^tQ"><field name="NUM">20</field></block></value></block></value> <statement name="DO0"><block type="control" id="r9bPfA:MHLuyVyYNQAyv"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266972.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="MI(RcU3C515Y=30gYN`i"><field name="NUM">20</field></block></value></block></statement></block></statement> <next><block type="comment" id="T(TWY?=!aIa9deKG+b(z"><field name="COMMENT">Front-Links</field> <next><block type="controls_if" id="XN)Fie6+Afb74c6Psh!d"><value name="IF0"><block type="logic_compare" id="*K??c/5YVPW4c=56M*}N"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="rd^r1C6[q#k!12SehX46"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0564861.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="X{}QEs*?j=g.=0G{ds}?"><field name="BOOL">TRUE</field></block></value></block></value> <statement name="DO0"><block type="controls_if" id="mbQfLpCF@R*:Twvgj91."><value name="IF0"><block type="logic_compare" id="_/KWsrpQO}/P2_135Z5,"><field name="OP">GT</field> <value name="A"><block type="get_value" id="T%b1IuIl%p@I#0^*Bhe;"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266958.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="JnM^pa^R@WCArRzh{p!0"><field name="NUM">20</field></block></value></block></value> <statement name="DO0"><block type="control" id="dUZCnL@=BvRINPp6fS{B"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266958.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="bkYLFAJPgen),r#+|ifT"><field name="NUM">20</field></block></value></block></statement></block></statement> <next><block type="comment" id="}Qa=)GGI@zb,n=GAAbpG"><field name="COMMENT">Front Rechts</field> <next><block type="controls_if" id="gQUel1A!-U1.):}yD:EA"><value name="IF0"><block type="logic_compare" id="l,gG7xP:MzqoM2yL[h?%"><field name="OP">EQ</field> <value name="A"><block type="get_value" id="}If)ni;}in`.eLMme,=|"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0566663.1.STATE</field></block></value> <value name="B"><block type="logic_boolean" id="P8f.U+2^NZNC95]7gL*H"><field name="BOOL">TRUE</field></block></value></block></value> <statement name="DO0"><block type="controls_if" id="(nF9)bCl3tncRXtAV2cR"><value name="IF0"><block type="logic_compare" id="k_D~5j7XC=!/j!G,+u`b"><field name="OP">GT</field> <value name="A"><block type="get_value" id="bw/zh]]iR?ewEWI-koCL"><field name="ATTR">val</field> <field name="OID">hm-rpc.0.OEQ0266962.1.LEVEL</field></block></value> <value name="B"><block type="math_number" id="uPjS`3v`mi8yZ7HS+^ZK"><field name="NUM">20</field></block></value></block></value> <statement name="DO0"><block type="control" id="Jk#4!)L7)hCrJtJvc-)h"><mutation delay_input="false"></mutation> <field name="OID">hm-rpc.0.OEQ0266962.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"><block type="math_number" id="RX!ryj91DnwzJ*B2bhx-"><field name="NUM">20</field></block></value></block></statement></block></statement></block></next></block></next></block></next></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></next></block></next></block></xml>
Zur Erklärung:
Morgens werden die Rolladen ganz hochefahren, wenn die Homematic Variable "Arbeitsstatus" auf "0" (Arbeit/Krank,Frei) steht
Steht die Homematic Variable "Arbeitsstatus" auf "1" (Urlaub) fahren die Rolladen nur auf 80%
Abends werden die Rolladen 45 Minuten nach Sonnenuntergang heruntegefahren.
GAnz herunter wenn alle Fenster zu sind. Falls nicht alle Fenster zu sind, fahren sie im entsprechenden Fenster auf Lüftung (20%).
Wem das zu kompliziert erscheint… ^^
Ich brauche nur für die "Falls Prüfung" so etwas wie "Aktuelles datum liegt nicht zwischen 26.11. und 06.01."
-
sowas?
ist nachgebaut mit Blockly:
Original Script von pix:
http://forum.iobroker.net/viewtopic.php … 4bf#p23136
! <xml 1999/xmlns="<URL url=" http:/www.w3.org/xhtml"="">http://www.w3.org/1999/xhtml">
! <block type="procedures_defcustomnoreturn" id="M.}G?[J[hrB_@XsA^6.6" x="-463" y="-337"><mutation statements="false"></mutation>
! <field name="NAME">currentDate</field>
! <field name="SCRIPT">dmFyIGQgPSBuZXcgRGF0ZSgpOw0KcmV0dXJuIG5ldyBEYXRlKGQuZ2V0RnVsbFllYXIoKSwgZC5nZXRNb250aCgpLCBkLmdldERhdGUoKSk7</field>
! <comment pinned="false" h="80" w="160">Beschreibe diese Funktion</comment></block>
! <block type="procedures_defcustomnoreturn" id="8gH}kTkxtfqqS7_fr!)!" x="-462" y="-312"><mutation statements="false"><arg name="strDate"></arg></mutation>
! <field name="NAME">addDate</field>
! <field name="SCRIPT">dmFyIGRhdGUgPSBzdHJEYXRlLnNwbGl0KCcuJyk7DQp2YXIgZCA9IGN1cnJlbnREYXRlKCk7DQpkLnNldERhdGUoZGF0ZVswXSk7DQpkLnNldE1vbnRoKGRhdGVbMV0tMSk7DQpkLnNldEZ1bGxZZWFyKGRhdGVbMl0pOw0KcmV0dXJuIGQ7</field>
! <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment></block>
! <block type="procedures_defcustomreturn" id="wfasF{l#V}GSTBwNPU#]" x="-462" y="-287"><mutation statements="false"><arg name="strLower"></arg>
! <arg name="strUpper"></arg></mutation>
! <field name="NAME">isDateInRange</field>
! <field name="SCRIPT">dmFyIG5vdyA9IG5ldyBEYXRlKCk7DQp2YXIgbG93ZXIgPSBhZGREYXRlKHN0ckxvd2VyKTsNCnZhciB1cHBlciA9IGFkZERhdGUoc3RyVXBwZXIpOw0KdmFyIGluUmFuZ2UgPSBmYWxzZTsNCmlmICh1cHBlciA+IGxvd2VyKSBpblJhbmdlID0gKG5vdyA+PSBsb3dlciAmJiBub3cgPD0gdXBwZXIpID8gdHJ1ZSA6IGZhbHNlOw0KZWxzZSBsb2coJ2lzRGF0ZUluUmFuZ2UgbWVsZGV0IEZlaGxlciEgInZvbiItRGF0dW0gaXN0IG5pY2h0IGZy/GhlciBhbHMgImJpcyItRGF0dW0nLCAnZXJyb3InKTsNCnJldHVybiBpblJhbmdlOw==</field>
! <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment></block>
! <block type="controls_if" id="ya/5Pf3N6xYn2RthpgP(" x="-462" y="-262"><mutation else="1"></mutation>
! <value name="IF0"><block type="procedures_callcustomreturn" id="t~8,T^sMcT8h_AJfox~p"><mutation name="isDateInRange"><arg name="strLower"></arg>
! <arg name="strUpper"></arg></mutation>
! <value name="ARG0"><block type="text" id=")h05{eu9x5E)7QR~_0B8"><field name="TEXT">28.11.2017</field></block></value>
! <value name="ARG1"><block type="text" id="]ZZxCrRORZ_kBMcF;N!b"><field name="TEXT">06.01.2018</field></block></value></block></value>
! <statement name="DO0"><block type="debug" id="TkFX[7xb``F6J+:7qQ?."><field name="Severity">log</field>
! <value name="TEXT"><shadow type="text" id="zOY:U[Z;XowNFqH#L-=t"><field name="TEXT">Datum im Bereich</field></shadow></value></block></statement>
! <statement name="ELSE"><block type="debug" id="n2{hqFfw9h:8bDn~.02W"><field name="Severity">log</field>
! <value name="TEXT"><shadow type="text" id="))p0G_TM|YYa7W(-_ofH"><field name="TEXT">Datum nicht im Bereich</field></shadow></value></block></statement></block></xml> -
Das scheint gut aus zu sehen.
Ich werde das mal in mein Skript einbauen und heute Abend testen
EDIT:
habe es mir jetzt mit einem kleinen Workaround vereinfacht.
Ab 26.11. sowie am 08.0. wird die Variable "Weihnachtszeit" auf "true" bzw. "false" geschaltet.
Die Variable verarbeitet ich dann im normalen Skripp in der "Falls-Bedingung"
-
Hallo
Habe das Blockly gerade mal ausprobiert.
Ich finde im Moment den original Beitrag/Autor nicht mehr
Die Grundidee (JavaScript) war, glaub ich, von Pix.
Die Funktion "IsDateInRange" hat noch einen kleinen Haken.
Dort wird die Variable "now" gesetzt mit````
var now = new Date();"Date()" liefert auch immer die Uhrzeit mit. Deshalb funktioniert die Bedingung "….&& now <= upper..." nicht, wenn der aktuelle Tag mit dem letzten Tag des Bereichs übereinstimmt. Bereich 01.02.2018 bis 22.02.2018 gibt am 22.02.2018 "Datum nicht im Bereich" Wenn man die Funktion "currentDate" benutzt passt es wieder.
//var now = new Date();
var now = currentDate();
var lower = addDate(strLower);
var upper = addDate(strUpper);
var inRange = false;
if (upper > lower) inRange = (now >= lower && now <= upper) ? true : false;
else log('isDateInRange meldet Fehler! "von"-Datum ist nicht früher als "bis"-Datum', 'error');
return inRange;Grüße
-
Schau mal hier…