NEWS
Monatsskript mit Fehler
-
Hallo ich möchte ein Script erstellen das um 23:58 startet dann den Tag/Monat des nächsten Tages ermittelt und jeweils am Monatsende und Monatsanfang eine Aktion auslösen soll. Dafür wollte ich dieses Modul nutzen.
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="4mOZkfmK}Mu(zB0_n6+F">Monat ermitteln</variable> <variable id=")Lqqk5,OZu:5U`z1ZY86">morgen</variable> <variable id="1nsD^3GVi1/3v+YIe|M?">morgen richtig</variable> <variable id="d3G|+sSZ}%.f]pU|xm4p">Monat Richtig</variable> </variables> <block type="schedule" id="Nu^-K$RusqfAgm^Vl||g" x="-372" y="-55"> <field name="SCHEDULE">58 23 * * *</field> <statement name="STATEMENT"> <block type="comment" id="0KNJB/nq$E}*|tiWzdL:"> <field name="COMMENT">Zeitpunk des Trigger + Min&#10;.</field> <next> <block type="variables_set" id="#5s$(nny]0w`h51(m,Hu"> <field name="VAR" id="4mOZkfmK}Mu(zB0_n6+F">Monat ermitteln</field> <value name="VALUE"> <block type="time_calculation" id="!2`Y!Psj0E)=q;.;N}Ic"> <field name="OPERATION">+</field> <field name="UNIT">min</field> <value name="DATE_TIME"> <shadow type="time_get" id="i%!9s_4=*f:NFldP0$JP"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">object</field> </shadow> <block type="time_get" id="3J=SE`O:f(k|z~WUb?x8"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">M</field> </block> </value> <value name="VALUE"> <shadow type="math_number" id="Y5g;:i``)Vzp)(|8wZOJ"> <field name="NUM">3</field> </shadow> </value> </block> </value> <next> <block type="variables_set" id="J:Fs,ly.%}2ujeBZ#^xr"> <field name="VAR" id=")Lqqk5,OZu:5U`z1ZY86">morgen</field> <value name="VALUE"> <block type="time_calculation" id="!#w5,6]E+BJv~Ptej%#@"> <field name="OPERATION">+</field> <field name="UNIT">min</field> <value name="DATE_TIME"> <shadow type="time_get" id="i%!9s_4=*f:NFldP0$JP"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">object</field> </shadow> <block type="time_get" id="%^*w(_|5$1{HvaDhurJY"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">object</field> </block> </value> <value name="VALUE"> <shadow type="math_number" id="D5dS[n|4C!5=xRVN4c|l"> <field name="NUM">3</field> </shadow> </value> </block> </value> <next> <block type="variables_set" id="IMvxI!1^G*=Tfj*1NvlZ"> <field name="VAR" id="1nsD^3GVi1/3v+YIe|M?">morgen richtig</field> <value name="VALUE"> <block type="convert_from_date" id="w;{HO]0/S]lf{hV9J@.o"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">d</field> <value name="VALUE"> <block type="variables_get" id="k0}}#-q$6s9wg?^i.1mX"> <field name="VAR" id=")Lqqk5,OZu:5U`z1ZY86">morgen</field> </block> </value> </block> </value> <next> <block type="variables_set" id="sYb|fI/3Z7``OlQ@l6*:"> <field name="VAR" id="d3G|+sSZ}%.f]pU|xm4p">Monat Richtig</field> <value name="VALUE"> <block type="math_arithmetic" id="#Z6)8Iey?l/FP.S@,V{q"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="L.dmfP8z6Zui)PPea)G:"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="^H1%e7S7+NJAJ[wl(`ld"> <field name="VAR" id="4mOZkfmK}Mu(zB0_n6+F">Monat ermitteln</field> </block> </value> <value name="B"> <shadow type="math_number" id="8K-#^1|NYe}4G]YcJ3?u"> <field name="NUM">1</field> </shadow> <block type="math_number" id="B:RZm+VO#1lj3*FI_NLP"> <field name="NUM">1</field> </block> </value> </block> </value> <next> <block type="comment" id="9bSGI1GNo/D:;%vEex15"> <field name="COMMENT">prüfen ob der Monatsletzte</field> <next> <block type="debug" id=",tTwyphQ}G7|EYrS5}MP"> <field name="Severity">warn</field> <value name="TEXT"> <shadow type="text" id="hx=1u*`,4C^[B!{8^8Y;"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="?lY*XEGN-aSGtXXc,RDv"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="6TZ1OZd?HnAvjq@*@1j6"> <field name="TEXT">Morgen ist der </field> </block> </value> <value name="ADD1"> <block type="convert_from_date" id=",Fjf9#/O7*xQ#`!?@fQX"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">d</field> <value name="VALUE"> <block type="variables_get" id="#q{R5W8@FPK|_~iMUK#;"> <field name="VAR" id=")Lqqk5,OZu:5U`z1ZY86">morgen</field> </block> </value> </block> </value> <value name="ADD2"> <block type="text" id="q6iW7Td/?9YqTyi2YKE`"> <field name="TEXT"> .</field> </block> </value> </block> </value> <next> <block type="debug" id="/p^Yis@LA9wG?.7w#Ql."> <field name="Severity">warn</field> <value name="TEXT"> <shadow type="text" id="[go?QvJ2${m#%p7?lT8$"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="0!VXXawo.|4k17OB}TOk"> <mutation items="4"></mutation> <value name="ADD0"> <block type="text" id="a,hdBg.5v@W)PA!2vB!6"> <field name="TEXT">Der Monat ist </field> </block> </value> <value name="ADD1"> <block type="convert_from_date" id="|9fS^M2J^pmz+amF3y+="> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="true"></mutation> <field name="OPTION">Mt</field> <field name="LANGUAGE">de</field> <value name="VALUE"> <block type="variables_get" id="89|h=1Bi2;Q43[!=xj/@"> <field name="VAR" id="4mOZkfmK}Mu(zB0_n6+F">Monat ermitteln</field> </block> </value> </block> </value> <value name="ADD2"> <block type="text" id="N8:S7!ZcKG-WNyULQ{,9"> <field name="TEXT"> . </field> </block> </value> <value name="ADD3"> <block type="convert_from_date" id="XuExtOBL,nEU/id.KIZD"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="true"></mutation> <field name="OPTION">Mt</field> <field name="LANGUAGE">de</field> <value name="VALUE"> <block type="variables_get" id="6`p]3f]6%)3PtK38Z[qk"> <field name="VAR" id="d3G|+sSZ}%.f]pU|xm4p">Monat Richtig</field> </block> </value> </block> </value> </block> </value> <next> <block type="controls_if" id="i;C/[=[[$i/A{O`m_nb."> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_multi_and" id="uo`D2*h^Gv^:eB^Uw]A]"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation> <value name="AND0"> <block type="logic_compare" id="baC3~L$6mkb/o@bGpRaa"> <field name="OP">EQ</field> <value name="A"> <block type="convert_from_date" id="9Jp/VeS|K5J~B]_t~~p-"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">d</field> <value name="VALUE"> <block type="variables_get" id="s3AS$ESw/9KY)Q**,r2A"> <field name="VAR" id=")Lqqk5,OZu:5U`z1ZY86">morgen</field> </block> </value> </block> </value> <value name="B"> <block type="math_number" id="2-HE$p#)Bv0t^n`.MUtC"> <field name="NUM">1</field> </block> </value> </block> </value> <value name="AND1"> <block type="logic_compare" id="~#C4TMybZ0QXKqXF}6J3"> <field name="OP">EQ</field> <value name="A"> <block type="convert_from_date" id="+Ozk}zRI0F(*RIq2!yJJ"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">d</field> <value name="VALUE"> <block type="variables_get" id="M/j%BFYA|Byf}PBg)a(h"> <field name="VAR" id="4mOZkfmK}Mu(zB0_n6+F">Monat ermitteln</field> </block> </value> </block> </value> <value name="B"> <block type="math_number" id="u924!;+~hs~A$WW=wj-#"> <field name="NUM">12</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id="Vc@C-.=G$paf07g=9;NH"> <field name="COMMENT">Monatswerte</field> <next> <block type="telegram" id="O=kfwt=|]4.[+S8ZkI[b"> <field name="INSTANCE"></field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <field name="ESCAPING">FALSE</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="H6M{l=3]oiB~e(xdv9:B"> <field name="TEXT">text</field> </shadow> <block type="text_join" id="Ez;:]zZeWeK2!eH_U#XO"> <mutation items="4"></mutation> <value name="ADD0"> <block type="text" id="G(SuY_W!$b0=2/:w+.52"> <field name="TEXT">Prima morgen wäre der, </field> </block> </value> <value name="ADD1"> <block type="variables_get" id="bC,8(XzicGvj(N]g`96Y"> <field name="VAR" id="1nsD^3GVi1/3v+YIe|M?">morgen richtig</field> </block> </value> <value name="ADD2"> <block type="text" id="0v+5x|%qw0yf9Iwi,V#r"> <field name="TEXT">des Monats.</field> </block> </value> <value name="ADD3"> <block type="variables_get" id="xgQbr~Kof1WX+KP=@uMh"> <field name="VAR" id="d3G|+sSZ}%.f]pU|xm4p">Monat Richtig</field> </block> </value> </block> </value> </block> </next> </block> </statement> <statement name="ELSE"> <block type="telegram" id="!Mee#r=gtD#Y6xDeqvLV"> <field name="INSTANCE"></field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">default</field> <field name="ESCAPING">FALSE</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="H6M{l=3]oiB~e(xdv9:B"> <field name="TEXT">text</field> </shadow> <block type="text_join" id="*1@|On|Lqa6_7P9?JRJN"> <mutation items="4"></mutation> <value name="ADD0"> <block type="text" id="g6sf)W-E/3n(mKF:_z+a"> <field name="TEXT">Morgen ist erst der, </field> </block> </value> <value name="ADD1"> <block type="variables_get" id="7_Ro,.VYC9/{4,?f:S__"> <field name="VAR" id="1nsD^3GVi1/3v+YIe|M?">morgen richtig</field> </block> </value> <value name="ADD2"> <block type="text" id="x.LY2x59#;keVmE`Cegs"> <field name="TEXT">des Monats.</field> </block> </value> <value name="ADD3"> <block type="variables_get" id="O%tK3r.{3@SY*a_3YRMK"> <field name="VAR" id="d3G|+sSZ}%.f]pU|xm4p">Monat Richtig</field> </block> </value> </block> </value> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </xml>
Problem er sagt zwar das morgen der erste sei aber im Monat ist er bei Januar. aber er müsste ja Dez. anzeigen.
Wie kann ich den in dem Script denn kommenden Monat ermitteln. und so nutzen.Im Verlauf habe ich dann unter userdata Ornder für die Monate angelegt wo er dann drauf zugreifen soll.
Gruß
Mico -
Hey Mico, mach doch zuerst einmal ein lesbares Bild rein, man kann nichts erkennen.
Deine ganzen Variablen verstehe ich nicht unbedingt, die sind alle überflüssig ...
Direkt so : (natürlich mit den 3 Minuten basierend auf deine trigger Zeit)