Navigation

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

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Testscript: Hausspeicher dyn. laden nach Tibberpreisen uvm.

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

      So ich will euch mal mein Gefrickel zeigen wie ich das mache, ich habe bereits versucht einiges zu erleichtern aber dies gelingt mir nur sehr schwer. Da ich seit 1.11.2022 bereits bei Tibber bin und seit 23.12.22 den Pulse habe, bin ich nun auch in den stündlichen Preisen involviert. Ich möchte euch hier meine Scripte vorstellen und eine Diskussion anregen, vielleicht kann man sie gemeinsam verbessern und vielleicht findet sich jemand der dann mal einen Adapter drausmacht, (für mich zu hoch)

      Zuerst einmal kommen die Tibberdatenpunkte folgender maßen an.
      Screenshot 2023-01-04 162404.jpg

      Ich habe nun bis jetzt nur den Hausspeicher integriert das Auto soll noch folgen, nur ich möchte eure Meinung dazuhören, ich würde das Projekt gerne gemeinsam voranbringen.

      Es gibt aktuell 3 Scripte, die ersten beiden machen nur eine Liste aus Tibberconnect zwischen 19-23 Uhr und zwischen 0-5Uhr, da hier meist die Preise am günstigsten sind, die beiden Datenpunkte zu den Scripten werden erstellt. Hier gibt es dann Mindest und Höchstwert

      Diese Datenpunkte brauchen wir für das Hauptscript, daß die Logik enthält.

      Vieles kann man einmal ausfüllen, doch vieles geht mit einfachen ausfüllen nicht, hier bitte ich @paul53 uns behilflich zu sein (Paul wurde diesbezüglich von mir bereits gefragt).

      Ich würde sagen schießt mal los und macht mich fertig, aktuell geht es einfach nciht besser sowas auf die Reihe zu bekommen, nur ich sehe hier viele User die genau zu diesem Thema Hilfe suchen, dies kann es vielleicht ein wenig erleichtern.
      Ich hoffe auch, daß wir das Projekt zusammen weiterführen.

      Hier meine Scripte.
      Script 1 Höchst und Mindestpreis von 0-5 Uhr

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id=":taPEF|OA3],C`ZVh*2+">preisliste</variable>
          <variable id="n1c!w}q(8+Nej#`|99*4">Preis_0_Uhr</variable>
          <variable id="+8H)%x~!7x`dRHSNYM*t">Preis_01_Uhr</variable>
          <variable id="ud,za*TX~^/qCF%RL|~h">Preis_02_Uhr</variable>
          <variable id="6yWUmC5Iax2090wEylOU">Preis_03_Uhr</variable>
          <variable id="RS/yNelwPzsGNN$NUvIV">Preis_04_Uhr</variable>
          <variable id=")5bd{9z9(%1DriBP3hmJ">Preis_05_Uhr</variable>
          <variable id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</variable>
          <variable id="O`PieEZ:0b5/eQ$FQ7Y5">Niedrigstpreist_0_5Uhr</variable>
          <variable id="Fk%)ju,SajNIbR!:!)4s">Höchstpreis_0_5Uhr</variable>
        </variables>
        <block type="create" id=";g)lhW?AnZ!qiR)c~VPy" x="138" y="13">
          <field name="NAME">0_userdata.0.Tibber.Bester_Preis.Höchstpreis_0-5Uhr</field>
          <value name="VALUE">
            <block type="text" id="MpGDBVBvkc96xgn_M(!x">
              <field name="TEXT">0</field>
            </block>
          </value>
          <value name="COMMON">
            <block type="text" id="DmTYmg!t)6zr+fF@!-_k">
              <field name="TEXT">{ "type": "number", "min": 0, "max": 100, "unit": "€" }</field>
            </block>
          </value>
          <next>
            <block type="create" id=":_obTCM~bb[4:ET-a7:`">
              <field name="NAME">0_userdata.0.Tibber.Bester_Preis.Niedrigstpreis_0-5Uhr</field>
              <value name="VALUE">
                <block type="text" id="T57eKs{igcSts%[D:Cng">
                  <field name="TEXT">0</field>
                </block>
              </value>
              <value name="COMMON">
                <block type="text" id="2p%uJ_7sR^k)%zSC8]|9">
                  <field name="TEXT">{ "type": "number", "min": 0, "max": 100, "unit": "€" }</field>
                </block>
              </value>
              <next>
                <block type="on_ext" id="Jxm;kpaqI!;6e7gR.mg2">
                  <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="g{GpEh@zet4t$g?`{k%7">
                      <field name="oid">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.0.total</field>
                    </shadow>
                  </value>
                  <statement name="STATEMENT">
                    <block type="variables_set" id="E6/-orxu^9._BQ]*:iG.">
                      <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                      <value name="VALUE">
                        <block type="lists_create_with" id="J`9^uZH04gDejGVC-zHP">
                          <mutation items="6"></mutation>
                          <value name="ADD0">
                            <block type="get_value" id="mB4wl5/e]xDyH::S{2T`">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.0.total</field>
                            </block>
                          </value>
                          <value name="ADD1">
                            <block type="get_value" id="nh=ud.rhNt2+YPj*+(K]">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.1.total</field>
                            </block>
                          </value>
                          <value name="ADD2">
                            <block type="get_value" id="s66+`HDoO$6hrW9V7N{O">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.2.total</field>
                            </block>
                          </value>
                          <value name="ADD3">
                            <block type="get_value" id="OK)8~ettS1U~FkB~uCw6">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.3.total</field>
                            </block>
                          </value>
                          <value name="ADD4">
                            <block type="get_value" id="7l6%6DRJl!2Pu3f`blwb">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.4.total</field>
                            </block>
                          </value>
                          <value name="ADD5">
                            <block type="get_value" id="q=|E$XJ-nRg2;3#k8#K8">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.5.total</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="af?A2jq;b#uUf#^)~;[B">
                          <field name="VAR" id="n1c!w}q(8+Nej#`|99*4">Preis_0_Uhr</field>
                          <value name="VALUE">
                            <block type="lists_getIndex" id="[~S:/!D_GBdnxqM4+C}p">
                              <mutation statement="false" at="true"></mutation>
                              <field name="MODE">GET</field>
                              <field name="WHERE">FROM_START</field>
                              <value name="VALUE">
                                <block type="variables_get" id="!cfBOJAlcJqXe7(Hc.V$">
                                  <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                </block>
                              </value>
                              <value name="AT">
                                <block type="math_number" id="pXs)n$E}@LDNf-,^s7WM">
                                  <field name="NUM">1</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <next>
                            <block type="variables_set" id="(*Erc#;vQx7~L-!ZJZ}d">
                              <field name="VAR" id="+8H)%x~!7x`dRHSNYM*t">Preis_01_Uhr</field>
                              <value name="VALUE">
                                <block type="lists_getIndex" id="(?8~B~:z-rKxlw+_;0K:">
                                  <mutation statement="false" at="true"></mutation>
                                  <field name="MODE">GET</field>
                                  <field name="WHERE">FROM_START</field>
                                  <value name="VALUE">
                                    <block type="variables_get" id="l?*.4cJH|dGK*se)Ju}?">
                                      <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                    </block>
                                  </value>
                                  <value name="AT">
                                    <block type="math_number" id="D-)?]70|G=}}_1WsmurI">
                                      <field name="NUM">2</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="variables_set" id="v:Dhu5t7VFOvGK|@tUi#">
                                  <field name="VAR" id="ud,za*TX~^/qCF%RL|~h">Preis_02_Uhr</field>
                                  <value name="VALUE">
                                    <block type="lists_getIndex" id="x|nB{0OFK4T,f,jvt_]a">
                                      <mutation statement="false" at="true"></mutation>
                                      <field name="MODE">GET</field>
                                      <field name="WHERE">FROM_START</field>
                                      <value name="VALUE">
                                        <block type="variables_get" id="n_Z|#{P0@HoemJSz55@+">
                                          <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                        </block>
                                      </value>
                                      <value name="AT">
                                        <block type="math_number" id="hM6yiox`s[ZCQJ(ql+@`">
                                          <field name="NUM">3</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="variables_set" id="Ht!Qp`2k-|j+-oIj,}]~">
                                      <field name="VAR" id="6yWUmC5Iax2090wEylOU">Preis_03_Uhr</field>
                                      <value name="VALUE">
                                        <block type="lists_getIndex" id="!`-,A9,F|)l;OVd_0hge">
                                          <mutation statement="false" at="true"></mutation>
                                          <field name="MODE">GET</field>
                                          <field name="WHERE">FROM_START</field>
                                          <value name="VALUE">
                                            <block type="variables_get" id="%XTq+tT;|@0;W_5_;fA?">
                                              <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                            </block>
                                          </value>
                                          <value name="AT">
                                            <block type="math_number" id="{;=o~ZQ{B9N~@rxOAh[m">
                                              <field name="NUM">4</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="variables_set" id="N))r#7HY7@l95!p:!o20">
                                          <field name="VAR" id="RS/yNelwPzsGNN$NUvIV">Preis_04_Uhr</field>
                                          <value name="VALUE">
                                            <block type="lists_getIndex" id="lVz@rTEAFgVfWSGE/2Er">
                                              <mutation statement="false" at="true"></mutation>
                                              <field name="MODE">GET</field>
                                              <field name="WHERE">FROM_START</field>
                                              <value name="VALUE">
                                                <block type="variables_get" id="k[B}/J/KM-(ywPN5]l|V">
                                                  <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                                </block>
                                              </value>
                                              <value name="AT">
                                                <block type="math_number" id="/?JJI;]%8Q)Z{~L!|D7,">
                                                  <field name="NUM">5</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="variables_set" id="=`n@9;/(cE+}O)ZNrj^a">
                                              <field name="VAR" id=")5bd{9z9(%1DriBP3hmJ">Preis_05_Uhr</field>
                                              <value name="VALUE">
                                                <block type="lists_getIndex" id="5jl,N8VlZ+A{aOnq(Cpy">
                                                  <mutation statement="false" at="true"></mutation>
                                                  <field name="MODE">GET</field>
                                                  <field name="WHERE">FROM_START</field>
                                                  <value name="VALUE">
                                                    <block type="variables_get" id="af/TF4U]LfbcKBEFcf^Y">
                                                      <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                                    </block>
                                                  </value>
                                                  <value name="AT">
                                                    <block type="math_number" id="u:XX^}-68rIO0%a%kOu@">
                                                      <field name="NUM">6</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="lJKqihB/)a,w1),=T;x@">
                                                  <field name="VAR" id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</field>
                                                  <value name="VALUE">
                                                    <block type="lists_create_with" id="LJHRJVnnV!{0/X87cY9T">
                                                      <mutation items="6"></mutation>
                                                      <value name="ADD0">
                                                        <block type="variables_get" id="SYLmc}CAjRXeP)J.^#Q[">
                                                          <field name="VAR" id="n1c!w}q(8+Nej#`|99*4">Preis_0_Uhr</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD1">
                                                        <block type="variables_get" id="v/Wp/Hf4lho-_{cB:Vf~">
                                                          <field name="VAR" id="+8H)%x~!7x`dRHSNYM*t">Preis_01_Uhr</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD2">
                                                        <block type="variables_get" id="Wr!)(Z]rR*{t~kCfMDeT">
                                                          <field name="VAR" id="ud,za*TX~^/qCF%RL|~h">Preis_02_Uhr</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD3">
                                                        <block type="variables_get" id="QzMk!Nl5B1!o,Q1PUpxp">
                                                          <field name="VAR" id="6yWUmC5Iax2090wEylOU">Preis_03_Uhr</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD4">
                                                        <block type="variables_get" id="dxMP!eV=6/4_+ii5?2FY">
                                                          <field name="VAR" id="RS/yNelwPzsGNN$NUvIV">Preis_04_Uhr</field>
                                                        </block>
                                                      </value>
                                                      <value name="ADD5">
                                                        <block type="variables_get" id="UAT^DvRmIm5p){lpd47}">
                                                          <field name="VAR" id=")5bd{9z9(%1DriBP3hmJ">Preis_05_Uhr</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id="o=-Uv:%,oY4]S%a=![e9">
                                                      <field name="VAR" id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</field>
                                                      <value name="VALUE">
                                                        <block type="lists_sort" id="bEc%{jF:k#-[wHej{@Kc">
                                                          <field name="TYPE">NUMERIC</field>
                                                          <field name="DIRECTION">1</field>
                                                          <value name="LIST">
                                                            <block type="variables_get" id="HC^knpB^4Q(b36%7!!4f">
                                                              <field name="VAR" id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="variables_set" id="B:w!n.rCgGPUBFRvV!O!">
                                                          <field name="VAR" id="O`PieEZ:0b5/eQ$FQ7Y5">Niedrigstpreist_0_5Uhr</field>
                                                          <value name="VALUE">
                                                            <block type="lists_getIndex" id="xFC.S(-Lna]zz:w-)S?o">
                                                              <mutation statement="false" at="true"></mutation>
                                                              <field name="MODE">GET</field>
                                                              <field name="WHERE">FROM_START</field>
                                                              <value name="VALUE">
                                                                <block type="variables_get" id="VNul9U?R^zRXFbR{@}5*">
                                                                  <field name="VAR" id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</field>
                                                                </block>
                                                              </value>
                                                              <value name="AT">
                                                                <block type="math_number" id="5hG,E+:BU0Q_3b]H~X;G">
                                                                  <field name="NUM">1</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="variables_set" id="WmPcgku15TD;2RIa(aba">
                                                              <field name="VAR" id="Fk%)ju,SajNIbR!:!)4s">Höchstpreis_0_5Uhr</field>
                                                              <value name="VALUE">
                                                                <block type="lists_getIndex" id="7~,IqVhHBBhzuVWB}rSe">
                                                                  <mutation statement="false" at="true"></mutation>
                                                                  <field name="MODE">GET</field>
                                                                  <field name="WHERE">FROM_START</field>
                                                                  <value name="VALUE">
                                                                    <block type="variables_get" id="]yWntlm$t{ZVPP8UM;nZ">
                                                                      <field name="VAR" id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="AT">
                                                                    <block type="math_number" id="wJ)GXNWmSkw(iK0_yGuT">
                                                                      <field name="NUM">6</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="update" id="YU%Ef%6s?),eF)`YTq$.">
                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                  <field name="OID">0_userdata.0.Tibber.Bester_Preis.Höchstpreis_0-5Uhr</field>
                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                  <value name="VALUE">
                                                                    <block type="variables_get" id="5F1bWxbudNk{iY}S0}B:">
                                                                      <field name="VAR" id="Fk%)ju,SajNIbR!:!)4s">Höchstpreis_0_5Uhr</field>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="update" id="0cRXYoN3/dAL8#q(qhil">
                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                      <field name="OID">0_userdata.0.Tibber.Bester_Preis.Niedrigstpreis_0-5Uhr</field>
                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                      <value name="VALUE">
                                                                        <block type="variables_get" id="p:js(QR.k.{{-[;(M*C:">
                                                                          <field name="VAR" id="O`PieEZ:0b5/eQ$FQ7Y5">Niedrigstpreist_0_5Uhr</field>
                                                                        </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>
                  </statement>
                </block>
              </next>
            </block>
          </next>
        </block>
      </xml>
      

      Script 2 Höchst und Mindestpreis von 19-23 Uhr

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id=":taPEF|OA3],C`ZVh*2+">preisliste</variable>
          <variable id="n1c!w}q(8+Nej#`|99*4">Preis_19_Uhr</variable>
          <variable id="+8H)%x~!7x`dRHSNYM*t">Preis_20_Uhr</variable>
          <variable id="ud,za*TX~^/qCF%RL|~h">Preis_21_Uhr</variable>
          <variable id="6yWUmC5Iax2090wEylOU">Preis_22_Uhr</variable>
          <variable id="RS/yNelwPzsGNN$NUvIV">Preis_23_Uhr</variable>
          <variable id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</variable>
          <variable id="O`PieEZ:0b5/eQ$FQ7Y5">Niedriegstpreis_19_23Uhr</variable>
          <variable id="Fk%)ju,SajNIbR!:!)4s">Höchstpreis_19_23Uhr</variable>
        </variables>
        <block type="create" id=";g)lhW?AnZ!qiR)c~VPy" x="138" y="13">
          <field name="NAME">0_userdata.0.Tibber.Bester_Preis.Höchstpreis_19-23Uhr</field>
          <value name="VALUE">
            <block type="text" id="MpGDBVBvkc96xgn_M(!x">
              <field name="TEXT">0</field>
            </block>
          </value>
          <value name="COMMON">
            <block type="text" id="DmTYmg!t)6zr+fF@!-_k">
              <field name="TEXT">{ "type": "number", "min": 0, "max": 100, "unit": "€" }</field>
            </block>
          </value>
          <next>
            <block type="create" id=":_obTCM~bb[4:ET-a7:`">
              <field name="NAME">0_userdata.0.Tibber.Bester_Preis.Niedrigstpreis_19-23Uhr</field>
              <value name="VALUE">
                <block type="text" id="T57eKs{igcSts%[D:Cng">
                  <field name="TEXT">0</field>
                </block>
              </value>
              <value name="COMMON">
                <block type="text" id="2p%uJ_7sR^k)%zSC8]|9">
                  <field name="TEXT">{ "type": "number", "min": 0, "max": 100, "unit": "€" }</field>
                </block>
              </value>
              <next>
                <block type="on_ext" id="R;kHw(@I39F24eV^KcI+">
                  <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="O4TTF.2:w86Wzc-$9)u3">
                      <field name="oid">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.0.total</field>
                    </shadow>
                  </value>
                  <statement name="STATEMENT">
                    <block type="variables_set" id="E6/-orxu^9._BQ]*:iG.">
                      <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                      <value name="VALUE">
                        <block type="lists_create_with" id="J`9^uZH04gDejGVC-zHP">
                          <mutation items="5"></mutation>
                          <value name="ADD0">
                            <block type="get_value" id="mB4wl5/e]xDyH::S{2T`">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.19.total</field>
                            </block>
                          </value>
                          <value name="ADD1">
                            <block type="get_value" id="nh=ud.rhNt2+YPj*+(K]">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.20.total</field>
                            </block>
                          </value>
                          <value name="ADD2">
                            <block type="get_value" id="s66+`HDoO$6hrW9V7N{O">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.21.total</field>
                            </block>
                          </value>
                          <value name="ADD3">
                            <block type="get_value" id="OK)8~ettS1U~FkB~uCw6">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.22.total</field>
                            </block>
                          </value>
                          <value name="ADD4">
                            <block type="get_value" id="7l6%6DRJl!2Pu3f`blwb">
                              <field name="ATTR">val</field>
                              <field name="OID">tibberconnect.0.Homes.ef9611f1-6e89-47ae-8966-ce359e21b819.PricesToday.23.total</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="af?A2jq;b#uUf#^)~;[B">
                          <field name="VAR" id="n1c!w}q(8+Nej#`|99*4">Preis_19_Uhr</field>
                          <value name="VALUE">
                            <block type="lists_getIndex" id="[~S:/!D_GBdnxqM4+C}p">
                              <mutation statement="false" at="true"></mutation>
                              <field name="MODE">GET</field>
                              <field name="WHERE">FROM_START</field>
                              <value name="VALUE">
                                <block type="variables_get" id="!cfBOJAlcJqXe7(Hc.V$">
                                  <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                </block>
                              </value>
                              <value name="AT">
                                <block type="math_number" id="pXs)n$E}@LDNf-,^s7WM">
                                  <field name="NUM">1</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <next>
                            <block type="variables_set" id="(*Erc#;vQx7~L-!ZJZ}d">
                              <field name="VAR" id="+8H)%x~!7x`dRHSNYM*t">Preis_20_Uhr</field>
                              <value name="VALUE">
                                <block type="lists_getIndex" id="(?8~B~:z-rKxlw+_;0K:">
                                  <mutation statement="false" at="true"></mutation>
                                  <field name="MODE">GET</field>
                                  <field name="WHERE">FROM_START</field>
                                  <value name="VALUE">
                                    <block type="variables_get" id="l?*.4cJH|dGK*se)Ju}?">
                                      <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                    </block>
                                  </value>
                                  <value name="AT">
                                    <block type="math_number" id="D-)?]70|G=}}_1WsmurI">
                                      <field name="NUM">2</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="variables_set" id="v:Dhu5t7VFOvGK|@tUi#">
                                  <field name="VAR" id="ud,za*TX~^/qCF%RL|~h">Preis_21_Uhr</field>
                                  <value name="VALUE">
                                    <block type="lists_getIndex" id="x|nB{0OFK4T,f,jvt_]a">
                                      <mutation statement="false" at="true"></mutation>
                                      <field name="MODE">GET</field>
                                      <field name="WHERE">FROM_START</field>
                                      <value name="VALUE">
                                        <block type="variables_get" id="n_Z|#{P0@HoemJSz55@+">
                                          <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                        </block>
                                      </value>
                                      <value name="AT">
                                        <block type="math_number" id="hM6yiox`s[ZCQJ(ql+@`">
                                          <field name="NUM">3</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="variables_set" id="Ht!Qp`2k-|j+-oIj,}]~">
                                      <field name="VAR" id="6yWUmC5Iax2090wEylOU">Preis_22_Uhr</field>
                                      <value name="VALUE">
                                        <block type="lists_getIndex" id="!`-,A9,F|)l;OVd_0hge">
                                          <mutation statement="false" at="true"></mutation>
                                          <field name="MODE">GET</field>
                                          <field name="WHERE">FROM_START</field>
                                          <value name="VALUE">
                                            <block type="variables_get" id="%XTq+tT;|@0;W_5_;fA?">
                                              <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                            </block>
                                          </value>
                                          <value name="AT">
                                            <block type="math_number" id="{;=o~ZQ{B9N~@rxOAh[m">
                                              <field name="NUM">4</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="variables_set" id="N))r#7HY7@l95!p:!o20">
                                          <field name="VAR" id="RS/yNelwPzsGNN$NUvIV">Preis_23_Uhr</field>
                                          <value name="VALUE">
                                            <block type="lists_getIndex" id="lVz@rTEAFgVfWSGE/2Er">
                                              <mutation statement="false" at="true"></mutation>
                                              <field name="MODE">GET</field>
                                              <field name="WHERE">FROM_START</field>
                                              <value name="VALUE">
                                                <block type="variables_get" id="k[B}/J/KM-(ywPN5]l|V">
                                                  <field name="VAR" id=":taPEF|OA3],C`ZVh*2+">preisliste</field>
                                                </block>
                                              </value>
                                              <value name="AT">
                                                <block type="math_number" id="/?JJI;]%8Q)Z{~L!|D7,">
                                                  <field name="NUM">5</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="variables_set" id="lJKqihB/)a,w1),=T;x@">
                                              <field name="VAR" id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</field>
                                              <value name="VALUE">
                                                <block type="lists_create_with" id="LJHRJVnnV!{0/X87cY9T">
                                                  <mutation items="5"></mutation>
                                                  <value name="ADD0">
                                                    <block type="variables_get" id="SYLmc}CAjRXeP)J.^#Q[">
                                                      <field name="VAR" id="n1c!w}q(8+Nej#`|99*4">Preis_19_Uhr</field>
                                                    </block>
                                                  </value>
                                                  <value name="ADD1">
                                                    <block type="variables_get" id="v/Wp/Hf4lho-_{cB:Vf~">
                                                      <field name="VAR" id="+8H)%x~!7x`dRHSNYM*t">Preis_20_Uhr</field>
                                                    </block>
                                                  </value>
                                                  <value name="ADD2">
                                                    <block type="variables_get" id="Wr!)(Z]rR*{t~kCfMDeT">
                                                      <field name="VAR" id="ud,za*TX~^/qCF%RL|~h">Preis_21_Uhr</field>
                                                    </block>
                                                  </value>
                                                  <value name="ADD3">
                                                    <block type="variables_get" id="QzMk!Nl5B1!o,Q1PUpxp">
                                                      <field name="VAR" id="6yWUmC5Iax2090wEylOU">Preis_22_Uhr</field>
                                                    </block>
                                                  </value>
                                                  <value name="ADD4">
                                                    <block type="variables_get" id="dxMP!eV=6/4_+ii5?2FY">
                                                      <field name="VAR" id="RS/yNelwPzsGNN$NUvIV">Preis_23_Uhr</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="o=-Uv:%,oY4]S%a=![e9">
                                                  <field name="VAR" id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</field>
                                                  <value name="VALUE">
                                                    <block type="lists_sort" id="bEc%{jF:k#-[wHej{@Kc">
                                                      <field name="TYPE">NUMERIC</field>
                                                      <field name="DIRECTION">1</field>
                                                      <value name="LIST">
                                                        <block type="variables_get" id="HC^knpB^4Q(b36%7!!4f">
                                                          <field name="VAR" id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id="B:w!n.rCgGPUBFRvV!O!">
                                                      <field name="VAR" id="O`PieEZ:0b5/eQ$FQ7Y5">Niedriegstpreis_19_23Uhr</field>
                                                      <value name="VALUE">
                                                        <block type="lists_getIndex" id="xFC.S(-Lna]zz:w-)S?o">
                                                          <mutation statement="false" at="true"></mutation>
                                                          <field name="MODE">GET</field>
                                                          <field name="WHERE">FROM_START</field>
                                                          <value name="VALUE">
                                                            <block type="variables_get" id="VNul9U?R^zRXFbR{@}5*">
                                                              <field name="VAR" id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</field>
                                                            </block>
                                                          </value>
                                                          <value name="AT">
                                                            <block type="math_number" id="5hG,E+:BU0Q_3b]H~X;G">
                                                              <field name="NUM">1</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="variables_set" id="WmPcgku15TD;2RIa(aba">
                                                          <field name="VAR" id="Fk%)ju,SajNIbR!:!)4s">Höchstpreis_19_23Uhr</field>
                                                          <value name="VALUE">
                                                            <block type="lists_getIndex" id="7~,IqVhHBBhzuVWB}rSe">
                                                              <mutation statement="false" at="true"></mutation>
                                                              <field name="MODE">GET</field>
                                                              <field name="WHERE">FROM_START</field>
                                                              <value name="VALUE">
                                                                <block type="variables_get" id="]yWntlm$t{ZVPP8UM;nZ">
                                                                  <field name="VAR" id="z:!j=LF{]qlVp)bMVA}s">preisliste_sortiert</field>
                                                                </block>
                                                              </value>
                                                              <value name="AT">
                                                                <block type="math_number" id="wJ)GXNWmSkw(iK0_yGuT">
                                                                  <field name="NUM">5</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="update" id="YU%Ef%6s?),eF)`YTq$.">
                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                              <field name="OID">0_userdata.0.Tibber.Bester_Preis.Höchstpreis_19-23Uhr</field>
                                                              <field name="WITH_DELAY">FALSE</field>
                                                              <value name="VALUE">
                                                                <block type="variables_get" id="5F1bWxbudNk{iY}S0}B:">
                                                                  <field name="VAR" id="Fk%)ju,SajNIbR!:!)4s">Höchstpreis_19_23Uhr</field>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="update" id="OHavlRE4V^-7M~le`gC$">
                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                  <field name="OID">0_userdata.0.Tibber.Bester_Preis.Niedrigstpreis_19-23Uhr</field>
                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                  <value name="VALUE">
                                                                    <block type="variables_get" id="eC?ovVgVm*XhAQ}ayPA*">
                                                                      <field name="VAR" id="O`PieEZ:0b5/eQ$FQ7Y5">Niedriegstpreis_19_23Uhr</field>
                                                                    </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>
                  </statement>
                </block>
              </next>
            </block>
          </next>
        </block>
      </xml>
      
      B paul53 3 Replies Last reply Reply Quote 0
      • B
        babl @babl last edited by

        Script 3 ist zu lang hier es reinzukopieren.

        Script 3.txt

        Auf gute Zusammenarbeit

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

          Im Script 3 gibt es einige Sachen wo ich so nicht weiterkomme, zum 1. Wie könnte man das lösen wenn der Speicher 2 Stunden zum laden braucht die besten 2 Punkte zu finden.

          Das mit der Hauptabsicherung muß geklärt werden.

          Hausspeicher User Soc datenpunkt, warum wird der unten in Batteriespeicher laden nicht berücksichtigt und ich muß den reelllen Datenpunkt eingeben. Wie könnte man das mit Variablen lösen?

          Als weiteres Script kann ich euch das dynamische Berechnen und die Ersparnisse mit den dynamischen Tarifen anbieten. (Hier geht mein Dank wieder an @paul53 der dieses Script eigentlich ganz entwickelt hat. Aber es funktioniert einbahnfrei.
          Anbei das Script:

          <xml xmlns="https://developers.google.com/blockly/xml">
            <variables>
              <variable id="~bv5l}lJAJ*QvjiCf8}D">KWH-Ein</variable>
              <variable id="mF/M_`BC;9tQ27;~)Kbi">Kosten</variable>
              <variable id="yli#ydUr0RWm~eEx_+qc">kWhStart</variable>
              <variable id="GcZ0LGBgi2+CQDV+Ml8U">kWhEnde</variable>
              <variable id="1FxLO6;u5+HXu78D?dr~">kWhStunde</variable>
            </variables>
            <block type="variables_set" id="f(Impw@FbLMot:4tHn9)" x="63" y="88">
              <field name="VAR" id="~bv5l}lJAJ*QvjiCf8}D">KWH-Ein</field>
              <value name="VALUE">
                <block type="get_value" id="%zwH}7swA`wsSE_xpl!+">
                  <field name="ATTR">val</field>
                  <field name="OID">sourceanalytix.0.0_userdata__0__netzbezug.cumulativeReading</field>
                </block>
              </value>
              <next>
                <block type="variables_set" id="8QjP{,ABWGo{?@kz]]h/">
                  <field name="VAR" id="mF/M_`BC;9tQ27;~)Kbi">Kosten</field>
                  <value name="VALUE">
                    <block type="math_number" id="krcx/{eaKV3ruP!2S.-m">
                      <field name="NUM">0</field>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="aKBC7~ZF5s-Y4ocrU3]-">
                      <field name="VAR" id="yli#ydUr0RWm~eEx_+qc">kWhStart</field>
                      <value name="VALUE">
                        <block type="variables_get" id="mKs:yvT6pf)(+m*DN@4[">
                          <field name="VAR" id="~bv5l}lJAJ*QvjiCf8}D">KWH-Ein</field>
                        </block>
                      </value>
                      <next>
                        <block type="on_ext" id="I|k$!JS[Z/E3JHtWDT_w">
                          <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="+bCQzw0[Z0*;H;%:CHoL">
                              <field name="oid">0_userdata.0.SB_10_manuell_laden</field>
                            </shadow>
                          </value>
                          <statement name="STATEMENT">
                            <block type="controls_if" id="G1EVoPhC%xx|%num]%Uz">
                              <mutation else="1"></mutation>
                              <value name="IF0">
                                <block type="on_source" id=",XiBVQbvl@]c[k9hE72P">
                                  <field name="ATTR">state.val</field>
                                </block>
                              </value>
                              <statement name="DO0">
                                <block type="variables_set" id="{w-Wf*y?0BX-i]qsCny?">
                                  <field name="VAR" id="~bv5l}lJAJ*QvjiCf8}D">KWH-Ein</field>
                                  <value name="VALUE">
                                    <block type="get_value" id="VP$b-Gc*I#~TDnHt`y9N">
                                      <field name="ATTR">val</field>
                                      <field name="OID">sourceanalytix.0.0_userdata__0__netzbezug.cumulativeReading</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="variables_set" id="??:W/Nd/3Zp*@AhV=%$0">
                                      <field name="VAR" id="yli#ydUr0RWm~eEx_+qc">kWhStart</field>
                                      <value name="VALUE">
                                        <block type="variables_get" id="FPOd?Q-Ead?/U)muJonY">
                                          <field name="VAR" id="~bv5l}lJAJ*QvjiCf8}D">KWH-Ein</field>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="variables_set" id="L/}|ZJ){q4cQK`H7bI9M">
                                          <field name="VAR" id="mF/M_`BC;9tQ27;~)Kbi">Kosten</field>
                                          <value name="VALUE">
                                            <block type="math_number" id="w,=2S;vWAQ]y(r3N#JvI">
                                              <field name="NUM">0</field>
                                            </block>
                                          </value>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                              <statement name="ELSE">
                                <block type="variables_set" id="H-OWOCnVehtKG^6qiq@3">
                                  <field name="VAR" id="GcZ0LGBgi2+CQDV+Ml8U">kWhEnde</field>
                                  <value name="VALUE">
                                    <block type="get_value" id="z3JeZ:FG1y3Nwn[8KTvA">
                                      <field name="ATTR">val</field>
                                      <field name="OID">sourceanalytix.0.0_userdata__0__netzbezug.cumulativeReading</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="math_change" id="[15V=b-1%miyl`w}tky0">
                                      <field name="VAR" id="mF/M_`BC;9tQ27;~)Kbi">Kosten</field>
                                      <value name="DELTA">
                                        <shadow type="math_number" id="8Sn,@`@iT_M2gG|:phv)">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="math_arithmetic" id="1-g856BSw%8`7bV5y^YX" inline="false">
                                          <field name="OP">MULTIPLY</field>
                                          <value name="A">
                                            <shadow type="math_number" id=",YmSizo08~k2Kdu]nm_I">
                                              <field name="NUM">1</field>
                                            </shadow>
                                            <block type="get_value" id="L2N[9lo,YwlVz;rraw4f">
                                              <field name="ATTR">val</field>
                                              <field name="OID">tibber.0.priceInfo.current.total</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <shadow type="math_number" id="J)vkcIKw#*]=8%=zSDVj">
                                              <field name="NUM">1</field>
                                            </shadow>
                                            <block type="math_arithmetic" id="w%E~OkTN(e@o9+iVwvY0">
                                              <field name="OP">MINUS</field>
                                              <value name="A">
                                                <shadow type="math_number" id=".Yu#^d7D,*$t_XzR/sDW">
                                                  <field name="NUM">1</field>
                                                </shadow>
                                                <block type="variables_get" id="o)Vcy_OR-bIC6+Loi0X4">
                                                  <field name="VAR" id="GcZ0LGBgi2+CQDV+Ml8U">kWhEnde</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <shadow type="math_number" id=")yXjkl:.bV=bb2%|0N0;">
                                                  <field name="NUM">1</field>
                                                </shadow>
                                                <block type="variables_get" id="oJ6Yk,`3j%%Wz,379+M/">
                                                  <field name="VAR" id="~bv5l}lJAJ*QvjiCf8}D">KWH-Ein</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="update" id="EGM}$Q:?(5ru_6[n~i0k">
                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                          <field name="OID">0_userdata.0.Tibber.Stromkosten_Tibber</field>
                                          <field name="WITH_DELAY">FALSE</field>
                                          <value name="VALUE">
                                            <block type="variables_get" id="=k~m{lCc~%Q6[:mU,amL">
                                              <field name="VAR" id="mF/M_`BC;9tQ27;~)Kbi">Kosten</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="update" id="o#$9,br8MrIrK:y1}|fS">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                              <field name="OID">0_userdata.0.Tibber.verbrauchte-Kwh</field>
                                              <field name="WITH_DELAY">FALSE</field>
                                              <value name="VALUE">
                                                <block type="math_arithmetic" id="Kx@ha8z,xaB7;:b~r@}j">
                                                  <field name="OP">MINUS</field>
                                                  <value name="A">
                                                    <shadow type="math_number" id="^.zS_dkuOK=azX[+q?eY">
                                                      <field name="NUM">1</field>
                                                    </shadow>
                                                    <block type="variables_get" id="mQyiC#;hhvZ[`w@?asm_">
                                                      <field name="VAR" id="GcZ0LGBgi2+CQDV+Ml8U">kWhEnde</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <shadow type="math_number">
                                                      <field name="NUM">1</field>
                                                    </shadow>
                                                    <block type="variables_get" id="T?/SP|*Y_#Wik.P76)FY">
                                                      <field name="VAR" id="yli#ydUr0RWm~eEx_+qc">kWhStart</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                            </block>
                          </statement>
                          <next>
                            <block type="on_ext" id="xY{E]_r$nK7:GmjKI4HI">
                              <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="jC5AUn]cZ)!dR|zPhbd4">
                                  <field name="oid">tibber.0.priceInfo.current.total</field>
                                </shadow>
                              </value>
                              <statement name="STATEMENT">
                                <block type="variables_set" id=")cis05nu?2tVd%5.qDGf">
                                  <field name="VAR" id="1FxLO6;u5+HXu78D?dr~">kWhStunde</field>
                                  <value name="VALUE">
                                    <block type="get_value" id="nvt1|ycu|YVOZn^#QO]w">
                                      <field name="ATTR">val</field>
                                      <field name="OID">sourceanalytix.0.0_userdata__0__netzbezug.cumulativeReading</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="math_change" id="@e1vcrk3i[E#VpJ)R1Hc">
                                      <field name="VAR" id="mF/M_`BC;9tQ27;~)Kbi">Kosten</field>
                                      <value name="DELTA">
                                        <shadow type="math_number" id=",NINoZ;(8H(uZp/4U=Q~">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="math_arithmetic" id="dC^+t{P9f+Sx9w;|nk@`">
                                          <field name="OP">MULTIPLY</field>
                                          <value name="A">
                                            <shadow type="math_number" id="ukRC~;/{9!0o]i{xymI*">
                                              <field name="NUM">1</field>
                                            </shadow>
                                            <block type="on_source" id="qj/d~$DMnCBwc7^UnZz0">
                                              <field name="ATTR">oldState.val</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <shadow type="math_number">
                                              <field name="NUM">1</field>
                                            </shadow>
                                            <block type="math_arithmetic" id="4,Qb4`;adLZ?y?[yP3uT">
                                              <field name="OP">MINUS</field>
                                              <value name="A">
                                                <shadow type="math_number" id="eXhLomaNY*[fDJ|pMO8u">
                                                  <field name="NUM">1</field>
                                                </shadow>
                                                <block type="variables_get" id="c$SF*W,GMxORc|`Vu._b">
                                                  <field name="VAR" id="1FxLO6;u5+HXu78D?dr~">kWhStunde</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <shadow type="math_number">
                                                  <field name="NUM">1</field>
                                                </shadow>
                                                <block type="variables_get" id="+2sd7tZ5/XyOM%R*jOtI">
                                                  <field name="VAR" id="~bv5l}lJAJ*QvjiCf8}D">KWH-Ein</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="variables_set" id="IMz-bO[CwqJ)(W1^7CQ4">
                                          <field name="VAR" id="~bv5l}lJAJ*QvjiCf8}D">KWH-Ein</field>
                                          <value name="VALUE">
                                            <block type="variables_get" id="N`J{8y)MP?U#!R]a6t]l">
                                              <field name="VAR" id="1FxLO6;u5+HXu78D?dr~">kWhStunde</field>
                                            </block>
                                          </value>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
            <block type="on_ext" id="sGufirhgja7:nP:^?Lk0" x="63" y="838">
              <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=",u7qbvQ`ajuItQl{Yy/Q">
                  <field name="oid">0_userdata.0.Tibber.verbrauchte-Kwh</field>
                </shadow>
              </value>
              <statement name="STATEMENT">
                <block type="update" id="jjvPSkbX:?G_,%nW4S=D">
                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                  <field name="OID">0_userdata.0.Tibber.verbrauchte_Kwh_gesamt</field>
                  <field name="WITH_DELAY">FALSE</field>
                  <value name="VALUE">
                    <block type="math_arithmetic" id=";C_^LiG(jfy=)gmrk}rd">
                      <field name="OP">ADD</field>
                      <value name="A">
                        <shadow type="math_number">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="get_value" id="$Scn7}g=S$cqQ_!--qV+">
                          <field name="ATTR">val</field>
                          <field name="OID">0_userdata.0.Tibber.verbrauchte_Kwh_gesamt</field>
                        </block>
                      </value>
                      <value name="B">
                        <shadow type="math_number">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="get_value" id="LbX;@0F~+YUyDI/lFlsL">
                          <field name="ATTR">val</field>
                          <field name="OID">0_userdata.0.Tibber.verbrauchte-Kwh</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <next>
                    <block type="update" id=")%I+O.n0`k=Kc//Cu4UB">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">0_userdata.0.Tibber.Stromkosten_Tibber_Gesamt</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="math_arithmetic" id="AAcbOY%JK4j2Su%@tn%^">
                          <field name="OP">ADD</field>
                          <value name="A">
                            <shadow type="math_number">
                              <field name="NUM">1</field>
                            </shadow>
                            <block type="get_value" id="OA/?o_9YwSJi0.{hg4T!">
                              <field name="ATTR">val</field>
                              <field name="OID">0_userdata.0.Tibber.Stromkosten_Tibber_Gesamt</field>
                            </block>
                          </value>
                          <value name="B">
                            <shadow type="math_number">
                              <field name="NUM">1</field>
                            </shadow>
                            <block type="get_value" id="8[mq5A?f6GHlp(jQWWAT">
                              <field name="ATTR">val</field>
                              <field name="OID">0_userdata.0.Tibber.Stromkosten_Tibber</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="update" id="s@nZ2P0W.LeIbx7d:T2Q">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">0_userdata.0.Tibber.Stromkosten_Festpreis</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="math_arithmetic" id="-yB8Jn!:ai4Mek93^Ktv">
                              <field name="OP">MULTIPLY</field>
                              <value name="A">
                                <shadow type="math_number">
                                  <field name="NUM">1</field>
                                </shadow>
                                <block type="get_value" id="Kjh,jqVAZBW|iRo[HX+h">
                                  <field name="ATTR">val</field>
                                  <field name="OID">0_userdata.0.Tibber.verbrauchte-Kwh</field>
                                </block>
                              </value>
                              <value name="B">
                                <shadow type="math_number">
                                  <field name="NUM">1</field>
                                </shadow>
                                <block type="get_value" id="]z|3}232YO6aT7Qe%N:G">
                                  <field name="ATTR">val</field>
                                  <field name="OID">0_userdata.0.Tibber.Strompreis_Festpreis</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <next>
                            <block type="update" id="0Tu|R@M9BTR7ZE**4,E}">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                              <field name="OID">0_userdata.0.Tibber.Stromkosten_Festpreis_gesamt</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="math_arithmetic" id="mJ(}R3C6;}4{k4Xnc=8#">
                                  <field name="OP">ADD</field>
                                  <value name="A">
                                    <shadow type="math_number">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="get_value" id="feZSU=#ISY|1mMJ=[%|3">
                                      <field name="ATTR">val</field>
                                      <field name="OID">0_userdata.0.Tibber.Stromkosten_Festpreis_gesamt</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <shadow type="math_number">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="get_value" id="5IuQM0WONZl/YZL|YoD+">
                                      <field name="ATTR">val</field>
                                      <field name="OID">0_userdata.0.Tibber.Stromkosten_Festpreis</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="update" id="Rqh8MS=b|]Fe%0[5@5M0">
                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                  <field name="OID">0_userdata.0.Tibber.Ersparnis</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="math_arithmetic" id="]|v{V#V3f_JXS~N.x!Xz">
                                      <field name="OP">MINUS</field>
                                      <value name="A">
                                        <shadow type="math_number">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="get_value" id="QbXs9v$2ztsxtf+5^Pe9">
                                          <field name="ATTR">val</field>
                                          <field name="OID">0_userdata.0.Tibber.Stromkosten_Tibber_Gesamt</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <shadow type="math_number">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="get_value" id=";26cZNZ1Pv4|0P5ExFv)">
                                          <field name="ATTR">val</field>
                                          <field name="OID">0_userdata.0.Tibber.Stromkosten_Festpreis_gesamt</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
          </xml>
          

          tibber ersparnis dynamisch zu fest.jpg

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

            @babl sagte: Script 1 Höchst und Mindestpreis

            Die Blocklys kann man sich sparen, wenn die Preise sortiert sind (siehe Skript). Der Mindestpreis steht im ersten Element, der Höchstpreis im letzten Element.

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

              @paul53 ja habe ich gesehen, daß du da auf die schnelle ein script gezaubert hast, darf ich das verwenden?

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

                @babl sagte: darf ich das verwenden?

                Ja, natürlich. Das Forum ist öffentlich.

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

                  @paul53 danke, aber eigentlich braucht man ja den ganzen tag nciht, da ich eigentlich noch keinen tag erlebt habe, wo die preise unterm tag tiefer waren als in der nacht, eigentlich sind die 19-23 und 0 - 5 uhr interessant. und dann ergibt es gleich andere werte der mindest und höchstpreise

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

                    @babl sagte: andere werte der mindest und höchstpreise

                    Nur Höchstpreise sollten sich unterscheiden.

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

                    eigentlich sind die 19-23 und 0 - 5 uhr interessant.

                    Das Array einzugrenzen sollte doch kein Problem sein?

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

                      @babl sagte: Script 1 Höchst und Mindestpreis von 0-5 Uhr

                      Du nimmst die Werte von "PricesToday". Ist das korrekt? Müssten es nicht die Werte von "PricesTomorrow" sein? Etwa so?

                      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);
                      });
                      
                      B 1 Reply Last reply Reply Quote 0
                      • B
                        babl @paul53 last edited by

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

                        paul53 1 Reply Last reply Reply Quote 0
                        • paul53
                          paul53 @babl last edited by 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 1 Reply Last reply Reply Quote 1
                          • B
                            babl @paul53 last edited by

                            @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

                            paul53 1 Reply Last reply Reply Quote 0
                            • paul53
                              paul53 @babl last edited by 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 1 Reply Last reply Reply Quote 0
                              • B
                                babl @paul53 last edited by

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

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

                                  @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 1 Reply Last reply Reply Quote 0
                                  • B
                                    babl @paul53 last edited by

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

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

                                      @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 1 Reply Last reply Reply Quote 0
                                      • B
                                        babl @paul53 last edited by

                                        @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

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

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

                                          Welcher Datenpunkt?

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

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

                                            paul53 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            923
                                            Online

                                            31.7k
                                            Users

                                            79.6k
                                            Topics

                                            1.3m
                                            Posts

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