Skip to content
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Logo
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. Blockly
  5. Testscript: Hausspeicher dyn. laden nach Tibberpreisen uvm.

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.0k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.8k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.0k

Testscript: Hausspeicher dyn. laden nach Tibberpreisen uvm.

Testscript: Hausspeicher dyn. laden nach Tibberpreisen uvm.

Scheduled Pinned Locked Moved Blockly
blockly
60 Posts 6 Posters 5.5k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B babl

    @paul53 ja da ich vor mitternacht meinen Hausspeicher laden will und ab 0 Uhr kommen ja bereits die morgigen Preise als heutige Preise und Tomorrow bleibt ja dann bis 13Uhr oder später leer.

    Ich habe bei meinem Script die Solarprognose als falls block miteingebaut falls morgiger Tag mehr als 10kw Ertrag prognostiziert werden soll er den Speicher nicht laden, da ja in der Nacht die Preise eigentlich sowieso niedrig sind, ist der prognostizierte Ertrag unter 10 soll er den Hausspeicher laden.

    paul53P Offline
    paul53P Offline
    paul53
    wrote on last edited by paul53
    #11

    @babl sagte: ab 0 Uhr kommen ja bereits die morgigen Preise als heutige Preise und Tomorrow bleibt ja dann bis 13Uhr oder später leer.

    Deshalb sollte man nicht auf die Datenpunkte triggern, sondern nur einmal am Tag kurz bevor man die Preise auswertet (z.B. 18:57 Uhr). Andernfalls stehen vor Mitternacht nicht die richtigen Preise von nach Mitternacht für einen Vergleich / eine Sortierung zur Verfügung.

    Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
    Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

    B 1 Reply Last reply
    1
    • paul53P paul53

      @babl sagte: ab 0 Uhr kommen ja bereits die morgigen Preise als heutige Preise und Tomorrow bleibt ja dann bis 13Uhr oder später leer.

      Deshalb sollte man nicht auf die Datenpunkte triggern, sondern nur einmal am Tag kurz bevor man die Preise auswertet (z.B. 18:57 Uhr). Andernfalls stehen vor Mitternacht nicht die richtigen Preise von nach Mitternacht für einen Vergleich / eine Sortierung zur Verfügung.

      B Offline
      B Offline
      babl
      wrote on last edited by
      #12

      @paul53 ok und wie könnte man sowas jetzt lösen wenn ich nun 10 Punkte habe und trotzdem irgendwie eine zusammenhängende Zeit nutzen will.

      z.B von 0 - 4 Uhr sind die Preise am günstigsten, dann kommt 23 Uhr dazwischen und dann geht es wieder mit 5 Uhr weiter und dann 22 Uhr, 21 und 20 Uhr. Hast du da eine Idee?

      Wenn ich z.B für den Speicher mehr als 1 Stunde brauche um zu laden dann sollten die besten 2 Stunden zusammenhängend sein oder was denkst du oder würdest du einfach dann um als beispiel um 21 uhr laden um 22 uhr nicht laden und 23 uhr wieder laden

      paul53P 1 Reply Last reply
      0
      • B babl

        @paul53 ok und wie könnte man sowas jetzt lösen wenn ich nun 10 Punkte habe und trotzdem irgendwie eine zusammenhängende Zeit nutzen will.

        z.B von 0 - 4 Uhr sind die Preise am günstigsten, dann kommt 23 Uhr dazwischen und dann geht es wieder mit 5 Uhr weiter und dann 22 Uhr, 21 und 20 Uhr. Hast du da eine Idee?

        Wenn ich z.B für den Speicher mehr als 1 Stunde brauche um zu laden dann sollten die besten 2 Stunden zusammenhängend sein oder was denkst du oder würdest du einfach dann um als beispiel um 21 uhr laden um 22 uhr nicht laden und 23 uhr wieder laden

        paul53P Offline
        paul53P Offline
        paul53
        wrote on last edited by paul53
        #13

        @babl sagte: mehr als 1 Stunde brauche um zu laden dann sollten die besten 2 Stunden zusammenhängend sein

        Dann braucht man aber eine chronologische Sortierung und muss den Startzeitpunkt für die minimale Summe über zwei aufeinanderfolgende Werte ermitteln, ähnlich wie hier.

        Wenn es dem Akku nicht schadet, sind natürlich die beiden günstigsten Stunden wirtschaftlicher (Sortierung nach Preis).

        Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
        Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

        B 1 Reply Last reply
        0
        • paul53P paul53

          @babl sagte: mehr als 1 Stunde brauche um zu laden dann sollten die besten 2 Stunden zusammenhängend sein

          Dann braucht man aber eine chronologische Sortierung und muss den Startzeitpunkt für die minimale Summe über zwei aufeinanderfolgende Werte ermitteln, ähnlich wie hier.

          Wenn es dem Akku nicht schadet, sind natürlich die beiden günstigsten Stunden wirtschaftlicher (Sortierung nach Preis).

          B Offline
          B Offline
          babl
          wrote on last edited by
          #14

          @paul53 ok, das muß ich mir morgen mal ansehen, ich danke dir einstweilen, mir raucht eh schon der kopf.

          1 Reply Last reply
          0
          • B babl

            Script 3 ist zu lang hier es reinzukopieren.

            Script 3.txt

            Auf gute Zusammenarbeit

            paul53P Offline
            paul53P Offline
            paul53
            wrote on last edited by
            #15

            @babl sagte: Script 3 ist zu lang hier es reinzukopieren.

            Ganz schön unübersichtlich und wenn man die Bedeutung verschiedener Datenpunkte nicht kennt, auch nicht nachzuvollziehen.
            Was gar nicht geht: Der 8-s-Zeitplan innerhalb der Funktion Hausspeicher_laden!!
            Das Hauptprogramm läuft doch schon mit einem stündlichen Trigger.

            Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
            Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

            B 1 Reply Last reply
            0
            • paul53P paul53

              @babl sagte: Script 3 ist zu lang hier es reinzukopieren.

              Ganz schön unübersichtlich und wenn man die Bedeutung verschiedener Datenpunkte nicht kennt, auch nicht nachzuvollziehen.
              Was gar nicht geht: Der 8-s-Zeitplan innerhalb der Funktion Hausspeicher_laden!!
              Das Hauptprogramm läuft doch schon mit einem stündlichen Trigger.

              B Offline
              B Offline
              babl
              wrote on last edited by
              #16

              @paul53 es läuft aber so seit Wochen ich kann das aber dann gern in einem extra Script unterbringen

              paul53P 1 Reply Last reply
              0
              • B babl

                @paul53 es läuft aber so seit Wochen ich kann das aber dann gern in einem extra Script unterbringen

                paul53P Offline
                paul53P Offline
                paul53
                wrote on last edited by
                #17

                @babl sagte: es läuft aber so seit Wochen

                Es sind zu viele 8-s-Zeitpläne, da jede Stunde nachts ein neuer erstellt wird und alles darin mehrfach hintereinander ausgeführt wird. Irgendwann wird das System dadurch überlastet.

                Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                B 1 Reply Last reply
                0
                • paul53P paul53

                  @babl sagte: es läuft aber so seit Wochen

                  Es sind zu viele 8-s-Zeitpläne, da jede Stunde nachts ein neuer erstellt wird und alles darin mehrfach hintereinander ausgeführt wird. Irgendwann wird das System dadurch überlastet.

                  B Offline
                  B Offline
                  babl
                  wrote on last edited by
                  #18

                  @paul53 das kann sein denn seit Wochen habe ich auch kleinere Probleme mit den Admin subscribes und unsubscribes, dann kann das hinkommen, ich wüsste aber nicht wie ich das sonst machen sollte denn der Datenpunkt muss alle 8 Sekunden beschrieben werden

                  paul53P 1 Reply Last reply
                  0
                  • B babl

                    @paul53 das kann sein denn seit Wochen habe ich auch kleinere Probleme mit den Admin subscribes und unsubscribes, dann kann das hinkommen, ich wüsste aber nicht wie ich das sonst machen sollte denn der Datenpunkt muss alle 8 Sekunden beschrieben werden

                    paul53P Offline
                    paul53P Offline
                    paul53
                    wrote on last edited by paul53
                    #19

                    @babl sagte: der Datenpunkt muss alle 8 Sekunden beschrieben werden

                    Welcher Datenpunkt?

                    Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                    Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                    B 1 Reply Last reply
                    0
                    • paul53P paul53

                      @babl sagte: der Datenpunkt muss alle 8 Sekunden beschrieben werden

                      Welcher Datenpunkt?

                      B Offline
                      B Offline
                      babl
                      wrote on last edited by
                      #20

                      @paul53 der charging Punkt der Sonnenbatterie damit das laden funktioniert, sobald nicht mehr beschrieben wird geht der Speicher in den normalen Modus über.

                      paul53P 1 Reply Last reply
                      0
                      • B babl

                        @paul53 der charging Punkt der Sonnenbatterie damit das laden funktioniert, sobald nicht mehr beschrieben wird geht der Speicher in den normalen Modus über.

                        paul53P Offline
                        paul53P Offline
                        paul53
                        wrote on last edited by paul53
                        #21

                        @babl sagte: charging Punkt der Sonnenbatterie damit das laden funktioniert

                        Dann setze in der Funktion eine Variable mit dem zu schreibenden Wert und schreibe den Variablenwert alle 8 s in den Datenpunkt.

                        Bild_2023-01-04_203844287.png

                        Das verbraucht auch viel weniger Ressourcen.

                        Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                        Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                        B 1 Reply Last reply
                        0
                        • paul53P paul53

                          @babl sagte: charging Punkt der Sonnenbatterie damit das laden funktioniert

                          Dann setze in der Funktion eine Variable mit dem zu schreibenden Wert und schreibe den Variablenwert alle 8 s in den Datenpunkt.

                          Bild_2023-01-04_203844287.png

                          Das verbraucht auch viel weniger Ressourcen.

                          B Offline
                          B Offline
                          babl
                          wrote on last edited by
                          #22

                          @paul53 ok

                          paul53P 1 Reply Last reply
                          0
                          • B babl

                            @paul53 ok

                            paul53P Offline
                            paul53P Offline
                            paul53
                            wrote on last edited by paul53
                            #23

                            @babl
                            Anstelle der Funktion verwende einen Trigger auf "sonnen.0.status.userSoc", denn darauf muss reagiert werden.

                            Blockly_temp.JPG

                            Gesteuert wird es über den Datenpunkt "0_userdata.0.SB_10_manuell_laden".

                            Bild_2023-01-04_221529588.png

                            Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                            Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                            B 2 Replies Last reply
                            0
                            • paul53P paul53

                              @babl
                              Anstelle der Funktion verwende einen Trigger auf "sonnen.0.status.userSoc", denn darauf muss reagiert werden.

                              Blockly_temp.JPG

                              Gesteuert wird es über den Datenpunkt "0_userdata.0.SB_10_manuell_laden".

                              Bild_2023-01-04_221529588.png

                              B Offline
                              B Offline
                              babl
                              wrote on last edited by
                              #24

                              @paul53 werde ich morgen Mal so ändern danke dir

                              1 Reply Last reply
                              0
                              • paul53P paul53

                                @babl
                                Anstelle der Funktion verwende einen Trigger auf "sonnen.0.status.userSoc", denn darauf muss reagiert werden.

                                Blockly_temp.JPG

                                Gesteuert wird es über den Datenpunkt "0_userdata.0.SB_10_manuell_laden".

                                Bild_2023-01-04_221529588.png

                                B Offline
                                B Offline
                                babl
                                wrote on last edited by
                                #25

                                @paul53 ich gebs auf, das ist einfach zu hoch für mich, ich komme ja schon mit deinem array nicht mal klar damit ich hier die uhrzeit rausbringe und damit arbeiten kann. Ich programmier meine CNC Fräsmaschine weiter das habe ich gelernt und das mache ich nun schon 30 Jahre und das kann ich und laß von dem anderen Zeug die Finger. Vielleicht denke ich auch zu kompliziert.

                                paul53P 1 Reply Last reply
                                0
                                • B babl

                                  @paul53 ich gebs auf, das ist einfach zu hoch für mich, ich komme ja schon mit deinem array nicht mal klar damit ich hier die uhrzeit rausbringe und damit arbeiten kann. Ich programmier meine CNC Fräsmaschine weiter das habe ich gelernt und das mache ich nun schon 30 Jahre und das kann ich und laß von dem anderen Zeug die Finger. Vielleicht denke ich auch zu kompliziert.

                                  paul53P Offline
                                  paul53P Offline
                                  paul53
                                  wrote on last edited by paul53
                                  #26

                                  @babl
                                  Das folgende Skript ermittelt die Startzeiten (Stunde der Uhrzeit) für bis zu einer Stunde Ladedauer und für mehr als einer Stunde Ladedauer (aufeinander folgend) unter Berücksichtigung eines maximalen Preises.

                                  const tibber = 'tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.'; 
                                  const idStart1 = '0_userdata.0.Tibber.Bester_Preis.Start1h';
                                  const idStart2 = '0_userdata.0.Tibber.Bester_Preis.Start2h';
                                  const maxPreis = 0.3;
                                  
                                  schedule('57 18 * * *', function() {
                                      const preise = [];
                                      for(let i = 19; i < 24; i++) {
                                          let obj = {};
                                          let idStart = tibber + 'PricesToday.' + i + '.startsAt';
                                          let idPreis = tibber + 'PricesToday.' + i + '.total';
                                          obj.start = new Date(getState(idStart).val).getHours();
                                          obj.preis = getState(idPreis).val;
                                          preise.push(obj);
                                      }
                                      for(let i = 0; i < 6; i++) {
                                          let obj = {};
                                          let idStart = tibber + 'PricesTomorrow.' + i + '.startsAt';
                                          let idPreis = tibber + 'PricesTomorrow.' + i + '.total';
                                          obj.start = new Date(getState(idStart).val).getHours();
                                          obj.preis = getState(idPreis).val;
                                          preise.push(obj);
                                      }
                                      let start1h = 12;
                                      let min = maxPreis;
                                      for(let i = 0; i < preise.length; i++) {
                                          if(preise[i].preis < min) {
                                              min = preise[i].preis;
                                              start1h = preise[i].start;
                                          }
                                      }
                                      let start2h = 12;
                                      let summe2 = 1.5 * maxPreis;
                                      for(let i = 0; i < preise.length - 1; i++) {
                                          let summe = preise[i].preis + 0.5 * preise[i + 1].preis;
                                          if(summe < summe2) {
                                              summe2 = summe;
                                              start2h = preise[i].start;
                                          }
                                      }
                                      setState(idStart1, start1h, true); // Startstunde für bis 1 h laden
                                      setState(idStart2, start2h, true); // Startstunde für bis 2 h laden
                                  });
                                  

                                  Das angepasste Blockly steuert abhängig von der Startstunde die Ladung.

                                  <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>
                                  

                                  Das alles konnte ich allerdings nicht testen. Es können also noch Fehler enthalten sein.

                                  Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                                  Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                                  B 2 Replies Last reply
                                  0
                                  • paul53P paul53

                                    @babl
                                    Das folgende Skript ermittelt die Startzeiten (Stunde der Uhrzeit) für bis zu einer Stunde Ladedauer und für mehr als einer Stunde Ladedauer (aufeinander folgend) unter Berücksichtigung eines maximalen Preises.

                                    const tibber = 'tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.'; 
                                    const idStart1 = '0_userdata.0.Tibber.Bester_Preis.Start1h';
                                    const idStart2 = '0_userdata.0.Tibber.Bester_Preis.Start2h';
                                    const maxPreis = 0.3;
                                    
                                    schedule('57 18 * * *', function() {
                                        const preise = [];
                                        for(let i = 19; i < 24; i++) {
                                            let obj = {};
                                            let idStart = tibber + 'PricesToday.' + i + '.startsAt';
                                            let idPreis = tibber + 'PricesToday.' + i + '.total';
                                            obj.start = new Date(getState(idStart).val).getHours();
                                            obj.preis = getState(idPreis).val;
                                            preise.push(obj);
                                        }
                                        for(let i = 0; i < 6; i++) {
                                            let obj = {};
                                            let idStart = tibber + 'PricesTomorrow.' + i + '.startsAt';
                                            let idPreis = tibber + 'PricesTomorrow.' + i + '.total';
                                            obj.start = new Date(getState(idStart).val).getHours();
                                            obj.preis = getState(idPreis).val;
                                            preise.push(obj);
                                        }
                                        let start1h = 12;
                                        let min = maxPreis;
                                        for(let i = 0; i < preise.length; i++) {
                                            if(preise[i].preis < min) {
                                                min = preise[i].preis;
                                                start1h = preise[i].start;
                                            }
                                        }
                                        let start2h = 12;
                                        let summe2 = 1.5 * maxPreis;
                                        for(let i = 0; i < preise.length - 1; i++) {
                                            let summe = preise[i].preis + 0.5 * preise[i + 1].preis;
                                            if(summe < summe2) {
                                                summe2 = summe;
                                                start2h = preise[i].start;
                                            }
                                        }
                                        setState(idStart1, start1h, true); // Startstunde für bis 1 h laden
                                        setState(idStart2, start2h, true); // Startstunde für bis 2 h laden
                                    });
                                    

                                    Das angepasste Blockly steuert abhängig von der Startstunde die Ladung.

                                    <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>
                                    

                                    Das alles konnte ich allerdings nicht testen. Es können also noch Fehler enthalten sein.

                                    B Offline
                                    B Offline
                                    babl
                                    wrote on last edited by
                                    #27

                                    @paul53 ich danke dir für das Script, doch ich gebe nicht so schnell auf.

                                    Hier nun mein Vorschlag, ich würde dich bitten dies dir durchzusehen ob du damit einverstanden sein kannst oder was noch besser gemacht werden könnte, nur so lernt man es.

                                    1. Script dies erstellt die Liste nach Sortierung und schreibt sie in einen Datenpunkt als Array. (Script ist sowieso von dir)
                                    const tibber = 'tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.'; // Anpassen!
                                    
                                    const idSort = '0_userdata.0.Tibber.Bester_Preis.Tibber_Bester_Preis'; // DP-Typ: "array"
                                    
                                     
                                    
                                    function sortPreis(a, b) {
                                    
                                        return a.preis - b.preis;
                                    
                                    }
                                    
                                     
                                    
                                    schedule('57 18 * * *', function() {
                                    
                                        const preise = [];
                                    
                                        for(let i = 19; i < 24; i++) {
                                    
                                            let obj = {};
                                    
                                            let idStart = tibber + 'PricesToday.' + i + '.startsAt';
                                    
                                            let idPreis = tibber + 'PricesToday.' + i + '.total';
                                    
                                            obj.start = new Date(getState(idStart).val).getHours();
                                    
                                            obj.preis = getState(idPreis).val;
                                    
                                            preise.push(obj);
                                    
                                        }
                                        for(let i = 0; i < 6; i++) {
                                    
                                            let obj = {};
                                    
                                            let idStart = tibber + 'PricesTomorrow.' + i + '.startsAt';
                                    
                                            let idPreis = tibber + 'PricesTomorrow.' + i + '.total';
                                    
                                            obj.start = new Date(getState(idStart).val).getHours();
                                    
                                            obj.preis = getState(idPreis).val;
                                    
                                            preise.push(obj);
                                    
                                        }
                                        preise.sort(sortPreis);
                                    
                                        setState(idSort, preise, true);
                                    
                                    });
                                    
                                    1. Script läd aus diesem Array die aufgeschlüsselten Preise und Uhrzeiten heraus nach Sortierung. Also Billigster Preis ist 0 usw. Hier müssen Ordner erstellt werden mit je 2 Datenpunkte als Nummer 1mal Als Beschreibung Uhrzeit und 1 mal als Beschreibung Preis.
                                    <xml xmlns="https://developers.google.com/blockly/xml">
                                      <variables>
                                        <variable id="K(-Do$/%qq.3:uuMW(mO">100</variable>
                                        <variable id="T0C|e_iyDzVNTT#.cr|Q">0</variable>
                                        <variable id="?}?K(VcpoL%Ym#A!twK4">result</variable>
                                      </variables>
                                      <block type="on" id="U^4ser/A.u~1BI|SC*yA" x="-387" y="-237">
                                        <field name="OID">0_userdata.0.Tibber.Bester_Preis.Tibber_Bester_Preis</field>
                                        <field name="CONDITION">any</field>
                                        <field name="ACK_CONDITION"></field>
                                        <statement name="STATEMENT">
                                          <block type="timeouts_wait" id="vm)?nG0?5#k:sloY%gL,">
                                            <field name="DELAY">5</field>
                                            <field name="UNIT">sec</field>
                                            <next>
                                              <block type="variables_set" id="Al$@}qOAKZ,LIXa~{nN?">
                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                <value name="VALUE">
                                                  <block type="math_number" id="A{1Q~3J[L^-T`HSO)q[(">
                                                    <field name="NUM">0</field>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="variables_set" id="{D?U7(?.qg1[]yAP=q[:">
                                                    <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                    <value name="VALUE">
                                                      <block type="math_number" id="C%9evA_V}*d}%J7%%XFT">
                                                        <field name="NUM">0</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="variables_set" id="x;P=;(;15/Y6?muBc;O2">
                                                        <field name="VAR" id="?}?K(VcpoL%Ym#A!twK4">result</field>
                                                        <value name="VALUE">
                                                          <block type="convert_object2json" id="m2AZ#H~a//`@h%Z,?MIP">
                                                            <field name="PRETTIFY">TRUE</field>
                                                            <value name="VALUE">
                                                              <block type="get_value" id="c0i8z=dH#h^4!AyN|@F6">
                                                                <field name="ATTR">val</field>
                                                                <field name="OID">0_userdata.0.Tibber.Bester_Preis.Tibber_Bester_Preis</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="procedures_callnoreturn" id="B~-[:|-,:xDeD;nO=JHs">
                                                            <mutation name="berechnung"></mutation>
                                                            <next>
                                                              <block type="update" id="_G;(k8|7k0md#C%Z.9`^">
                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                <field name="OID">0_userdata.0.Tibber.Bester_Preis.0.Uhrzeit</field>
                                                                <field name="WITH_DELAY">FALSE</field>
                                                                <value name="VALUE">
                                                                  <block type="convert_tonumber" id="FTU}.-5n*rcZHb07}rI~">
                                                                    <value name="VALUE">
                                                                      <block type="variables_get" id="rw1HaX00l)D`PFWCDkaM">
                                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <next>
                                                                  <block type="update" id=":7vggz4G)}3Pzvr]^jGP">
                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                    <field name="OID">0_userdata.0.Tibber.Bester_Preis.0.Preis</field>
                                                                    <field name="WITH_DELAY">FALSE</field>
                                                                    <value name="VALUE">
                                                                      <block type="convert_tonumber" id="5/(};HGK8ux4D{Xu=h./">
                                                                        <value name="VALUE">
                                                                          <block type="variables_get" id="_cgR9I,cyL_otBDM0Da#">
                                                                            <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                    <next>
                                                                      <block type="math_change" id="^x7KRl;_C6G1c*m6bbc-">
                                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                        <value name="DELTA">
                                                                          <shadow type="math_number" id="SgtllF9[vj4b#?z$|l}{">
                                                                            <field name="NUM">1</field>
                                                                          </shadow>
                                                                          <block type="math_number" id="[Q^HA}XdjF^W^FUmYuCZ">
                                                                            <field name="NUM">1</field>
                                                                          </block>
                                                                        </value>
                                                                        <next>
                                                                          <block type="math_change" id="3@jhWn;d66~(Cm=f6O;z">
                                                                            <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                            <value name="DELTA">
                                                                              <shadow type="math_number">
                                                                                <field name="NUM">1</field>
                                                                              </shadow>
                                                                              <block type="math_number" id="D,i5:/:~#6-:uGMr)JY:">
                                                                                <field name="NUM">1</field>
                                                                              </block>
                                                                            </value>
                                                                            <next>
                                                                              <block type="procedures_callnoreturn" id="@.Un+MpeN4n@OV7?%^;W">
                                                                                <mutation name="berechnung"></mutation>
                                                                                <next>
                                                                                  <block type="update" id="=Rw^.5Z6Ug|MKL*%~KBZ">
                                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                    <field name="OID">0_userdata.0.Tibber.Bester_Preis.1.Uhrzeit</field>
                                                                                    <field name="WITH_DELAY">FALSE</field>
                                                                                    <value name="VALUE">
                                                                                      <block type="convert_tonumber" id="2|h%C[.lz@gwZE`{6^qg">
                                                                                        <value name="VALUE">
                                                                                          <block type="variables_get" id="_?g_G;]d^67GHpw3ub@[">
                                                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                          </block>
                                                                                        </value>
                                                                                      </block>
                                                                                    </value>
                                                                                    <next>
                                                                                      <block type="update" id="uNiid^?;#vOI003B_/fq">
                                                                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                        <field name="OID">0_userdata.0.Tibber.Bester_Preis.1.Preis</field>
                                                                                        <field name="WITH_DELAY">FALSE</field>
                                                                                        <value name="VALUE">
                                                                                          <block type="convert_tonumber" id="H;:o2y0()ww+8=RCp+T_">
                                                                                            <value name="VALUE">
                                                                                              <block type="variables_get" id="4C*qw@#t=^I/i5:v}=Ar">
                                                                                                <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                              </block>
                                                                                            </value>
                                                                                          </block>
                                                                                        </value>
                                                                                        <next>
                                                                                          <block type="math_change" id="v{VuNDgvyXrVNcl9NMe#">
                                                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                            <value name="DELTA">
                                                                                              <shadow type="math_number">
                                                                                                <field name="NUM">1</field>
                                                                                              </shadow>
                                                                                              <block type="math_number" id="()jaFG_|9Rt^I6qa((4]">
                                                                                                <field name="NUM">2</field>
                                                                                              </block>
                                                                                            </value>
                                                                                            <next>
                                                                                              <block type="math_change" id="-W.RhLJC5jyapNtq5*Hc">
                                                                                                <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                <value name="DELTA">
                                                                                                  <shadow type="math_number">
                                                                                                    <field name="NUM">1</field>
                                                                                                  </shadow>
                                                                                                  <block type="math_number" id="66xM{oArQ*BwU4RC=Th7">
                                                                                                    <field name="NUM">2</field>
                                                                                                  </block>
                                                                                                </value>
                                                                                                <next>
                                                                                                  <block type="procedures_callnoreturn" id=":p79FAs~qmAKRwtKHVll">
                                                                                                    <mutation name="berechnung"></mutation>
                                                                                                    <next>
                                                                                                      <block type="update" id="MowHnZIs,W1PsC/0CM+D">
                                                                                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                        <field name="OID">0_userdata.0.Tibber.Bester_Preis.2.Uhrzeit</field>
                                                                                                        <field name="WITH_DELAY">FALSE</field>
                                                                                                        <value name="VALUE">
                                                                                                          <block type="convert_tonumber" id="0lma^Z9G9T*/3M3~US4e">
                                                                                                            <value name="VALUE">
                                                                                                              <block type="variables_get" id="~2~q9mDKmM=U_AvXRTX%">
                                                                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                              </block>
                                                                                                            </value>
                                                                                                          </block>
                                                                                                        </value>
                                                                                                        <next>
                                                                                                          <block type="update" id="a;)_(OQKce#@9}Op6q==">
                                                                                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                            <field name="OID">0_userdata.0.Tibber.Bester_Preis.2.Preis</field>
                                                                                                            <field name="WITH_DELAY">FALSE</field>
                                                                                                            <value name="VALUE">
                                                                                                              <block type="convert_tonumber" id="zta~P(yNy}T=);PZlS2]">
                                                                                                                <value name="VALUE">
                                                                                                                  <block type="variables_get" id="i~fBbugvj9+%j{sk3cQe">
                                                                                                                    <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                  </block>
                                                                                                                </value>
                                                                                                              </block>
                                                                                                            </value>
                                                                                                            <next>
                                                                                                              <block type="math_change" id="K2w%_-~e,xI`R5][R/c1">
                                                                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                <value name="DELTA">
                                                                                                                  <shadow type="math_number">
                                                                                                                    <field name="NUM">1</field>
                                                                                                                  </shadow>
                                                                                                                  <block type="math_number" id="}`5[f!_8X$nYMKH8l]g=">
                                                                                                                    <field name="NUM">3</field>
                                                                                                                  </block>
                                                                                                                </value>
                                                                                                                <next>
                                                                                                                  <block type="math_change" id="_Ii{BnJL?eDd6XcROFd|">
                                                                                                                    <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                    <value name="DELTA">
                                                                                                                      <shadow type="math_number">
                                                                                                                        <field name="NUM">1</field>
                                                                                                                      </shadow>
                                                                                                                      <block type="math_number" id="5p^_1^yslVy@n*Ic-[js">
                                                                                                                        <field name="NUM">3</field>
                                                                                                                      </block>
                                                                                                                    </value>
                                                                                                                    <next>
                                                                                                                      <block type="procedures_callnoreturn" id="+gDbX1[.6D:YP!MwJ;W)">
                                                                                                                        <mutation name="berechnung"></mutation>
                                                                                                                        <next>
                                                                                                                          <block type="update" id="b`y[di#={z/5v{I*U+oM">
                                                                                                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                            <field name="OID">0_userdata.0.Tibber.Bester_Preis.3.Uhrzeit</field>
                                                                                                                            <field name="WITH_DELAY">FALSE</field>
                                                                                                                            <value name="VALUE">
                                                                                                                              <block type="convert_tonumber" id="0d#m~([keYztR*z5B~5N">
                                                                                                                                <value name="VALUE">
                                                                                                                                  <block type="variables_get" id="eG|MJh08|mlM@8%NwdG,">
                                                                                                                                    <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                              </block>
                                                                                                                            </value>
                                                                                                                            <next>
                                                                                                                              <block type="update" id="z{*VgN*Y4JH3{7#}?,Uu">
                                                                                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                <field name="OID">0_userdata.0.Tibber.Bester_Preis.3.Preis</field>
                                                                                                                                <field name="WITH_DELAY">FALSE</field>
                                                                                                                                <value name="VALUE">
                                                                                                                                  <block type="convert_tonumber" id="ASSa.2$}A|cs^j.at2kk">
                                                                                                                                    <value name="VALUE">
                                                                                                                                      <block type="variables_get" id="zTs%PeRbGjhE(h,(,~n$">
                                                                                                                                        <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                                <next>
                                                                                                                                  <block type="math_change" id="87-Y.1bQ7HK`UQRbW=7U">
                                                                                                                                    <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                                    <value name="DELTA">
                                                                                                                                      <shadow type="math_number">
                                                                                                                                        <field name="NUM">1</field>
                                                                                                                                      </shadow>
                                                                                                                                      <block type="math_number" id="VS5Gr3sA|RKE3tsFY6xs">
                                                                                                                                        <field name="NUM">4</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                    <next>
                                                                                                                                      <block type="math_change" id="*ay]M=;~hHQrvS1N~G-e">
                                                                                                                                        <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                                        <value name="DELTA">
                                                                                                                                          <shadow type="math_number">
                                                                                                                                            <field name="NUM">1</field>
                                                                                                                                          </shadow>
                                                                                                                                          <block type="math_number" id="i=z*v5e#pEPR7^.lN=:p">
                                                                                                                                            <field name="NUM">4</field>
                                                                                                                                          </block>
                                                                                                                                        </value>
                                                                                                                                        <next>
                                                                                                                                          <block type="procedures_callnoreturn" id=",9=hosChNr)aH{x]z7mA">
                                                                                                                                            <mutation name="berechnung"></mutation>
                                                                                                                                            <next>
                                                                                                                                              <block type="update" id="%a-^sAj.+*gyu_fcRCbs">
                                                                                                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                <field name="OID">0_userdata.0.Tibber.Bester_Preis.4.Uhrzeit</field>
                                                                                                                                                <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                <value name="VALUE">
                                                                                                                                                  <block type="convert_tonumber" id="g4{}dEgb^o{6*x.OWt:Y">
                                                                                                                                                    <value name="VALUE">
                                                                                                                                                      <block type="variables_get" id="VGvxmGwh!%%j$t?3-H!y">
                                                                                                                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                  </block>
                                                                                                                                                </value>
                                                                                                                                                <next>
                                                                                                                                                  <block type="update" id="q!V{W(E16Ixx!o[8ur}%">
                                                                                                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                    <field name="OID">0_userdata.0.Tibber.Bester_Preis.4.Preis</field>
                                                                                                                                                    <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                    <value name="VALUE">
                                                                                                                                                      <block type="convert_tonumber" id="NULd5lQk%@`|6?w.g=54">
                                                                                                                                                        <value name="VALUE">
                                                                                                                                                          <block type="variables_get" id="Ib}rrRN@e3:@JR_M):CL">
                                                                                                                                                            <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                                                          </block>
                                                                                                                                                        </value>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                    <next>
                                                                                                                                                      <block type="math_change" id="1;zowsQe|)7}~l/jr_i-">
                                                                                                                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                                                        <value name="DELTA">
                                                                                                                                                          <shadow type="math_number">
                                                                                                                                                            <field name="NUM">1</field>
                                                                                                                                                          </shadow>
                                                                                                                                                          <block type="math_number" id="3,FvV4k1`n#.Uts#f|O(">
                                                                                                                                                            <field name="NUM">5</field>
                                                                                                                                                          </block>
                                                                                                                                                        </value>
                                                                                                                                                        <next>
                                                                                                                                                          <block type="math_change" id="0BXWG)QWD(B4zgW[QLcC">
                                                                                                                                                            <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                                                            <value name="DELTA">
                                                                                                                                                              <shadow type="math_number">
                                                                                                                                                                <field name="NUM">1</field>
                                                                                                                                                              </shadow>
                                                                                                                                                              <block type="math_number" id="93XjsCho?vwkA@?|E0`g">
                                                                                                                                                                <field name="NUM">5</field>
                                                                                                                                                              </block>
                                                                                                                                                            </value>
                                                                                                                                                            <next>
                                                                                                                                                              <block type="procedures_callnoreturn" id="@FLbyN/V+,,W85lY7d,l">
                                                                                                                                                                <mutation name="berechnung"></mutation>
                                                                                                                                                                <next>
                                                                                                                                                                  <block type="update" id="?Bc6DzRit#}v#`5-E-|7">
                                                                                                                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                                    <field name="OID">0_userdata.0.Tibber.Bester_Preis.5.Uhrzeit</field>
                                                                                                                                                                    <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                                    <value name="VALUE">
                                                                                                                                                                      <block type="convert_tonumber" id="5zuD~;ROsOY7K}%1M}Fh">
                                                                                                                                                                        <value name="VALUE">
                                                                                                                                                                          <block type="variables_get" id="MhRJ*Ur.D[,=r#sl)Mem">
                                                                                                                                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                                                                          </block>
                                                                                                                                                                        </value>
                                                                                                                                                                      </block>
                                                                                                                                                                    </value>
                                                                                                                                                                    <next>
                                                                                                                                                                      <block type="update" id="vI08AGBoAyKaBQ9Pz%vT">
                                                                                                                                                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                                        <field name="OID">0_userdata.0.Tibber.Bester_Preis.5.Preis</field>
                                                                                                                                                                        <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                                        <value name="VALUE">
                                                                                                                                                                          <block type="convert_tonumber" id="1KincJZ@C0ZYU8Hr^$iW">
                                                                                                                                                                            <value name="VALUE">
                                                                                                                                                                              <block type="variables_get" id="F}!13RJfHB*OtMVr`WvJ">
                                                                                                                                                                                <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                                                                              </block>
                                                                                                                                                                            </value>
                                                                                                                                                                          </block>
                                                                                                                                                                        </value>
                                                                                                                                                                      </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>
                                                                                                                </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>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </statement>
                                      </block>
                                      <block type="procedures_defnoreturn" id="4,ZP*xHgsT%~Vk9o,/Z7" x="388" y="-237">
                                        <field name="NAME">berechnung</field>
                                        <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                                        <statement name="STACK">
                                          <block type="variables_set" id="hlL]N13nxkDPQ.Krt(,B">
                                            <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                            <value name="VALUE">
                                              <block type="get_attr" id="%e~~oxn;qZ:TyC/{|Sx?">
                                                <value name="PATH">
                                                  <shadow type="text">
                                                    <field name="TEXT">0.start</field>
                                                  </shadow>
                                                  <block type="text_join" id="r7T5MDbWvXS2iEN:k2f?">
                                                    <mutation items="2"></mutation>
                                                    <value name="ADD0">
                                                      <block type="variables_get" id="A47KrkMC%=?zK`c-jcXx">
                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                      </block>
                                                    </value>
                                                    <value name="ADD1">
                                                      <block type="text" id="0){dC1^m!`?CR-3=D2QV">
                                                        <field name="TEXT">.preis</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <value name="OBJECT">
                                                  <block type="variables_get" id="36Pl!b#af-jjQ~?*FXGR">
                                                    <field name="VAR" id="?}?K(VcpoL%Ym#A!twK4">result</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="variables_set" id="GOsC=G]i2U|$PE?`VQ{X">
                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                <value name="VALUE">
                                                  <block type="get_attr" id="k7ce6(TiR}pa6jP_zg|J">
                                                    <value name="PATH">
                                                      <shadow type="text">
                                                        <field name="TEXT">0.start</field>
                                                      </shadow>
                                                      <block type="text_join" id=";2}`@T;`;]U`3VdZg/`)">
                                                        <mutation items="2"></mutation>
                                                        <value name="ADD0">
                                                          <block type="variables_get" id="Jf7VYMn+/Oh#AW5n2Z3h">
                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                          </block>
                                                        </value>
                                                        <value name="ADD1">
                                                          <block type="text" id="UZ,LFab6RXpnSL8sS0/9">
                                                            <field name="TEXT">.start</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <value name="OBJECT">
                                                      <block type="variables_get" id="N.x,j[|gKn6|$Xy4vx]F">
                                                        <field name="VAR" id="?}?K(VcpoL%Ym#A!twK4">result</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="controls_if" id="1l-ZNlHL1kp36KS*OWZG">
                                                    <mutation else="1"></mutation>
                                                    <value name="IF0">
                                                      <block type="logic_compare" id="J|n@lq4HGP,)apj(Udq2">
                                                        <field name="OP">LT</field>
                                                        <value name="A">
                                                          <block type="variables_get" id="vAzn1wdU6Uwz)47K7L^d">
                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                          </block>
                                                        </value>
                                                        <value name="B">
                                                          <block type="math_number" id=":QLlxQ4le4BD`Y6Az(bo">
                                                            <field name="NUM">10</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <statement name="DO0">
                                                      <block type="variables_set" id="Ro2~YB.img(1Dg9h^*UH">
                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                        <value name="VALUE">
                                                          <block type="text_join" id="nF#N|NQ,4lXk]edsZW}E">
                                                            <mutation items="2"></mutation>
                                                            <value name="ADD0">
                                                              <block type="text" id="dS2,;jes`.51UGGKaHYs">
                                                                <field name="TEXT">0</field>
                                                              </block>
                                                            </value>
                                                            <value name="ADD1">
                                                              <block type="variables_get" id="75^,N|GdzhUhRq^_MI/@">
                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="1#wigNK`{4{qD,JESQ#;">
                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                            <value name="VALUE">
                                                              <block type="convert_from_date" id="V~o|SjsbjR2Bdw/ZqqUU">
                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                                <field name="OPTION">hh:mm</field>
                                                                <value name="VALUE">
                                                                  <block type="variables_get" id="|%2{}vR)p4Is-6xqOm58">
                                                                    <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </statement>
                                                    <statement name="ELSE">
                                                      <block type="variables_set" id="(_+|}rSH=0`=NpJn57?d">
                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                        <value name="VALUE">
                                                          <block type="text_join" id="X0XB2/z`@:aJ6W4rmx!7">
                                                            <mutation items="1"></mutation>
                                                            <value name="ADD0">
                                                              <block type="variables_get" id="orj?.k84:R,qaX-EN6g1">
                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="#GZr/RwMBMo/Go]iE*!6">
                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                            <value name="VALUE">
                                                              <block type="convert_from_date" id=".%3W]QEHFOj72r/%~U3H">
                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                                <field name="OPTION">hh:mm</field>
                                                                <value name="VALUE">
                                                                  <block type="variables_get" id="+UW98s,bvTOj@0CF(TES">
                                                                    <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </statement>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </statement>
                                      </block>
                                    </xml>
                                    
                                    paul53P 1 Reply Last reply
                                    0
                                    • paul53P paul53

                                      @babl
                                      Das folgende Skript ermittelt die Startzeiten (Stunde der Uhrzeit) für bis zu einer Stunde Ladedauer und für mehr als einer Stunde Ladedauer (aufeinander folgend) unter Berücksichtigung eines maximalen Preises.

                                      const tibber = 'tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.'; 
                                      const idStart1 = '0_userdata.0.Tibber.Bester_Preis.Start1h';
                                      const idStart2 = '0_userdata.0.Tibber.Bester_Preis.Start2h';
                                      const maxPreis = 0.3;
                                      
                                      schedule('57 18 * * *', function() {
                                          const preise = [];
                                          for(let i = 19; i < 24; i++) {
                                              let obj = {};
                                              let idStart = tibber + 'PricesToday.' + i + '.startsAt';
                                              let idPreis = tibber + 'PricesToday.' + i + '.total';
                                              obj.start = new Date(getState(idStart).val).getHours();
                                              obj.preis = getState(idPreis).val;
                                              preise.push(obj);
                                          }
                                          for(let i = 0; i < 6; i++) {
                                              let obj = {};
                                              let idStart = tibber + 'PricesTomorrow.' + i + '.startsAt';
                                              let idPreis = tibber + 'PricesTomorrow.' + i + '.total';
                                              obj.start = new Date(getState(idStart).val).getHours();
                                              obj.preis = getState(idPreis).val;
                                              preise.push(obj);
                                          }
                                          let start1h = 12;
                                          let min = maxPreis;
                                          for(let i = 0; i < preise.length; i++) {
                                              if(preise[i].preis < min) {
                                                  min = preise[i].preis;
                                                  start1h = preise[i].start;
                                              }
                                          }
                                          let start2h = 12;
                                          let summe2 = 1.5 * maxPreis;
                                          for(let i = 0; i < preise.length - 1; i++) {
                                              let summe = preise[i].preis + 0.5 * preise[i + 1].preis;
                                              if(summe < summe2) {
                                                  summe2 = summe;
                                                  start2h = preise[i].start;
                                              }
                                          }
                                          setState(idStart1, start1h, true); // Startstunde für bis 1 h laden
                                          setState(idStart2, start2h, true); // Startstunde für bis 2 h laden
                                      });
                                      

                                      Das angepasste Blockly steuert abhängig von der Startstunde die Ladung.

                                      <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>
                                      

                                      Das alles konnte ich allerdings nicht testen. Es können also noch Fehler enthalten sein.

                                      B Offline
                                      B Offline
                                      babl
                                      wrote on last edited by
                                      #28
                                      1. Script ist das Script um die Batterie an den Zeiten zu laden die vorher in den beiden Scripten ausgearbeitet wurden.
                                      <xml xmlns="https://developers.google.com/blockly/xml">
                                        <variables>
                                          <variable id="ML@$Lt_]|-r%{#NpcuTc">Angestrebte Ladung des Hausspeichers in %</variable>
                                          <variable id="EG.rbA-N:U.-0WD.q.!q">Ladeleistung Hausspeicher in Watt</variable>
                                          <variable id="goWOWAU+Ug5AX7zoPejz">Max Füllstand Hausspeicher in Wh</variable>
                                          <variable id="4J?aX*2N(RCecW;gi3B;">user_soc</variable>
                                          <variable id="OpCZqd.EFNouMwR1*Z?X">start ladung</variable>
                                          <variable id="g}MF8_uaSRlr;N!k%#HA">ladung</variable>
                                          <variable id="d}:9/gTxuS605HBk*Vh#">Aktueller Füllstand Hausspeicher</variable>
                                          <variable id="x]#UqG,4n[x3lR-{wi=%">berechnung</variable>
                                          <variable id="YLKsIDz]9MH,.z4Hlri/">mehr als 1 stunde</variable>
                                          <variable type="cron" id="schedule1">schedule1</variable>
                                          <variable type="cron" id="schedule2">schedule2</variable>
                                          <variable type="cron" id="schedule3">schedule3</variable>
                                        </variables>
                                        <block type="variables_set" id="LV/YM`ccmRcE}iIYofSo" x="88" y="413">
                                          <field name="VAR" id="ML@$Lt_]|-r%{#NpcuTc">Angestrebte Ladung des Hausspeichers in %</field>
                                          <value name="VALUE">
                                            <block type="math_number" id="Ob{p6sJ+B^]pk$uAhpbr">
                                              <field name="NUM">100</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="variables_set" id="8HO5Q;6hbG~$,Hd{wWj?">
                                              <field name="VAR" id="EG.rbA-N:U.-0WD.q.!q">Ladeleistung Hausspeicher in Watt</field>
                                              <value name="VALUE">
                                                <block type="math_number" id="Pl)!Bv-Rf{F{0;A?j[4x">
                                                  <field name="NUM">3000</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="cpeqv]RuwK^PLMbr#_}Y">
                                                  <field name="VAR" id="goWOWAU+Ug5AX7zoPejz">Max Füllstand Hausspeicher in Wh</field>
                                                  <value name="VALUE">
                                                    <block type="math_number" id="5lteLew:-BAmA:T47H0_">
                                                      <field name="NUM">5000</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id="X./aSKc)=0pVT8EZZpCf">
                                                      <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                      <value name="VALUE">
                                                        <block type="get_value" id="=5sbMX8r_3[G-?=W6TB_">
                                                          <field name="ATTR">val</field>
                                                          <field name="OID">0_userdata.0.Tibber.Bester_Preis.0.Uhrzeit</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="schedule" id="PpHw,4;Y%c+B0c_2!yvm">
                                                          <field name="SCHEDULE">{"time":{"start":"sunset","end":"sunrise","mode":"hours","interval":1},"period":{"days":1}}</field>
                                                          <statement name="STATEMENT">
                                                            <block type="variables_set" id="+[Er4N3+fY[UF,]*nA_}">
                                                              <field name="VAR" id="d}:9/gTxuS605HBk*Vh#">Aktueller Füllstand Hausspeicher</field>
                                                              <value name="VALUE">
                                                                <block type="math_arithmetic" id="$W5(oC9tYC)d1d!ykQjZ">
                                                                  <field name="OP">DIVIDE</field>
                                                                  <value name="A">
                                                                    <shadow type="math_number" id="`q%]g0+3,ql3|b6{?.#V">
                                                                      <field name="NUM">1</field>
                                                                    </shadow>
                                                                    <block type="math_arithmetic" id="SM3|Od8O8XifG};eY-M+">
                                                                      <field name="OP">MULTIPLY</field>
                                                                      <value name="A">
                                                                        <shadow type="math_number" id="S/`Dm(AO/oP=)BFqdH~T">
                                                                          <field name="NUM">1</field>
                                                                        </shadow>
                                                                        <block type="variables_get" id="HISAN$fC4;k.Wv2E=G#8">
                                                                          <field name="VAR" id="goWOWAU+Ug5AX7zoPejz">Max Füllstand Hausspeicher in Wh</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="B">
                                                                        <shadow type="math_number" id="xe.-h_}[@bU;zB4CdTq]">
                                                                          <field name="NUM">1</field>
                                                                        </shadow>
                                                                        <block type="get_value" id="@N}??]8R#0xR/zo:5E]k">
                                                                          <field name="ATTR">val</field>
                                                                          <field name="OID">sonnen.0.status.userSoc</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <value name="B">
                                                                    <shadow type="math_number" id="nQ()6Jl.@|Iq}Q8~k7#)">
                                                                      <field name="NUM">1</field>
                                                                    </shadow>
                                                                    <block type="math_number" id="^*9c-Frw{7[A8C0DJr}1">
                                                                      <field name="NUM">100</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="variables_set" id="aai9l-l7vb)f::o9,[hA">
                                                                  <field name="VAR" id="x]#UqG,4n[x3lR-{wi=%">berechnung</field>
                                                                  <value name="VALUE">
                                                                    <block type="math_arithmetic" id=")Qb]Wr35*4![FU06.CDz">
                                                                      <field name="OP">MINUS</field>
                                                                      <value name="A">
                                                                        <shadow type="math_number" id="|}uEFH|!V1u3o%|`Z|P@">
                                                                          <field name="NUM">1</field>
                                                                        </shadow>
                                                                        <block type="variables_get" id="_:biLL}VcUr-eEl$$HR?">
                                                                          <field name="VAR" id="goWOWAU+Ug5AX7zoPejz">Max Füllstand Hausspeicher in Wh</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="B">
                                                                        <shadow type="math_number" id="P89`WEYM7yh]CKxW/`h:">
                                                                          <field name="NUM">1</field>
                                                                        </shadow>
                                                                        <block type="variables_get" id="b?R[@BuSC^8}|ynV7Z(w">
                                                                          <field name="VAR" id="d}:9/gTxuS605HBk*Vh#">Aktueller Füllstand Hausspeicher</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="controls_if" id="*aITaBVqga~c?`Y16L]y">
                                                                      <mutation else="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="^+y:hf;({LqRAy82+y:K">
                                                                              <field name="VAR" id="x]#UqG,4n[x3lR-{wi=%">berechnung</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="B">
                                                                            <block type="variables_get" id="7;izE9{|{{M#CPUoU2nG">
                                                                              <field name="VAR" id="EG.rbA-N:U.-0WD.q.!q">Ladeleistung Hausspeicher in Watt</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <statement name="DO0">
                                                                        <block type="debug" id="[7Q@F$)p#$IWLL9HJl!l">
                                                                          <field name="Severity">log</field>
                                                                          <value name="TEXT">
                                                                            <shadow type="text" id="@et]-#PUIz8NFG0/uDV.">
                                                                              <field name="TEXT">test</field>
                                                                            </shadow>
                                                                            <block type="text" id="rnD(s?y[I|jltc{t%v:)">
                                                                              <field name="TEXT">Hausspeicher braucht mehr Zeit als 1 Stunde zum laden</field>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="variables_set" id="n:L0K+eh$HsloK,hJ=M}">
                                                                              <field name="VAR" id="YLKsIDz]9MH,.z4Hlri/">mehr als 1 stunde</field>
                                                                              <value name="VALUE">
                                                                                <block type="math_number" id="O7c08GJ4;v]O:KEocFOq">
                                                                                  <field name="NUM">1</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </statement>
                                                                      <statement name="ELSE">
                                                                        <block type="variables_set" id="Nz-Y}HaS1|UPvlF923^,">
                                                                          <field name="VAR" id="YLKsIDz]9MH,.z4Hlri/">mehr als 1 stunde</field>
                                                                          <value name="VALUE">
                                                                            <block type="math_number" id=".[{{u#9HJ7]yXML`D7Zd">
                                                                              <field name="NUM">0</field>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="debug" id="|Xo|;2c$BPKS;]6=zd^/">
                                                                              <field name="Severity">log</field>
                                                                              <value name="TEXT">
                                                                                <shadow type="text" id="AM:gcMXCq6m^Ece,|srv">
                                                                                  <field name="TEXT">test</field>
                                                                                </shadow>
                                                                                <block type="text" id="0GJt~9uV4UwpcIl]S]RN">
                                                                                  <field name="TEXT">Hausspeicher braucht weniger Zeit als 1 Stunde zum laden</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </statement>
                                                                      <next>
                                                                        <block type="controls_if" id="~pa#*tFO;43xct8E*9*v">
                                                                          <mutation elseif="1"></mutation>
                                                                          <value name="IF0">
                                                                            <block type="logic_compare" id="{u6UgYjuG}BdOOvo=_+x">
                                                                              <field name="OP">EQ</field>
                                                                              <value name="A">
                                                                                <block type="variables_get" id="BmTjF:*;]w@wgfpPUqGJ">
                                                                                  <field name="VAR" id="YLKsIDz]9MH,.z4Hlri/">mehr als 1 stunde</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="B">
                                                                                <block type="math_number" id="b!(noN/?90nVl9a$LB1;">
                                                                                  <field name="NUM">1</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <statement name="DO0">
                                                                            <block type="controls_if" id="},E,0+.1Q]o0O8^c/;RK">
                                                                              <mutation else="1"></mutation>
                                                                              <value name="IF0">
                                                                                <block type="logic_compare" id="=oI1,42OV5xXnv}ctl?O">
                                                                                  <field name="OP">LT</field>
                                                                                  <value name="A">
                                                                                    <block type="get_value" id="KSN[vS9-7KED$lQLG^^P">
                                                                                      <field name="ATTR">val</field>
                                                                                      <field name="OID">0_userdata.0.Tibber.Bester_Preis.1.Uhrzeit</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="B">
                                                                                    <block type="get_value" id="c|zsGPH0{e!@7(a-(IpC">
                                                                                      <field name="ATTR">val</field>
                                                                                      <field name="OID">0_userdata.0.Tibber.Bester_Preis.0.Uhrzeit</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                              <statement name="DO0">
                                                                                <block type="variables_set" id="!oDadcObIuF/m!DKgoB+">
                                                                                  <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                  <value name="VALUE">
                                                                                    <block type="math_arithmetic" id="|DfsO2R%l-ztqy(ASEnQ">
                                                                                      <field name="OP">MINUS</field>
                                                                                      <value name="A">
                                                                                        <shadow type="math_number" id=";h2oyrBp+Oaoz-j[5ZH#">
                                                                                          <field name="NUM">1</field>
                                                                                        </shadow>
                                                                                        <block type="variables_get" id="rJDB8`!n=C]l$I]N-?9(">
                                                                                          <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="B">
                                                                                        <shadow type="math_number" id="CqPRA+C_4|(F#+xZv0%%">
                                                                                          <field name="NUM">1</field>
                                                                                        </shadow>
                                                                                        <block type="math_number" id="sA==0mTxWu!X7{eTz%bY">
                                                                                          <field name="NUM">1</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </value>
                                                                                  <next>
                                                                                    <block type="schedule_create" id="Kb~{O?7%@kmbg29O![3k">
                                                                                      <field name="NAME">schedule2</field>
                                                                                      <value name="SCHEDULE">
                                                                                        <shadow type="field_cron">
                                                                                          <field name="CRON">* * * * *</field>
                                                                                        </shadow>
                                                                                        <block type="cron_builder" id="1_Cs!0I|N0;l;(waVeeC" inline="true">
                                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" seconds="false" as_line="false"></mutation>
                                                                                          <field name="LINE">TRUE</field>
                                                                                          <field name="WITH_SECONDS">FALSE</field>
                                                                                          <value name="DOW">
                                                                                            <shadow type="text" id="!G?2GB#@?OtrhK]M|m;$">
                                                                                              <field name="TEXT">*</field>
                                                                                            </shadow>
                                                                                          </value>
                                                                                          <value name="MONTHS">
                                                                                            <shadow type="text" id="?F@+P_;??(#!a(D}miw0">
                                                                                              <field name="TEXT">*</field>
                                                                                            </shadow>
                                                                                          </value>
                                                                                          <value name="DAYS">
                                                                                            <shadow type="text" id="b!Uu0:A$WEbrwb{;f*TW">
                                                                                              <field name="TEXT">*</field>
                                                                                            </shadow>
                                                                                          </value>
                                                                                          <value name="HOURS">
                                                                                            <shadow type="text">
                                                                                              <field name="TEXT">*</field>
                                                                                            </shadow>
                                                                                            <block type="variables_get" id="R;1?aKX^DR%xuWY}Om{0">
                                                                                              <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                            </block>
                                                                                          </value>
                                                                                          <value name="MINUTES">
                                                                                            <shadow type="text" id="R/lDIh]=qAH0ESK13ygY">
                                                                                              <field name="TEXT">*</field>
                                                                                            </shadow>
                                                                                          </value>
                                                                                        </block>
                                                                                      </value>
                                                                                      <statement name="STATEMENT">
                                                                                        <block type="update" id="Jiy46ovPO.HG]0uJ=)*5">
                                                                                          <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="Ujbo)O0+l-~r0{25zaNM">
                                                                                              <field name="BOOL">TRUE</field>
                                                                                            </block>
                                                                                          </value>
                                                                                        </block>
                                                                                      </statement>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </statement>
                                                                              <statement name="ELSE">
                                                                                <block type="variables_set" id="Hg]_nxZ!8ws/WcM1^gza">
                                                                                  <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                  <value name="VALUE">
                                                                                    <block type="variables_get" id="}8tlC_$h;XoxalZM?82#">
                                                                                      <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <next>
                                                                                    <block type="schedule_create" id="6LKI7T3!qFm,RTC*{1[D">
                                                                                      <field name="NAME">schedule3</field>
                                                                                      <value name="SCHEDULE">
                                                                                        <shadow type="field_cron">
                                                                                          <field name="CRON">* * * * *</field>
                                                                                        </shadow>
                                                                                        <block type="cron_builder" id="*V.rE+aUeX-^mjb9~gSU" inline="true">
                                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" seconds="false" as_line="false"></mutation>
                                                                                          <field name="LINE">FALSE</field>
                                                                                          <field name="WITH_SECONDS">FALSE</field>
                                                                                          <value name="DOW">
                                                                                            <shadow type="text" id="bVsEN7f16vgRwp7{Le%U">
                                                                                              <field name="TEXT">*</field>
                                                                                            </shadow>
                                                                                          </value>
                                                                                          <value name="MONTHS">
                                                                                            <shadow type="text" id="+AE;v0T)S^2`+$Rv$?P#">
                                                                                              <field name="TEXT">*</field>
                                                                                            </shadow>
                                                                                          </value>
                                                                                          <value name="DAYS">
                                                                                            <shadow type="text" id="ZQ!l*(E#|J2i,Z^!67wG">
                                                                                              <field name="TEXT">*</field>
                                                                                            </shadow>
                                                                                          </value>
                                                                                          <value name="HOURS">
                                                                                            <shadow type="text">
                                                                                              <field name="TEXT">*</field>
                                                                                            </shadow>
                                                                                            <block type="variables_get" id="yP;{JyQoEhN+%k1mE/j*">
                                                                                              <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                            </block>
                                                                                          </value>
                                                                                          <value name="MINUTES">
                                                                                            <shadow type="text" id="7f;y])6]3,5!n)C:aU$i">
                                                                                              <field name="TEXT">*</field>
                                                                                            </shadow>
                                                                                          </value>
                                                                                        </block>
                                                                                      </value>
                                                                                      <statement name="STATEMENT">
                                                                                        <block type="update" id="BX/Z_7g8Gl;x:|y(r;w(">
                                                                                          <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="fbSR%WF{pHU9#zf|HhZL">
                                                                                              <field name="BOOL">TRUE</field>
                                                                                            </block>
                                                                                          </value>
                                                                                        </block>
                                                                                      </statement>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </statement>
                                                                            </block>
                                                                          </statement>
                                                                          <value name="IF1">
                                                                            <block type="logic_compare" id="Su1?m]QD3]1SfLJVdyB?">
                                                                              <field name="OP">EQ</field>
                                                                              <value name="A">
                                                                                <block type="variables_get" id="${+eKYzVR?MP(mtP:}*k">
                                                                                  <field name="VAR" id="YLKsIDz]9MH,.z4Hlri/">mehr als 1 stunde</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="B">
                                                                                <block type="math_number" id="Iuu%~s`qi}I%tG5ax1ez">
                                                                                  <field name="NUM">0</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <statement name="DO1">
                                                                            <block type="schedule_create" id="72:7^3=1b^~aeu-z/8@|">
                                                                              <field name="NAME">schedule1</field>
                                                                              <value name="SCHEDULE">
                                                                                <shadow type="field_cron" id="e]-wfGNxa(WCODp.0)~N">
                                                                                  <field name="CRON">* * * * *</field>
                                                                                </shadow>
                                                                                <block type="cron_builder" id="E5OPeWM?Q2CisyT)yi.t" inline="true">
                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" seconds="false" as_line="false"></mutation>
                                                                                  <field name="LINE">FALSE</field>
                                                                                  <field name="WITH_SECONDS">FALSE</field>
                                                                                  <value name="DOW">
                                                                                    <shadow type="text" id=":,]7l,/9;x;U[/{U?7BR">
                                                                                      <field name="TEXT">*</field>
                                                                                    </shadow>
                                                                                  </value>
                                                                                  <value name="MONTHS">
                                                                                    <shadow type="text" id="Ch2bg`fbk$6MjiBAiB;`">
                                                                                      <field name="TEXT">*</field>
                                                                                    </shadow>
                                                                                  </value>
                                                                                  <value name="DAYS">
                                                                                    <shadow type="text" id="9hC5JVB==f*vj)alD^hF">
                                                                                      <field name="TEXT">*</field>
                                                                                    </shadow>
                                                                                  </value>
                                                                                  <value name="HOURS">
                                                                                    <shadow type="text" id="Fi+4#uvW~;];=W|F^-)}">
                                                                                      <field name="TEXT">*</field>
                                                                                    </shadow>
                                                                                    <block type="variables_get" id="%zuvphPJ*:|$ogkn3PM^">
                                                                                      <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="MINUTES">
                                                                                    <shadow type="text" id="?|:Z-!075n/pD4/t+6u]">
                                                                                      <field name="TEXT">*</field>
                                                                                    </shadow>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                              <statement name="STATEMENT">
                                                                                <block type="update" id="W#8k+fCnusVzQys3JIoR">
                                                                                  <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="|BSESbtBs=H9eqL#m??O">
                                                                                      <field name="BOOL">TRUE</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </statement>
                                                                            </block>
                                                                          </statement>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </statement>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                        <block type="on_ext" id="}ec}5MTos#m/+Jc%mAv," x="88" y="1665">
                                          <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="9T+8w9LUyD0C|]4R5vds">
                                              <field name="oid">sonnen.0.status.userSoc</field>
                                            </shadow>
                                          </value>
                                          <statement name="STATEMENT">
                                            <block type="controls_if" id="2i;.un?=k!HN(E#9_S}{">
                                              <value name="IF0">
                                                <block type="logic_compare" id="-|PDR$iLtW*acAH_g;%8">
                                                  <field name="OP">EQ</field>
                                                  <value name="A">
                                                    <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>
                                                  <value name="B">
                                                    <block type="logic_boolean" id="e+a51Z==w4Gi(JCD/TP(">
                                                      <field name="BOOL">TRUE</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <statement name="DO0">
                                                <block type="variables_set" id="9:hB{DuI0$WVq*3K-fh4">
                                                  <field name="VAR" id="4J?aX*2N(RCecW;gi3B;">user_soc</field>
                                                  <value name="VALUE">
                                                    <block type="on_source" id="e$4T}@8fHA)f[PLb0u7c">
                                                      <field name="ATTR">state.val</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="controls_if" id="~w!Ro5h?:#7tnE4=x9-Y">
                                                      <mutation elseif="1"></mutation>
                                                      <value name="IF0">
                                                        <block type="logic_compare" id="4B5Q!,$t_dk8cPg?slzF">
                                                          <field name="OP">LT</field>
                                                          <value name="A">
                                                            <block type="variables_get" id="yV,ZA2NpDWg4H]hGr?/$">
                                                              <field name="VAR" id="4J?aX*2N(RCecW;gi3B;">user_soc</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <block type="variables_get" id="t3vGPyaw8nXwWzeR][XX">
                                                              <field name="VAR" id="ML@$Lt_]|-r%{#NpcuTc">Angestrebte Ladung des Hausspeichers in %</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <statement name="DO0">
                                                        <block type="controls_if" id="^WjYBsozNBT-$d/yBGcp">
                                                          <mutation else="1"></mutation>
                                                          <value name="IF0">
                                                            <block type="logic_operation" id="*yY1cJY1p4x9@dR4toT-" inline="false">
                                                              <field name="OP">OR</field>
                                                              <value name="A">
                                                                <block type="logic_compare" id=")|N4!7dE$lGQf%IKqU,~">
                                                                  <field name="OP">LT</field>
                                                                  <value name="A">
                                                                    <block type="variables_get" id="aAPwk3f=aFk1X%rD}Or@">
                                                                      <field name="VAR" id="4J?aX*2N(RCecW;gi3B;">user_soc</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="B">
                                                                    <block type="math_number" id="PZ#ooa4jyT9#1*[as2XV">
                                                                      <field name="NUM">5</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="logic_compare" id="M:`Sz,:(g[v/e}!5M=C:">
                                                                  <field name="OP">GT</field>
                                                                  <value name="A">
                                                                    <block type="variables_get" id="Mu%rTuZNodaJCDc2-wOp">
                                                                      <field name="VAR" id="4J?aX*2N(RCecW;gi3B;">user_soc</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="B">
                                                                    <block type="math_number" id="EqY/*s2tp5KA%N}vqY)R">
                                                                      <field name="NUM">95</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <statement name="DO0">
                                                            <block type="variables_set" id="dFt3k]R?%yno!6e![[1~">
                                                              <field name="VAR" id="g}MF8_uaSRlr;N!k%#HA">ladung</field>
                                                              <value name="VALUE">
                                                                <block type="math_arithmetic" id="ZZ7u1pzwK.k~RIyE(5%B">
                                                                  <field name="OP">DIVIDE</field>
                                                                  <value name="A">
                                                                    <shadow type="math_number" id="o`FFL(Ww=gzl.gm@yEUe">
                                                                      <field name="NUM">1</field>
                                                                    </shadow>
                                                                    <block type="variables_get" id="GOH!9`0Ns689,KS/yG:e">
                                                                      <field name="VAR" id="EG.rbA-N:U.-0WD.q.!q">Ladeleistung Hausspeicher in Watt</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="B">
                                                                    <shadow type="math_number">
                                                                      <field name="NUM">1</field>
                                                                    </shadow>
                                                                    <block type="math_number" id="/?Hc2`zev:ICtMC2d}o/">
                                                                      <field name="NUM">2</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </statement>
                                                          <statement name="ELSE">
                                                            <block type="variables_set" id="Y1o%+C9-[|PE/*2,9wt8">
                                                              <field name="VAR" id="g}MF8_uaSRlr;N!k%#HA">ladung</field>
                                                              <value name="VALUE">
                                                                <block type="variables_get" id="yK%yYFy|-Ls_zbjpUWx3">
                                                                  <field name="VAR" id="EG.rbA-N:U.-0WD.q.!q">Ladeleistung Hausspeicher in Watt</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </statement>
                                                        </block>
                                                      </statement>
                                                      <value name="IF1">
                                                        <block type="logic_compare" id="YCo~T:mO^H~4SgA+}xNj">
                                                          <field name="OP">EQ</field>
                                                          <value name="A">
                                                            <block type="variables_get" id="{7}9wHB7]Wd9OKI~5{G|">
                                                              <field name="VAR" id="4J?aX*2N(RCecW;gi3B;">user_soc</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <block type="variables_get" id="iM_7JOkAno;+HG3rPOpG">
                                                              <field name="VAR" id="ML@$Lt_]|-r%{#NpcuTc">Angestrebte Ladung des Hausspeichers in %</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <statement name="DO1">
                                                        <block type="variables_set" id="b[n/uLuI[HVEuq__}k$y">
                                                          <field name="VAR" id="g}MF8_uaSRlr;N!k%#HA">ladung</field>
                                                          <value name="VALUE">
                                                            <block type="math_number" id="p1sNSm2Id}8}[Ov.Le`C">
                                                              <field name="NUM">0</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </statement>
                                                    </block>
                                                  </next>
                                                </block>
                                              </statement>
                                            </block>
                                          </statement>
                                          <next>
                                            <block type="schedule" id="+NROA+tjABrSw/,khlQV">
                                              <field name="SCHEDULE">*/10 * * * * *</field>
                                              <statement name="STATEMENT">
                                                <block type="control" id="a6m]ztAM=I`t[0uNBv8D">
                                                  <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="d*3eJ0B6U?ie;$;,Nud3">
                                                      <field name="VAR" id="g}MF8_uaSRlr;N!k%#HA">ladung</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </statement>
                                            </block>
                                          </next>
                                        </block>
                                      </xml>
                                      

                                      script3.jpg
                                      script3a.jpg

                                      paul53P 1 Reply Last reply
                                      0
                                      • B babl

                                        @paul53 ich danke dir für das Script, doch ich gebe nicht so schnell auf.

                                        Hier nun mein Vorschlag, ich würde dich bitten dies dir durchzusehen ob du damit einverstanden sein kannst oder was noch besser gemacht werden könnte, nur so lernt man es.

                                        1. Script dies erstellt die Liste nach Sortierung und schreibt sie in einen Datenpunkt als Array. (Script ist sowieso von dir)
                                        const tibber = 'tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.'; // Anpassen!
                                        
                                        const idSort = '0_userdata.0.Tibber.Bester_Preis.Tibber_Bester_Preis'; // DP-Typ: "array"
                                        
                                         
                                        
                                        function sortPreis(a, b) {
                                        
                                            return a.preis - b.preis;
                                        
                                        }
                                        
                                         
                                        
                                        schedule('57 18 * * *', function() {
                                        
                                            const preise = [];
                                        
                                            for(let i = 19; i < 24; i++) {
                                        
                                                let obj = {};
                                        
                                                let idStart = tibber + 'PricesToday.' + i + '.startsAt';
                                        
                                                let idPreis = tibber + 'PricesToday.' + i + '.total';
                                        
                                                obj.start = new Date(getState(idStart).val).getHours();
                                        
                                                obj.preis = getState(idPreis).val;
                                        
                                                preise.push(obj);
                                        
                                            }
                                            for(let i = 0; i < 6; i++) {
                                        
                                                let obj = {};
                                        
                                                let idStart = tibber + 'PricesTomorrow.' + i + '.startsAt';
                                        
                                                let idPreis = tibber + 'PricesTomorrow.' + i + '.total';
                                        
                                                obj.start = new Date(getState(idStart).val).getHours();
                                        
                                                obj.preis = getState(idPreis).val;
                                        
                                                preise.push(obj);
                                        
                                            }
                                            preise.sort(sortPreis);
                                        
                                            setState(idSort, preise, true);
                                        
                                        });
                                        
                                        1. Script läd aus diesem Array die aufgeschlüsselten Preise und Uhrzeiten heraus nach Sortierung. Also Billigster Preis ist 0 usw. Hier müssen Ordner erstellt werden mit je 2 Datenpunkte als Nummer 1mal Als Beschreibung Uhrzeit und 1 mal als Beschreibung Preis.
                                        <xml xmlns="https://developers.google.com/blockly/xml">
                                          <variables>
                                            <variable id="K(-Do$/%qq.3:uuMW(mO">100</variable>
                                            <variable id="T0C|e_iyDzVNTT#.cr|Q">0</variable>
                                            <variable id="?}?K(VcpoL%Ym#A!twK4">result</variable>
                                          </variables>
                                          <block type="on" id="U^4ser/A.u~1BI|SC*yA" x="-387" y="-237">
                                            <field name="OID">0_userdata.0.Tibber.Bester_Preis.Tibber_Bester_Preis</field>
                                            <field name="CONDITION">any</field>
                                            <field name="ACK_CONDITION"></field>
                                            <statement name="STATEMENT">
                                              <block type="timeouts_wait" id="vm)?nG0?5#k:sloY%gL,">
                                                <field name="DELAY">5</field>
                                                <field name="UNIT">sec</field>
                                                <next>
                                                  <block type="variables_set" id="Al$@}qOAKZ,LIXa~{nN?">
                                                    <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                    <value name="VALUE">
                                                      <block type="math_number" id="A{1Q~3J[L^-T`HSO)q[(">
                                                        <field name="NUM">0</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="variables_set" id="{D?U7(?.qg1[]yAP=q[:">
                                                        <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                        <value name="VALUE">
                                                          <block type="math_number" id="C%9evA_V}*d}%J7%%XFT">
                                                            <field name="NUM">0</field>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="x;P=;(;15/Y6?muBc;O2">
                                                            <field name="VAR" id="?}?K(VcpoL%Ym#A!twK4">result</field>
                                                            <value name="VALUE">
                                                              <block type="convert_object2json" id="m2AZ#H~a//`@h%Z,?MIP">
                                                                <field name="PRETTIFY">TRUE</field>
                                                                <value name="VALUE">
                                                                  <block type="get_value" id="c0i8z=dH#h^4!AyN|@F6">
                                                                    <field name="ATTR">val</field>
                                                                    <field name="OID">0_userdata.0.Tibber.Bester_Preis.Tibber_Bester_Preis</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <next>
                                                              <block type="procedures_callnoreturn" id="B~-[:|-,:xDeD;nO=JHs">
                                                                <mutation name="berechnung"></mutation>
                                                                <next>
                                                                  <block type="update" id="_G;(k8|7k0md#C%Z.9`^">
                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                    <field name="OID">0_userdata.0.Tibber.Bester_Preis.0.Uhrzeit</field>
                                                                    <field name="WITH_DELAY">FALSE</field>
                                                                    <value name="VALUE">
                                                                      <block type="convert_tonumber" id="FTU}.-5n*rcZHb07}rI~">
                                                                        <value name="VALUE">
                                                                          <block type="variables_get" id="rw1HaX00l)D`PFWCDkaM">
                                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                    <next>
                                                                      <block type="update" id=":7vggz4G)}3Pzvr]^jGP">
                                                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                        <field name="OID">0_userdata.0.Tibber.Bester_Preis.0.Preis</field>
                                                                        <field name="WITH_DELAY">FALSE</field>
                                                                        <value name="VALUE">
                                                                          <block type="convert_tonumber" id="5/(};HGK8ux4D{Xu=h./">
                                                                            <value name="VALUE">
                                                                              <block type="variables_get" id="_cgR9I,cyL_otBDM0Da#">
                                                                                <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                              </block>
                                                                            </value>
                                                                          </block>
                                                                        </value>
                                                                        <next>
                                                                          <block type="math_change" id="^x7KRl;_C6G1c*m6bbc-">
                                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                            <value name="DELTA">
                                                                              <shadow type="math_number" id="SgtllF9[vj4b#?z$|l}{">
                                                                                <field name="NUM">1</field>
                                                                              </shadow>
                                                                              <block type="math_number" id="[Q^HA}XdjF^W^FUmYuCZ">
                                                                                <field name="NUM">1</field>
                                                                              </block>
                                                                            </value>
                                                                            <next>
                                                                              <block type="math_change" id="3@jhWn;d66~(Cm=f6O;z">
                                                                                <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                <value name="DELTA">
                                                                                  <shadow type="math_number">
                                                                                    <field name="NUM">1</field>
                                                                                  </shadow>
                                                                                  <block type="math_number" id="D,i5:/:~#6-:uGMr)JY:">
                                                                                    <field name="NUM">1</field>
                                                                                  </block>
                                                                                </value>
                                                                                <next>
                                                                                  <block type="procedures_callnoreturn" id="@.Un+MpeN4n@OV7?%^;W">
                                                                                    <mutation name="berechnung"></mutation>
                                                                                    <next>
                                                                                      <block type="update" id="=Rw^.5Z6Ug|MKL*%~KBZ">
                                                                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                        <field name="OID">0_userdata.0.Tibber.Bester_Preis.1.Uhrzeit</field>
                                                                                        <field name="WITH_DELAY">FALSE</field>
                                                                                        <value name="VALUE">
                                                                                          <block type="convert_tonumber" id="2|h%C[.lz@gwZE`{6^qg">
                                                                                            <value name="VALUE">
                                                                                              <block type="variables_get" id="_?g_G;]d^67GHpw3ub@[">
                                                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                              </block>
                                                                                            </value>
                                                                                          </block>
                                                                                        </value>
                                                                                        <next>
                                                                                          <block type="update" id="uNiid^?;#vOI003B_/fq">
                                                                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                            <field name="OID">0_userdata.0.Tibber.Bester_Preis.1.Preis</field>
                                                                                            <field name="WITH_DELAY">FALSE</field>
                                                                                            <value name="VALUE">
                                                                                              <block type="convert_tonumber" id="H;:o2y0()ww+8=RCp+T_">
                                                                                                <value name="VALUE">
                                                                                                  <block type="variables_get" id="4C*qw@#t=^I/i5:v}=Ar">
                                                                                                    <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                  </block>
                                                                                                </value>
                                                                                              </block>
                                                                                            </value>
                                                                                            <next>
                                                                                              <block type="math_change" id="v{VuNDgvyXrVNcl9NMe#">
                                                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                <value name="DELTA">
                                                                                                  <shadow type="math_number">
                                                                                                    <field name="NUM">1</field>
                                                                                                  </shadow>
                                                                                                  <block type="math_number" id="()jaFG_|9Rt^I6qa((4]">
                                                                                                    <field name="NUM">2</field>
                                                                                                  </block>
                                                                                                </value>
                                                                                                <next>
                                                                                                  <block type="math_change" id="-W.RhLJC5jyapNtq5*Hc">
                                                                                                    <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                    <value name="DELTA">
                                                                                                      <shadow type="math_number">
                                                                                                        <field name="NUM">1</field>
                                                                                                      </shadow>
                                                                                                      <block type="math_number" id="66xM{oArQ*BwU4RC=Th7">
                                                                                                        <field name="NUM">2</field>
                                                                                                      </block>
                                                                                                    </value>
                                                                                                    <next>
                                                                                                      <block type="procedures_callnoreturn" id=":p79FAs~qmAKRwtKHVll">
                                                                                                        <mutation name="berechnung"></mutation>
                                                                                                        <next>
                                                                                                          <block type="update" id="MowHnZIs,W1PsC/0CM+D">
                                                                                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                            <field name="OID">0_userdata.0.Tibber.Bester_Preis.2.Uhrzeit</field>
                                                                                                            <field name="WITH_DELAY">FALSE</field>
                                                                                                            <value name="VALUE">
                                                                                                              <block type="convert_tonumber" id="0lma^Z9G9T*/3M3~US4e">
                                                                                                                <value name="VALUE">
                                                                                                                  <block type="variables_get" id="~2~q9mDKmM=U_AvXRTX%">
                                                                                                                    <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                  </block>
                                                                                                                </value>
                                                                                                              </block>
                                                                                                            </value>
                                                                                                            <next>
                                                                                                              <block type="update" id="a;)_(OQKce#@9}Op6q==">
                                                                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                <field name="OID">0_userdata.0.Tibber.Bester_Preis.2.Preis</field>
                                                                                                                <field name="WITH_DELAY">FALSE</field>
                                                                                                                <value name="VALUE">
                                                                                                                  <block type="convert_tonumber" id="zta~P(yNy}T=);PZlS2]">
                                                                                                                    <value name="VALUE">
                                                                                                                      <block type="variables_get" id="i~fBbugvj9+%j{sk3cQe">
                                                                                                                        <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                      </block>
                                                                                                                    </value>
                                                                                                                  </block>
                                                                                                                </value>
                                                                                                                <next>
                                                                                                                  <block type="math_change" id="K2w%_-~e,xI`R5][R/c1">
                                                                                                                    <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                    <value name="DELTA">
                                                                                                                      <shadow type="math_number">
                                                                                                                        <field name="NUM">1</field>
                                                                                                                      </shadow>
                                                                                                                      <block type="math_number" id="}`5[f!_8X$nYMKH8l]g=">
                                                                                                                        <field name="NUM">3</field>
                                                                                                                      </block>
                                                                                                                    </value>
                                                                                                                    <next>
                                                                                                                      <block type="math_change" id="_Ii{BnJL?eDd6XcROFd|">
                                                                                                                        <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                        <value name="DELTA">
                                                                                                                          <shadow type="math_number">
                                                                                                                            <field name="NUM">1</field>
                                                                                                                          </shadow>
                                                                                                                          <block type="math_number" id="5p^_1^yslVy@n*Ic-[js">
                                                                                                                            <field name="NUM">3</field>
                                                                                                                          </block>
                                                                                                                        </value>
                                                                                                                        <next>
                                                                                                                          <block type="procedures_callnoreturn" id="+gDbX1[.6D:YP!MwJ;W)">
                                                                                                                            <mutation name="berechnung"></mutation>
                                                                                                                            <next>
                                                                                                                              <block type="update" id="b`y[di#={z/5v{I*U+oM">
                                                                                                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                <field name="OID">0_userdata.0.Tibber.Bester_Preis.3.Uhrzeit</field>
                                                                                                                                <field name="WITH_DELAY">FALSE</field>
                                                                                                                                <value name="VALUE">
                                                                                                                                  <block type="convert_tonumber" id="0d#m~([keYztR*z5B~5N">
                                                                                                                                    <value name="VALUE">
                                                                                                                                      <block type="variables_get" id="eG|MJh08|mlM@8%NwdG,">
                                                                                                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                  </block>
                                                                                                                                </value>
                                                                                                                                <next>
                                                                                                                                  <block type="update" id="z{*VgN*Y4JH3{7#}?,Uu">
                                                                                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                    <field name="OID">0_userdata.0.Tibber.Bester_Preis.3.Preis</field>
                                                                                                                                    <field name="WITH_DELAY">FALSE</field>
                                                                                                                                    <value name="VALUE">
                                                                                                                                      <block type="convert_tonumber" id="ASSa.2$}A|cs^j.at2kk">
                                                                                                                                        <value name="VALUE">
                                                                                                                                          <block type="variables_get" id="zTs%PeRbGjhE(h,(,~n$">
                                                                                                                                            <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                                          </block>
                                                                                                                                        </value>
                                                                                                                                      </block>
                                                                                                                                    </value>
                                                                                                                                    <next>
                                                                                                                                      <block type="math_change" id="87-Y.1bQ7HK`UQRbW=7U">
                                                                                                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                                        <value name="DELTA">
                                                                                                                                          <shadow type="math_number">
                                                                                                                                            <field name="NUM">1</field>
                                                                                                                                          </shadow>
                                                                                                                                          <block type="math_number" id="VS5Gr3sA|RKE3tsFY6xs">
                                                                                                                                            <field name="NUM">4</field>
                                                                                                                                          </block>
                                                                                                                                        </value>
                                                                                                                                        <next>
                                                                                                                                          <block type="math_change" id="*ay]M=;~hHQrvS1N~G-e">
                                                                                                                                            <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                                            <value name="DELTA">
                                                                                                                                              <shadow type="math_number">
                                                                                                                                                <field name="NUM">1</field>
                                                                                                                                              </shadow>
                                                                                                                                              <block type="math_number" id="i=z*v5e#pEPR7^.lN=:p">
                                                                                                                                                <field name="NUM">4</field>
                                                                                                                                              </block>
                                                                                                                                            </value>
                                                                                                                                            <next>
                                                                                                                                              <block type="procedures_callnoreturn" id=",9=hosChNr)aH{x]z7mA">
                                                                                                                                                <mutation name="berechnung"></mutation>
                                                                                                                                                <next>
                                                                                                                                                  <block type="update" id="%a-^sAj.+*gyu_fcRCbs">
                                                                                                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                    <field name="OID">0_userdata.0.Tibber.Bester_Preis.4.Uhrzeit</field>
                                                                                                                                                    <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                    <value name="VALUE">
                                                                                                                                                      <block type="convert_tonumber" id="g4{}dEgb^o{6*x.OWt:Y">
                                                                                                                                                        <value name="VALUE">
                                                                                                                                                          <block type="variables_get" id="VGvxmGwh!%%j$t?3-H!y">
                                                                                                                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                                                          </block>
                                                                                                                                                        </value>
                                                                                                                                                      </block>
                                                                                                                                                    </value>
                                                                                                                                                    <next>
                                                                                                                                                      <block type="update" id="q!V{W(E16Ixx!o[8ur}%">
                                                                                                                                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                        <field name="OID">0_userdata.0.Tibber.Bester_Preis.4.Preis</field>
                                                                                                                                                        <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                        <value name="VALUE">
                                                                                                                                                          <block type="convert_tonumber" id="NULd5lQk%@`|6?w.g=54">
                                                                                                                                                            <value name="VALUE">
                                                                                                                                                              <block type="variables_get" id="Ib}rrRN@e3:@JR_M):CL">
                                                                                                                                                                <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                                                              </block>
                                                                                                                                                            </value>
                                                                                                                                                          </block>
                                                                                                                                                        </value>
                                                                                                                                                        <next>
                                                                                                                                                          <block type="math_change" id="1;zowsQe|)7}~l/jr_i-">
                                                                                                                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                                                            <value name="DELTA">
                                                                                                                                                              <shadow type="math_number">
                                                                                                                                                                <field name="NUM">1</field>
                                                                                                                                                              </shadow>
                                                                                                                                                              <block type="math_number" id="3,FvV4k1`n#.Uts#f|O(">
                                                                                                                                                                <field name="NUM">5</field>
                                                                                                                                                              </block>
                                                                                                                                                            </value>
                                                                                                                                                            <next>
                                                                                                                                                              <block type="math_change" id="0BXWG)QWD(B4zgW[QLcC">
                                                                                                                                                                <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                                                                <value name="DELTA">
                                                                                                                                                                  <shadow type="math_number">
                                                                                                                                                                    <field name="NUM">1</field>
                                                                                                                                                                  </shadow>
                                                                                                                                                                  <block type="math_number" id="93XjsCho?vwkA@?|E0`g">
                                                                                                                                                                    <field name="NUM">5</field>
                                                                                                                                                                  </block>
                                                                                                                                                                </value>
                                                                                                                                                                <next>
                                                                                                                                                                  <block type="procedures_callnoreturn" id="@FLbyN/V+,,W85lY7d,l">
                                                                                                                                                                    <mutation name="berechnung"></mutation>
                                                                                                                                                                    <next>
                                                                                                                                                                      <block type="update" id="?Bc6DzRit#}v#`5-E-|7">
                                                                                                                                                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                                        <field name="OID">0_userdata.0.Tibber.Bester_Preis.5.Uhrzeit</field>
                                                                                                                                                                        <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                                        <value name="VALUE">
                                                                                                                                                                          <block type="convert_tonumber" id="5zuD~;ROsOY7K}%1M}Fh">
                                                                                                                                                                            <value name="VALUE">
                                                                                                                                                                              <block type="variables_get" id="MhRJ*Ur.D[,=r#sl)Mem">
                                                                                                                                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                                                                                                                              </block>
                                                                                                                                                                            </value>
                                                                                                                                                                          </block>
                                                                                                                                                                        </value>
                                                                                                                                                                        <next>
                                                                                                                                                                          <block type="update" id="vI08AGBoAyKaBQ9Pz%vT">
                                                                                                                                                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                                                                                                            <field name="OID">0_userdata.0.Tibber.Bester_Preis.5.Preis</field>
                                                                                                                                                                            <field name="WITH_DELAY">FALSE</field>
                                                                                                                                                                            <value name="VALUE">
                                                                                                                                                                              <block type="convert_tonumber" id="1KincJZ@C0ZYU8Hr^$iW">
                                                                                                                                                                                <value name="VALUE">
                                                                                                                                                                                  <block type="variables_get" id="F}!13RJfHB*OtMVr`WvJ">
                                                                                                                                                                                    <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                                                                                                                                                  </block>
                                                                                                                                                                                </value>
                                                                                                                                                                              </block>
                                                                                                                                                                            </value>
                                                                                                                                                                          </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>
                                                                                                                    </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>
                                                                </next>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </statement>
                                          </block>
                                          <block type="procedures_defnoreturn" id="4,ZP*xHgsT%~Vk9o,/Z7" x="388" y="-237">
                                            <field name="NAME">berechnung</field>
                                            <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                                            <statement name="STACK">
                                              <block type="variables_set" id="hlL]N13nxkDPQ.Krt(,B">
                                                <field name="VAR" id="K(-Do$/%qq.3:uuMW(mO">100</field>
                                                <value name="VALUE">
                                                  <block type="get_attr" id="%e~~oxn;qZ:TyC/{|Sx?">
                                                    <value name="PATH">
                                                      <shadow type="text">
                                                        <field name="TEXT">0.start</field>
                                                      </shadow>
                                                      <block type="text_join" id="r7T5MDbWvXS2iEN:k2f?">
                                                        <mutation items="2"></mutation>
                                                        <value name="ADD0">
                                                          <block type="variables_get" id="A47KrkMC%=?zK`c-jcXx">
                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                          </block>
                                                        </value>
                                                        <value name="ADD1">
                                                          <block type="text" id="0){dC1^m!`?CR-3=D2QV">
                                                            <field name="TEXT">.preis</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <value name="OBJECT">
                                                      <block type="variables_get" id="36Pl!b#af-jjQ~?*FXGR">
                                                        <field name="VAR" id="?}?K(VcpoL%Ym#A!twK4">result</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="variables_set" id="GOsC=G]i2U|$PE?`VQ{X">
                                                    <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                    <value name="VALUE">
                                                      <block type="get_attr" id="k7ce6(TiR}pa6jP_zg|J">
                                                        <value name="PATH">
                                                          <shadow type="text">
                                                            <field name="TEXT">0.start</field>
                                                          </shadow>
                                                          <block type="text_join" id=";2}`@T;`;]U`3VdZg/`)">
                                                            <mutation items="2"></mutation>
                                                            <value name="ADD0">
                                                              <block type="variables_get" id="Jf7VYMn+/Oh#AW5n2Z3h">
                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                              </block>
                                                            </value>
                                                            <value name="ADD1">
                                                              <block type="text" id="UZ,LFab6RXpnSL8sS0/9">
                                                                <field name="TEXT">.start</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <value name="OBJECT">
                                                          <block type="variables_get" id="N.x,j[|gKn6|$Xy4vx]F">
                                                            <field name="VAR" id="?}?K(VcpoL%Ym#A!twK4">result</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="controls_if" id="1l-ZNlHL1kp36KS*OWZG">
                                                        <mutation else="1"></mutation>
                                                        <value name="IF0">
                                                          <block type="logic_compare" id="J|n@lq4HGP,)apj(Udq2">
                                                            <field name="OP">LT</field>
                                                            <value name="A">
                                                              <block type="variables_get" id="vAzn1wdU6Uwz)47K7L^d">
                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <block type="math_number" id=":QLlxQ4le4BD`Y6Az(bo">
                                                                <field name="NUM">10</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <statement name="DO0">
                                                          <block type="variables_set" id="Ro2~YB.img(1Dg9h^*UH">
                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                            <value name="VALUE">
                                                              <block type="text_join" id="nF#N|NQ,4lXk]edsZW}E">
                                                                <mutation items="2"></mutation>
                                                                <value name="ADD0">
                                                                  <block type="text" id="dS2,;jes`.51UGGKaHYs">
                                                                    <field name="TEXT">0</field>
                                                                  </block>
                                                                </value>
                                                                <value name="ADD1">
                                                                  <block type="variables_get" id="75^,N|GdzhUhRq^_MI/@">
                                                                    <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <next>
                                                              <block type="variables_set" id="1#wigNK`{4{qD,JESQ#;">
                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                <value name="VALUE">
                                                                  <block type="convert_from_date" id="V~o|SjsbjR2Bdw/ZqqUU">
                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                                    <field name="OPTION">hh:mm</field>
                                                                    <value name="VALUE">
                                                                      <block type="variables_get" id="|%2{}vR)p4Is-6xqOm58">
                                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </statement>
                                                        <statement name="ELSE">
                                                          <block type="variables_set" id="(_+|}rSH=0`=NpJn57?d">
                                                            <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                            <value name="VALUE">
                                                              <block type="text_join" id="X0XB2/z`@:aJ6W4rmx!7">
                                                                <mutation items="1"></mutation>
                                                                <value name="ADD0">
                                                                  <block type="variables_get" id="orj?.k84:R,qaX-EN6g1">
                                                                    <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <next>
                                                              <block type="variables_set" id="#GZr/RwMBMo/Go]iE*!6">
                                                                <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                <value name="VALUE">
                                                                  <block type="convert_from_date" id=".%3W]QEHFOj72r/%~U3H">
                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                                    <field name="OPTION">hh:mm</field>
                                                                    <value name="VALUE">
                                                                      <block type="variables_get" id="+UW98s,bvTOj@0CF(TES">
                                                                        <field name="VAR" id="T0C|e_iyDzVNTT#.cr|Q">0</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </next>
                                                          </block>
                                                        </statement>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </statement>
                                          </block>
                                        </xml>
                                        
                                        paul53P Offline
                                        paul53P Offline
                                        paul53
                                        wrote on last edited by
                                        #29

                                        @babl
                                        Ich habe in dem neuen Skript auf eine Sortierung nach Preis verzichtet, da bei Ladung länger als eine Stunde zwei zeitlich aufeinanderfolgende Preise berücksichtigt werden sollten. Es werden also nur noch zwei Startzeitpunkte ermittelt und per Datenpunkt übermittelt.

                                        Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                                        Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                                        1 Reply Last reply
                                        0
                                        • B babl
                                          1. Script ist das Script um die Batterie an den Zeiten zu laden die vorher in den beiden Scripten ausgearbeitet wurden.
                                          <xml xmlns="https://developers.google.com/blockly/xml">
                                            <variables>
                                              <variable id="ML@$Lt_]|-r%{#NpcuTc">Angestrebte Ladung des Hausspeichers in %</variable>
                                              <variable id="EG.rbA-N:U.-0WD.q.!q">Ladeleistung Hausspeicher in Watt</variable>
                                              <variable id="goWOWAU+Ug5AX7zoPejz">Max Füllstand Hausspeicher in Wh</variable>
                                              <variable id="4J?aX*2N(RCecW;gi3B;">user_soc</variable>
                                              <variable id="OpCZqd.EFNouMwR1*Z?X">start ladung</variable>
                                              <variable id="g}MF8_uaSRlr;N!k%#HA">ladung</variable>
                                              <variable id="d}:9/gTxuS605HBk*Vh#">Aktueller Füllstand Hausspeicher</variable>
                                              <variable id="x]#UqG,4n[x3lR-{wi=%">berechnung</variable>
                                              <variable id="YLKsIDz]9MH,.z4Hlri/">mehr als 1 stunde</variable>
                                              <variable type="cron" id="schedule1">schedule1</variable>
                                              <variable type="cron" id="schedule2">schedule2</variable>
                                              <variable type="cron" id="schedule3">schedule3</variable>
                                            </variables>
                                            <block type="variables_set" id="LV/YM`ccmRcE}iIYofSo" x="88" y="413">
                                              <field name="VAR" id="ML@$Lt_]|-r%{#NpcuTc">Angestrebte Ladung des Hausspeichers in %</field>
                                              <value name="VALUE">
                                                <block type="math_number" id="Ob{p6sJ+B^]pk$uAhpbr">
                                                  <field name="NUM">100</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="8HO5Q;6hbG~$,Hd{wWj?">
                                                  <field name="VAR" id="EG.rbA-N:U.-0WD.q.!q">Ladeleistung Hausspeicher in Watt</field>
                                                  <value name="VALUE">
                                                    <block type="math_number" id="Pl)!Bv-Rf{F{0;A?j[4x">
                                                      <field name="NUM">3000</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id="cpeqv]RuwK^PLMbr#_}Y">
                                                      <field name="VAR" id="goWOWAU+Ug5AX7zoPejz">Max Füllstand Hausspeicher in Wh</field>
                                                      <value name="VALUE">
                                                        <block type="math_number" id="5lteLew:-BAmA:T47H0_">
                                                          <field name="NUM">5000</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="variables_set" id="X./aSKc)=0pVT8EZZpCf">
                                                          <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                          <value name="VALUE">
                                                            <block type="get_value" id="=5sbMX8r_3[G-?=W6TB_">
                                                              <field name="ATTR">val</field>
                                                              <field name="OID">0_userdata.0.Tibber.Bester_Preis.0.Uhrzeit</field>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="schedule" id="PpHw,4;Y%c+B0c_2!yvm">
                                                              <field name="SCHEDULE">{"time":{"start":"sunset","end":"sunrise","mode":"hours","interval":1},"period":{"days":1}}</field>
                                                              <statement name="STATEMENT">
                                                                <block type="variables_set" id="+[Er4N3+fY[UF,]*nA_}">
                                                                  <field name="VAR" id="d}:9/gTxuS605HBk*Vh#">Aktueller Füllstand Hausspeicher</field>
                                                                  <value name="VALUE">
                                                                    <block type="math_arithmetic" id="$W5(oC9tYC)d1d!ykQjZ">
                                                                      <field name="OP">DIVIDE</field>
                                                                      <value name="A">
                                                                        <shadow type="math_number" id="`q%]g0+3,ql3|b6{?.#V">
                                                                          <field name="NUM">1</field>
                                                                        </shadow>
                                                                        <block type="math_arithmetic" id="SM3|Od8O8XifG};eY-M+">
                                                                          <field name="OP">MULTIPLY</field>
                                                                          <value name="A">
                                                                            <shadow type="math_number" id="S/`Dm(AO/oP=)BFqdH~T">
                                                                              <field name="NUM">1</field>
                                                                            </shadow>
                                                                            <block type="variables_get" id="HISAN$fC4;k.Wv2E=G#8">
                                                                              <field name="VAR" id="goWOWAU+Ug5AX7zoPejz">Max Füllstand Hausspeicher in Wh</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="B">
                                                                            <shadow type="math_number" id="xe.-h_}[@bU;zB4CdTq]">
                                                                              <field name="NUM">1</field>
                                                                            </shadow>
                                                                            <block type="get_value" id="@N}??]8R#0xR/zo:5E]k">
                                                                              <field name="ATTR">val</field>
                                                                              <field name="OID">sonnen.0.status.userSoc</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <value name="B">
                                                                        <shadow type="math_number" id="nQ()6Jl.@|Iq}Q8~k7#)">
                                                                          <field name="NUM">1</field>
                                                                        </shadow>
                                                                        <block type="math_number" id="^*9c-Frw{7[A8C0DJr}1">
                                                                          <field name="NUM">100</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="variables_set" id="aai9l-l7vb)f::o9,[hA">
                                                                      <field name="VAR" id="x]#UqG,4n[x3lR-{wi=%">berechnung</field>
                                                                      <value name="VALUE">
                                                                        <block type="math_arithmetic" id=")Qb]Wr35*4![FU06.CDz">
                                                                          <field name="OP">MINUS</field>
                                                                          <value name="A">
                                                                            <shadow type="math_number" id="|}uEFH|!V1u3o%|`Z|P@">
                                                                              <field name="NUM">1</field>
                                                                            </shadow>
                                                                            <block type="variables_get" id="_:biLL}VcUr-eEl$$HR?">
                                                                              <field name="VAR" id="goWOWAU+Ug5AX7zoPejz">Max Füllstand Hausspeicher in Wh</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="B">
                                                                            <shadow type="math_number" id="P89`WEYM7yh]CKxW/`h:">
                                                                              <field name="NUM">1</field>
                                                                            </shadow>
                                                                            <block type="variables_get" id="b?R[@BuSC^8}|ynV7Z(w">
                                                                              <field name="VAR" id="d}:9/gTxuS605HBk*Vh#">Aktueller Füllstand Hausspeicher</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="controls_if" id="*aITaBVqga~c?`Y16L]y">
                                                                          <mutation else="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="^+y:hf;({LqRAy82+y:K">
                                                                                  <field name="VAR" id="x]#UqG,4n[x3lR-{wi=%">berechnung</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="B">
                                                                                <block type="variables_get" id="7;izE9{|{{M#CPUoU2nG">
                                                                                  <field name="VAR" id="EG.rbA-N:U.-0WD.q.!q">Ladeleistung Hausspeicher in Watt</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <statement name="DO0">
                                                                            <block type="debug" id="[7Q@F$)p#$IWLL9HJl!l">
                                                                              <field name="Severity">log</field>
                                                                              <value name="TEXT">
                                                                                <shadow type="text" id="@et]-#PUIz8NFG0/uDV.">
                                                                                  <field name="TEXT">test</field>
                                                                                </shadow>
                                                                                <block type="text" id="rnD(s?y[I|jltc{t%v:)">
                                                                                  <field name="TEXT">Hausspeicher braucht mehr Zeit als 1 Stunde zum laden</field>
                                                                                </block>
                                                                              </value>
                                                                              <next>
                                                                                <block type="variables_set" id="n:L0K+eh$HsloK,hJ=M}">
                                                                                  <field name="VAR" id="YLKsIDz]9MH,.z4Hlri/">mehr als 1 stunde</field>
                                                                                  <value name="VALUE">
                                                                                    <block type="math_number" id="O7c08GJ4;v]O:KEocFOq">
                                                                                      <field name="NUM">1</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </statement>
                                                                          <statement name="ELSE">
                                                                            <block type="variables_set" id="Nz-Y}HaS1|UPvlF923^,">
                                                                              <field name="VAR" id="YLKsIDz]9MH,.z4Hlri/">mehr als 1 stunde</field>
                                                                              <value name="VALUE">
                                                                                <block type="math_number" id=".[{{u#9HJ7]yXML`D7Zd">
                                                                                  <field name="NUM">0</field>
                                                                                </block>
                                                                              </value>
                                                                              <next>
                                                                                <block type="debug" id="|Xo|;2c$BPKS;]6=zd^/">
                                                                                  <field name="Severity">log</field>
                                                                                  <value name="TEXT">
                                                                                    <shadow type="text" id="AM:gcMXCq6m^Ece,|srv">
                                                                                      <field name="TEXT">test</field>
                                                                                    </shadow>
                                                                                    <block type="text" id="0GJt~9uV4UwpcIl]S]RN">
                                                                                      <field name="TEXT">Hausspeicher braucht weniger Zeit als 1 Stunde zum laden</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </statement>
                                                                          <next>
                                                                            <block type="controls_if" id="~pa#*tFO;43xct8E*9*v">
                                                                              <mutation elseif="1"></mutation>
                                                                              <value name="IF0">
                                                                                <block type="logic_compare" id="{u6UgYjuG}BdOOvo=_+x">
                                                                                  <field name="OP">EQ</field>
                                                                                  <value name="A">
                                                                                    <block type="variables_get" id="BmTjF:*;]w@wgfpPUqGJ">
                                                                                      <field name="VAR" id="YLKsIDz]9MH,.z4Hlri/">mehr als 1 stunde</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="B">
                                                                                    <block type="math_number" id="b!(noN/?90nVl9a$LB1;">
                                                                                      <field name="NUM">1</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                              <statement name="DO0">
                                                                                <block type="controls_if" id="},E,0+.1Q]o0O8^c/;RK">
                                                                                  <mutation else="1"></mutation>
                                                                                  <value name="IF0">
                                                                                    <block type="logic_compare" id="=oI1,42OV5xXnv}ctl?O">
                                                                                      <field name="OP">LT</field>
                                                                                      <value name="A">
                                                                                        <block type="get_value" id="KSN[vS9-7KED$lQLG^^P">
                                                                                          <field name="ATTR">val</field>
                                                                                          <field name="OID">0_userdata.0.Tibber.Bester_Preis.1.Uhrzeit</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="B">
                                                                                        <block type="get_value" id="c|zsGPH0{e!@7(a-(IpC">
                                                                                          <field name="ATTR">val</field>
                                                                                          <field name="OID">0_userdata.0.Tibber.Bester_Preis.0.Uhrzeit</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </value>
                                                                                  <statement name="DO0">
                                                                                    <block type="variables_set" id="!oDadcObIuF/m!DKgoB+">
                                                                                      <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                      <value name="VALUE">
                                                                                        <block type="math_arithmetic" id="|DfsO2R%l-ztqy(ASEnQ">
                                                                                          <field name="OP">MINUS</field>
                                                                                          <value name="A">
                                                                                            <shadow type="math_number" id=";h2oyrBp+Oaoz-j[5ZH#">
                                                                                              <field name="NUM">1</field>
                                                                                            </shadow>
                                                                                            <block type="variables_get" id="rJDB8`!n=C]l$I]N-?9(">
                                                                                              <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                            </block>
                                                                                          </value>
                                                                                          <value name="B">
                                                                                            <shadow type="math_number" id="CqPRA+C_4|(F#+xZv0%%">
                                                                                              <field name="NUM">1</field>
                                                                                            </shadow>
                                                                                            <block type="math_number" id="sA==0mTxWu!X7{eTz%bY">
                                                                                              <field name="NUM">1</field>
                                                                                            </block>
                                                                                          </value>
                                                                                        </block>
                                                                                      </value>
                                                                                      <next>
                                                                                        <block type="schedule_create" id="Kb~{O?7%@kmbg29O![3k">
                                                                                          <field name="NAME">schedule2</field>
                                                                                          <value name="SCHEDULE">
                                                                                            <shadow type="field_cron">
                                                                                              <field name="CRON">* * * * *</field>
                                                                                            </shadow>
                                                                                            <block type="cron_builder" id="1_Cs!0I|N0;l;(waVeeC" inline="true">
                                                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" seconds="false" as_line="false"></mutation>
                                                                                              <field name="LINE">TRUE</field>
                                                                                              <field name="WITH_SECONDS">FALSE</field>
                                                                                              <value name="DOW">
                                                                                                <shadow type="text" id="!G?2GB#@?OtrhK]M|m;$">
                                                                                                  <field name="TEXT">*</field>
                                                                                                </shadow>
                                                                                              </value>
                                                                                              <value name="MONTHS">
                                                                                                <shadow type="text" id="?F@+P_;??(#!a(D}miw0">
                                                                                                  <field name="TEXT">*</field>
                                                                                                </shadow>
                                                                                              </value>
                                                                                              <value name="DAYS">
                                                                                                <shadow type="text" id="b!Uu0:A$WEbrwb{;f*TW">
                                                                                                  <field name="TEXT">*</field>
                                                                                                </shadow>
                                                                                              </value>
                                                                                              <value name="HOURS">
                                                                                                <shadow type="text">
                                                                                                  <field name="TEXT">*</field>
                                                                                                </shadow>
                                                                                                <block type="variables_get" id="R;1?aKX^DR%xuWY}Om{0">
                                                                                                  <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                                </block>
                                                                                              </value>
                                                                                              <value name="MINUTES">
                                                                                                <shadow type="text" id="R/lDIh]=qAH0ESK13ygY">
                                                                                                  <field name="TEXT">*</field>
                                                                                                </shadow>
                                                                                              </value>
                                                                                            </block>
                                                                                          </value>
                                                                                          <statement name="STATEMENT">
                                                                                            <block type="update" id="Jiy46ovPO.HG]0uJ=)*5">
                                                                                              <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="Ujbo)O0+l-~r0{25zaNM">
                                                                                                  <field name="BOOL">TRUE</field>
                                                                                                </block>
                                                                                              </value>
                                                                                            </block>
                                                                                          </statement>
                                                                                        </block>
                                                                                      </next>
                                                                                    </block>
                                                                                  </statement>
                                                                                  <statement name="ELSE">
                                                                                    <block type="variables_set" id="Hg]_nxZ!8ws/WcM1^gza">
                                                                                      <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                      <value name="VALUE">
                                                                                        <block type="variables_get" id="}8tlC_$h;XoxalZM?82#">
                                                                                          <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <next>
                                                                                        <block type="schedule_create" id="6LKI7T3!qFm,RTC*{1[D">
                                                                                          <field name="NAME">schedule3</field>
                                                                                          <value name="SCHEDULE">
                                                                                            <shadow type="field_cron">
                                                                                              <field name="CRON">* * * * *</field>
                                                                                            </shadow>
                                                                                            <block type="cron_builder" id="*V.rE+aUeX-^mjb9~gSU" inline="true">
                                                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" seconds="false" as_line="false"></mutation>
                                                                                              <field name="LINE">FALSE</field>
                                                                                              <field name="WITH_SECONDS">FALSE</field>
                                                                                              <value name="DOW">
                                                                                                <shadow type="text" id="bVsEN7f16vgRwp7{Le%U">
                                                                                                  <field name="TEXT">*</field>
                                                                                                </shadow>
                                                                                              </value>
                                                                                              <value name="MONTHS">
                                                                                                <shadow type="text" id="+AE;v0T)S^2`+$Rv$?P#">
                                                                                                  <field name="TEXT">*</field>
                                                                                                </shadow>
                                                                                              </value>
                                                                                              <value name="DAYS">
                                                                                                <shadow type="text" id="ZQ!l*(E#|J2i,Z^!67wG">
                                                                                                  <field name="TEXT">*</field>
                                                                                                </shadow>
                                                                                              </value>
                                                                                              <value name="HOURS">
                                                                                                <shadow type="text">
                                                                                                  <field name="TEXT">*</field>
                                                                                                </shadow>
                                                                                                <block type="variables_get" id="yP;{JyQoEhN+%k1mE/j*">
                                                                                                  <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                                </block>
                                                                                              </value>
                                                                                              <value name="MINUTES">
                                                                                                <shadow type="text" id="7f;y])6]3,5!n)C:aU$i">
                                                                                                  <field name="TEXT">*</field>
                                                                                                </shadow>
                                                                                              </value>
                                                                                            </block>
                                                                                          </value>
                                                                                          <statement name="STATEMENT">
                                                                                            <block type="update" id="BX/Z_7g8Gl;x:|y(r;w(">
                                                                                              <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="fbSR%WF{pHU9#zf|HhZL">
                                                                                                  <field name="BOOL">TRUE</field>
                                                                                                </block>
                                                                                              </value>
                                                                                            </block>
                                                                                          </statement>
                                                                                        </block>
                                                                                      </next>
                                                                                    </block>
                                                                                  </statement>
                                                                                </block>
                                                                              </statement>
                                                                              <value name="IF1">
                                                                                <block type="logic_compare" id="Su1?m]QD3]1SfLJVdyB?">
                                                                                  <field name="OP">EQ</field>
                                                                                  <value name="A">
                                                                                    <block type="variables_get" id="${+eKYzVR?MP(mtP:}*k">
                                                                                      <field name="VAR" id="YLKsIDz]9MH,.z4Hlri/">mehr als 1 stunde</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="B">
                                                                                    <block type="math_number" id="Iuu%~s`qi}I%tG5ax1ez">
                                                                                      <field name="NUM">0</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                              <statement name="DO1">
                                                                                <block type="schedule_create" id="72:7^3=1b^~aeu-z/8@|">
                                                                                  <field name="NAME">schedule1</field>
                                                                                  <value name="SCHEDULE">
                                                                                    <shadow type="field_cron" id="e]-wfGNxa(WCODp.0)~N">
                                                                                      <field name="CRON">* * * * *</field>
                                                                                    </shadow>
                                                                                    <block type="cron_builder" id="E5OPeWM?Q2CisyT)yi.t" inline="true">
                                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" seconds="false" as_line="false"></mutation>
                                                                                      <field name="LINE">FALSE</field>
                                                                                      <field name="WITH_SECONDS">FALSE</field>
                                                                                      <value name="DOW">
                                                                                        <shadow type="text" id=":,]7l,/9;x;U[/{U?7BR">
                                                                                          <field name="TEXT">*</field>
                                                                                        </shadow>
                                                                                      </value>
                                                                                      <value name="MONTHS">
                                                                                        <shadow type="text" id="Ch2bg`fbk$6MjiBAiB;`">
                                                                                          <field name="TEXT">*</field>
                                                                                        </shadow>
                                                                                      </value>
                                                                                      <value name="DAYS">
                                                                                        <shadow type="text" id="9hC5JVB==f*vj)alD^hF">
                                                                                          <field name="TEXT">*</field>
                                                                                        </shadow>
                                                                                      </value>
                                                                                      <value name="HOURS">
                                                                                        <shadow type="text" id="Fi+4#uvW~;];=W|F^-)}">
                                                                                          <field name="TEXT">*</field>
                                                                                        </shadow>
                                                                                        <block type="variables_get" id="%zuvphPJ*:|$ogkn3PM^">
                                                                                          <field name="VAR" id="OpCZqd.EFNouMwR1*Z?X">start ladung</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="MINUTES">
                                                                                        <shadow type="text" id="?|:Z-!075n/pD4/t+6u]">
                                                                                          <field name="TEXT">*</field>
                                                                                        </shadow>
                                                                                      </value>
                                                                                    </block>
                                                                                  </value>
                                                                                  <statement name="STATEMENT">
                                                                                    <block type="update" id="W#8k+fCnusVzQys3JIoR">
                                                                                      <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="|BSESbtBs=H9eqL#m??O">
                                                                                          <field name="BOOL">TRUE</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </statement>
                                                                                </block>
                                                                              </statement>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </statement>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                            <block type="on_ext" id="}ec}5MTos#m/+Jc%mAv," x="88" y="1665">
                                              <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="9T+8w9LUyD0C|]4R5vds">
                                                  <field name="oid">sonnen.0.status.userSoc</field>
                                                </shadow>
                                              </value>
                                              <statement name="STATEMENT">
                                                <block type="controls_if" id="2i;.un?=k!HN(E#9_S}{">
                                                  <value name="IF0">
                                                    <block type="logic_compare" id="-|PDR$iLtW*acAH_g;%8">
                                                      <field name="OP">EQ</field>
                                                      <value name="A">
                                                        <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>
                                                      <value name="B">
                                                        <block type="logic_boolean" id="e+a51Z==w4Gi(JCD/TP(">
                                                          <field name="BOOL">TRUE</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <statement name="DO0">
                                                    <block type="variables_set" id="9:hB{DuI0$WVq*3K-fh4">
                                                      <field name="VAR" id="4J?aX*2N(RCecW;gi3B;">user_soc</field>
                                                      <value name="VALUE">
                                                        <block type="on_source" id="e$4T}@8fHA)f[PLb0u7c">
                                                          <field name="ATTR">state.val</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="controls_if" id="~w!Ro5h?:#7tnE4=x9-Y">
                                                          <mutation elseif="1"></mutation>
                                                          <value name="IF0">
                                                            <block type="logic_compare" id="4B5Q!,$t_dk8cPg?slzF">
                                                              <field name="OP">LT</field>
                                                              <value name="A">
                                                                <block type="variables_get" id="yV,ZA2NpDWg4H]hGr?/$">
                                                                  <field name="VAR" id="4J?aX*2N(RCecW;gi3B;">user_soc</field>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="variables_get" id="t3vGPyaw8nXwWzeR][XX">
                                                                  <field name="VAR" id="ML@$Lt_]|-r%{#NpcuTc">Angestrebte Ladung des Hausspeichers in %</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <statement name="DO0">
                                                            <block type="controls_if" id="^WjYBsozNBT-$d/yBGcp">
                                                              <mutation else="1"></mutation>
                                                              <value name="IF0">
                                                                <block type="logic_operation" id="*yY1cJY1p4x9@dR4toT-" inline="false">
                                                                  <field name="OP">OR</field>
                                                                  <value name="A">
                                                                    <block type="logic_compare" id=")|N4!7dE$lGQf%IKqU,~">
                                                                      <field name="OP">LT</field>
                                                                      <value name="A">
                                                                        <block type="variables_get" id="aAPwk3f=aFk1X%rD}Or@">
                                                                          <field name="VAR" id="4J?aX*2N(RCecW;gi3B;">user_soc</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="B">
                                                                        <block type="math_number" id="PZ#ooa4jyT9#1*[as2XV">
                                                                          <field name="NUM">5</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <value name="B">
                                                                    <block type="logic_compare" id="M:`Sz,:(g[v/e}!5M=C:">
                                                                      <field name="OP">GT</field>
                                                                      <value name="A">
                                                                        <block type="variables_get" id="Mu%rTuZNodaJCDc2-wOp">
                                                                          <field name="VAR" id="4J?aX*2N(RCecW;gi3B;">user_soc</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="B">
                                                                        <block type="math_number" id="EqY/*s2tp5KA%N}vqY)R">
                                                                          <field name="NUM">95</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <statement name="DO0">
                                                                <block type="variables_set" id="dFt3k]R?%yno!6e![[1~">
                                                                  <field name="VAR" id="g}MF8_uaSRlr;N!k%#HA">ladung</field>
                                                                  <value name="VALUE">
                                                                    <block type="math_arithmetic" id="ZZ7u1pzwK.k~RIyE(5%B">
                                                                      <field name="OP">DIVIDE</field>
                                                                      <value name="A">
                                                                        <shadow type="math_number" id="o`FFL(Ww=gzl.gm@yEUe">
                                                                          <field name="NUM">1</field>
                                                                        </shadow>
                                                                        <block type="variables_get" id="GOH!9`0Ns689,KS/yG:e">
                                                                          <field name="VAR" id="EG.rbA-N:U.-0WD.q.!q">Ladeleistung Hausspeicher in Watt</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="B">
                                                                        <shadow type="math_number">
                                                                          <field name="NUM">1</field>
                                                                        </shadow>
                                                                        <block type="math_number" id="/?Hc2`zev:ICtMC2d}o/">
                                                                          <field name="NUM">2</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </statement>
                                                              <statement name="ELSE">
                                                                <block type="variables_set" id="Y1o%+C9-[|PE/*2,9wt8">
                                                                  <field name="VAR" id="g}MF8_uaSRlr;N!k%#HA">ladung</field>
                                                                  <value name="VALUE">
                                                                    <block type="variables_get" id="yK%yYFy|-Ls_zbjpUWx3">
                                                                      <field name="VAR" id="EG.rbA-N:U.-0WD.q.!q">Ladeleistung Hausspeicher in Watt</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </statement>
                                                            </block>
                                                          </statement>
                                                          <value name="IF1">
                                                            <block type="logic_compare" id="YCo~T:mO^H~4SgA+}xNj">
                                                              <field name="OP">EQ</field>
                                                              <value name="A">
                                                                <block type="variables_get" id="{7}9wHB7]Wd9OKI~5{G|">
                                                                  <field name="VAR" id="4J?aX*2N(RCecW;gi3B;">user_soc</field>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="variables_get" id="iM_7JOkAno;+HG3rPOpG">
                                                                  <field name="VAR" id="ML@$Lt_]|-r%{#NpcuTc">Angestrebte Ladung des Hausspeichers in %</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <statement name="DO1">
                                                            <block type="variables_set" id="b[n/uLuI[HVEuq__}k$y">
                                                              <field name="VAR" id="g}MF8_uaSRlr;N!k%#HA">ladung</field>
                                                              <value name="VALUE">
                                                                <block type="math_number" id="p1sNSm2Id}8}[Ov.Le`C">
                                                                  <field name="NUM">0</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </statement>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </statement>
                                                </block>
                                              </statement>
                                              <next>
                                                <block type="schedule" id="+NROA+tjABrSw/,khlQV">
                                                  <field name="SCHEDULE">*/10 * * * * *</field>
                                                  <statement name="STATEMENT">
                                                    <block type="control" id="a6m]ztAM=I`t[0uNBv8D">
                                                      <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="d*3eJ0B6U?ie;$;,Nud3">
                                                          <field name="VAR" id="g}MF8_uaSRlr;N!k%#HA">ladung</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </statement>
                                                </block>
                                              </next>
                                            </block>
                                          </xml>
                                          

                                          script3.jpg
                                          script3a.jpg

                                          paul53P Offline
                                          paul53P Offline
                                          paul53
                                          wrote on last edited by paul53
                                          #30

                                          @babl sagte: Script ist das Script um die Batterie an den Zeiten zu laden die vorher in den beiden Scripten ausgearbeitet wurden.

                                          Das funktioniert so nicht: Wenn Zeitpläne innerhalb eines Triggers neu erstellt werden, müssen die laufenden Zeitpläne vorher gelöscht werden. Außerdem darf die Variable start_ladung nicht nur bei Skriptstart gesetzt werden.

                                          Der untere Teil (Trigger: "User State of Charge") gefällt mir wesentlich besser als der Ursprung.

                                          Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                                          Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                                          B 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          543

                                          Online

                                          32.4k

                                          Users

                                          81.3k

                                          Topics

                                          1.3m

                                          Posts
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Recent
                                          • Tags
                                          • Unread 0
                                          • Categories
                                          • Unreplied
                                          • Popular
                                          • GitHub
                                          • Docu
                                          • Hilfe