Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Blockly für SB 10 Ladezyklen und Gesundheit

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Blockly für SB 10 Ladezyklen und Gesundheit

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

      So ich habe mich heute mal ran gemacht und ein Blockly geschrieben (als Anfänger) um die Original Ladezyklen der Sonnenbatterie SB 10 auszulesen (da es ja hier seit Anfang an hapert und bei einigen die Ladezyklen nicht richtig gezählt werden). Ebenso habe ich den Zustand der Akkuzellen aus der Batterie Api ausgelesen und dies kann dann in eigene Datenpunkte gespeichert werden.
      Warum habe ich das gemacht, dies hat mir jemand externer als Flows in Node Red geschrieben, aber es werden nur diese beiden ausgelesen somit könnte ich mir den Adapter für Node Red ganz sparen.

      Das Script funktioniert soweit, das einzige was ich noch nicht weiß wie ich das lösen kann ist

      1. bei den Ladezyklen wenn die über 1000 gehen
      2. bei dem Zustand wenn er von 99.0 auf 100 wechselt.

      Ich hoffe hier können mir die Cracks @paul53 unter euch helfen und vielleicht auch das Script noch zu optimieren.

      Als erstes müßtet ihr eure IP Adresse der Batterie eingeben, alles andere wird an die URl rangehängt. Der Abruf des Scripts wird alle Stunde ausgeführt.

      Hier mal als Code:

      <block xmlns="https://developers.google.com/blockly/xml" type="schedule" id="K=~VVW$dsmF:.?Ban:xU" x="113" y="196">
        <field name="SCHEDULE">{"time":{"start":"00:00","end":"24:00","mode":"hours","interval":1},"period":{"days":1}}</field>
        <statement name="STATEMENT">
          <block type="request" id="[dR$K#cK(y!X.Ts]+LGi">
            <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="true"></mutation>
            <field name="WITH_STATEMENT">TRUE</field>
            <field name="LOG">log</field>
            <value name="URL">
              <shadow type="text" id="3#2b-3opeXYlh-JrMHTb">
                <field name="TEXT">http://XXX.XXX.XXX.XX:8080/api/battery</field>
              </shadow>
              <block type="variables_get" id=":7MM_84#(~r6-m+#f-nb">
                <field name="VAR" id="UPIEW`RfxC:l#j^WWT2X">url_api_battery</field>
              </block>
            </value>
            <statement name="STATEMENT">
              <block type="comment" id="paDc?N}K1hYedw(s2u1j">
                <field name="COMMENT">Ladezyklen Sonnenbatterie nur gültig bis max 999</field>
                <next>
                  <block type="variables_set" id="VXISny_)?:d`|qi-3(w6">
                    <field name="VAR" id="@m*;6/yfC0xY}`l+NHJH">cyclecount_position</field>
                    <value name="VALUE">
                      <block type="text_indexOf" id="m~s0sbL_u!C95E%R}_w}">
                        <field name="END">FIRST</field>
                        <value name="VALUE">
                          <block type="variables_get" id=":C(f~N9utj2|ZcphW3AL">
                            <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                          </block>
                        </value>
                        <value name="FIND">
                          <shadow type="text" id="sVzxU`RM?HM+_j4tY5*}">
                            <field name="TEXT">cyclecount</field>
                          </shadow>
                        </value>
                      </block>
                    </value>
                    <next>
                      <block type="variables_set" id="K+1?Fxmof/nmEcu+g%xT">
                        <field name="VAR" id="qYpA~*y}}fWn!X$88M{[">cyclecount_wert_1</field>
                        <value name="VALUE">
                          <block type="text_charAt" id="-cQ@;qukglX$J6~[33/0">
                            <mutation at="true"></mutation>
                            <field name="WHERE">FROM_START</field>
                            <value name="VALUE">
                              <block type="variables_get" id="Q~GhPk!WQY.0Z$ui=X|l">
                                <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                              </block>
                            </value>
                            <value name="AT">
                              <block type="math_arithmetic" id="^%S{(VO%jjB[SPZF!/cJ">
                                <field name="OP">ADD</field>
                                <value name="A">
                                  <shadow type="math_number" id="k|A%T)Jl^wKbTL03pYA)">
                                    <field name="NUM">1</field>
                                  </shadow>
                                  <block type="variables_get" id="qPTLI)jB1C?|Wp5BYD)0">
                                    <field name="VAR" id="@m*;6/yfC0xY}`l+NHJH">cyclecount_position</field>
                                  </block>
                                </value>
                                <value name="B">
                                  <shadow type="math_number" id="eU][q?qyr06oLLLK`2n#">
                                    <field name="NUM">13</field>
                                  </shadow>
                                </value>
                              </block>
                            </value>
                          </block>
                        </value>
                        <next>
                          <block type="variables_set" id="0]@=3nwiD5(-j/+K%3N1">
                            <field name="VAR" id="b,T7S6NY(Z*RdKEl}/eu">cyclecount_wert_2</field>
                            <value name="VALUE">
                              <block type="text_charAt" id="@M~ujxIqw^4.}$|}m9GE">
                                <mutation at="true"></mutation>
                                <field name="WHERE">FROM_START</field>
                                <value name="VALUE">
                                  <block type="variables_get" id="8iNw!q$aIkWbvjd0iEMu">
                                    <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                                  </block>
                                </value>
                                <value name="AT">
                                  <block type="math_arithmetic" id="j64x13z11G|{.K=dExr[">
                                    <field name="OP">ADD</field>
                                    <value name="A">
                                      <shadow type="math_number">
                                        <field name="NUM">1</field>
                                      </shadow>
                                      <block type="variables_get" id="Hb1Nr(k)XrZU.|8N%)uF">
                                        <field name="VAR" id="@m*;6/yfC0xY}`l+NHJH">cyclecount_position</field>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <shadow type="math_number" id="~-kbY-(}3dl?!j2cQ+b@">
                                        <field name="NUM">14</field>
                                      </shadow>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <next>
                              <block type="variables_set" id="E3l,IJc##F,k_v!z}Tp$">
                                <field name="VAR" id="Q4u}VkzpDirk0kuXLgMd">cyclecount_wert_3</field>
                                <value name="VALUE">
                                  <block type="text_charAt" id="i[-Xo2eMgQO5C3YC2C=~">
                                    <mutation at="true"></mutation>
                                    <field name="WHERE">FROM_START</field>
                                    <value name="VALUE">
                                      <block type="variables_get" id="5UXcPfpO-_EU$CL[(:./">
                                        <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                                      </block>
                                    </value>
                                    <value name="AT">
                                      <block type="math_arithmetic" id="S6s0WR#sn*Aj7X8HO:s0">
                                        <field name="OP">ADD</field>
                                        <value name="A">
                                          <shadow type="math_number">
                                            <field name="NUM">1</field>
                                          </shadow>
                                          <block type="variables_get" id="%akt^U8%VAnF8%Kkl:Q4">
                                            <field name="VAR" id="@m*;6/yfC0xY}`l+NHJH">cyclecount_position</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <shadow type="math_number" id="%;Vp$9k4*?(zSL1eu:#P">
                                            <field name="NUM">15</field>
                                          </shadow>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <next>
                                  <block type="variables_set" id="7H|@8f=c@!-%H=Y;nISD">
                                    <field name="VAR" id=":L}Z^QY/Dt;FxE-qsw=A">cyclecount</field>
                                    <value name="VALUE">
                                      <block type="text_join" id="o~j?@(OtV8.$`C.$ZUjj">
                                        <mutation items="3"></mutation>
                                        <value name="ADD0">
                                          <block type="variables_get" id="5L5A#`AhG+X]F:GBW2DI">
                                            <field name="VAR" id="qYpA~*y}}fWn!X$88M{[">cyclecount_wert_1</field>
                                          </block>
                                        </value>
                                        <value name="ADD1">
                                          <block type="variables_get" id="REVO^b5oZWNWA`hZ~*|;">
                                            <field name="VAR" id="b,T7S6NY(Z*RdKEl}/eu">cyclecount_wert_2</field>
                                          </block>
                                        </value>
                                        <value name="ADD2">
                                          <block type="variables_get" id="vL23TLg?[{jSz{gK8Sl*">
                                            <field name="VAR" id="Q4u}VkzpDirk0kuXLgMd">cyclecount_wert_3</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="update" id="~(1cvG{*k[Q8ap0(/6I1">
                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                        <field name="OID">0_userdata.0.test</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="variables_get" id="@=Akm1h/*g!FF_W3[`_I">
                                            <field name="VAR" id=":L}Z^QY/Dt;FxE-qsw=A">cyclecount</field>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="comment" id="sB7_%[PQS6M:~]ByeHf;">
                                            <field name="COMMENT">Gesundheit der Akkuzellen der Batterie</field>
                                            <next>
                                              <block type="variables_set" id="fNr|hkoz/@?3co_SzwE%">
                                                <field name="VAR" id="8N-Qzg;~t6Z:UMz$ErSy">state_of_health_position</field>
                                                <value name="VALUE">
                                                  <block type="text_indexOf" id="TP6^:2kon/vNem8B_nSw">
                                                    <field name="END">FIRST</field>
                                                    <value name="VALUE">
                                                      <block type="variables_get" id="J:PKLt-WFK@(4;kd!X~s">
                                                        <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                                                      </block>
                                                    </value>
                                                    <value name="FIND">
                                                      <shadow type="text" id="[ItG:Ih9Kz9%Th6Wv%RE">
                                                        <field name="TEXT">stateofhealth</field>
                                                      </shadow>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="variables_set" id="NwLn?dz{`qdbTyEqjUjl">
                                                    <field name="VAR" id="!yQ-s()lr;vZ]FqhFnSP">state_of_health_1</field>
                                                    <value name="VALUE">
                                                      <block type="text_charAt" id="-aZZ)!7C?ZDM:h~X.P8I">
                                                        <mutation at="true"></mutation>
                                                        <field name="WHERE">FROM_START</field>
                                                        <value name="VALUE">
                                                          <block type="variables_get" id="N!_y6:;r^w!A._DN?|,1">
                                                            <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                                                          </block>
                                                        </value>
                                                        <value name="AT">
                                                          <block type="math_arithmetic" id="~z1GxL=fg0Lhm_QKr`kf">
                                                            <field name="OP">ADD</field>
                                                            <value name="A">
                                                              <shadow type="math_number">
                                                                <field name="NUM">1</field>
                                                              </shadow>
                                                              <block type="variables_get" id="AEKKF6?j(R[P:7oN;.@F">
                                                                <field name="VAR" id="8N-Qzg;~t6Z:UMz$ErSy">state_of_health_position</field>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <shadow type="math_number" id="j.{5~W_%obCp2NnLnRyy">
                                                                <field name="NUM">16</field>
                                                              </shadow>
                                                            </value>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="variables_set" id="qVAiWA9G.EK[Z_2aHc2%">
                                                        <field name="VAR" id="Uk7%2@*ECS}(NY:pspY9">state_of_health_2</field>
                                                        <value name="VALUE">
                                                          <block type="text_charAt" id="x_bb-yiZP6j2j$UHNyfD">
                                                            <mutation at="true"></mutation>
                                                            <field name="WHERE">FROM_START</field>
                                                            <value name="VALUE">
                                                              <block type="variables_get" id="`;ACz9DS^ckNikUC`}Ql">
                                                                <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                                                              </block>
                                                            </value>
                                                            <value name="AT">
                                                              <block type="math_arithmetic" id=":7$S5DfG0:pp*aFN;vpa">
                                                                <field name="OP">ADD</field>
                                                                <value name="A">
                                                                  <shadow type="math_number">
                                                                    <field name="NUM">1</field>
                                                                  </shadow>
                                                                  <block type="variables_get" id="W,[2hI_MkC@NtQwwgSN|">
                                                                    <field name="VAR" id="8N-Qzg;~t6Z:UMz$ErSy">state_of_health_position</field>
                                                                  </block>
                                                                </value>
                                                                <value name="B">
                                                                  <shadow type="math_number" id="T9eb]%D4-sVV(Uaj[e2q">
                                                                    <field name="NUM">17</field>
                                                                  </shadow>
                                                                </value>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="variables_set" id="04M%|KX}`]w+8?ik!I~^">
                                                            <field name="VAR" id="vTRl$*`1n}V+ywCJkw@I">state_of_health_3</field>
                                                            <value name="VALUE">
                                                              <block type="text_charAt" id="$[VhhNHd(Jh`ba]D%$_3">
                                                                <mutation at="true"></mutation>
                                                                <field name="WHERE">FROM_START</field>
                                                                <value name="VALUE">
                                                                  <block type="variables_get" id="#1{Ci_nsrT,%epOWCdkR">
                                                                    <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                                                                  </block>
                                                                </value>
                                                                <value name="AT">
                                                                  <block type="math_arithmetic" id="76a:Smn7;GOF1T%^5f#6">
                                                                    <field name="OP">ADD</field>
                                                                    <value name="A">
                                                                      <shadow type="math_number">
                                                                        <field name="NUM">1</field>
                                                                      </shadow>
                                                                      <block type="variables_get" id="1$nx_iaH2DDm2uK~uOz?">
                                                                        <field name="VAR" id="8N-Qzg;~t6Z:UMz$ErSy">state_of_health_position</field>
                                                                      </block>
                                                                    </value>
                                                                    <value name="B">
                                                                      <shadow type="math_number" id="pVZ7YwQ[)S]k130k+{UP">
                                                                        <field name="NUM">18</field>
                                                                      </shadow>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <next>
                                                              <block type="variables_set" id="/aC--#DAMn:pRaJ:a9hN">
                                                                <field name="VAR" id="]XHv?]|cGDwCIYpP:!e8">state_of_health_4</field>
                                                                <value name="VALUE">
                                                                  <block type="text_charAt" id="Ayvw+qy.#98Rib$BQV8C">
                                                                    <mutation at="true"></mutation>
                                                                    <field name="WHERE">FROM_START</field>
                                                                    <value name="VALUE">
                                                                      <block type="variables_get" id="h)(#pKTY7.W.N4qburnr">
                                                                        <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                                                                      </block>
                                                                    </value>
                                                                    <value name="AT">
                                                                      <block type="math_arithmetic" id="uX^q7=YVnoC%_,@u;ZYF">
                                                                        <field name="OP">ADD</field>
                                                                        <value name="A">
                                                                          <shadow type="math_number">
                                                                            <field name="NUM">1</field>
                                                                          </shadow>
                                                                          <block type="variables_get" id="-|14k[zX^:5qOAq8`w|a">
                                                                            <field name="VAR" id="8N-Qzg;~t6Z:UMz$ErSy">state_of_health_position</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="B">
                                                                          <shadow type="math_number" id="%!1*3}[o09W+y!{$g,8S">
                                                                            <field name="NUM">19</field>
                                                                          </shadow>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <next>
                                                                  <block type="variables_set" id="NQ56zgJC0?z$rw!-!,D@">
                                                                    <field name="VAR" id="sSWuEaf!:mQW?u}q1O#(">state_of_health</field>
                                                                    <value name="VALUE">
                                                                      <block type="text_join" id="QQZ#m}b9/BcA*S;R{v*w">
                                                                        <mutation items="4"></mutation>
                                                                        <value name="ADD0">
                                                                          <block type="variables_get" id="W~w,JDn:?e]6ypwyQk}d">
                                                                            <field name="VAR" id="!yQ-s()lr;vZ]FqhFnSP">state_of_health_1</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="ADD1">
                                                                          <block type="variables_get" id="pKXE7E6jw{V,:ZtU4@|f">
                                                                            <field name="VAR" id="Uk7%2@*ECS}(NY:pspY9">state_of_health_2</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="ADD2">
                                                                          <block type="variables_get" id="Ko^+e1S,vU+#46W#CAHV">
                                                                            <field name="VAR" id="vTRl$*`1n}V+ywCJkw@I">state_of_health_3</field>
                                                                          </block>
                                                                        </value>
                                                                        <value name="ADD3">
                                                                          <block type="variables_get" id="_=rO*F6S,k,gtBE;?jj_">
                                                                            <field name="VAR" id="]XHv?]|cGDwCIYpP:!e8">state_of_health_4</field>
                                                                          </block>
                                                                        </value>
                                                                      </block>
                                                                    </value>
                                                                    <next>
                                                                      <block type="debug" id="4ZpPDJ[Ohbl2o(:iPO!g">
                                                                        <field name="Severity">log</field>
                                                                        <value name="TEXT">
                                                                          <shadow type="text" id="cf.=@yD_RjA+ei`_h31,">
                                                                            <field name="TEXT">test</field>
                                                                          </shadow>
                                                                          <block type="variables_get" id="H}9uGQs7jQa;KL]xLhDa">
                                                                            <field name="VAR" id="sSWuEaf!:mQW?u}q1O#(">state_of_health</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>
                    </next>
                  </block>
                </next>
              </block>
            </statement>
          </block>
        </statement>
      </block>
      

      SB10ladezyklenundzustand.jpg

      Vielleicht ist das Script für den ein oder anderen interessant. Würde mich über regen Austausch freuen

      Man braucht ja noch die original Daten, hätte ich fast vergessen.

      {"alarms":{"communicationerror":0,"highestoperationtemperature":0,"initializeerror":0,"lowestoperationtemperature":0,"lowvoltage":0,"mixedbmsmodules":0,"modulecorrupted":0,"overchargecurrent":0,"overdischarge":0,"overdischargecurrent":0,"oversystemchargecurrentlimit":0,"oversystemdischargecurrentlimit":0,"overtemperaturecharge":0,"overtemperaturedischarge":0,"overvoltage":0,"undertemperaturecharge":0,"undertemperaturedischarge":0,"wrongbmstype":0},"battery_status":{"balancechargerequest":"0","chargecurrentlimit":"6.200","cyclecount":"194","dischargecurrentlimit":"19.000","fullchargecapacity":"48.338","maximumcelltemperature":"27.05","maximumcellvoltage":"3.430","maximumcellvoltagenum":"0","maximummodulecurrent":"-0.070","maximummoduledcvoltage":"109.264","maximummoduletemperature":"-273.15","minimumcelltemperature":"21.05","minimumcellvoltage":"3.377","minimumcellvoltagenum":"0","minimummodulecurrent":"-0.070","minimummoduledcvoltage":"108.664","minimummoduletemperature":"-273.15","relativestateofcharge":"100.0","remainingcapacity":"47.854","stateofhealth":"99.0","systemalarm":"0","systemcurrent":"0.000","systemdcvoltage":"217.928","systemstatus":"49","systemtime":"0","systemwarning":"0"},"battery_status_units":{"balancechargerequest":"","chargecurrentlimit":"A","cyclecount":"count","dischargecurrentlimit":"A","fullchargecapacity":"Ah","maximumcelltemperature":"C","maximumcellvoltage":"V","maximumcellvoltagenum":"","maximummodulecurrent":"A","maximummoduledcvoltage":"V","maximummoduletemperature":"C","minimumcelltemperature":"C","minimumcellvoltage":"V","minimumcellvoltagenum":"","minimummodulecurrent":"A","minimummoduledcvoltage":"V","minimummoduletemperature":"C","relativestateofcharge":"%","remainingcapacity":"Ah","stateofhealth":"%","systemalarm":"","systemcurrent":"A","systemdcvoltage":"V","systemstatus":"","systemtime":"sec","systemwarning":""},"system_status":{"savedatacompleteflag":1,"systemalarmstatus":0,"systempoweroffready":1,"systemready":1,"systemwarningstatus":0},"warnings":{"communicationerror":0,"fullchargerequestformaintenance":0,"loginfailure":0,"mixedbmsmodules":0,"modulecorrupted":0,"notallserialnumbersread":0,"overchargecurrent":0,"overdischarge":0,"overdischargecurrent":0,"overtemperaturebalancer":0,"overtemperaturecharge":0,"overtemperaturedischarge":0,"overtemperaturepcb":0,"overvoltage":0,"undercurrent":0,"undertemperaturecharge":0,"undertemperaturedischarge":0,"undervoltage":0,"wrongbmstype":0,"wrongserialnumberformat":0}}
      
      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @babl last edited by

        @babl sagte: helfen und vielleicht auch das Script noch zu optimieren.

        Bild_2021-08-17_122127.png

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

          @paul53 ich habs doch gewußt daß da was kommt,

          kannst du mir das auch bitte erklären, was du hier genau machst?

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

            @babl sagte: erklären, was du hier genau machst?

            Die Daten liegen als JSON (stringified object) vor. Mit dem Block "Attribut" wird gezielt auf ein Attribut des Objekts zugegriffen.
            Schau mal die Daten im JSON-Viewer an.

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

              @paul53 ok, cool heißt das dann ich kann mir die ganzen auslesesachen im blockly sparen, und nur daß mit den attributen so machen und daß dann an die datenpunkte übergeben, das wäre ja zu schön um wahr zu sein.

              Dann wäre das Problem mit den Ziffern von 99% auf 100% ja auch gleich bereinigt👏

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

                @babl sagte: das wäre ja zu schön um wahr zu sein.

                Es ist wahr.

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

                  @paul53 sagte in Blockly für SB 10 Ladezyklen und Gesundheit:

                  @babl sagte: das wäre ja zu schön um wahr zu sein.

                  Es ist wahr.

                  Ja es ist wahr, danke dir super wahnsinn, was man hier alles machen kann, und wenn man Hilfe dazu bekommt, danke dir @paul53

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

                    SO dank @paul53 seiner Hilfe nun hier das Script in vollendeter Form zum Import.
                    Und schon wurde es von 34kb auf 5kb zusammengeschrumpft.

                    <xml xmlns="https://developers.google.com/blockly/xml">
                      <variables>
                        <variable id="b#*MBhkWm%KIhN(UAJ%~">deine_ip</variable>
                        <variable id="UPIEW`RfxC:l#j^WWT2X">url_api_battery</variable>
                        <variable id=":L}Z^QY/Dt;FxE-qsw=A">cyclecount</variable>
                        <variable id="ryCWJ?G=WX+qFYK:|[nC">result</variable>
                        <variable id="sSWuEaf!:mQW?u}q1O#(">state_of_health</variable>
                      </variables>
                      <block type="variables_set" id="{^%R4##9lWq8W_]`TLvG" x="113" y="88">
                        <field name="VAR" id="b#*MBhkWm%KIhN(UAJ%~">deine_ip</field>
                        <value name="VALUE">
                          <block type="text" id="!`9a#XbsO^oWtmg@Tz%4">
                            <field name="TEXT">XXX.XXX.XXX.XX</field>
                          </block>
                        </value>
                        <next>
                          <block type="variables_set" id="Cg?)|Er}?__QBZP+ejp|">
                            <field name="VAR" id="UPIEW`RfxC:l#j^WWT2X">url_api_battery</field>
                            <value name="VALUE">
                              <block type="text_join" id="0v.{#QqX`vFHrM?!{OjW">
                                <mutation items="3"></mutation>
                                <value name="ADD0">
                                  <block type="text" id="ecZ*ch)d5ULnxHK0.ZY!">
                                    <field name="TEXT">http://</field>
                                  </block>
                                </value>
                                <value name="ADD1">
                                  <block type="variables_get" id=")%j~D}5n}*Q-H]|Dma=E">
                                    <field name="VAR" id="b#*MBhkWm%KIhN(UAJ%~">deine_ip</field>
                                  </block>
                                </value>
                                <value name="ADD2">
                                  <block type="text" id="u3so;vnLGDydm|j~CLKe">
                                    <field name="TEXT">:8080/api/battery</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <next>
                              <block type="schedule" id="K=~VVW$dsmF:.?Ban:xU">
                                <field name="SCHEDULE">{"time":{"start":"00:00","end":"24:00","interval":1,"mode":"hours"},"period":{"days":1}}</field>
                                <statement name="STATEMENT">
                                  <block type="request" id="[dR$K#cK(y!X.Ts]+LGi">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="true"></mutation>
                                    <field name="WITH_STATEMENT">TRUE</field>
                                    <field name="LOG"></field>
                                    <value name="URL">
                                      <shadow type="text" id="3#2b-3opeXYlh-JrMHTb">
                                        <field name="TEXT">http://192.168.178.22:8080/api/battery</field>
                                      </shadow>
                                      <block type="variables_get" id=":7MM_84#(~r6-m+#f-nb">
                                        <field name="VAR" id="UPIEW`RfxC:l#j^WWT2X">url_api_battery</field>
                                      </block>
                                    </value>
                                    <statement name="STATEMENT">
                                      <block type="comment" id="paDc?N}K1hYedw(s2u1j">
                                        <field name="COMMENT">Ladezyklen Sonnenbatterie</field>
                                        <next>
                                          <block type="variables_set" id="AT$LduK@gc|Lgd^x.=G3">
                                            <field name="VAR" id=":L}Z^QY/Dt;FxE-qsw=A">cyclecount</field>
                                            <value name="VALUE">
                                              <block type="get_attr" id="PQ6i6dtW#[@I*l|~q_Rh">
                                                <value name="PATH">
                                                  <shadow type="text" id="l^*[zId_Pgl^wPi)hC+W">
                                                    <field name="TEXT">battery_status.cyclecount</field>
                                                  </shadow>
                                                </value>
                                                <value name="OBJECT">
                                                  <block type="variables_get" id="3T{ld~hN/q%TqI7D2Ah7">
                                                    <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="update" id="~(1cvG{*k[Q8ap0(/6I1">
                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                <field name="OID">0_userdata.0.Original_ladezyklen_sonnen</field>
                                                <field name="WITH_DELAY">FALSE</field>
                                                <value name="VALUE">
                                                  <block type="variables_get" id="@=Akm1h/*g!FF_W3[`_I">
                                                    <field name="VAR" id=":L}Z^QY/Dt;FxE-qsw=A">cyclecount</field>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="comment" id="sB7_%[PQS6M:~]ByeHf;">
                                                    <field name="COMMENT">Gesundheit der Akkuzellen der Batterie</field>
                                                    <next>
                                                      <block type="variables_set" id="l:~wZgi*~@oLcbOWH5dX">
                                                        <field name="VAR" id="sSWuEaf!:mQW?u}q1O#(">state_of_health</field>
                                                        <value name="VALUE">
                                                          <block type="get_attr" id="EY-PH*9%#$yJ%;V/ipXk">
                                                            <value name="PATH">
                                                              <shadow type="text" id="b04`1]2YPJE2|cITS6d^">
                                                                <field name="TEXT">battery_status.stateofhealth</field>
                                                              </shadow>
                                                            </value>
                                                            <value name="OBJECT">
                                                              <block type="variables_get" id="}=CKf:+RC[Ua/S^8m3QH">
                                                                <field name="VAR" id="ryCWJ?G=WX+qFYK:|[nC">result</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <next>
                                                          <block type="update" id="f4M-)dp[Wq;~W2j@wk0:">
                                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                            <field name="OID">0_userdata.0.Sonnen_Batterie_Zustand</field>
                                                            <field name="WITH_DELAY">FALSE</field>
                                                            <value name="VALUE">
                                                              <block type="variables_get" id="XTi=t_$qyZwl.0Pj5R*2">
                                                                <field name="VAR" id="sSWuEaf!:mQW?u}q1O#(">state_of_health</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                  </block>
                                </statement>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </xml>
                    
                    paul53 1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 @babl last edited by paul53

                      @babl sagte: hier das Script in vollendeter Form zum Import.

                      Wo wird die Variable url_api_battery gesetzt?
                      Der Kommentar "Ladezyklen Sonnenbatterie nur gültig bis max 999" stimmt nicht.

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

                        @paul53 danke, wurde bereits berichtigt

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        824
                        Online

                        32.0k
                        Users

                        80.5k
                        Topics

                        1.3m
                        Posts

                        blockly monitoring
                        2
                        10
                        363
                        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