Hallo zusammen,
versuche jetzt schon eine ganze Zeit das Skript mit der Astrofunktion zu verbinden, ich bekomme es aber irgendwie nicht hin.
Das Skript soll erst nach Sonnenuntergang ausgeführt werden und dann bis zum nächsten Tag Sonnenaufgang laufen.
Wo genau und wie könnte man die Astrofunktion hier einbauen.
Wäre super wenn mir da jemand weiterhelfen kann bekomme es einfach nicht hin 
Danke für eure Hilfe!
blockly 2 Verbraucher.JPG
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="#/itWQ|YDaeoy53bnxke">Verzoegerung</variable>
<variable id="N2Dk85CQN2uL0w3qt8A_">Verbraucher_1</variable>
<variable id="f6*O*xo-Qtq,VGU7f|-6">Verbraucher_2</variable>
<variable id="iwu_1;PHCBW[(6sePQ9Q">Verbraucher_1_TF</variable>
<variable id="Zs+nKXWb1F_(8ioCBAN2">Verbraucher_2_TF</variable>
<variable type="timeout" id="Timeout">Timeout</variable>
</variables>
<block type="request" id="2lj$W?l7{*fdw%]~~BfT" x="562" y="-1463">
<mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="false"></mutation>
<field name="WITH_STATEMENT">FALSE</field>
<field name="LOG"></field>
<value name="URL">
<shadow type="text">
<field name="TEXT">text</field>
</shadow>
<block type="text" id=":+y{bmw}24Ej90N0wN;*">
<field name="TEXT"></field>
</block>
</value>
</block>
<block type="variables_set" id="/E-q[dH)W-w]o13faTdn" x="37" y="-1338">
<field name="VAR" id="#/itWQ|YDaeoy53bnxke">Verzoegerung</field>
<value name="VALUE">
<block type="logic_boolean" id="cN+]-J6tWyNJF!1RK6Fa">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="comment" id="!$7v[$OV+$1bj2,8AG^I">
<field name="COMMENT">Verbraucher nach Priorität definieren</field>
<next>
<block type="variables_set" id="X,Kte;fb[i[!TOm:{KMP">
<field name="VAR" id="N2Dk85CQN2uL0w3qt8A_">Verbraucher_1</field>
<value name="VALUE">
<block type="math_number" id="4]$iqGm92WQ(}+WKtd@b">
<field name="NUM">580</field>
</block>
</value>
<next>
<block type="variables_set" id="D}?AQ/fSwSt3Yn@5aWda">
<field name="VAR" id="f6*O*xo-Qtq,VGU7f|-6">Verbraucher_2</field>
<value name="VALUE">
<block type="math_number" id=";x*A;(3wi@hJO^nx#Rdx">
<field name="NUM">1000</field>
</block>
</value>
<next>
<block type="variables_set" id="q9RCpGf%NCHwe3CT?.Bg">
<field name="VAR" id="iwu_1;PHCBW[(6sePQ9Q">Verbraucher_1_TF</field>
<value name="VALUE">
<block type="logic_boolean" id="S%3.V:zT{[3GZ]B9GhTu">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="variables_set" id="+e=+FZA$6D/hg3sg}-6~">
<field name="VAR" id="Zs+nKXWb1F_(8ioCBAN2">Verbraucher_2_TF</field>
<value name="VALUE">
<block type="logic_boolean" id="IwMX1dzDOB#m*QTi$gMq">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="procedures_callnoreturn" id="N$t)M,:~htBoAo.G_^)p">
<mutation name="Verbraucher_1_F"></mutation>
<next>
<block type="procedures_callnoreturn" id="U,y:5!^da~,*5BF~il0v">
<mutation name="Verbraucher_2_F"></mutation>
<next>
<block type="on_ext" id="W*oi[r42Fur~gO:zbm4g">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="85SpWm|JTqSGg:^e/*rU">
<field name="oid">default</field>
</shadow>
<block type="field_oid" id="QJ=%Ay8%ZQ4%B9.thx%A">
<field name="oid">sma-em.0.3004906910.pregard</field>
</block>
</value>
<value name="OID1">
<shadow type="field_oid" id="p,ke`l}Dw-?*+.^!V%/G">
<field name="oid">default</field>
</shadow>
<block type="field_oid" id="#a`3[p,W%r/bDBKGnYO)">
<field name="oid">sma-em.0.3004906910.psurplus</field>
</block>
</value>
<statement name="STATEMENT">
<block type="controls_if" id="a?[/(Q4EkZ,N#^}I=.}a">
<value name="IF0">
<block type="time_compare_ex" id=")~ji;1MPN5a47UpX[$$D">
<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="a{}4_96t0[=lszF8V$$_">
<field name="TEXT">19:41</field>
</shadow>
</value>
<value name="END_TIME">
<shadow type="text" id="k`C};aYX*CK2|kqWO8{v">
<field name="TEXT">19:44</field>
</shadow>
</value>
</block>
</value>
<statement name="DO0">
<block type="controls_if" id="v8.(L%0TiTorFvIML`3~">
<value name="IF0">
<block type="logic_compare" id="9oA69nxC[:i5e.$F2!9t">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="R:32]u-u?UndIOEY)]G$">
<field name="VAR" id="#/itWQ|YDaeoy53bnxke">Verzoegerung</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="en#t)k}r);d6lQyrwhk5">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="+/27k2|Tb9!mOc~X=mFf">
<field name="VAR" id="#/itWQ|YDaeoy53bnxke">Verzoegerung</field>
<value name="VALUE">
<block type="logic_boolean" id="TlS9[#v[apU1@m;kHf1d">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="timeouts_settimeout" id="Cv=7iqUAOvM}4avbTcd-">
<field name="NAME">Timeout</field>
<field name="DELAY">1</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="variables_set" id="K;AZe|2u4q]z}VACP?k*">
<field name="VAR" id="#/itWQ|YDaeoy53bnxke">Verzoegerung</field>
<value name="VALUE">
<block type="logic_boolean" id="$!GsY[qL/lkCzDW{RE}$">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
<next>
<block type="controls_if" id="OEQ[V;`THSEyZA1ok[{I">
<value name="IF0">
<block type="logic_compare" id="%R*rwCt*,+;f5pX}09vO">
<field name="OP">EQ</field>
<value name="A">
<block type="on_source" id="vUtwM@oGXuw{0%6vVVC:">
<field name="ATTR">common.name</field>
</block>
</value>
<value name="B">
<block type="text" id="YS+CfAp3mdUW!IlcPx=;">
<field name="TEXT">pregard</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="controls_if" id="TlcF#~;(KK,X;G*vlZ8=">
<value name="IF0">
<block type="logic_operation" id="(Rj_mFB[y=NL]@HA7P/|" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_operation" id="7N^F+8]71lW$##QIUy$B" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="h{d{Dw:k9^KsTD$L{nZ7">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id=",QW|)b.9Tq}2!F|NR!1x">
<field name="VAR" id="iwu_1;PHCBW[(6sePQ9Q">Verbraucher_1_TF</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="th:D+I`=$t*~EaFGdK~G">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="DTqYVel.mUQrL@|]~Lmd">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="D=AepqiQ{QDRI]n%b1f7">
<field name="VAR" id="Zs+nKXWb1F_(8ioCBAN2">Verbraucher_2_TF</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="?T)F?s)1CDYj7%CO.g`B">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="?v3=Y9}r,}OY(ncYjj9g">
<field name="OP">GT</field>
<value name="A">
<block type="on_source" id="C/Pmre#rdW$tUH-XW*$*">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="variables_get" id="9*Jny))Y@xs%`xDHR*@p">
<field name="VAR" id="f6*O*xo-Qtq,VGU7f|-6">Verbraucher_2</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="Zg$SD{N]K+PSUxYB9-o|">
<field name="VAR" id="Zs+nKXWb1F_(8ioCBAN2">Verbraucher_2_TF</field>
<value name="VALUE">
<block type="logic_boolean" id="/oh?,o%I$vT+j)lb_O(#">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="procedures_callnoreturn" id="KfF(Reu0A`vil9gQLN0Y">
<mutation name="Verbraucher_2_F"></mutation>
</block>
</next>
</block>
</statement>
<next>
<block type="controls_if" id="OR;gh_3qNzTWff^,Odz?">
<value name="IF0">
<block type="logic_operation" id="-sA^!k(a^)![bgg8QO,0" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="[:_X{(FJiRjRP5Dq[b~7">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="5l|ih7Z{?RspVMO/,T+*">
<field name="VAR" id="iwu_1;PHCBW[(6sePQ9Q">Verbraucher_1_TF</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="Ysq0?hi]75cZ;bA?Idq8">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id=",g[iGCo{TR}`a3/UY_EV">
<field name="OP">GT</field>
<value name="A">
<block type="on_source" id="9F5lP(6(HiG8a*)D/2Ly">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="variables_get" id="fTjOF-28N.5xkh.w3{}*">
<field name="VAR" id="N2Dk85CQN2uL0w3qt8A_">Verbraucher_1</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="VS:=Vu}2;M9#/-!Bs$j+">
<field name="VAR" id="iwu_1;PHCBW[(6sePQ9Q">Verbraucher_1_TF</field>
<value name="VALUE">
<block type="logic_boolean" id="bv=z4F*]g3`I_!*W03Q^">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="procedures_callnoreturn" id="$_59jQ7tbX]YcUXk@o(:">
<mutation name="Verbraucher_1_F"></mutation>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</statement>
<next>
<block type="controls_if" id="uC1XTN|}ER:(B(XDJQ-k">
<value name="IF0">
<block type="logic_compare" id="V@I;MW5*~=~~z-MtboMD">
<field name="OP">EQ</field>
<value name="A">
<block type="on_source" id="9nQ]K;pDOtTY$~4LU%*O">
<field name="ATTR">common.name</field>
</block>
</value>
<value name="B">
<block type="text" id="3GE06,@El}_1{n,dJ-qd">
<field name="TEXT">psurplus</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="controls_if" id="6=1*.Afj/9S!Iab2LFQR">
<mutation elseif="1"></mutation>
<value name="IF0">
<block type="logic_operation" id="12nva]Q=7I]aU=RqPcF^" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="B/,5-jyojV+qqsCnlguO">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="olTmeRlU/{_y6p~fNgbK">
<field name="VAR" id="Zs+nKXWb1F_(8ioCBAN2">Verbraucher_2_TF</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="GEr$l_D,jsSI#i$XS:*?">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="e%|4mPECYNQ?=Wxe_-N-">
<field name="OP">LT</field>
<value name="A">
<block type="on_source" id="BX,l?`N8Ne$//Pj[be79">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="variables_get" id="6w]Y.3!mnc3gkOHJcNfr">
<field name="VAR" id="f6*O*xo-Qtq,VGU7f|-6">Verbraucher_2</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="9RgBrLvxD2U,ye-m9viy">
<field name="VAR" id="Zs+nKXWb1F_(8ioCBAN2">Verbraucher_2_TF</field>
<value name="VALUE">
<block type="logic_boolean" id="@1`T||6b=WVwfp5%#[8%">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="procedures_callnoreturn" id="rh}kO.E$x/(8_Uq(19zR">
<mutation name="Verbraucher_2_F"></mutation>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="logic_operation" id="OoH]dSnZuO^}B?a}EP8z" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="$68a%w#)rPE:4TDpRWis">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="/;g5aqBuPe84GnfC2UbU">
<field name="VAR" id="iwu_1;PHCBW[(6sePQ9Q">Verbraucher_1_TF</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id=")hP]*877jPwu9N8.[(79">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id=".V;dQCQ)J3E+aXm0(^vh">
<field name="OP">LT</field>
<value name="A">
<block type="on_source" id="[g1HWrXjMhE+XBZ[C?{u">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="variables_get" id="##_kE;LZ.iFP~mVkc`DL">
<field name="VAR" id="N2Dk85CQN2uL0w3qt8A_">Verbraucher_1</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="variables_set" id="UBdvQr/~=|oAO4JZI2YP">
<field name="VAR" id="iwu_1;PHCBW[(6sePQ9Q">Verbraucher_1_TF</field>
<value name="VALUE">
<block type="logic_boolean" id="q894myS0At?(+8Iub+)O">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="procedures_callnoreturn" id="t*`6kK;Hg:%(cS!PAAy#">
<mutation name="Verbraucher_1_F"></mutation>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
<block type="procedures_defnoreturn" id="@ekGxf-0b4ul@_*yU!q!" x="787" y="-1237">
<field name="NAME">Verbraucher_1_F</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="debug" id="XsQy?M`M`FP^QIJ)GB|7">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="Id[jm[wLw-/,vB51Uf]H">
<field name="TEXT">Verbraucher 1</field>
</shadow>
<block type="text_join" id="]4D|#f/?y/zeHDhp$LWS">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="jQw-UwTC]DksT)NNdDF.">
<field name="TEXT">Verbraucher 1</field>
</block>
</value>
<value name="ADD1">
<block type="logic_ternary" id="3$oAdrX`bqXSv1TghR.a" collapsed="true">
<value name="IF">
<block type="logic_compare" id="_^RA22h*u.[ABpnqOU-6">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="DjJzTDY_{F!8$yQ,;f~w">
<field name="VAR" id="iwu_1;PHCBW[(6sePQ9Q">Verbraucher_1_TF</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="ynJ[Spx.q3u?mqcU0Qxy">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<value name="THEN">
<block type="text" id="[7]As70kU{wfCZ8:,62F">
<field name="TEXT"> zugeschaltet</field>
</block>
</value>
<value name="ELSE">
<block type="text" id="f%SouFvX9rOT[udv-)ON">
<field name="TEXT"> abgeschaltet</field>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="control" id="i5St;qI=KfF6(?@W4e|G">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">fritzdect.0.DECT_116570370102.state</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="variables_get" id="W@27ApZuY8.*wCEN]X~1">
<field name="VAR" id="iwu_1;PHCBW[(6sePQ9Q">Verbraucher_1_TF</field>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="F^J*l7#(vxkqOv6n)nLf" x="787" y="-1063">
<field name="NAME">Verbraucher_2_F</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
<statement name="STACK">
<block type="debug" id="If`Pz%NHny~M=l4AMJx1">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text">
<field name="TEXT">Verbraucher 1</field>
</shadow>
<block type="text_join" id="~^.dt!hM~I?DoQg7dyf9">
<mutation items="2"></mutation>
<value name="ADD0">
<block type="text" id="WK4M9[-w%~LwJYG;P4y@">
<field name="TEXT">Verbraucher 2</field>
</block>
</value>
<value name="ADD1">
<block type="logic_ternary" id="T8._+^dNayVtrY,5wyUO" collapsed="true">
<value name="IF">
<block type="logic_compare" id="z``pY2*;X=~7=DU7`0(b">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="2DY;v,+~;E`GhWN(UehP">
<field name="VAR" id="Zs+nKXWb1F_(8ioCBAN2">Verbraucher_2_TF</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="]:B-TeVoq?l?+RB9}+!^">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<value name="THEN">
<block type="text" id="CGE4y~V]Ky}?W:_K9u+A">
<field name="TEXT"> zugeschaltet</field>
</block>
</value>
<value name="ELSE">
<block type="text" id="RiVXqI.mm[=Y]rgpn-6T">
<field name="TEXT"> abgeschaltet</field>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="control" id="Ab]ShI{UYRiAaaT!$NwT">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">hmip.0.devices.3014F711A00001D709951707.channels.1.on</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="variables_get" id=":vYLNLT)_fh2R+)0#1d]">
<field name="VAR" id="Zs+nKXWb1F_(8ioCBAN2">Verbraucher_2_TF</field>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</xml>