Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Testscript: Hausspeicher dyn. laden nach Tibberpreisen uvm.

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Testscript: Hausspeicher dyn. laden nach Tibberpreisen uvm.

    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      babl @paul53 last edited by

      @paul53 Funktioniert dann das Script auch sollte es im schlimmsten Fall dazu kommen daß der billigste punkt um 0Uhr ist und der 2. billigste um 23 Uhr?

      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @babl last edited by paul53

        @babl sagte: meinst du so?

        Nein, es müssen immer alle Zeitpläne gestoppt werden, da z.B. vorherige Nacht > 1h und diese Nacht < 1 h geladen werden kann. Außerdem muss der Ladevorgang nicht bei > 1 h laden nicht zweimal gestartet werden, da er nicht automatisch nach einer Stunde endet, sondern erst, wenn voll geladen ist: Der Datenpunkt "manuell_laden" muss auch zurück gesetzt werden.

        Bild_2023-01-06_134437936.png

        Was ist das überhaupt für ein Trigger? Astro-Trigger macht in diesem Zusammenhang keinen Sinn!

        1 Reply Last reply Reply Quote 0
        • paul53
          paul53 @babl last edited by

          @babl
          Stoppen der Zeitpläne:

          Bild_2023-01-06_140244972.png

          Trigger jede Stunde von 19:00 bis 5:00 Uhr und Auswertung nur zu beiden möglichen Startzeitpunkten:

          Bild_2023-01-06_140532085.png

          B 1 Reply Last reply Reply Quote 0
          • B
            babl @paul53 last edited by

            @paul53 so hätte ich es jetzt überarbeitet.

            script3c.jpg

            paul53 1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @babl last edited by paul53

              @babl sagte: so hätte ich es jetzt überarbeitet.

              Das wird wohl so nicht funktionieren?

              Nimm besser das Javascript, das die beiden Startzeitpunkte ermittelt, und das folgende Blockly:

              <xml xmlns="https://developers.google.com/blockly/xml">
               <variables>
                 <variable id="_o(A;@hO^Y!0l@!%+U[U">Groesse_Hausspeicher_in_Wh</variable>
                 <variable id="p*yERo]2-$0,t=p+lkg8">Beladeleistung_Hausspeicher_in_Watt</variable>
                 <variable id="tUKE0PX3K5)VD=YNcLvD">userSoc</variable>
                 <variable id="662+@SNN1=iL4}c|%OCB">Gewünschte Volladung der Batterie in %</variable>
                 <variable id="7%%2=ua6TF*_3*n=+KFP">ladung</variable>
                 <variable id="i!o.-Ha)p18KJmC7sy:z">stunde</variable>
                 <variable id="2]{L:*:~P%K~o/VBmsiG">start1h</variable>
                 <variable id="W81ft)h|Zh*R-R*?Fb?/">start2h</variable>
                 <variable id="-^A9hW=83#~9i72OlX=6">Hausspeicher_User_Soc_in%</variable>
                 <variable id="ML@$Lt_]|-r%{#NpcuTc">Gewünschte Volladung des Hausspeichers in Wh</variable>
                 <variable id="i.}R%W]BfZO,N3SI9H@(">Aktueller Inhalt des Hausspeichers in Wh</variable>
                 <variable id="8%;!XNXHU4)/mq1Q{26l">benoetigte_Wh_fuer_Vollladung</variable>
               </variables>
               <block type="on_ext" id="!:S,u%F%,D|^qI+fx8+7" x="913" y="-62">
                 <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                 <field name="CONDITION">ne</field>
                 <field name="ACK_CONDITION"></field>
                 <value name="OID0">
                   <shadow type="field_oid" id="`}o+tiQuWh+V$coUrcqd">
                     <field name="oid">default</field>
                   </shadow>
                   <block type="text" id="u6A}Mf}c?SsdQ$-NSY|Q">
                     <field name="TEXT">sonnen.0.status.userSoc</field>
                   </block>
                 </value>
                 <statement name="STATEMENT">
                   <block type="controls_if" id="2i;.un?=k!HN(E#9_S}{">
                     <value name="IF0">
                       <block type="get_value" id="_[9Nyawe!,B~3YiY`6B*">
                         <field name="ATTR">val</field>
                         <field name="OID">0_userdata.0.SB_10_manuell_laden</field>
                       </block>
                     </value>
                     <statement name="DO0">
                       <block type="variables_set" id=",ve{v3}#7O$OVB;qf4b3">
                         <field name="VAR" id="tUKE0PX3K5)VD=YNcLvD">userSoc</field>
                         <value name="VALUE">
                           <block type="on_source" id="=Nyl81_dezLL_9N^QooF">
                             <field name="ATTR">state.val</field>
                           </block>
                         </value>
                         <next>
                           <block type="controls_if" id="S[wO/T])mRy4l-TM9G~]">
                             <mutation else="1"></mutation>
                             <value name="IF0">
                               <block type="logic_compare" id="2f4p(u=}(=K%7M%4r^T,">
                                 <field name="OP">LT</field>
                                 <value name="A">
                                   <block type="variables_get" id="Q)@yXE3VuEJmeqc!iI]3">
                                     <field name="VAR" id="tUKE0PX3K5)VD=YNcLvD">userSoc</field>
                                   </block>
                                 </value>
                                 <value name="B">
                                   <block type="variables_get" id="zR1p/~~]}.J]ql^Q9C.j">
                                     <field name="VAR" id="662+@SNN1=iL4}c|%OCB">Gewünschte Volladung der Batterie in %</field>
                                   </block>
                                 </value>
                               </block>
                             </value>
                             <statement name="DO0">
                               <block type="controls_if" id="qb(ZsyG;/ctpEs%AgIhu">
                                 <mutation else="1"></mutation>
                                 <value name="IF0">
                                   <block type="logic_operation" id="WR,do8bkYb4;$b0d0ZRz" inline="false">
                                     <field name="OP">OR</field>
                                     <value name="A">
                                       <block type="logic_compare" id="+)8PQPUGZ:f^FSo.X8XH">
                                         <field name="OP">LT</field>
                                         <value name="A">
                                           <block type="variables_get" id="H.`T3QRHnKeW8/r[|Z_X">
                                             <field name="VAR" id="tUKE0PX3K5)VD=YNcLvD">userSoc</field>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <block type="math_number" id="]M3DjmiXpy??;HfY3IRA">
                                             <field name="NUM">5</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <block type="logic_compare" id="#hzl#oPN@kR$Vml(Mb=-">
                                         <field name="OP">GT</field>
                                         <value name="A">
                                           <block type="variables_get" id="`@hXr^ZK`egjbYkULC%E">
                                             <field name="VAR" id="tUKE0PX3K5)VD=YNcLvD">userSoc</field>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <block type="math_number" id="CZTTbH4U%.tnZndUo?)-">
                                             <field name="NUM">95</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                                 <statement name="DO0">
                                   <block type="variables_set" id="i?5`%cy!H,*)mre5DN,g">
                                     <field name="VAR" id="7%%2=ua6TF*_3*n=+KFP">ladung</field>
                                     <value name="VALUE">
                                       <block type="math_arithmetic" id="0R*gz0*U~M)o$]a@aH3^">
                                         <field name="OP">DIVIDE</field>
                                         <value name="A">
                                           <shadow type="math_number">
                                             <field name="NUM">1</field>
                                           </shadow>
                                           <block type="variables_get" id="NRSK%SF9*$IrZJK5O+?W">
                                             <field name="VAR" id="p*yERo]2-$0,t=p+lkg8">Beladeleistung_Hausspeicher_in_Watt</field>
                                           </block>
                                         </value>
                                         <value name="B">
                                           <shadow type="math_number">
                                             <field name="NUM">1</field>
                                           </shadow>
                                           <block type="math_number" id=":Yi=O@m`xRWa=P-q=xW)">
                                             <field name="NUM">2</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                   </block>
                                 </statement>
                                 <statement name="ELSE">
                                   <block type="variables_set" id="bRNS:q59Ud-z?;Z?q:6|">
                                     <field name="VAR" id="7%%2=ua6TF*_3*n=+KFP">ladung</field>
                                     <value name="VALUE">
                                       <block type="variables_get" id="T79bP^WCXStAdTBj{KVH">
                                         <field name="VAR" id="p*yERo]2-$0,t=p+lkg8">Beladeleistung_Hausspeicher_in_Watt</field>
                                       </block>
                                     </value>
                                   </block>
                                 </statement>
                               </block>
                             </statement>
                             <statement name="ELSE">
                               <block type="update" id="d3zagXK[uKqXL~AVHIl+">
                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                 <field name="OID">0_userdata.0.SB_10_manuell_laden</field>
                                 <field name="WITH_DELAY">FALSE</field>
                                 <value name="VALUE">
                                   <block type="logic_boolean" id="HqS~dS}s![:3!na`{LE|">
                                     <field name="BOOL">FALSE</field>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="variables_set" id="$grJ9zwL;,f|c:%(i4iO">
                                     <field name="VAR" id="7%%2=ua6TF*_3*n=+KFP">ladung</field>
                                     <value name="VALUE">
                                       <block type="math_number" id="54W^ln.jYu|z27??![pW">
                                         <field name="NUM">0</field>
                                       </block>
                                     </value>
                                   </block>
                                 </next>
                               </block>
                             </statement>
                           </block>
                         </next>
                       </block>
                     </statement>
                   </block>
                 </statement>
                 <next>
                   <block type="schedule" id="HswSC2x#x@q*V16btQTB">
                     <field name="SCHEDULE">*/8 * * * * *</field>
                     <statement name="STATEMENT">
                       <block type="control" id="{Vq?}rT:I^wT${3(H3+.">
                         <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                         <field name="OID">sonnen.0.control.charge</field>
                         <field name="WITH_DELAY">FALSE</field>
                         <value name="VALUE">
                           <block type="variables_get" id="n7~aIw=1}rs5#-lK+@V3">
                             <field name="VAR" id="7%%2=ua6TF*_3*n=+KFP">ladung</field>
                           </block>
                         </value>
                       </block>
                     </statement>
                   </block>
                 </next>
               </block>
               <block type="variables_set" id="MZP??-@GgCQ0uW}:EOVg" x="87" y="194">
                 <field name="VAR" id="_o(A;@hO^Y!0l@!%+U[U">Groesse_Hausspeicher_in_Wh</field>
                 <value name="VALUE">
                   <block type="math_number" id="o8-buWU0G_HoI4}4;evH">
                     <field name="NUM">5000</field>
                   </block>
                 </value>
                 <next>
                   <block type="variables_set" id="(S#.kljR#zd~`f9RB(yq">
                     <field name="VAR" id="p*yERo]2-$0,t=p+lkg8">Beladeleistung_Hausspeicher_in_Watt</field>
                     <value name="VALUE">
                       <block type="math_number" id="Zu?;iFSO1mu1EKv/TXIl">
                         <field name="NUM">3000</field>
                       </block>
                     </value>
                     <next>
                       <block type="variables_set" id="GKzOcYV_*aI#z-DvQM-l">
                         <field name="VAR" id="662+@SNN1=iL4}c|%OCB">Gewünschte Volladung der Batterie in %</field>
                         <value name="VALUE">
                           <block type="math_number" id="~rqaOR`YtTkL*2N]d]Pb">
                             <field name="NUM">100</field>
                           </block>
                         </value>
                         <next>
                           <block type="schedule" id="PpHw,4;Y%c+B0c_2!yvm">
                             <field name="SCHEDULE">0 0-5,19-23 * * *</field>
                             <statement name="STATEMENT">
                               <block type="variables_set" id="+CObYKOl:duuBTJwO?fN">
                                 <field name="VAR" id="i!o.-Ha)p18KJmC7sy:z">stunde</field>
                                 <value name="VALUE">
                                   <block type="time_get" id="{7CG2P6msM+sg=DI/Ib*">
                                     <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                     <field name="OPTION">h</field>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="variables_set" id=";w9ec0563t3N?#;PR6lg">
                                     <field name="VAR" id="2]{L:*:~P%K~o/VBmsiG">start1h</field>
                                     <value name="VALUE">
                                       <block type="get_value" id="+edqU(uyzR7C!in:@y!m">
                                         <field name="ATTR">val</field>
                                         <field name="OID">0_userdata.0.Tibber.Bester_Preis.Start1h</field>
                                       </block>
                                     </value>
                                     <next>
                                       <block type="variables_set" id="}/(:p1v0{D5D)^a^_7eM">
                                         <field name="VAR" id="W81ft)h|Zh*R-R*?Fb?/">start2h</field>
                                         <value name="VALUE">
                                           <block type="get_value" id="_)S5(r}hvt!234ABX7Lj">
                                             <field name="ATTR">val</field>
                                             <field name="OID">0_userdata.0.Tibber.Bester_Preis.Start2h</field>
                                           </block>
                                         </value>
                                         <next>
                                           <block type="controls_if" id="V^C-W~Z]9ve.tu:OK[{b">
                                             <value name="IF0">
                                               <block type="logic_operation" id=",s,PDs0@SsAH+2PG[P2^" inline="false">
                                                 <field name="OP">AND</field>
                                                 <value name="A">
                                                   <block type="logic_operation" id="[Em}#@0oLHmA_`E|F34W">
                                                     <field name="OP">OR</field>
                                                     <value name="A">
                                                       <block type="logic_compare" id="4,c|9~-qXY=toW32Ju)#">
                                                         <field name="OP">EQ</field>
                                                         <value name="A">
                                                           <block type="variables_get" id="b{gm}vW!jZgpF^){AEia">
                                                             <field name="VAR" id="i!o.-Ha)p18KJmC7sy:z">stunde</field>
                                                           </block>
                                                         </value>
                                                         <value name="B">
                                                           <block type="variables_get" id="7(h*]j;D}wA9b^Oiq!66">
                                                             <field name="VAR" id="2]{L:*:~P%K~o/VBmsiG">start1h</field>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </value>
                                                     <value name="B">
                                                       <block type="logic_compare" id="=NSBA(Vb)IIYp.vkf^;B">
                                                         <field name="OP">EQ</field>
                                                         <value name="A">
                                                           <block type="variables_get" id="N@`O)}08SBDD7T9fhJWo">
                                                             <field name="VAR" id="i!o.-Ha)p18KJmC7sy:z">stunde</field>
                                                           </block>
                                                         </value>
                                                         <value name="B">
                                                           <block type="variables_get" id=":AwViRZ{e7#a8N4Vw=r1">
                                                             <field name="VAR" id="W81ft)h|Zh*R-R*?Fb?/">start2h</field>
                                                           </block>
                                                         </value>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </value>
                                                 <value name="B">
                                                   <block type="logic_negate" id="Q/R*]xz%tp{@9@qvYxJJ">
                                                     <value name="BOOL">
                                                       <block type="get_value" id="wp[}xVYrx(%|;LlRFs,%">
                                                         <field name="ATTR">val</field>
                                                         <field name="OID">0_userdata.0.SB_10_manuell_laden</field>
                                                       </block>
                                                     </value>
                                                   </block>
                                                 </value>
                                               </block>
                                             </value>
                                             <statement name="DO0">
                                               <block type="comment" id="?{,$;?Kz_31x-o=h1qXF">
                                                 <field name="COMMENT">Hausspeicher aktueller User Soc Datenpunkt (diese Variable wird leider unten in der Ausführung nicht übernommen, daher muß man sie unten manuell eingeben)</field>
                                                 <next>
                                                   <block type="variables_set" id="!70`ha%X:wSKw!l4tfT0">
                                                     <field name="VAR" id="-^A9hW=83#~9i72OlX=6">Hausspeicher_User_Soc_in%</field>
                                                     <value name="VALUE">
                                                       <block type="get_value" id="M~|s)d7rGJAty~MxH`GT">
                                                         <field name="ATTR">val</field>
                                                         <field name="OID">sonnen.0.status.userSoc</field>
                                                       </block>
                                                     </value>
                                                     <next>
                                                       <block type="variables_set" id="aT316iyC~O^.QPGm#usj">
                                                         <field name="VAR" id="ML@$Lt_]|-r%{#NpcuTc">Gewünschte Volladung des Hausspeichers in Wh</field>
                                                         <value name="VALUE">
                                                           <block type="math_arithmetic" id="L,d!WkA(ZTF?rMk*gX|:">
                                                             <field name="OP">DIVIDE</field>
                                                             <value name="A">
                                                               <shadow type="math_number">
                                                                 <field name="NUM">1</field>
                                                               </shadow>
                                                               <block type="math_arithmetic" id="Y?ptK9X2+dF|Q6oNZfa;">
                                                                 <field name="OP">MULTIPLY</field>
                                                                 <value name="A">
                                                                   <shadow type="math_number">
                                                                     <field name="NUM">1</field>
                                                                   </shadow>
                                                                   <block type="variables_get" id="Y[a`=E?0,0EU%,*`|@PL">
                                                                     <field name="VAR" id="_o(A;@hO^Y!0l@!%+U[U">Groesse_Hausspeicher_in_Wh</field>
                                                                   </block>
                                                                 </value>
                                                                 <value name="B">
                                                                   <shadow type="math_number" id="D:Q_eDfS0$0eFkE.s~d9">
                                                                     <field name="NUM">1</field>
                                                                   </shadow>
                                                                   <block type="variables_get" id="h+AE0hEXUMZzgS/(PqHw">
                                                                     <field name="VAR" id="662+@SNN1=iL4}c|%OCB">Gewünschte Volladung der Batterie in %</field>
                                                                   </block>
                                                                 </value>
                                                               </block>
                                                             </value>
                                                             <value name="B">
                                                               <shadow type="math_number">
                                                                 <field name="NUM">1</field>
                                                               </shadow>
                                                               <block type="math_number" id=".q-.W`ppE=W6~U,G[M{G">
                                                                 <field name="NUM">100</field>
                                                               </block>
                                                             </value>
                                                           </block>
                                                         </value>
                                                         <next>
                                                           <block type="debug" id="}G,+oeAzYOWBp`(;iE/L">
                                                             <field name="Severity">log</field>
                                                             <value name="TEXT">
                                                               <shadow type="text">
                                                                 <field name="TEXT">test</field>
                                                               </shadow>
                                                               <block type="variables_get" id="@ylEhTd*p|@Qpf9DO01~">
                                                                 <field name="VAR" id="ML@$Lt_]|-r%{#NpcuTc">Gewünschte Volladung des Hausspeichers in Wh</field>
                                                               </block>
                                                             </value>
                                                             <next>
                                                               <block type="variables_set" id="QpSp*L2/obVl#BmPW=Im">
                                                                 <field name="VAR" id="i.}R%W]BfZO,N3SI9H@(">Aktueller Inhalt des Hausspeichers in Wh</field>
                                                                 <value name="VALUE">
                                                                   <block type="math_arithmetic" id="4yEqQ!XOBu/CM1z55rZ+">
                                                                     <field name="OP">DIVIDE</field>
                                                                     <value name="A">
                                                                       <shadow type="math_number">
                                                                         <field name="NUM">1</field>
                                                                       </shadow>
                                                                       <block type="math_arithmetic" id="NOV4:y,hKM_4WGK+-L5a">
                                                                         <field name="OP">MULTIPLY</field>
                                                                         <value name="A">
                                                                           <shadow type="math_number">
                                                                             <field name="NUM">1</field>
                                                                           </shadow>
                                                                           <block type="variables_get" id="@@bf!^!!zG3ZazhhDi3N">
                                                                             <field name="VAR" id="_o(A;@hO^Y!0l@!%+U[U">Groesse_Hausspeicher_in_Wh</field>
                                                                           </block>
                                                                         </value>
                                                                         <value name="B">
                                                                           <shadow type="math_number">
                                                                             <field name="NUM">1</field>
                                                                           </shadow>
                                                                           <block type="variables_get" id="r8^7W*S+mf8?Y+^iCEu^">
                                                                             <field name="VAR" id="-^A9hW=83#~9i72OlX=6">Hausspeicher_User_Soc_in%</field>
                                                                           </block>
                                                                         </value>
                                                                       </block>
                                                                     </value>
                                                                     <value name="B">
                                                                       <shadow type="math_number">
                                                                         <field name="NUM">1</field>
                                                                       </shadow>
                                                                       <block type="math_number" id="z=X5B0F%iKCu_{K=nTtz">
                                                                         <field name="NUM">100</field>
                                                                       </block>
                                                                     </value>
                                                                   </block>
                                                                 </value>
                                                                 <next>
                                                                   <block type="variables_set" id="GcnkwY=Av#fEW9`j_(LA">
                                                                     <field name="VAR" id="8%;!XNXHU4)/mq1Q{26l">benoetigte_Wh_fuer_Vollladung</field>
                                                                     <value name="VALUE">
                                                                       <block type="math_arithmetic" id="BC:,rAc!m7F!HG_H?a`.">
                                                                         <field name="OP">MINUS</field>
                                                                         <value name="A">
                                                                           <shadow type="math_number" id="ZEU-dcK#.OUwTR%xlpL!">
                                                                             <field name="NUM">1</field>
                                                                           </shadow>
                                                                           <block type="variables_get" id="znl~Q@O?I@#g8i;LBO3F">
                                                                             <field name="VAR" id="ML@$Lt_]|-r%{#NpcuTc">Gewünschte Volladung des Hausspeichers in Wh</field>
                                                                           </block>
                                                                         </value>
                                                                         <value name="B">
                                                                           <shadow type="math_number" id="`6.:,gs|}r;|)i=WOM)q">
                                                                             <field name="NUM">1</field>
                                                                           </shadow>
                                                                           <block type="variables_get" id=".aFs`RGDYOQiyNOnEq,s">
                                                                             <field name="VAR" id="i.}R%W]BfZO,N3SI9H@(">Aktueller Inhalt des Hausspeichers in Wh</field>
                                                                           </block>
                                                                         </value>
                                                                       </block>
                                                                     </value>
                                                                     <next>
                                                                       <block type="debug" id="U-5c]Rj@%|q4-iR)n$GK">
                                                                         <field name="Severity">log</field>
                                                                         <value name="TEXT">
                                                                           <shadow type="text" id="0/@w@_4bKtO[4-@JL/bx">
                                                                             <field name="TEXT">test</field>
                                                                           </shadow>
                                                                           <block type="variables_get" id="sQjcbO4t8x}*ph/08A42">
                                                                             <field name="VAR" id="8%;!XNXHU4)/mq1Q{26l">benoetigte_Wh_fuer_Vollladung</field>
                                                                           </block>
                                                                         </value>
                                                                         <next>
                                                                           <block type="controls_if" id="Dv{j+@Ao0zX4F,q.:#[=">
                                                                             <mutation elseif="1"></mutation>
                                                                             <value name="IF0">
                                                                               <block type="logic_compare" id="J4doY.kF$c~7WO6$@Zl]">
                                                                                 <field name="OP">GTE</field>
                                                                                 <value name="A">
                                                                                   <block type="variables_get" id="gJz6kkTqUqfp]]%bVxmK">
                                                                                     <field name="VAR" id="8%;!XNXHU4)/mq1Q{26l">benoetigte_Wh_fuer_Vollladung</field>
                                                                                   </block>
                                                                                 </value>
                                                                                 <value name="B">
                                                                                   <block type="variables_get" id="aigO*jWNOUWw.2d4z`y}">
                                                                                     <field name="VAR" id="p*yERo]2-$0,t=p+lkg8">Beladeleistung_Hausspeicher_in_Watt</field>
                                                                                   </block>
                                                                                 </value>
                                                                               </block>
                                                                             </value>
                                                                             <statement name="DO0">
                                                                               <block type="controls_if" id=")`YJ^)aGk6A+l]oCX9@g">
                                                                                 <value name="IF0">
                                                                                   <block type="logic_compare" id="1kL5O,FD^1AF~Ui^-?N%">
                                                                                     <field name="OP">EQ</field>
                                                                                     <value name="A">
                                                                                       <block type="variables_get" id="YTv05lus(j-!otQ,RA0l">
                                                                                         <field name="VAR" id="i!o.-Ha)p18KJmC7sy:z">stunde</field>
                                                                                       </block>
                                                                                     </value>
                                                                                     <value name="B">
                                                                                       <block type="variables_get" id="+nauxomT!BzcChx*43Gu">
                                                                                         <field name="VAR" id="W81ft)h|Zh*R-R*?Fb?/">start2h</field>
                                                                                       </block>
                                                                                     </value>
                                                                                   </block>
                                                                                 </value>
                                                                                 <statement name="DO0">
                                                                                   <block type="update" id=")`oTB=*R-ng3gjG-q5ZH">
                                                                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                     <field name="OID">0_userdata.0.SB_10_manuell_laden</field>
                                                                                     <field name="WITH_DELAY">FALSE</field>
                                                                                     <value name="VALUE">
                                                                                       <block type="logic_boolean" id=",je=plC@|,)bhNC|FHQk">
                                                                                         <field name="BOOL">TRUE</field>
                                                                                       </block>
                                                                                     </value>
                                                                                   </block>
                                                                                 </statement>
                                                                               </block>
                                                                             </statement>
                                                                             <value name="IF1">
                                                                               <block type="logic_compare" id="NS0?wW4pIbx9)fY,Xiqa">
                                                                                 <field name="OP">EQ</field>
                                                                                 <value name="A">
                                                                                   <block type="variables_get" id="U?57`D)MS,~NwrLt[I5u">
                                                                                     <field name="VAR" id="i!o.-Ha)p18KJmC7sy:z">stunde</field>
                                                                                   </block>
                                                                                 </value>
                                                                                 <value name="B">
                                                                                   <block type="variables_get" id="JMJ{duW8sv=nwo^:39h3">
                                                                                     <field name="VAR" id="2]{L:*:~P%K~o/VBmsiG">start1h</field>
                                                                                   </block>
                                                                                 </value>
                                                                               </block>
                                                                             </value>
                                                                             <statement name="DO1">
                                                                               <block type="update" id="~_6S%,WZ][E^nlvlRJXE">
                                                                                 <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                 <field name="OID">0_userdata.0.SB_10_manuell_laden</field>
                                                                                 <field name="WITH_DELAY">FALSE</field>
                                                                                 <value name="VALUE">
                                                                                   <block type="logic_boolean" id="CpF%8d:6}p-SqTWpemF4">
                                                                                     <field name="BOOL">TRUE</field>
                                                                                   </block>
                                                                                 </value>
                                                                               </block>
                                                                             </statement>
                                                                           </block>
                                                                         </next>
                                                                       </block>
                                                                     </next>
                                                                   </block>
                                                                 </next>
                                                               </block>
                                                             </next>
                                                           </block>
                                                         </next>
                                                       </block>
                                                     </next>
                                                   </block>
                                                 </next>
                                               </block>
                                             </statement>
                                           </block>
                                         </next>
                                       </block>
                                     </next>
                                   </block>
                                 </next>
                               </block>
                             </statement>
                           </block>
                         </next>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
              </xml>
              

              B 1 Reply Last reply Reply Quote 1
              • B
                babl @paul53 last edited by

                @paul53 da kommt dann auf beiden datenpunkten die gleiche Uhrzeit raus, sind die preise dann von heute oder von morgen in deinem Script

                paul53 1 Reply Last reply Reply Quote 0
                • paul53
                  paul53 @babl last edited by paul53

                  @babl sagte: da kommt dann auf beiden datenpunkten die gleiche Uhrzeit raus

                  Das kann durchaus sein, ist aber nicht immer so.

                  @babl sagte in Testscript: Hausspeicher dyn. laden nach Tibberpreisen uvm.:

                  sind die preise dann von heute oder von morgen

                  Bis Mitternacht von heute und ab 0:00 Uhr von morgen.

                  B 1 Reply Last reply Reply Quote 0
                  • B
                    babl @paul53 last edited by

                    @paul53 ok danke kann man dann den Höchstpreis noch als bestehenden Datenpunkt in das Script miteinbauen, so kann man den Preis über die VIS ändern, ohne daß man jedesmal in deinem Script rumwursteln muss? 😀

                    paul53 1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 @babl last edited by

                      @babl sagte: kann man dann den Höchstpreis noch als bestehenden Datenpunkt in das Script miteinbauen, so kann man den Preis über die VIS ändern, ohne daß man jedesmal in deinem Script rumwursteln muss?

                      Ja, dann muss der Höchstpreis-Datenpunkt innerhalb des 18:57-Uhr-Triggers abgefragt werden.

                      B 1 Reply Last reply Reply Quote 0
                      • B
                        babl @paul53 last edited by babl

                        @paul53

                        also so

                        const maxPreis = 0.3;

                        zu

                        const maxPreis = '0_userdata.0.Tibber.Strom_Höchstpreis';

                        innerhalb des Trigger Block

                        Ist das so richtig?

                        paul53 1 Reply Last reply Reply Quote 0
                        • paul53
                          paul53 @babl last edited by

                          @babl sagte: Ist das so richtig?

                          Nein, innerhalb des Triggers:

                          const maxPreis = getState('0_userdata.0.Tibber.Strom_Höchstpreis').val;
                          
                          B 1 Reply Last reply Reply Quote 0
                          • B
                            babl @paul53 last edited by

                            @paul53 sagte in Testscript: Hausspeicher dyn. laden nach Tibberpreisen uvm.:

                            const maxPreis = getState('0_userdata.0.Tibber.Strom_Höchstpreis').val;

                            ok so?

                            schedule('50 14 * * *', function() {
                                
                            const maxPreis = getState('0_userdata.0.Tibber.Strom_Höchstpreis').val; 
                            
                                const preise = [];
                            
                            paul53 1 Reply Last reply Reply Quote 0
                            • paul53
                              paul53 @babl last edited by

                              @babl sagte: ok so?

                              Ja.
                              Verwendest Du Firefox für ioBroker? Das würde die Leerzeilen beim Kopieren erklären.

                              B 2 Replies Last reply Reply Quote 0
                              • B
                                babl @paul53 last edited by

                                @paul53 ja

                                paul53 1 Reply Last reply Reply Quote 0
                                • paul53
                                  paul53 @babl last edited by

                                  @babl
                                  Für das Internet verwende ich auch Firefox, aber Chrome für ioBroker (ohne Leerzeilen beim Kopieren).

                                  1 Reply Last reply Reply Quote 1
                                  • B
                                    babl @paul53 last edited by

                                    @paul53 noch eine Frage warum kommt dann bei dir wenn der max Preis kleiner ist als der Tibberpreis die Zahl 12 raus?

                                    paul53 1 Reply Last reply Reply Quote 0
                                    • paul53
                                      paul53 @babl last edited by

                                      @babl sagte: wenn der max Preis kleiner ist als der Tibberpreis die Zahl 12 raus?

                                      Weil 12:00 Uhr außerhalb des Abfragezeitraums 19:00 bis 5:00 Uhr ist und somit nicht geladen wird.

                                      B 1 Reply Last reply Reply Quote 0
                                      • B
                                        babl @paul53 last edited by

                                        @paul53 aaaah ok, gut danke dir ich glaube das ganze ist mir doch zu hoch, habe aber heute geglaubt ich bringe es auf die reihe.

                                        paul53 1 Reply Last reply Reply Quote 0
                                        • paul53
                                          paul53 @babl last edited by paul53

                                          @babl
                                          Das mit den Zeitplänen ist keine so gute Idee. Mache es besser so:

                                          Bild_2023-01-07_133858905.png

                                          B 1 Reply Last reply Reply Quote 0
                                          • B
                                            babl @paul53 last edited by

                                            @paul53 ok danke

                                            U D 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            748
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            blockly
                                            6
                                            60
                                            3630
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo