@surfer09
Wäre das so wie du dir das vorstellst?
Spoiler
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="G*`]]U$zjbIZxV!:7F_o">Anzahl_verbleibende_Tage</variable>
</variables>
<block type="create" id="-JMH1!^#35FNI0Ie^`;p" inline="true" x="-437" y="-337">
<field name="NAME">0_userdata.0.Test.MediCalc.1.GesamtBestand</field>
<value name="VALUE">
<block type="math_number" id="7DzJI5hGW{P8HO3rp4@Z">
<field name="NUM">750</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="25V5Xlr~6Muygj$6W,Tn">
<field name="TEXT">{"type":"number"}</field>
</block>
</value>
<next>
<block type="create" id="=]3C1tlZJWn/41qK|wfN" inline="true">
<field name="NAME">0_userdata.0.Test.MediCalc.1.Tagesbedarf</field>
<value name="VALUE">
<block type="math_number" id="NeO|b*rTJl;z;K3Tk]:D">
<field name="NUM">1</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="fo?I*MO(M3ri3;}da{VW">
<field name="TEXT">{"type":"number"}</field>
</block>
</value>
<next>
<block type="comment" id="*]C2B/4J$K!I(fiO)m#x">
<field name="COMMENT">4 Wochen = 28 Tage</field>
<next>
<block type="create" id="2{Q-bqTN@iYk@VvrZlMN" inline="true">
<field name="NAME">0_userdata.0.Test.MediCalc.1.WarnungTage</field>
<value name="VALUE">
<block type="math_number" id="z=GG/OH})sI_uA!E*}lq">
<field name="NUM">28</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="hSLP.7!7~v1)7![Kwy(m">
<field name="TEXT">{"type":"number"}</field>
</block>
</value>
<next>
<block type="create" id="t-GN3[jiJ/s,CvuFt~!{" inline="true">
<field name="NAME">0_userdata.0.Test.MediCalc.1.ReichweiteTage</field>
<value name="VALUE">
<block type="math_number" id="GYh,f7H~rgdZc8IM=|22">
<field name="NUM">0</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="bL*)m%.yOBYh(Yp_M.RV">
<field name="TEXT">{"type":"number"}</field>
</block>
</value>
<next>
<block type="create" id="UGRN?Z[30$9Jm(G7[!31" inline="true">
<field name="NAME">0_userdata.0.Test.MediCalc.1.ReichweiteDatum</field>
<value name="VALUE">
<block type="time_get" id="*L5SEOx^=N9XOf#Lo)#.">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">DD.MM.YYYY</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="i]xyO$b0w[ymd{06YLHC">
<field name="TEXT">{"type":"string"}</field>
</block>
</value>
<next>
<block type="schedule" id="h~Vvmf[N2eX6i|v+sP/.">
<field name="SCHEDULE">0 19 * * *</field>
<statement name="STATEMENT">
<block type="control_ex" id="hGKVeF_y[Ws6gmb7?w`E">
<field name="TYPE">false</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="OID">
<shadow type="field_oid" id="dQ:xzCcTYfyzuJ[x;ANB">
<field name="oid">Object ID</field>
</shadow>
<block type="text" id="U:2]N4j6/g~h#Djq`MJ-">
<field name="TEXT">0_userdata.0.Test.MediCalc.1.GesamtBestand</field>
</block>
</value>
<value name="VALUE">
<shadow type="logic_boolean" id="_}~Hgdm,C$P0GVw:V-3m">
<field name="BOOL">TRUE</field>
</shadow>
<block type="math_arithmetic" id=")wVbnP5T9WhjG]2_-:B4" inline="false">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="LhKnFtuczwK!MAfE$e0Y">
<field name="NUM">1</field>
</shadow>
<block type="get_value_var" id="#X+qDeeC,*HqcH=R,~c4">
<field name="ATTR">val</field>
<value name="OID">
<shadow type="text" id="6JKdrd^P0HKN,hT(X$B,">
<field name="TEXT">0_userdata.0.Test.MediCalc.1.GesamtBestand</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="w*J{-o^/.~0#Q*$qvS/v">
<field name="NUM">1</field>
</shadow>
<block type="get_value_var" id="f;OLGqq6jOElY#.5Amum">
<field name="ATTR">val</field>
<value name="OID">
<shadow type="text" id="Rq=Gcd*ji|Zul@DWq*_.">
<field name="TEXT">0_userdata.0.Test.MediCalc.1.Tagesbedarf</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<value name="DELAY_MS">
<shadow type="math_number" id="gR{+c,mIV8XLDwZT6M~9">
<field name="NUM">0</field>
</shadow>
</value>
<next>
<block type="variables_set" id="SDs$N$))#q,GuO81im*h">
<field name="VAR" id="G*`]]U$zjbIZxV!:7F_o">Anzahl_verbleibende_Tage</field>
<value name="VALUE">
<block type="math_arithmetic" id="M7-Hjb)W%D.?|PJS?^v(" inline="false">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number" id="?13[!|PSkDOG{zKFz(ZT">
<field name="NUM">1</field>
</shadow>
<block type="get_value_var" id="x9Mu!3SI`|O3cL.fV/sZ">
<field name="ATTR">val</field>
<value name="OID">
<shadow type="text" id="M]#s?hWHhlfB`S:$_g@~">
<field name="TEXT">0_userdata.0.Test.MediCalc.1.GesamtBestand</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="g+x$JAg6b!*D;fa7jz8T">
<field name="NUM">1</field>
</shadow>
<block type="get_value_var" id="3oH,)XS,%p@?b;COt~V%">
<field name="ATTR">val</field>
<value name="OID">
<shadow type="text" id="AH+1yxbQ]VX?Gung[SE`">
<field name="TEXT">0_userdata.0.Test.MediCalc.1.Tagesbedarf</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="control_ex" id="-L-2(J$PKwnU*^}Z8x3.">
<field name="TYPE">false</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="OID">
<shadow type="field_oid">
<field name="oid">Object ID</field>
</shadow>
<block type="text" id="NiYbUALzNNi1wb.VtJL:">
<field name="TEXT">0_userdata.0.Test.MediCalc.1.ReichweiteDatum</field>
</block>
</value>
<value name="VALUE">
<shadow type="logic_boolean">
<field name="BOOL">TRUE</field>
</shadow>
<block type="convert_from_date" id="1!Sf)U%BNaWYlcV+CcIe">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">DD.MM.YYYY</field>
<value name="VALUE">
<block type="math_arithmetic" id="@%P~yjyG#$ga8);M?73R" inline="false">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="time_get" id=":e5HvH2X/6KKnph?0M75">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">object</field>
</block>
</value>
<value name="B">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="D7K^YP]/JOt$4g*#Ug_9">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="2R4#E?;]V`=$PTsI%Oq~">
<field name="NUM">86400000</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="CdYx$Qx2D#:vEB)_~CSr">
<field name="VAR" id="G*`]]U$zjbIZxV!:7F_o">Anzahl_verbleibende_Tage</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="DELAY_MS">
<shadow type="math_number" id="M^$nnL[NnOA;}!1!B#DZ">
<field name="NUM">0</field>
</shadow>
</value>
<next>
<block type="control_ex" id="0sT^INHS(U{#yI3rqbws">
<field name="TYPE">false</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="OID">
<shadow type="field_oid">
<field name="oid">Object ID</field>
</shadow>
<block type="text" id="?E1pghQj+w}2zTLcJ#*2">
<field name="TEXT">0_userdata.0.Test.MediCalc.1.ReichweiteTage</field>
</block>
</value>
<value name="VALUE">
<shadow type="logic_boolean" id="+Ewf+eWz806Ih+]kX$a,">
<field name="BOOL">TRUE</field>
</shadow>
<block type="variables_get" id=")Cp^Bw)Ea;4K=tXi*RIM">
<field name="VAR" id="G*`]]U$zjbIZxV!:7F_o">Anzahl_verbleibende_Tage</field>
</block>
</value>
<value name="DELAY_MS">
<shadow type="math_number" id="4{JX9mUj/T:J2_jkb=(W">
<field name="NUM">0</field>
</shadow>
</value>
<next>
<block type="debug" id="CF:Dh:w!o9zH{]kQ}=5v">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="%y57o4=UcG|.rQjY)4Jv">
<field name="TEXT">test</field>
</shadow>
<block type="variables_get" id="Y){Ge=^:8}27$[N@^w1U">
<field name="VAR" id="G*`]]U$zjbIZxV!:7F_o">Anzahl_verbleibende_Tage</field>
</block>
</value>
<next>
<block type="debug" id="3`hMN_fB-T~3!?,1tM*K">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="q:W$4~FgoUW+rq*53{W{">
<field name="TEXT">test</field>
</shadow>
<block type="convert_from_date" id="_BC!gBUnO.nz,l%H2Q%~">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">DD.MM.YYYY</field>
<value name="VALUE">
<block type="math_arithmetic" id="mD`zSu[s`oCjYN[GR^H%" inline="false">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="HU}HIg1@5KHpL~XH%eVo">
<field name="NUM">1</field>
</shadow>
<block type="time_get" id="HzT9z^w$l~1F`dzxZGEk">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">object</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="r^IG$XR}a)K=QmR_rYhI">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="+MyPdth8gKbZhX3{xZ_c">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="Gx:~gLx{@!b=nRK(TBUr">
<field name="NUM">86400000</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="!H/@HF_[$9An?/]1!,6e">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="cP54OM`/ZH*P4Rs0;fJ#">
<field name="VAR" id="G*`]]U$zjbIZxV!:7F_o">Anzahl_verbleibende_Tage</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="controls_if" id="g:e^(O4fHk?pR@cUEP+!">
<value name="IF0">
<block type="logic_compare" id="MnKzN]WF-T#cW5.=L5+8">
<field name="OP">LTE</field>
<value name="A">
<block type="variables_get" id="O3;FFF|/3P5*XpNL%a@;">
<field name="VAR" id="G*`]]U$zjbIZxV!:7F_o">Anzahl_verbleibende_Tage</field>
</block>
</value>
<value name="B">
<block type="get_value_var" id="3Ii:Ff~TKwUY+3DyAERp">
<field name="ATTR">val</field>
<value name="OID">
<shadow type="text" id="-lgRcL;n?uqC}xV_NlPw">
<field name="TEXT">0_userdata.0.Test.MediCalc.1.WarnungTage</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="sendto_custom" id="[;81EZ%z$sn~Y#Gm;nYa">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="parameter1" with_statement="false"></mutation>
<field name="INSTANCE">telegram.0</field>
<field name="COMMAND">send</field>
<field name="LOG"></field>
<field name="WITH_STATEMENT">FALSE</field>
<value name="ARG0">
<shadow type="text" id="zV)nvs$L$f$Up0XW42ie">
<field name="TEXT"></field>
</shadow>
<block type="text_join" id="+aigpuCMB,btBZ5FkKz}">
<mutation items="3"></mutation>
<value name="ADD0">
<block type="text" id="-wG3f~_D~!Xj9f#Eg(0c">
<field name="TEXT">Warnung für Medikament 2. Aufgebraucht in</field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="xYmw/05?Q^?5T.7xaL}t">
<field name="VAR" id="G*`]]U$zjbIZxV!:7F_o">Anzahl_verbleibende_Tage</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="=9Vf0Ag3@ynWzOg|~Y3!">
<field name="TEXT"> Tagen</field>
</block>
</value>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</xml>
Kannst du dann auch in eine Visu einbauen
Klein wenig zur Erklärung:
Skript je Medikament anlegen und den Index hier 1 verändern
In gewissen Abständen Inventur durchführen und Gesamtbestand in den Datenpunkt eintragen...
Zu einer bestimmten Zeit (hier 19:00 Uhr)
Wenn Zeitraum für Warnung in Tagen erreicht, dann Meldung an Telegram
Hoffe das hilft dir und Deiner Family
LG