Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. h07d0q

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    H
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 39
    • Best 7
    • Groups 1

    h07d0q

    @h07d0q

    Starter

    7
    Reputation
    10
    Profile views
    39
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    h07d0q Follow
    Starter

    Best posts made by h07d0q

    • RE: Energymanagement PV/Solar: Nulleinspeisung

      @homoran said in Energymanagement PV/Solar: Nulleinspeisung:

      grundsätzlich sollte ein Balkonkraftwerk so dimensioniert sein, dass es gar nicht einspeisen könnte.
      Ansonsten könnte es Probleme bei der Anmeldung beim Netzbetreiber geben was den Umfang der Auflagen angeht.

      Das ist nicht richtig. Es gibt mittlerweile (je nach VNB) vereinfachte Anmeldeformulare für solche Steckerfertige Solaranlagen bis 600W. Ganz realistisch: Wie viel Watt wird da zu Spitzenzeiten in das Netz eingespeist? Wenn er eine Grundlast von 200-300W hat, dann bleiben maximal 300-400W (theoretisch) über maximal 3 Stunden, die er dem VNB schenkt (wird nicht vergütet). Das geht im Netz unter, weil das ja nicht jeder macht und genau deswegen soll man das auch melden (nicht genehmigen lassen). Zudem möchte der TO genau das vermeiden und seine Eigennutzung erhöhen (kann man auch Nulleinspeisung nennen), also zurück zum Thema 🙂

      @homoran said in Energymanagement PV/Solar: Nulleinspeisung:

      @jheide sagte in Energymanagement PV/Solar: Nulleinspeisung:

      Fritz Dect Steckdosen

      können die auch "negativen" Strom messen?

      Ja. Nicht nur die, z.B. Shellys auch.

      posted in Praktische Anwendungen (Showcase)
      H
      h07d0q
    • RE: [Gelöst] Listen durchforsten u. bestimmte Elemente entfernen

      @DAN78
      Ich bin aktuell auf das gleiche Problem gestoßen, dass ich aus einer Liste einen bekannten Wert löschen wollte und so einen Block nicht gefunden habe. Man könnte natürlich eine Schleife drüber laufen lassen und falls der Wert dem gesuchten Wert entspricht, die betroffene Stelle aus der Liste entfernen.
      Die Javascript Lösung sieht so aus:

      var arr = ['three', 'seven', 'eleven'];
      var filteredArray = arr.filter(e => e !== 'seven')
      

      Letztendlich wird auch hier wie ich verstehe das Array durchlaufen und ein neues ohne den gesuchten Wert erzeugt, es sei aber wohl schneller als mit der slice Funktion von Javascript.
      Man könnte das in einen Javascript Block mit Ergebnis packen, oder aber man führt einen neuen Block ein?
      4261f9af-d1c6-4a82-849a-eed62adb11fd-image.png
      in der Funktion steckt:

      liste.filter(e => e !== filter);
      

      Wenn man die ursprüngliche Liste nicht verlieren möchte, muss man das Ganze so machen:
      bbd69e00-f4fc-43cd-994d-354faf3713b5-image.png
      in der Funktion steckt:

      var f = liste.filter(e => e !== filter);
      return f;
      

      Ich hoffe ich kann dem ein oder anderen helfen, der auf diesen Post stößt.

      posted in Blockly
      H
      h07d0q
    • RE: Energymanagement PV/Solar: Nulleinspeisung

      @jheide said in Energymanagement PV/Solar: Nulleinspeisung:

      "Etwas" müsste auf nem bestimmten Port "hören" und das was ankommt verarbeiten können

      Schau dir mal folgendes Projekt an: https://github.com/XtheOne/Inverter-Data-Logger

      Du musst ne Lösung für die Solarman Daten finden. Wenn das Auslesen mit o.g. funktioniert, könnte man (du) das mit etwas programmieren so anpassen, dass es die Daten in iobroker Datenpunkte schreibt. Dort gibt es ja schon ein Plugin für domoticz...
      Eine weitere Alternative wäre, jemand schreibt einen Adapter für die Solarman Plattform und man ruft da die Werte ab, aber das hat dementsprechend Verzögerung und wäre nicht für eine Nulleinspeisung geeignet.

      Ich weiß nicht ob es vielleicht einfacher wäre die Werte aus der Website zu Parsen...

      posted in Praktische Anwendungen (Showcase)
      H
      h07d0q
    • RE: Energymanagement PV/Solar: Nulleinspeisung

      @klassisch said in Energymanagement PV/Solar: Nulleinspeisung:

      Der Inverter ist nicht sein Problem

      Doch, steht ja ganz unten:

      @jheide said in Energymanagement PV/Solar: Nulleinspeisung:

      Woran scheitere ich aktuell:
      Die Website des WR benötigt einen Login, danach wäre es vermutlich "nur" noch ein parsen der HTML Seite

      Alles andere was ihr hier schreibt ist sowas von Offtopic...

      @jheide Ich habe dir zwei Wege vorgeschlagen. Schau sie dir an. Kann dir ggf. bei der Webseite des WR helfen, nur über den Chat ist das schwierig. Vielleicht in Discord?

      posted in Praktische Anwendungen (Showcase)
      H
      h07d0q
    • RE: Energymanagement PV/Solar: Nulleinspeisung
      1. Blockly
        Benachrichtigung per Telegram wenn Mindest-Überschuss länger als 10 Minuten überschritten ist. Danach wird die Nachricht immer wieder aktulalisiert (bearbeitet). Wird der Mindest-Überschuss länger als 3 Minuten unterschritten, wird die Nachricht gelöscht. Danach geht das Ganze wieder von vorne los. (weiß gerade nicht wie sich das mit dem Timer "nächste Warnung" verhält - das ist ein gewachsenes Skript)
        9ba69ee5-f677-45b1-a411-017ea4c9e5ee-Screenshot - 10_12 002.png

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="+uo*h9CiBC;Z6Tu6|]{-">url</variable>
          <variable id="t735B|g/I)mmA`_=bQf=">Token</variable>
          <variable id="OY|-nxmyPkjf5lu#3k4b">MessageID_old</variable>
          <variable id="[cm_4R;3)cv_BI@^],fP">ÜberschussMin</variable>
          <variable id="V+u7Uf#;)B4bY+w!q#b:">aktiv</variable>
          <variable id="Oz_`bUcn~F`@Yx~KX@t6">nächsteAktualisierung</variable>
          <variable type="timeout" id="minimum-zeit unterschritten">minimum-zeit unterschritten</variable>
          <variable type="timeout" id="nächste Warnung">nächste Warnung</variable>
          <variable type="timeout" id="Benachrichtigung">Benachrichtigung</variable>
          <variable id="UNwn*kL_@D)gcE`$^mO+">ChatID_old</variable>
          <variable type="timeout" id="timeout">timeout</variable>
        </variables>
        <block type="comment" id="`]K4h=n0i;nQJm.g0OXj" x="2213" y="38">
          <field name="COMMENT">PV Überschuss</field>
          <next>
            <block type="variables_set" id="SPfX1fy;_JV}@tLLLZ}n">
              <field name="VAR" id="t735B|g/I)mmA`_=bQf=">Token</field>
              <value name="VALUE">
                <block type="get_value" id="tia~F+^mE`V^WFLpJ]Wt">
                  <field name="ATTR">val</field>
                  <field name="OID">0_userdata.0.Telegram.Token</field>
                </block>
              </value>
              <next>
                <block type="variables_set" id="pd`+}c6k}RdpIR%g4ty6">
                  <field name="VAR" id="OY|-nxmyPkjf5lu#3k4b">MessageID_old</field>
                  <value name="VALUE">
                    <block type="text" id="E~g|;]jTA[oq#Yz0mR@#">
                      <field name="TEXT"></field>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="#dy/OwG@e1Gn|=N4qwps">
                      <field name="VAR" id="[cm_4R;3)cv_BI@^],fP">ÜberschussMin</field>
                      <value name="VALUE">
                        <block type="math_number" id="rcwze5X=CEl8nT|9w[Ne">
                          <field name="NUM">50</field>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="-I.7v}2OO!agGHfnCF`~">
                          <field name="VAR" id="V+u7Uf#;)B4bY+w!q#b:">aktiv</field>
                          <value name="VALUE">
                            <block type="logic_boolean" id="o;=Ft3,44yukRdj~G?b~">
                              <field name="BOOL">FALSE</field>
                            </block>
                          </value>
                          <next>
                            <block type="variables_set" id="`r-=kwrDStf)Yy!^{#fE">
                              <field name="VAR" id="Oz_`bUcn~F`@Yx~KX@t6">nächsteAktualisierung</field>
                              <value name="VALUE">
                                <block type="math_number" id="S~aBFESzn3NFyq3;x:bU">
                                  <field name="NUM">0</field>
                                </block>
                              </value>
                              <next>
                                <block type="on_ext" id="YzNQ9Xi|,Zh/V1/8{s89">
                                  <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="gZimHH#8!L?jYTs)zsi-">
                                      <field name="oid">0_userdata.0.PV.MomentanwertÜberschuss</field>
                                    </shadow>
                                  </value>
                                  <statement name="STATEMENT">
                                    <block type="debug" id="W^E5Um3?2:yK=pF}ZY%q">
                                      <field name="Severity">debug</field>
                                      <value name="TEXT">
                                        <shadow type="text" id="9G|vv.L5YkXn]G0o{+KQ">
                                          <field name="TEXT">test</field>
                                        </shadow>
                                        <block type="text_join" id="(38u(qHq6[?}kkNJ(~hG">
                                          <mutation items="4"></mutation>
                                          <value name="ADD0">
                                            <block type="text" id="zjj{O6r2}[qfrl*owp?f">
                                              <field name="TEXT">Benachrichtigung aktiv: </field>
                                            </block>
                                          </value>
                                          <value name="ADD1">
                                            <block type="variables_get" id="p83c%6d!NT{3`]i;Ypgs">
                                              <field name="VAR" id="V+u7Uf#;)B4bY+w!q#b:">aktiv</field>
                                            </block>
                                          </value>
                                          <value name="ADD2">
                                            <block type="text" id="{GnY!ecGz^3{-n/K9zEk">
                                              <field name="TEXT">; Momentanwert: </field>
                                            </block>
                                          </value>
                                          <value name="ADD3">
                                            <block type="on_source" id="i@W)6eFLrwbMFxXr$~9~">
                                              <field name="ATTR">state.val</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="controls_if" id=")zjaK4dsMbvEb:e%CzF!">
                                          <mutation elseif="3"></mutation>
                                          <value name="IF0">
                                            <block type="logic_operation" id="KjHv~A/949Fv:YQM6fto">
                                              <field name="OP">AND</field>
                                              <value name="A">
                                                <block type="logic_compare" id="*p#pWZD_V`eowQoyO$5N">
                                                  <field name="OP">GTE</field>
                                                  <value name="A">
                                                    <block type="on_source" id="52^;sStuV4blN{:3!ml-">
                                                      <field name="ATTR">state.val</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="variables_get" id="I%YvNA^e.H6Urv6l2sXM">
                                                      <field name="VAR" id="[cm_4R;3)cv_BI@^],fP">ÜberschussMin</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="logic_negate" id="YmR9cAnBuNT%mC.WwRun">
                                                  <value name="BOOL">
                                                    <block type="variables_get" id="XOd+~acw+EeaEGIOYUu@">
                                                      <field name="VAR" id="V+u7Uf#;)B4bY+w!q#b:">aktiv</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO0">
                                            <block type="debug" id="j[nFIS)6A2Ie`TyY4myH">
                                              <field name="Severity">log</field>
                                              <value name="TEXT">
                                                <shadow type="text">
                                                  <field name="TEXT">test</field>
                                                </shadow>
                                                <block type="text" id="|2.iafrWY#ZzJ-#oh+)P">
                                                  <field name="TEXT">Überschuss</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="timeouts_cleartimeout" id="zHdYa8zYHU~jnx-x:@nL">
                                                  <field name="NAME">minimum-zeit unterschritten</field>
                                                  <next>
                                                    <block type="variables_set" id="s|CSMlA/W.o,E@L/@zhq">
                                                      <field name="VAR" id="V+u7Uf#;)B4bY+w!q#b:">aktiv</field>
                                                      <value name="VALUE">
                                                        <block type="logic_boolean" id="2)1qcLKEf@M/QBcoPkiu">
                                                          <field name="BOOL">TRUE</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="timeouts_settimeout" id="AR[H#0h]{dssZgyT@ViB">
                                                          <field name="NAME">nächste Warnung</field>
                                                          <field name="DELAY">15</field>
                                                          <field name="UNIT">min</field>
                                                          <statement name="STATEMENT">
                                                            <block type="variables_set" id="vct%etLLl,G!ZQ_FFs.8">
                                                              <field name="VAR" id="V+u7Uf#;)B4bY+w!q#b:">aktiv</field>
                                                              <value name="VALUE">
                                                                <block type="logic_boolean" id="UZO9K8,v-^,m{dD@-25h">
                                                                  <field name="BOOL">FALSE</field>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="debug" id="TYsUK*8NYmtmO8udIJC@">
                                                                  <field name="Severity">debug</field>
                                                                  <value name="TEXT">
                                                                    <shadow type="text">
                                                                      <field name="TEXT">test</field>
                                                                    </shadow>
                                                                    <block type="text" id="!yWMD;u#|U{A@o)nZ%ak">
                                                                      <field name="TEXT">nächste Warnung kann kommen</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </statement>
                                                          <next>
                                                            <block type="timeouts_settimeout" id="8DSXrbtsM9;o;LKq@ID`">
                                                              <field name="NAME">Benachrichtigung</field>
                                                              <field name="DELAY">10</field>
                                                              <field name="UNIT">min</field>
                                                              <statement name="STATEMENT">
                                                                <block type="debug" id="fF$MIEs@DZN}.Dr6mWdh">
                                                                  <field name="Severity">debug</field>
                                                                  <value name="TEXT">
                                                                    <shadow type="text">
                                                                      <field name="TEXT">test</field>
                                                                    </shadow>
                                                                    <block type="text" id="/oiwNq69oO:w!N0y`#qc">
                                                                      <field name="TEXT">Benachrichtigung (zeitverzögerte)</field>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="controls_if" id="JfVueB1$i?*Mabtv,G@_">
                                                                      <mutation else="1"></mutation>
                                                                      <value name="IF0">
                                                                        <block type="logic_compare" id="{+rdLns6hK,J{y0Hh!zY">
                                                                          <field name="OP">EQ</field>
                                                                          <value name="A">
                                                                            <block type="variables_get" id=",KkV#(C]EI)^S[M/brw*">
                                                                              <field name="VAR" id="OY|-nxmyPkjf5lu#3k4b">MessageID_old</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="B">
                                                                            <block type="text" id="R7o6ajypmdhH%`oj$QLu">
                                                                              <field name="TEXT"></field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <statement name="DO0">
                                                                        <block type="telegram" id=".KG5zXOq`2aPXSTwix;y">
                                                                          <field name="INSTANCE"></field>
                                                                          <field name="LOG">debug</field>
                                                                          <field name="SILENT">FALSE</field>
                                                                          <field name="PARSEMODE">default</field>
                                                                          <value name="MESSAGE">
                                                                            <shadow type="text">
                                                                              <field name="TEXT">Vorsicht WW ist bei °C</field>
                                                                            </shadow>
                                                                            <block type="text_join" id="1q)#|2D9M^YSeYDva!dQ">
                                                                              <mutation items="2"></mutation>
                                                                              <value name="ADD0">
                                                                                <block type="text" id="0/gGP~oxeP_4ak9Yr58m">
                                                                                  <field name="TEXT">PV-Überschuss: </field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="ADD1">
                                                                                <block type="on_source" id=":t9Tpf{x1kw/jRAmqV-E">
                                                                                  <field name="ATTR">state.val</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="variables_set" id="~8O9B)6:$SP1Y3rc/_:x">
                                                                              <field name="VAR" id="Oz_`bUcn~F`@Yx~KX@t6">nächsteAktualisierung</field>
                                                                              <value name="VALUE">
                                                                                <block type="math_arithmetic" id="e5lCBAdl:tw8`e;uW:g?">
                                                                                  <field name="OP">ADD</field>
                                                                                  <value name="A">
                                                                                    <shadow type="math_number">
                                                                                      <field name="NUM">1</field>
                                                                                    </shadow>
                                                                                    <block type="on_source" id="wMzhn@fOF3!^lb]Yk]TJ">
                                                                                      <field name="ATTR">state.ts</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="B">
                                                                                    <shadow type="math_number">
                                                                                      <field name="NUM">1</field>
                                                                                    </shadow>
                                                                                    <block type="math_arithmetic" id="Nj7vD/D!*rI*@p;UdVC3">
                                                                                      <field name="OP">MULTIPLY</field>
                                                                                      <value name="A">
                                                                                        <shadow type="math_number" id="Q[F=:q;AWWkE?dsSO6Di">
                                                                                          <field name="NUM">1000</field>
                                                                                        </shadow>
                                                                                      </value>
                                                                                      <value name="B">
                                                                                        <shadow type="math_number" id="6nW20c4^%:Jysw0A-$i*">
                                                                                          <field name="NUM">30</field>
                                                                                        </shadow>
                                                                                      </value>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                              <next>
                                                                                <block type="comment" id="H90jwd1O]T9w*vM7.|#J">
                                                                                  <field name="COMMENT">MessageID für später merken</field>
                                                                                  <next>
                                                                                    <block type="timeouts_settimeout" id="#!b{mjY%}JF3r6T;Rj[6">
                                                                                      <field name="NAME">timeout</field>
                                                                                      <field name="DELAY">1</field>
                                                                                      <field name="UNIT">sec</field>
                                                                                      <statement name="STATEMENT">
                                                                                        <block type="variables_set" id="^CZ{$5}1M-^(5]:d=[ei">
                                                                                          <field name="VAR" id="OY|-nxmyPkjf5lu#3k4b">MessageID_old</field>
                                                                                          <value name="VALUE">
                                                                                            <block type="get_value_var" id="$b1ImQg_SiDH`#A6L9T7">
                                                                                              <field name="ATTR">val</field>
                                                                                              <value name="OID">
                                                                                                <shadow type="text" id="_%2i%0gQYmWIOJ_z0QBz">
                                                                                                  <field name="TEXT"></field>
                                                                                                </shadow>
                                                                                                <block type="field_oid" id="%6Y`/R^ix0}6G:HgNZXZ">
                                                                                                  <field name="oid">telegram.0.communicate.botSendMessageId</field>
                                                                                                </block>
                                                                                              </value>
                                                                                            </block>
                                                                                          </value>
                                                                                          <next>
                                                                                            <block type="variables_set" id="Im!5B9gQ@Z7Rpjj#)w@w">
                                                                                              <field name="VAR" id="UNwn*kL_@D)gcE`$^mO+">ChatID_old</field>
                                                                                              <value name="VALUE">
                                                                                                <block type="get_value_var" id=";@@xRpp=^$5icRd*2Q#R">
                                                                                                  <field name="ATTR">val</field>
                                                                                                  <value name="OID">
                                                                                                    <shadow type="text">
                                                                                                      <field name="TEXT"></field>
                                                                                                    </shadow>
                                                                                                    <block type="field_oid" id="Gfwkp!J7JMiJNI`):.la">
                                                                                                      <field name="oid">telegram.0.communicate.botSendChatId</field>
                                                                                                    </block>
                                                                                                  </value>
                                                                                                </block>
                                                                                              </value>
                                                                                            </block>
                                                                                          </next>
                                                                                        </block>
                                                                                      </statement>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </statement>
                                                                      <statement name="ELSE">
                                                                        <block type="debug" id="7)y`=f09@b4cArc:^3h9">
                                                                          <field name="Severity">error</field>
                                                                          <value name="TEXT">
                                                                            <shadow type="text">
                                                                              <field name="TEXT">test</field>
                                                                            </shadow>
                                                                            <block type="text" id="ZPD$1|_|R%_-CF_9k)/j">
                                                                              <field name="TEXT">MessageID_old ist nicht leer!!!!</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </statement>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </statement>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </statement>
                                          <value name="IF1">
                                            <block type="logic_operation" id="sH*,MP%A(B1UdZuvv~GR">
                                              <field name="OP">AND</field>
                                              <value name="A">
                                                <block type="logic_operation" id=")gD@SJYz;4TZ+zY(wc7s">
                                                  <field name="OP">AND</field>
                                                  <value name="A">
                                                    <block type="logic_operation" id="ML7uK_3QYuR//_8x%c+X">
                                                      <field name="OP">AND</field>
                                                      <value name="A">
                                                        <block type="logic_compare" id="CXI9kLd(/7*Jf4habbl^">
                                                          <field name="OP">GTE</field>
                                                          <value name="A">
                                                            <block type="on_source" id="szvmyZHtlNo)c(mUy0Q-">
                                                              <field name="ATTR">state.val</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <block type="variables_get" id=")I2GZ7TTSr=rQlIIbsHI">
                                                              <field name="VAR" id="[cm_4R;3)cv_BI@^],fP">ÜberschussMin</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <block type="variables_get" id="B[Wk#t79my0{$_v;]`kp">
                                                          <field name="VAR" id="V+u7Uf#;)B4bY+w!q#b:">aktiv</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="logic_compare" id="Xmb~|,r3UO*/0K,DrdQ=">
                                                      <field name="OP">NEQ</field>
                                                      <value name="A">
                                                        <block type="variables_get" id="YIaz.X?RG;gF!:z$A+~v">
                                                          <field name="VAR" id="OY|-nxmyPkjf5lu#3k4b">MessageID_old</field>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <block type="text" id="60?SN$jwQb-_j4GU^~3~">
                                                          <field name="TEXT"></field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="logic_compare" id="h5$qN;rEDymEXg/Ls!AH">
                                                  <field name="OP">LTE</field>
                                                  <value name="A">
                                                    <block type="variables_get" id="Y(APA7CD%a1U#Y$a?qS9">
                                                      <field name="VAR" id="Oz_`bUcn~F`@Yx~KX@t6">nächsteAktualisierung</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="on_source" id="Z*zw,ryx7CD/@|@v.]K~">
                                                      <field name="ATTR">state.ts</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO1">
                                            <block type="debug" id="9YyYL@FO8*,)-_:KO-J%">
                                              <field name="Severity">debug</field>
                                              <value name="TEXT">
                                                <shadow type="text" id="I]RG6k~V-xqO9g/?r#m]">
                                                  <field name="TEXT">test</field>
                                                </shadow>
                                                <block type="text" id="k9L6%$Nz4ok[OZ89_K*j">
                                                  <field name="TEXT">sonst falls message wurde gesendet, Wert aktualisieren.</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="timeouts_cleartimeout" id="7OE5C[:4MEAgbF..pGmn">
                                                  <field name="NAME">minimum-zeit unterschritten</field>
                                                  <next>
                                                    <block type="variables_set" id="XwF:)6dY84JyN}BRG?P(">
                                                      <field name="VAR" id="Oz_`bUcn~F`@Yx~KX@t6">nächsteAktualisierung</field>
                                                      <value name="VALUE">
                                                        <block type="math_arithmetic" id="l|e*4uj5SCH{{ylFgh:s">
                                                          <field name="OP">ADD</field>
                                                          <value name="A">
                                                            <shadow type="math_number" id="Eq5@Y9VzUr}dSZ+yv~t%">
                                                              <field name="NUM">1</field>
                                                            </shadow>
                                                            <block type="on_source" id="2*koF3/2pv*-]o,I8D1O">
                                                              <field name="ATTR">state.ts</field>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <shadow type="math_number" id="0+N:yZJUl+WEudT3yav)">
                                                              <field name="NUM">1</field>
                                                            </shadow>
                                                            <block type="math_arithmetic" id="3h4NIV%7pcFiOV^Zqzgs">
                                                              <field name="OP">MULTIPLY</field>
                                                              <value name="A">
                                                                <shadow type="math_number" id="qo)=$$d1NiH%5lN($VSC">
                                                                  <field name="NUM">1000</field>
                                                                </shadow>
                                                              </value>
                                                              <value name="B">
                                                                <shadow type="math_number" id="?*Cx!gU:]T)2,sKq2+t,">
                                                                  <field name="NUM">15</field>
                                                                </shadow>
                                                              </value>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="request" id="yh6{#(a!a*zzX.S0O}Jl">
                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="false"></mutation>
                                                          <field name="WITH_STATEMENT">FALSE</field>
                                                          <field name="LOG">debug</field>
                                                          <value name="URL">
                                                            <shadow type="text">
                                                              <field name="TEXT">text</field>
                                                            </shadow>
                                                            <block type="text_join" id="d`hP9NFCs/O)sRN(5iWy">
                                                              <mutation items="8"></mutation>
                                                              <value name="ADD0">
                                                                <block type="text" id="HayC](:j7qa~vXX*Cz*=">
                                                                  <field name="TEXT">https://api.telegram.org/bot</field>
                                                                </block>
                                                              </value>
                                                              <value name="ADD1">
                                                                <block type="variables_get" id="5v`R4$$SCz*zHBVTrHR%">
                                                                  <field name="VAR" id="t735B|g/I)mmA`_=bQf=">Token</field>
                                                                </block>
                                                              </value>
                                                              <value name="ADD2">
                                                                <block type="text" id="Ddi{D+zm-4^US]NQkKak">
                                                                  <field name="TEXT">/editMessageText?chat_id=</field>
                                                                </block>
                                                              </value>
                                                              <value name="ADD3">
                                                                <block type="variables_get" id="Cyp+gOM35bp]pi{tonN.">
                                                                  <field name="VAR" id="UNwn*kL_@D)gcE`$^mO+">ChatID_old</field>
                                                                </block>
                                                              </value>
                                                              <value name="ADD4">
                                                                <block type="text" id="*-G3B3hFN5w8Em(X]1xf">
                                                                  <field name="TEXT">&amp;message_id=</field>
                                                                </block>
                                                              </value>
                                                              <value name="ADD5">
                                                                <block type="variables_get" id="nj%U(!7{t;K@~NXE,qx/">
                                                                  <field name="VAR" id="OY|-nxmyPkjf5lu#3k4b">MessageID_old</field>
                                                                </block>
                                                              </value>
                                                              <value name="ADD6">
                                                                <block type="text" id="(jvJ80p1|hCYv|r2:sCc">
                                                                  <field name="TEXT">&amp;text=</field>
                                                                </block>
                                                              </value>
                                                              <value name="ADD7">
                                                                <block type="procedures_callcustomreturn" id="P+G[F^$b3kYUu0}6/-4)">
                                                                  <mutation name="URIencode">
                                                                    <arg name="url"></arg>
                                                                  </mutation>
                                                                  <value name="ARG0">
                                                                    <block type="text_join" id="SM8(MQ)c1|w?xjqH;qaO">
                                                                      <mutation items="2"></mutation>
                                                                      <value name="ADD0">
                                                                        <block type="text" id="K;e6@]em4{IS6]6+3x/H">
                                                                          <field name="TEXT">PV-Überschuss: </field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="ADD1">
                                                                        <block type="on_source" id="ZBo!@07Wskxg)TZmKnK:">
                                                                          <field name="ATTR">state.val</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </statement>
                                          <value name="IF2">
                                            <block type="logic_operation" id="WO4o%(5EKI4M8KD5M;zl">
                                              <field name="OP">AND</field>
                                              <value name="A">
                                                <block type="logic_compare" id=";=AMP;.Z+9R2$uE=U_{l">
                                                  <field name="OP">LT</field>
                                                  <value name="A">
                                                    <block type="on_source" id="Pe)^F$6jv^Uj/=7!,c5%">
                                                      <field name="ATTR">state.val</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="variables_get" id="pn!_b|pHR@9;PEYw#7r[">
                                                      <field name="VAR" id="[cm_4R;3)cv_BI@^],fP">ÜberschussMin</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="variables_get" id="QN{q/2SF|xNy2va!m@?n">
                                                  <field name="VAR" id="V+u7Uf#;)B4bY+w!q#b:">aktiv</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO2">
                                            <block type="timeouts_settimeout" id="pb9p#UNX+Ic$qTJP#C|d">
                                              <field name="NAME">minimum-zeit unterschritten</field>
                                              <field name="DELAY">3</field>
                                              <field name="UNIT">min</field>
                                              <statement name="STATEMENT">
                                                <block type="debug" id="J+en5BYLuXJ:QOji^q:i">
                                                  <field name="Severity">debug</field>
                                                  <value name="TEXT">
                                                    <shadow type="text">
                                                      <field name="TEXT">test</field>
                                                    </shadow>
                                                    <block type="text" id="YZ]8$|Hp^iSG*K$M$?L+">
                                                      <field name="TEXT">sonst falls kleiner ÜberschussMin und aktiv</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="debug" id="l7T~Ynz*guM.E;96*B%~">
                                                      <field name="Severity">log</field>
                                                      <value name="TEXT">
                                                        <shadow type="text">
                                                          <field name="TEXT">test</field>
                                                        </shadow>
                                                        <block type="text" id="a[d!Q.6r9kK+Z!7jS;7-">
                                                          <field name="TEXT">Momentanwert wurde mehr als 3min unterschritten, aktiv=falsch, Benachrichtigung und Warnung Timer stoppen</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="timeouts_cleartimeout" id="4MZ6w%:YKzCaTKqnH9r4">
                                                          <field name="NAME">nächste Warnung</field>
                                                          <next>
                                                            <block type="timeouts_cleartimeout" id="mOfFb{Po,d1Py^t@mb;@">
                                                              <field name="NAME">Benachrichtigung</field>
                                                              <next>
                                                                <block type="variables_set" id="zLg9?*u1BBL}^j%a%l?m">
                                                                  <field name="VAR" id="V+u7Uf#;)B4bY+w!q#b:">aktiv</field>
                                                                  <value name="VALUE">
                                                                    <block type="logic_boolean" id="Q7#0l)u#tqnj:MLsR^Qk">
                                                                      <field name="BOOL">FALSE</field>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="comment" id=")5}dXz#65x)x]o)Q6ct@">
                                                                      <field name="COMMENT">alte Benachrichtigung löschen</field>
                                                                      <next>
                                                                        <block type="controls_if" id="Io{{EN%TbcMivXNk$VRQ">
                                                                          <value name="IF0">
                                                                            <block type="logic_compare" id="^d6+W!})07~kxl_*1?R%">
                                                                              <field name="OP">NEQ</field>
                                                                              <value name="A">
                                                                                <block type="variables_get" id="`x|vFuKKk,8r?-@!n}A3">
                                                                                  <field name="VAR" id="OY|-nxmyPkjf5lu#3k4b">MessageID_old</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="B">
                                                                                <block type="text" id="1H{xq^3NCjNFP,rdf,sJ">
                                                                                  <field name="TEXT"></field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <statement name="DO0">
                                                                            <block type="debug" id="Q?74^SGE%*g:+MHK7egq">
                                                                              <field name="Severity">debug</field>
                                                                              <value name="TEXT">
                                                                                <shadow type="text">
                                                                                  <field name="TEXT">test</field>
                                                                                </shadow>
                                                                                <block type="text" id="yp_jIZhMV$X5ic{vt/Z+">
                                                                                  <field name="TEXT">alte Benachrichtigung für neue löschen</field>
                                                                                </block>
                                                                              </value>
                                                                              <next>
                                                                                <block type="request" id="-,[nMtcIh^e8A*n?/PyY">
                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="false"></mutation>
                                                                                  <field name="WITH_STATEMENT">FALSE</field>
                                                                                  <field name="LOG">debug</field>
                                                                                  <value name="URL">
                                                                                    <shadow type="text">
                                                                                      <field name="TEXT">text</field>
                                                                                    </shadow>
                                                                                    <block type="text_join" id="CGIN9IYmQkmT)MN.TwvK">
                                                                                      <mutation items="6"></mutation>
                                                                                      <value name="ADD0">
                                                                                        <block type="text" id="2%7=ugy#}^2xmN+A/@Sx">
                                                                                          <field name="TEXT">https://api.telegram.org/bot</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD1">
                                                                                        <block type="variables_get" id="yMD$it.T]Nf5R+^s/!#t">
                                                                                          <field name="VAR" id="t735B|g/I)mmA`_=bQf=">Token</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD2">
                                                                                        <block type="text" id="x^lrLQ{Zkm(Oy}il(%#/">
                                                                                          <field name="TEXT">/deleteMessage?chat_id=</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD3">
                                                                                        <block type="variables_get" id="[Dj.{K^j/_TA!QpA];Zl">
                                                                                          <field name="VAR" id="UNwn*kL_@D)gcE`$^mO+">ChatID_old</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD4">
                                                                                        <block type="text" id="R!%rFAYt7l6lI-:365#0">
                                                                                          <field name="TEXT">&amp;message_id=</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ADD5">
                                                                                        <block type="variables_get" id="%!(/hS`v6m|mm0U8D$[W">
                                                                                          <field name="VAR" id="OY|-nxmyPkjf5lu#3k4b">MessageID_old</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </value>
                                                                                  <next>
                                                                                    <block type="variables_set" id="BjZmQFa%y=ix~9V{M|rE">
                                                                                      <field name="VAR" id="OY|-nxmyPkjf5lu#3k4b">MessageID_old</field>
                                                                                      <value name="VALUE">
                                                                                        <block type="text" id="?C83XxOuf5fv0iP0hNmq">
                                                                                          <field name="TEXT"></field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </statement>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </statement>
                                            </block>
                                          </statement>
                                          <value name="IF3">
                                            <block type="logic_compare" id="0^24VPv!_^,UGJ|hYDr(">
                                              <field name="OP">GTE</field>
                                              <value name="A">
                                                <block type="on_source" id="~nC%oAT$ETg$NjK;HW8.">
                                                  <field name="ATTR">state.val</field>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="variables_get" id="sCVR[7~XMq7d[FzfITk6">
                                                  <field name="VAR" id="[cm_4R;3)cv_BI@^],fP">ÜberschussMin</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO3">
                                            <block type="timeouts_cleartimeout" id="[g*JMoCpS(gxV2qmpHj6">
                                              <field name="NAME">minimum-zeit unterschritten</field>
                                            </block>
                                          </statement>
                                        </block>
                                      </next>
                                    </block>
                                  </statement>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
        <block type="procedures_defcustomreturn" id="Av)?|}5mmDBPYHIw~:L;" x="3263" y="1738">
          <mutation statements="false">
            <arg name="url" varid="+uo*h9CiBC;Z6Tu6|]{-"></arg>
          </mutation>
          <field name="NAME">URIencode</field>
          <field name="SCRIPT">dXJsPWVuY29kZVVSSUNvbXBvbmVudCh1cmwpOw0KcmV0dXJuIHVybDs=</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
        </block>
      </xml>
      

      Um deinen Wunsch einer Nulleinspeisung kannst du dich an das zweite Skript anlehnen und nach einer Überschreitung deines kleinsten Verbrauchers bzw. auch nach unterschiedlichen Kombinationen der Verbraucher die eben zuschalten.
      Am besten wäre z.B. deine Poolpumpe mit einem Frequenzumrichter oder deine Poolheizung mit einem Dimmer auszustatten und darüber dessen Leistung linear zum Überschuss zu regeln. Aber ob das irgendwie wirtschaftlich ist und die Kosten irgendwann mal wieder reinholt, mag ich bezweifeln.
      In Zukunft würde ich auch wie du im ersten Schritt einzelne Verbraucher zu- und abschalten, da bin ich aber noch nicht so weit. Handhabe es daher so, dass ich die Spül- Waschmaschine und ggf. Trockner dann einschalte wenn ich die Benachrichtigung bekomme.
      Da man den meisten Überschuss im Sommer hat, bietet es sich an diesen in die Pooltechnik zu schieben, oder eben z.B. in Kühl und Gefrierschrank. Mein Gefrierschrank hat einen Inverter-Kompressor, welcher die Leistung nach Bedarf regelt. Ob es dafür eine Lösung gäbe die Leistung hochzuschrauben wenn es Überschuss gibt?

      posted in Praktische Anwendungen (Showcase)
      H
      h07d0q
    • RE: Energymanagement PV/Solar: Nulleinspeisung

      Gut, um noch was zum Thema beizutragen, habe ich hier zwei von mir geschriebene Blocklys für euch.

      1. Blockly:
        Die notwendigen Datenpunkte vorher anlegen
      • MomentanwertErtrag (PV Momentanleistung)
      • MomentanwertNetz (Smartmeter Momentanleistung über SML ausgelesen und einfach in den DP kopiert; Smartmeter zeigt Negativwerte bei Überschuss)
      • MomentanwertGesamtverbrauch (Netz + PV)
      • MomentanwertÜberschuss (negativer MomentanwertNetz)
      • MomentanwertEigenverbrauch (bei Überschuss gleich Gesamtverbrauch; wenn MomentanwertNetz positiv nur Momentanwert PV)
      • Berechnung der kWh für jeden einzelnen Momentanwert

      0530118c-2db3-48f5-9576-0a1f343b1a2f-image.png

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="izkgJG]@WDEEpP!/*8~;">ioMomentanwertPV</variable>
          <variable id="PkHJv!pTWh5?3nxx]llx">idPower</variable>
          <variable id="k:x2GxV0yr_4bxE=fy6F">idEnergy</variable>
          <variable id="?UBsG=y}eGCj9#{/%}JJ">ioMomentanwertNetz</variable>
          <variable id="Q3-:px;|?IAa-}L]9kty">ooMomentanwertNetz</variable>
          <variable id="p0wl^WGra1tD0aEf5Q}5">ooEnergieNetz</variable>
          <variable id="3S6*S2zc7FI;a4U%b.1I">ooMomentanwertGesamtverbrauch</variable>
          <variable id="llyT,cpBv81et;*xDA?A">ooEnergieGesamtleistung</variable>
          <variable id="UfA3$=x:6j@Q7/--/`2h">ooMomentanwertErtrag</variable>
          <variable id=";VhS{UF5HVCr`X)~]K{T">ooEnergieErtrag</variable>
          <variable id="at6C8ry#oR/wh(q!{hHK">ooMomentanwertEigenverbrauch</variable>
          <variable id="Vi122v6s//L#`,LZNN^r">ooEnergieEigenverbrauch</variable>
          <variable id="$bKg1i(J6[[[jf_Pt0!G">ooMomentanwertÜberschuss</variable>
          <variable id="%z^.9%1Yn=mJlhg{CU[i">ooEnergieÜberschuss</variable>
        </variables>
        <block type="variables_set" id="m;Hw?hl(18qe(/zD/.uR" x="62" y="40">
          <field name="VAR" id="izkgJG]@WDEEpP!/*8~;">ioMomentanwertPV</field>
          <value name="VALUE">
            <block type="field_oid" id=".Sq$76PP~MM!pC[#/Y)D">
              <field name="oid">shelly.0.SHSW-25#68C63AF9DB86#1.Relay0.Power</field>
            </block>
          </value>
          <next>
            <block type="variables_set" id="DC!nK%Ay!*[`G*Hb_JQb">
              <field name="VAR" id="?UBsG=y}eGCj9#{/%}JJ">ioMomentanwertNetz</field>
              <value name="VALUE">
                <block type="field_oid" id="s/3QJ,dTSc@U5Llqr}XX">
                  <field name="oid">smartmeter.0.1-0:16_7_0__255.value</field>
                </block>
              </value>
              <next>
                <block type="variables_set" id="$GvaqSv31]X$Vi8(n?uW">
                  <field name="VAR" id="Q3-:px;|?IAa-}L]9kty">ooMomentanwertNetz</field>
                  <value name="VALUE">
                    <block type="field_oid" id="H!~DRB..T%_QJJ?#oQ{l">
                      <field name="oid">0_userdata.0.PV.MomentanwertNetz</field>
                    </block>
                  </value>
                  <next>
                    <block type="variables_set" id="zBdH}Lge{Jz[$D5(g5|B">
                      <field name="VAR" id="p0wl^WGra1tD0aEf5Q}5">ooEnergieNetz</field>
                      <value name="VALUE">
                        <block type="field_oid" id="(WLOP*|_f7tV{_+eWw(8">
                          <field name="oid">0_userdata.0.PV.EnergieNetz</field>
                        </block>
                      </value>
                      <next>
                        <block type="variables_set" id="D8f=Ch/Kx/_e^gW/SplZ">
                          <field name="VAR" id="3S6*S2zc7FI;a4U%b.1I">ooMomentanwertGesamtverbrauch</field>
                          <value name="VALUE">
                            <block type="field_oid" id="3C8qMwOP,|uAp/W.qVC;">
                              <field name="oid">0_userdata.0.PV.MomentanwertGesamtleistung</field>
                            </block>
                          </value>
                          <next>
                            <block type="variables_set" id="{(]Z1_[0^VsI|U}7F-2z">
                              <field name="VAR" id="llyT,cpBv81et;*xDA?A">ooEnergieGesamtleistung</field>
                              <value name="VALUE">
                                <block type="field_oid" id="`Y%RF{{~U5DuY}wHt^E6">
                                  <field name="oid">0_userdata.0.PV.EnergieGesamtleistung</field>
                                </block>
                              </value>
                              <next>
                                <block type="variables_set" id="WA8}$f/;NE(n(3-zB})*">
                                  <field name="VAR" id="UfA3$=x:6j@Q7/--/`2h">ooMomentanwertErtrag</field>
                                  <value name="VALUE">
                                    <block type="field_oid" id="Lsulr)ug!LB0!5WQ#Xi0">
                                      <field name="oid">0_userdata.0.PV.MomentanwertErtrag</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="variables_set" id="?LAZWj{XKdBeOk+K]=.#">
                                      <field name="VAR" id=";VhS{UF5HVCr`X)~]K{T">ooEnergieErtrag</field>
                                      <value name="VALUE">
                                        <block type="field_oid" id="2*?cX2~2nOCO3usyRcE`">
                                          <field name="oid">0_userdata.0.PV.EnergieErtrag</field>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="variables_set" id="VOh$l88,|TgM-Br8N5*y">
                                          <field name="VAR" id="at6C8ry#oR/wh(q!{hHK">ooMomentanwertEigenverbrauch</field>
                                          <value name="VALUE">
                                            <block type="field_oid" id="w7KVM)8m)~?vF~(_dEuU">
                                              <field name="oid">0_userdata.0.PV.MomentanwertEigenverbrauch</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="variables_set" id="%VgeoDvmJ?eE-HRhLZbK">
                                              <field name="VAR" id="Vi122v6s//L#`,LZNN^r">ooEnergieEigenverbrauch</field>
                                              <value name="VALUE">
                                                <block type="field_oid" id="F[%w!.$DhIdgis?hyA/=">
                                                  <field name="oid">0_userdata.0.PV.EnergieErtrag</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="gQlVBQO-|lwMcb#e9u[U">
                                                  <field name="VAR" id="$bKg1i(J6[[[jf_Pt0!G">ooMomentanwertÜberschuss</field>
                                                  <value name="VALUE">
                                                    <block type="field_oid" id="+y9t+S?9x3D/W`8L6)N^">
                                                      <field name="oid">0_userdata.0.PV.MomentanwertÜberschuss</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id="y)%+KqjQFn7ID+lkF!;F">
                                                      <field name="VAR" id="%z^.9%1Yn=mJlhg{CU[i">ooEnergieÜberschuss</field>
                                                      <value name="VALUE">
                                                        <block type="field_oid" id="{@Xm$uF.SL=csDC|NF(E">
                                                          <field name="oid">0_userdata.0.PV.EnergieÜberschuss</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="on_ext" id="Q89%4z()rdZS1X5b+A^)">
                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
                                                          <field name="CONDITION">ne</field>
                                                          <field name="ACK_CONDITION"></field>
                                                          <value name="OID0">
                                                            <shadow type="field_oid" id="G=8?`s#~Ut?pH;x9NFA|">
                                                              <field name="oid">default</field>
                                                            </shadow>
                                                            <block type="variables_get" id="Px}MnKP,3KD{~kID|D0q">
                                                              <field name="VAR" id="izkgJG]@WDEEpP!/*8~;">ioMomentanwertPV</field>
                                                            </block>
                                                          </value>
                                                          <value name="OID1">
                                                            <block type="variables_get" id="MgAp4kGq[H+N*X)RpJM4">
                                                              <field name="VAR" id="?UBsG=y}eGCj9#{/%}JJ">ioMomentanwertNetz</field>
                                                            </block>
                                                          </value>
                                                          <statement name="STATEMENT">
                                                            <block type="control_ex" id="!yQ4;aibkvpg`CBxqQzR">
                                                              <field name="TYPE">true</field>
                                                              <field name="CLEAR_RUNNING">FALSE</field>
                                                              <value name="OID">
                                                                <shadow type="field_oid" id="/,v9}nx;CioIGpSNgRni">
                                                                  <field name="oid">Object ID</field>
                                                                </shadow>
                                                                <block type="variables_get" id="U$MPI`3]vhVFSx10[3U{">
                                                                  <field name="VAR" id="UfA3$=x:6j@Q7/--/`2h">ooMomentanwertErtrag</field>
                                                                </block>
                                                              </value>
                                                              <value name="VALUE">
                                                                <shadow type="logic_boolean" id="-D=jWf*EYIH.l)3)JOXQ">
                                                                  <field name="BOOL">TRUE</field>
                                                                </shadow>
                                                                <block type="math_rndfixed" id="(9hU/@P/_r4`whj8UiJ(">
                                                                  <field name="n">1</field>
                                                                  <value name="x">
                                                                    <shadow type="math_number">
                                                                      <field name="NUM">3.1234</field>
                                                                    </shadow>
                                                                    <block type="get_value_var" id="ns:ynA5c?/~$X,5!^;wh">
                                                                      <field name="ATTR">val</field>
                                                                      <value name="OID">
                                                                        <shadow type="text">
                                                                          <field name="TEXT"></field>
                                                                        </shadow>
                                                                        <block type="variables_get" id="Li4qOR%0o{uXPbWy:H1/">
                                                                          <field name="VAR" id="izkgJG]@WDEEpP!/*8~;">ioMomentanwertPV</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <value name="DELAY_MS">
                                                                <shadow type="math_number" id="v,DOCWi{X5`H}CL1T:`3">
                                                                  <field name="NUM">0</field>
                                                                </shadow>
                                                              </value>
                                                              <next>
                                                                <block type="control_ex" id="i~(Nj]MQDIY^T_;dqWzl">
                                                                  <field name="TYPE">true</field>
                                                                  <field name="CLEAR_RUNNING">FALSE</field>
                                                                  <value name="OID">
                                                                    <shadow type="field_oid">
                                                                      <field name="oid">Object ID</field>
                                                                    </shadow>
                                                                    <block type="variables_get" id="S{ZzU0e}-Hn;ci4e2AP[">
                                                                      <field name="VAR" id="Q3-:px;|?IAa-}L]9kty">ooMomentanwertNetz</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="VALUE">
                                                                    <shadow type="logic_boolean">
                                                                      <field name="BOOL">TRUE</field>
                                                                    </shadow>
                                                                    <block type="math_rndfixed" id="D+D@,SSOM@#O}n*G{g]N">
                                                                      <field name="n">1</field>
                                                                      <value name="x">
                                                                        <shadow type="math_number">
                                                                          <field name="NUM">3.1234</field>
                                                                        </shadow>
                                                                        <block type="get_value_var" id="kIgLHah,fJZ}bsG9W|G9">
                                                                          <field name="ATTR">val</field>
                                                                          <value name="OID">
                                                                            <shadow type="text">
                                                                              <field name="TEXT"></field>
                                                                            </shadow>
                                                                            <block type="variables_get" id="z%nKg}Sqvla43gk+TP[q">
                                                                              <field name="VAR" id="?UBsG=y}eGCj9#{/%}JJ">ioMomentanwertNetz</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <value name="DELAY_MS">
                                                                    <shadow type="math_number" id="-`OZ2KCKW0g/Fw+H^(=R">
                                                                      <field name="NUM">0</field>
                                                                    </shadow>
                                                                  </value>
                                                                  <next>
                                                                    <block type="control_ex" id="OWp[|C;Ik;T@^y6Q=Vwk">
                                                                      <field name="TYPE">true</field>
                                                                      <field name="CLEAR_RUNNING">FALSE</field>
                                                                      <value name="OID">
                                                                        <shadow type="field_oid">
                                                                          <field name="oid">Object ID</field>
                                                                        </shadow>
                                                                        <block type="variables_get" id="3T{9[k+^1_E[Y5R?#Zc=">
                                                                          <field name="VAR" id="3S6*S2zc7FI;a4U%b.1I">ooMomentanwertGesamtverbrauch</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="VALUE">
                                                                        <shadow type="logic_boolean">
                                                                          <field name="BOOL">TRUE</field>
                                                                        </shadow>
                                                                        <block type="math_rndfixed" id="V7dk-f..mDlz2+ctinz}">
                                                                          <field name="n">1</field>
                                                                          <value name="x">
                                                                            <shadow type="math_number">
                                                                              <field name="NUM">3.1234</field>
                                                                            </shadow>
                                                                            <block type="math_arithmetic" id="RQgl2EpgehH(tj]$G!hE">
                                                                              <field name="OP">ADD</field>
                                                                              <value name="A">
                                                                                <shadow type="math_number">
                                                                                  <field name="NUM">1</field>
                                                                                </shadow>
                                                                                <block type="get_value_var" id="q}.zZ[Tti*AM`4H4q~TF">
                                                                                  <field name="ATTR">val</field>
                                                                                  <value name="OID">
                                                                                    <shadow type="text">
                                                                                      <field name="TEXT"></field>
                                                                                    </shadow>
                                                                                    <block type="variables_get" id="go-GXpzlVDKA2wrf2BOy">
                                                                                      <field name="VAR" id="?UBsG=y}eGCj9#{/%}JJ">ioMomentanwertNetz</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                              <value name="B">
                                                                                <shadow type="math_number">
                                                                                  <field name="NUM">1</field>
                                                                                </shadow>
                                                                                <block type="get_value_var" id="LJnzkZ]z.{{8ILF5Gn5F">
                                                                                  <field name="ATTR">val</field>
                                                                                  <value name="OID">
                                                                                    <shadow type="text">
                                                                                      <field name="TEXT"></field>
                                                                                    </shadow>
                                                                                    <block type="variables_get" id="~8]pWQx8or~)]fOWiIU_">
                                                                                      <field name="VAR" id="izkgJG]@WDEEpP!/*8~;">ioMomentanwertPV</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <value name="DELAY_MS">
                                                                        <shadow type="math_number" id="bep0(E^LcSQjZ=%oiUo{">
                                                                          <field name="NUM">0</field>
                                                                        </shadow>
                                                                      </value>
                                                                      <next>
                                                                        <block type="controls_if" id="D`!QwbW8F9imZ8RQOf_;">
                                                                          <mutation else="1"></mutation>
                                                                          <value name="IF0">
                                                                            <block type="math_number_property" id="Uasn0252g-cnO0`!@lIj">
                                                                              <mutation divisor_input="false"></mutation>
                                                                              <field name="PROPERTY">NEGATIVE</field>
                                                                              <value name="NUMBER_TO_CHECK">
                                                                                <shadow type="math_number" id="x/t$m$d~^];:r4t}I7Ed">
                                                                                  <field name="NUM">0</field>
                                                                                </shadow>
                                                                                <block type="get_value_var" id="ANLj5!{994Ci)hom88.J">
                                                                                  <field name="ATTR">val</field>
                                                                                  <value name="OID">
                                                                                    <shadow type="text">
                                                                                      <field name="TEXT"></field>
                                                                                    </shadow>
                                                                                    <block type="variables_get" id="|MY/.~39D.Cmp9UY3x^i">
                                                                                      <field name="VAR" id="?UBsG=y}eGCj9#{/%}JJ">ioMomentanwertNetz</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <statement name="DO0">
                                                                            <block type="comment" id="2w^7kbr!a[8QKFzJYD^#">
                                                                              <field name="COMMENT">Überschuss</field>
                                                                              <next>
                                                                                <block type="control_ex" id=".kIU*93Fp^Kst]u(-)uB">
                                                                                  <field name="TYPE">true</field>
                                                                                  <field name="CLEAR_RUNNING">FALSE</field>
                                                                                  <value name="OID">
                                                                                    <shadow type="field_oid">
                                                                                      <field name="oid">Object ID</field>
                                                                                    </shadow>
                                                                                    <block type="variables_get" id=":#,/i}!f.kJZ`dOxsIRA">
                                                                                      <field name="VAR" id="$bKg1i(J6[[[jf_Pt0!G">ooMomentanwertÜberschuss</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="VALUE">
                                                                                    <shadow type="logic_boolean" id="bbN.]ZvNIa.~([%ezG]f">
                                                                                      <field name="BOOL">TRUE</field>
                                                                                    </shadow>
                                                                                    <block type="math_rndfixed" id="fel784_F!CWA]vohTPJq">
                                                                                      <field name="n">1</field>
                                                                                      <value name="x">
                                                                                        <shadow type="math_number" id="*8}]PUg_,p(%Xg4H^R~k">
                                                                                          <field name="NUM">3.1234</field>
                                                                                        </shadow>
                                                                                        <block type="math_arithmetic" id="f%mD)rl4YnE4r{}e6iIL">
                                                                                          <field name="OP">MULTIPLY</field>
                                                                                          <value name="A">
                                                                                            <shadow type="math_number" id="=yas,#u16i{Agyuo2W]R">
                                                                                              <field name="NUM">1</field>
                                                                                            </shadow>
                                                                                            <block type="get_value_var" id="Gnbd4RIK-3QGdh$}c}RZ">
                                                                                              <field name="ATTR">val</field>
                                                                                              <value name="OID">
                                                                                                <shadow type="text">
                                                                                                  <field name="TEXT"></field>
                                                                                                </shadow>
                                                                                                <block type="variables_get" id="*H]1G16xXC(:rLTdG)(}">
                                                                                                  <field name="VAR" id="?UBsG=y}eGCj9#{/%}JJ">ioMomentanwertNetz</field>
                                                                                                </block>
                                                                                              </value>
                                                                                            </block>
                                                                                          </value>
                                                                                          <value name="B">
                                                                                            <shadow type="math_number" id="ecc^M9|X$]S`f6vCpERb">
                                                                                              <field name="NUM">-1</field>
                                                                                            </shadow>
                                                                                          </value>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="DELAY_MS">
                                                                                    <shadow type="math_number" id="(sLcC0e}o~#tAT}.)v{b">
                                                                                      <field name="NUM">0</field>
                                                                                    </shadow>
                                                                                  </value>
                                                                                  <next>
                                                                                    <block type="control_ex" id="#jEWHj8OYUM*~Z8^X0pz">
                                                                                      <field name="TYPE">true</field>
                                                                                      <field name="CLEAR_RUNNING">FALSE</field>
                                                                                      <value name="OID">
                                                                                        <shadow type="field_oid">
                                                                                          <field name="oid">Object ID</field>
                                                                                        </shadow>
                                                                                        <block type="variables_get" id="||9MAx5iNX]`n/q}$w%v">
                                                                                          <field name="VAR" id="at6C8ry#oR/wh(q!{hHK">ooMomentanwertEigenverbrauch</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="VALUE">
                                                                                        <shadow type="logic_boolean">
                                                                                          <field name="BOOL">TRUE</field>
                                                                                        </shadow>
                                                                                        <block type="math_rndfixed" id="Gou3meWE5o6J)=Qx^vDY">
                                                                                          <field name="n">1</field>
                                                                                          <value name="x">
                                                                                            <shadow type="math_number">
                                                                                              <field name="NUM">3.1234</field>
                                                                                            </shadow>
                                                                                            <block type="math_arithmetic" id="raqa:GJg8q)|?B%Qk_@u">
                                                                                              <field name="OP">ADD</field>
                                                                                              <value name="A">
                                                                                                <shadow type="math_number">
                                                                                                  <field name="NUM">1</field>
                                                                                                </shadow>
                                                                                                <block type="get_value_var" id="t$dt,hI0E^33_ijk.rO7">
                                                                                                  <field name="ATTR">val</field>
                                                                                                  <value name="OID">
                                                                                                    <shadow type="text">
                                                                                                      <field name="TEXT"></field>
                                                                                                    </shadow>
                                                                                                    <block type="variables_get" id="h6UYt4sPO+@3v(=py6*9">
                                                                                                      <field name="VAR" id="izkgJG]@WDEEpP!/*8~;">ioMomentanwertPV</field>
                                                                                                    </block>
                                                                                                  </value>
                                                                                                </block>
                                                                                              </value>
                                                                                              <value name="B">
                                                                                                <shadow type="math_number" id="@`{=eYz*f@COoX_#*{D!">
                                                                                                  <field name="NUM">1</field>
                                                                                                </shadow>
                                                                                                <block type="get_value_var" id="AGeeCoGSTt-|{s?U,;,(">
                                                                                                  <field name="ATTR">val</field>
                                                                                                  <value name="OID">
                                                                                                    <shadow type="text">
                                                                                                      <field name="TEXT"></field>
                                                                                                    </shadow>
                                                                                                    <block type="variables_get" id="xlO43#PZ-(-/Z^iiou1S">
                                                                                                      <field name="VAR" id="?UBsG=y}eGCj9#{/%}JJ">ioMomentanwertNetz</field>
                                                                                                    </block>
                                                                                                  </value>
                                                                                                </block>
                                                                                              </value>
                                                                                            </block>
                                                                                          </value>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="DELAY_MS">
                                                                                        <shadow type="math_number" id="~L}wlG$}`NutF(1T(+mO">
                                                                                          <field name="NUM">0</field>
                                                                                        </shadow>
                                                                                      </value>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </statement>
                                                                          <statement name="ELSE">
                                                                            <block type="comment" id="~Tl6}SiA[B?/Ge[Aj4qq">
                                                                              <field name="COMMENT">kein Überschuss</field>
                                                                              <next>
                                                                                <block type="control_ex" id="$Y09Eao=FiDW[li/1SS.">
                                                                                  <field name="TYPE">true</field>
                                                                                  <field name="CLEAR_RUNNING">FALSE</field>
                                                                                  <value name="OID">
                                                                                    <shadow type="field_oid">
                                                                                      <field name="oid">Object ID</field>
                                                                                    </shadow>
                                                                                    <block type="variables_get" id=")5*ui8M7uJ.$up)HYc3%">
                                                                                      <field name="VAR" id="$bKg1i(J6[[[jf_Pt0!G">ooMomentanwertÜberschuss</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="VALUE">
                                                                                    <shadow type="logic_boolean" id="gL)cfGa^S!hf+!4jQk_q">
                                                                                      <field name="BOOL">TRUE</field>
                                                                                    </shadow>
                                                                                    <block type="math_number" id="+[VAmghxH8cfn:GTB8OT">
                                                                                      <field name="NUM">0</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="DELAY_MS">
                                                                                    <shadow type="math_number" id="XrZrD6JbC.B9k}eMA!hN">
                                                                                      <field name="NUM">0</field>
                                                                                    </shadow>
                                                                                  </value>
                                                                                  <next>
                                                                                    <block type="control_ex" id="~%%1IlP6yy@1%X(r*[GD">
                                                                                      <field name="TYPE">true</field>
                                                                                      <field name="CLEAR_RUNNING">FALSE</field>
                                                                                      <value name="OID">
                                                                                        <shadow type="field_oid">
                                                                                          <field name="oid">Object ID</field>
                                                                                        </shadow>
                                                                                        <block type="variables_get" id="/)e[0Z-xOx.}5wG-jxl#">
                                                                                          <field name="VAR" id="at6C8ry#oR/wh(q!{hHK">ooMomentanwertEigenverbrauch</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="VALUE">
                                                                                        <shadow type="logic_boolean">
                                                                                          <field name="BOOL">TRUE</field>
                                                                                        </shadow>
                                                                                        <block type="math_rndfixed" id="H7sIENM!lQ-t6.(vs;,O">
                                                                                          <field name="n">1</field>
                                                                                          <value name="x">
                                                                                            <shadow type="math_number" id="pg(gf-9:B8Ei$h?XGSv.">
                                                                                              <field name="NUM">3.1234</field>
                                                                                            </shadow>
                                                                                            <block type="get_value_var" id="rb}@?LLu^pn_ohK}Fb`$">
                                                                                              <field name="ATTR">val</field>
                                                                                              <value name="OID">
                                                                                                <shadow type="text">
                                                                                                  <field name="TEXT"></field>
                                                                                                </shadow>
                                                                                                <block type="variables_get" id="LP/b]@dl@+XNn@HA:K46">
                                                                                                  <field name="VAR" id="izkgJG]@WDEEpP!/*8~;">ioMomentanwertPV</field>
                                                                                                </block>
                                                                                              </value>
                                                                                            </block>
                                                                                          </value>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="DELAY_MS">
                                                                                        <shadow type="math_number" id="`m`2MG7`;6SHfuWZ]5gQ">
                                                                                          <field name="NUM">0</field>
                                                                                        </shadow>
                                                                                      </value>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </statement>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </statement>
                                                          <next>
                                                            <block type="procedures_callcustomnoreturn" id="4NPS7?bggL$oA0y|8/UM">
                                                              <mutation name="kWh berechnen">
                                                                <arg name="idPower"></arg>
                                                                <arg name="idEnergy"></arg>
                                                              </mutation>
                                                              <value name="ARG0">
                                                                <block type="variables_get" id="!~hSC9J3Uf6#0{Ar#%|v">
                                                                  <field name="VAR" id="UfA3$=x:6j@Q7/--/`2h">ooMomentanwertErtrag</field>
                                                                </block>
                                                              </value>
                                                              <value name="ARG1">
                                                                <block type="variables_get" id="oE|bP5,^{5*:2Bifm=ye">
                                                                  <field name="VAR" id=";VhS{UF5HVCr`X)~]K{T">ooEnergieErtrag</field>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="procedures_callcustomnoreturn" id="JkjewDAT~3^{cj*I[0#J">
                                                                  <mutation name="kWh berechnen">
                                                                    <arg name="idPower"></arg>
                                                                    <arg name="idEnergy"></arg>
                                                                  </mutation>
                                                                  <value name="ARG0">
                                                                    <block type="variables_get" id="60/Dc(/nzA^tLjM=+_a}">
                                                                      <field name="VAR" id="?UBsG=y}eGCj9#{/%}JJ">ioMomentanwertNetz</field>
                                                                    </block>
                                                                  </value>
                                                                  <value name="ARG1">
                                                                    <block type="variables_get" id="5o{hbOnwC!#l4j9D1i,$">
                                                                      <field name="VAR" id="p0wl^WGra1tD0aEf5Q}5">ooEnergieNetz</field>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="procedures_callcustomnoreturn" id="O3-v19Kw0LHCe}Di*:ep">
                                                                      <mutation name="kWh berechnen">
                                                                        <arg name="idPower"></arg>
                                                                        <arg name="idEnergy"></arg>
                                                                      </mutation>
                                                                      <value name="ARG0">
                                                                        <block type="variables_get" id="$Ol%U_BAmg`Z1n_R)Pvh">
                                                                          <field name="VAR" id="3S6*S2zc7FI;a4U%b.1I">ooMomentanwertGesamtverbrauch</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="ARG1">
                                                                        <block type="variables_get" id="1fp6*[7d81{[pJju;ef;">
                                                                          <field name="VAR" id="llyT,cpBv81et;*xDA?A">ooEnergieGesamtleistung</field>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="procedures_callcustomnoreturn" id="1Xf#HNN!9g7Qn?+bmI*=">
                                                                          <mutation name="kWh berechnen">
                                                                            <arg name="idPower"></arg>
                                                                            <arg name="idEnergy"></arg>
                                                                          </mutation>
                                                                          <value name="ARG0">
                                                                            <block type="variables_get" id="$5S~6Yw^L6jP,CaZ[)v=">
                                                                              <field name="VAR" id="$bKg1i(J6[[[jf_Pt0!G">ooMomentanwertÜberschuss</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="ARG1">
                                                                            <block type="variables_get" id="!I#n1|KSvgut?=hBBZGd">
                                                                              <field name="VAR" id="%z^.9%1Yn=mJlhg{CU[i">ooEnergieÜberschuss</field>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="procedures_callcustomnoreturn" id="o^81W3F{e7Qz?Zy^;,20">
                                                                              <mutation name="kWh berechnen">
                                                                                <arg name="idPower"></arg>
                                                                                <arg name="idEnergy"></arg>
                                                                              </mutation>
                                                                              <value name="ARG0">
                                                                                <block type="variables_get" id="x6*g04YU;NLgH_11jLYt">
                                                                                  <field name="VAR" id="at6C8ry#oR/wh(q!{hHK">ooMomentanwertEigenverbrauch</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="ARG1">
                                                                                <block type="variables_get" id="{t5msqp_#r:}2)3;ZgUn">
                                                                                  <field name="VAR" id="Vi122v6s//L#`,LZNN^r">ooEnergieEigenverbrauch</field>
                                                                                </block>
                                                                              </value>
                                                                              <next>
                                                                                <block type="schedule" id="I00bCdg5aDfH0YCZY^.Z">
                                                                                  <field name="SCHEDULE">{"time":{"exactTime":true,"start":"00:00"},"period":{"days":1}}</field>
                                                                                  <statement name="STATEMENT">
                                                                                    <block type="control_ex" id="Lk@v2y7:xWk}b/66hoEe">
                                                                                      <field name="TYPE">true</field>
                                                                                      <field name="CLEAR_RUNNING">FALSE</field>
                                                                                      <value name="OID">
                                                                                        <shadow type="field_oid" id="x{kTqkUr=Grc5]FYI1tC">
                                                                                          <field name="oid">Object ID</field>
                                                                                        </shadow>
                                                                                        <block type="variables_get" id="b-$ltTD9au58#yRtY1#6">
                                                                                          <field name="VAR" id="llyT,cpBv81et;*xDA?A">ooEnergieGesamtleistung</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="VALUE">
                                                                                        <shadow type="logic_boolean" id="(2zAoc0-2(#YDikxsHs7">
                                                                                          <field name="BOOL">TRUE</field>
                                                                                        </shadow>
                                                                                        <block type="math_number" id="oY}_%=ngkMIm/~kB29cu">
                                                                                          <field name="NUM">0</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="DELAY_MS">
                                                                                        <shadow type="math_number" id="A]wbzrB3e)4S#OIs+~BQ">
                                                                                          <field name="NUM">0</field>
                                                                                        </shadow>
                                                                                      </value>
                                                                                      <next>
                                                                                        <block type="control_ex" id="(WDur9^Ph%U4tPv[Ie_w">
                                                                                          <field name="TYPE">true</field>
                                                                                          <field name="CLEAR_RUNNING">FALSE</field>
                                                                                          <value name="OID">
                                                                                            <shadow type="field_oid">
                                                                                              <field name="oid">Object ID</field>
                                                                                            </shadow>
                                                                                            <block type="variables_get" id="3LsdOigJ@qvLI3xBjp:=">
                                                                                              <field name="VAR" id=";VhS{UF5HVCr`X)~]K{T">ooEnergieErtrag</field>
                                                                                            </block>
                                                                                          </value>
                                                                                          <value name="VALUE">
                                                                                            <shadow type="logic_boolean">
                                                                                              <field name="BOOL">TRUE</field>
                                                                                            </shadow>
                                                                                            <block type="math_number" id="[yLBAczpsQ,rl3c^H!P0">
                                                                                              <field name="NUM">0</field>
                                                                                            </block>
                                                                                          </value>
                                                                                          <value name="DELAY_MS">
                                                                                            <shadow type="math_number" id="zRfEwJ?LeIsxG37!ts=i">
                                                                                              <field name="NUM">0</field>
                                                                                            </shadow>
                                                                                          </value>
                                                                                          <next>
                                                                                            <block type="control_ex" id="j:w6xv%_~=%c@an7m3Bw">
                                                                                              <field name="TYPE">true</field>
                                                                                              <field name="CLEAR_RUNNING">FALSE</field>
                                                                                              <value name="OID">
                                                                                                <shadow type="field_oid">
                                                                                                  <field name="oid">Object ID</field>
                                                                                                </shadow>
                                                                                                <block type="variables_get" id="O=bf4/P=|~z^J(-wi2q(">
                                                                                                  <field name="VAR" id="p0wl^WGra1tD0aEf5Q}5">ooEnergieNetz</field>
                                                                                                </block>
                                                                                              </value>
                                                                                              <value name="VALUE">
                                                                                                <shadow type="logic_boolean">
                                                                                                  <field name="BOOL">TRUE</field>
                                                                                                </shadow>
                                                                                                <block type="math_number" id="N^o~`lX[cH%Tzr+05(Yy">
                                                                                                  <field name="NUM">0</field>
                                                                                                </block>
                                                                                              </value>
                                                                                              <value name="DELAY_MS">
                                                                                                <shadow type="math_number" id="J5[PRk-5-(~76laKZsG.">
                                                                                                  <field name="NUM">0</field>
                                                                                                </shadow>
                                                                                              </value>
                                                                                              <next>
                                                                                                <block type="control_ex" id="]?1@zcPlBvl;W4xjX|FG">
                                                                                                  <field name="TYPE">true</field>
                                                                                                  <field name="CLEAR_RUNNING">FALSE</field>
                                                                                                  <value name="OID">
                                                                                                    <shadow type="field_oid">
                                                                                                      <field name="oid">Object ID</field>
                                                                                                    </shadow>
                                                                                                    <block type="variables_get" id="0g9+mQNVrYfCsHfkI.HZ">
                                                                                                      <field name="VAR" id="%z^.9%1Yn=mJlhg{CU[i">ooEnergieÜberschuss</field>
                                                                                                    </block>
                                                                                                  </value>
                                                                                                  <value name="VALUE">
                                                                                                    <shadow type="logic_boolean">
                                                                                                      <field name="BOOL">TRUE</field>
                                                                                                    </shadow>
                                                                                                    <block type="math_number" id="l%v`]{cSaKZpVR[Dd.Qn">
                                                                                                      <field name="NUM">0</field>
                                                                                                    </block>
                                                                                                  </value>
                                                                                                  <value name="DELAY_MS">
                                                                                                    <shadow type="math_number" id="s:UY#M~?Lt1(n-`dIU`C">
                                                                                                      <field name="NUM">0</field>
                                                                                                    </shadow>
                                                                                                  </value>
                                                                                                </block>
                                                                                              </next>
                                                                                            </block>
                                                                                          </next>
                                                                                        </block>
                                                                                      </next>
                                                                                    </block>
                                                                                  </statement>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
        <block type="procedures_defcustomnoreturn" id="p|(xFb6nb}3ab{(ZuXW6" x="587" y="1913">
          <mutation statements="false">
            <arg name="idPower" varid="PkHJv!pTWh5?3nxx]llx"></arg>
            <arg name="idEnergy" varid="k:x2GxV0yr_4bxE=fy6F"></arg>
          </mutation>
          <field name="NAME">kWh berechnen</field>
          <field name="SCRIPT">Ly9odHRwczovL2ZvcnVtLmlvYnJva2VyLm5ldC90b3BpYy8xNzMwOS9nZWwlQzMlQjZzdC1rd2gtYmVyZWNobmVuLXVuZC1mb3J0bGF1ZmVuZC1zcGVpY2hlcm4vMzg/bGFuZz1kZQ0KDQovL2NvbnN0IGlkUG93ZXIgPSAnamF2YXNjcmlwdC4wLnh4eC5wb3dlcic7ICAvLyBjdXJfcG93ZXINCi8vY29uc3QgaWRFbmVyZ3kgPSAneHh4LmtXaCc7ICAvLyBrV2gNCiANCmNvbnN0IGluaXRpYWxLd2ggPSAwLjA7IC8vIGtXaCBhdCBiZWdpbg0KdmFyIGVuZXJneSA9IDA7DQogDQovLyBFbmVyZ2llLURhdGVucHVua3QgZXJ6ZXVnZW4NCmNyZWF0ZVN0YXRlKGlkRW5lcmd5LCBpbml0aWFsS3doLCB7IHR5cGU6ICdudW1iZXInLCB1bml0OiAna1doJyB9LA0KICAgICgpID0+IGVuZXJneSA9IDEwMDAgKiBnZXRTdGF0ZShpZEVuZXJneSkudmFsDQopOyAvLyBBbmZhbmdzd2VydCBhbnBhc3NlbiAhDQogDQpvbih7IGlkOiBpZFBvd2VyIH0sIGZ1bmN0aW9uIChkcCkgew0KICAgIGVuZXJneSA9IDEwMDAgKiBnZXRTdGF0ZShpZEVuZXJneSkudmFsOyAvL2V2dGwuIHZvcmhhbmRlbmVuIFdlcnQgbGVzZW4NCiAgICBlbmVyZ3kgPSBlbmVyZ3kgKyBkcC5vbGRTdGF0ZS52YWwgKiAoZHAuc3RhdGUudHMgLSBkcC5vbGRTdGF0ZS50cykgLyAzNjAwMDAwOyAvLyBXaA0KICAgIHNldFN0YXRlKGlkRW5lcmd5LCBNYXRoLnJvdW5kKGVuZXJneSkgLyAxMDAwLCB0cnVlKTsgLy8ga1doIG1pdCAzIE5hY2hrb21tYXN0ZWxsZW4NCn0pOw0K</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
        </block>
      </xml>
      

      Eventuell habe ich an der ein oder anderen Stelle einen Denkfehler... die wechselnden Vorzeichen machen es nicht gerade leichter... Die Berechnung der kWh habe ich bisher nicht auf Plausibilität geprüft und der Link der (angepassten) Quelle steckt im Skript. Der Sourceanalytics Adapter ist für mich irgendwie overkill 🙂

      posted in Praktische Anwendungen (Showcase)
      H
      h07d0q
    • RE: WW Zirkulationspumpe bedarfsgerecht ein- und ausschalten

      @noschvie
      meine aktuelle Version habe ich minimal angepasst.

      //https://forum.iobroker.net/post/133815
      //VL
      const idTempVL = 'sonoff.0.HWR.DS18B20-2_Temperature';
      const iddTVL = '0_userdata.0.WWZirkulationspumpe.dTVL';
      const swOn = 0.7;  // Grenzwert in K/min
      var speedVL
      var speedVLold = 0;
      //RL
      const idTempRL = 'sonoff.0.HWR.DS18B20-1_Temperature';
      const iddTRL = '0_userdata.0.WWZirkulationspumpe.dTRL';
      const swOff = 0.3;  // Grenzwert in K/min
      var speedRL
      var speedRLold = 0;
      
      var timer = null, alarmTimer;
      var iAlarmTimer = 40*60000;   // Wenn die Pumpe außergewöhnlich lange läuft
      const minTime = 120000;   // Minimum Zeit in Millisekunden, welche die Pumpe laufen soll, bevor abgeschalten werden kann (TRL ist noch unter swOff)
      const minTemp = 38;      // Minimum Temperatur, bevor die Pumpe wieder läuft
      const minPercent = 0.8;  // Minimum Prozent von RL/VL bevor abgeschalten wird
      var checkMinTimeErreicht = false;      // Check für minTime
      var checkMinSpeedVL = 1;         // Check für minimalen speedVL für Ausschalten, sonst wird zu früh abgeschalten
      var h1, h2
      const idAktor = 'sonoff.0.HWR.POWER2';
      var aktor = getState(idAktor).val;
      on({id: idAktor, ack: true}, function(dp) {aktor = dp.state.val;});
      
      // Erweiterter Log im ioBroker
      const LOG_INFO = true;    // Informationen loggen
      const LOG_DEBUG = false;   // Erweiterter Log für Debugging
      const Telegram_DEBUG = false;   // Erweiterter Log für Debugging
      
      
      //////////////////////////////////////////////////////////
      /* Einschalten bei steigender Vorlauftemperatur */
      on(idTempVL, function(dp) {  // Triggern bei Wertänderung
         h1 = 60000 * (dp.state.val - dp.oldState.val) / (dp.state.lc - dp.oldState.lc);  // K/min
         speedVL = (h1 + speedVLold)/2;
         //if (LOG_DEBUG) console.debug(([Math.round(speedVL*100)/100,' speedVL = (',Math.round(h1*100)/100,' + ',Math.round(speedVLold*100)/100,')/2 K/min'].join('')));
         speedVLold = h1;
         if (speedVL < -5 || speedVL > 5) {return;}
         //if (LOG_DEBUG) console.debug((['state - oldState: ',dp.state.val,' - ',dp.oldState.val,' = ',Math.round((dp.state.val - dp.oldState.val)*100)/100].join('')));
         //if (LOG_DEBUG) console.debug((['TDiff: ',(dp.state.lc - dp.oldState.lc),'ms'].join('')));
         //if (LOG_DEBUG) console.debug(speedVL + ' K/min.');
         setState(iddTVL, Math.round(speedVL*1000)/1000, true);
         
         if (LOG_DEBUG) console.debug('VL: ' + speedVL + ' >= ' + swOn + ' & ' + !aktor + ' & ' + getState(idTempVL).val + ' <= ' + minTemp);
         if (speedVL >= swOn && !aktor && getState(idTempVL).val <= minTemp) {
            setState(idAktor,true);
            var messageText =['Zirkulationspumpe an.  (*dTVL: ',Math.round(speedVL*1000)/1000,', dTRL: ',Math.round(speedRL*1000)/1000,')'].join('');
            //if (Telegram_DEBUG) sendTo("telegram", "send", { text: messageText });
            if (LOG_INFO) console.log((messageText));
            
            /* Prüfung mit Alarm */
            if (!getState("0_userdata.0.Anwesenheit.Status.anyonePresent").val) {
                var messageText =['Zirkulationspumpe an, obwohl niemand da ist!\r\n(*dTVL: ',Math.round(speedVL*1000)/1000,', dTRL: ',Math.round(speedRL*1000)/1000,')'].join('');
                sendTo("telegram", "send", { text: messageText });
                console.error((messageText));
            }
            if (LOG_INFO) console.log(Math.round(speedVL*100)/100 + ' K/min');
            if (LOG_INFO) console.log('Temperatur ist um mehr als ' + swOn + ' K/min gestiegen.');
            //clearTimeout(timer);
            timer = setTimeout(function() {
                //if(aktor) setState(idAktor, false);
              checkMinTimeErreicht = true
            }, minTime);
            alarmTimer = setTimeout(function() {
              var messageText = 'speedRL: ' + Math.round(speedRL*1000)/1000 + ' <= ' + swOff + '\r\nspeedRL: ' + Math.round(speedRL*1000)/1000 + ' > 0 \r\nspeedRL: ' + Math.round(speedRL*1000)/1000 + ' > ' + Math.round(speedRLold*1000)/1000 + '(old)\r\naktor: ' + aktor + '\r\ncheckMinTimeErreicht: ' + checkMinTimeErreicht + '\r\nSpeedVl: ' + Math.round(speedVL*1000)/1000 + ' <= ' + checkMinSpeedVL + '\r\nRL/VL Temp: ' + (getState(idTempRL).val+4.0) + '/' + getState(idTempVL).val + ' = ' + Math.round(((getState(idTempRL).val+4.0)/getState(idTempVL).val)*100)/100 + ' > ' +  minPercent;
              sendTo("telegram", "send", { text: 'Zirkulationspumpe läuft seit mehr als ' + iAlarmTimer/60000 + ' Minuten!\r\n\r\n' + messageText });
            }, iAlarmTimer);
         }
      });
      
      /* Ausschalten bei fallender Rücklauftemperatur, nach minimaler Zeit, bei stagnierender Vorlauftemperatur */
      /* neu: minPercent */
      on(idTempRL, function(dp) {  // Triggern bei Wertänderung
          h2 = 60000 * (dp.state.val - dp.oldState.val) / (dp.state.lc - dp.oldState.lc);  // K/min
          speedRL = (h2 + speedRLold)/2;
          //if (LOG_DEBUG) console.debug(([Math.round(speedRL*100)/100,' speedRL = (',Math.round(h2*100)/100,' + ',Math.round(speedRLold*100)/100,')/2 K/min'].join('')));
          speedRLold = h2;
          if (speedRL < -5 || speedRL > 5) {return;}
          setState(iddTRL, Math.round(speedRL*1000)/1000, true);
          var messageText = 'speedRL: ' + Math.round(speedRL*1000)/1000 + ' <= ' + swOff + '\r\nspeedRL: ' + Math.round(speedRL*1000)/1000 + ' > 0 (deaktiviert) \r\nspeedRL: ' + Math.round(speedRL*1000)/1000 + ' < ' + Math.round(speedRLold*1000)/1000 + '(old)\r\naktor: ' + aktor + '\r\ncheckMinTimeErreicht: ' + checkMinTimeErreicht + '\r\nSpeedVl: ' + Math.round(speedVL*1000)/1000 + ' <= ' + checkMinSpeedVL + '\r\nRL/VL Temp: ' + (getState(idTempRL).val+4.0) + '/' + getState(idTempVL).val + ' = ' + Math.round(((getState(idTempRL).val+4.0)/getState(idTempVL).val)*100)/100 + ' > ' +  minPercent;
          if (LOG_DEBUG) console.debug('RL! ' + messageText);
          //if(speedRL <= swOff && speedRL > 0 && speedRL < speedRLold && aktor && checkMinTimeErreicht && speedVL <= checkMinSpeedVL && (getState(idTempRL).val/getState(idTempVL).val) > minPercent) {
          if(speedRL <= swOff && speedRL < speedRLold && aktor && checkMinTimeErreicht && speedVL <= checkMinSpeedVL && (getState(idTempRL).val/getState(idTempVL).val) > minPercent) {
              clearTimeout(timer);
              checkMinTimeErreicht = false
              setState(idAktor,false);
              messageText = 'Zirkulationspumpe aus\r\n' + messageText
              if (Telegram_DEBUG) sendTo("telegram", "send", { text: messageText });
              if (LOG_INFO) console.log((messageText));
              clearTimeout(alarmTimer);
          }
      });
      
      //Debug
      /*
      if (LOG_DEBUG) {
      on({id: new RegExp(idTempVL + "$|" + idTempRL + "$"), change: "ne"}, async function (obj) {
          console.debug((['(dTVL: ',Math.round(speedVL*1000)/1000,', dTRL: ',Math.round(speedRL*1000)/1000,', aktor: ',aktor,', timeout: ',checkMinTimeErreicht ,')'].join('')));
      });
      }
      */
      

      Das läuft so jetzt schon seit mehr als zwei Jahren und meine Frau hat sich nicht beschwert 😁 Die Infos per Telegram müsste ich eigentlich mal einstampfen. Der Alarm bei zu langer Laufzeit ist auf jeden Fall hilfreich, manchmal ist es in Fehlalarm, wenn der Aktor seit der Aktivierung keine WLAN Verbindung hat z.B.. Wie oben schon erwähnt, ist es nicht zu erwarten, dass beim Zapfen direkt Heißwasser kommt, aber nach kurzer Zeit, oder wenn man kurz zapft und dann wartet.

      posted in Praktische Anwendungen (Showcase)
      H
      h07d0q

    Latest posts made by h07d0q

    • RE: WW Zirkulationspumpe bedarfsgerecht ein- und ausschalten

      @noschvie oh sorry, deine Frage im letzten Post habe ich übersehen.. die Trigger reagieren auf Wertänderung der States vom Tasmota Sensor. Da dieser im Standard alle 10s abgerufen wird, sollte das nicht in meinem Code stehen, da dort die Zeit zwischen neuem und allem Trigger zum Rechnen verwendet wird und nicht starre 10s. Ich könnte mir vermutlich eine eigene Tasmota Firmware kompilieren, welche die Sensoren öfter über MQTT raushaut, aber es funktioniert auch so ausreichend gut.

      posted in Praktische Anwendungen (Showcase)
      H
      h07d0q
    • RE: WW Zirkulationspumpe bedarfsgerecht ein- und ausschalten

      @noschvie said in WW Zirkulationspumpe bedarfsgerecht ein- und ausschalten:

      geht's

      Ohh interessant! Vor allem, dass es vermutlich auch über Rules gehen würde, allerdings vermisse ich den Teil der Rücklauftemperatur-Überwachung zur Abschaltung...

      Schon komisch so eine detaillierte Analyse seines zusammengefrickelten Codes zu lesen😁

      posted in Praktische Anwendungen (Showcase)
      H
      h07d0q
    • RE: WW Zirkulationspumpe bedarfsgerecht ein- und ausschalten

      @noschvie said in WW Zirkulationspumpe bedarfsgerecht ein- und ausschalten:

      mal sehen, ob ChatGPT dafür eine Hilfe ist.

      Viel Erfolg 😬

      posted in Praktische Anwendungen (Showcase)
      H
      h07d0q
    • RE: WW Zirkulationspumpe bedarfsgerecht ein- und ausschalten

      @noschvie
      meine aktuelle Version habe ich minimal angepasst.

      //https://forum.iobroker.net/post/133815
      //VL
      const idTempVL = 'sonoff.0.HWR.DS18B20-2_Temperature';
      const iddTVL = '0_userdata.0.WWZirkulationspumpe.dTVL';
      const swOn = 0.7;  // Grenzwert in K/min
      var speedVL
      var speedVLold = 0;
      //RL
      const idTempRL = 'sonoff.0.HWR.DS18B20-1_Temperature';
      const iddTRL = '0_userdata.0.WWZirkulationspumpe.dTRL';
      const swOff = 0.3;  // Grenzwert in K/min
      var speedRL
      var speedRLold = 0;
      
      var timer = null, alarmTimer;
      var iAlarmTimer = 40*60000;   // Wenn die Pumpe außergewöhnlich lange läuft
      const minTime = 120000;   // Minimum Zeit in Millisekunden, welche die Pumpe laufen soll, bevor abgeschalten werden kann (TRL ist noch unter swOff)
      const minTemp = 38;      // Minimum Temperatur, bevor die Pumpe wieder läuft
      const minPercent = 0.8;  // Minimum Prozent von RL/VL bevor abgeschalten wird
      var checkMinTimeErreicht = false;      // Check für minTime
      var checkMinSpeedVL = 1;         // Check für minimalen speedVL für Ausschalten, sonst wird zu früh abgeschalten
      var h1, h2
      const idAktor = 'sonoff.0.HWR.POWER2';
      var aktor = getState(idAktor).val;
      on({id: idAktor, ack: true}, function(dp) {aktor = dp.state.val;});
      
      // Erweiterter Log im ioBroker
      const LOG_INFO = true;    // Informationen loggen
      const LOG_DEBUG = false;   // Erweiterter Log für Debugging
      const Telegram_DEBUG = false;   // Erweiterter Log für Debugging
      
      
      //////////////////////////////////////////////////////////
      /* Einschalten bei steigender Vorlauftemperatur */
      on(idTempVL, function(dp) {  // Triggern bei Wertänderung
         h1 = 60000 * (dp.state.val - dp.oldState.val) / (dp.state.lc - dp.oldState.lc);  // K/min
         speedVL = (h1 + speedVLold)/2;
         //if (LOG_DEBUG) console.debug(([Math.round(speedVL*100)/100,' speedVL = (',Math.round(h1*100)/100,' + ',Math.round(speedVLold*100)/100,')/2 K/min'].join('')));
         speedVLold = h1;
         if (speedVL < -5 || speedVL > 5) {return;}
         //if (LOG_DEBUG) console.debug((['state - oldState: ',dp.state.val,' - ',dp.oldState.val,' = ',Math.round((dp.state.val - dp.oldState.val)*100)/100].join('')));
         //if (LOG_DEBUG) console.debug((['TDiff: ',(dp.state.lc - dp.oldState.lc),'ms'].join('')));
         //if (LOG_DEBUG) console.debug(speedVL + ' K/min.');
         setState(iddTVL, Math.round(speedVL*1000)/1000, true);
         
         if (LOG_DEBUG) console.debug('VL: ' + speedVL + ' >= ' + swOn + ' & ' + !aktor + ' & ' + getState(idTempVL).val + ' <= ' + minTemp);
         if (speedVL >= swOn && !aktor && getState(idTempVL).val <= minTemp) {
            setState(idAktor,true);
            var messageText =['Zirkulationspumpe an.  (*dTVL: ',Math.round(speedVL*1000)/1000,', dTRL: ',Math.round(speedRL*1000)/1000,')'].join('');
            //if (Telegram_DEBUG) sendTo("telegram", "send", { text: messageText });
            if (LOG_INFO) console.log((messageText));
            
            /* Prüfung mit Alarm */
            if (!getState("0_userdata.0.Anwesenheit.Status.anyonePresent").val) {
                var messageText =['Zirkulationspumpe an, obwohl niemand da ist!\r\n(*dTVL: ',Math.round(speedVL*1000)/1000,', dTRL: ',Math.round(speedRL*1000)/1000,')'].join('');
                sendTo("telegram", "send", { text: messageText });
                console.error((messageText));
            }
            if (LOG_INFO) console.log(Math.round(speedVL*100)/100 + ' K/min');
            if (LOG_INFO) console.log('Temperatur ist um mehr als ' + swOn + ' K/min gestiegen.');
            //clearTimeout(timer);
            timer = setTimeout(function() {
                //if(aktor) setState(idAktor, false);
              checkMinTimeErreicht = true
            }, minTime);
            alarmTimer = setTimeout(function() {
              var messageText = 'speedRL: ' + Math.round(speedRL*1000)/1000 + ' <= ' + swOff + '\r\nspeedRL: ' + Math.round(speedRL*1000)/1000 + ' > 0 \r\nspeedRL: ' + Math.round(speedRL*1000)/1000 + ' > ' + Math.round(speedRLold*1000)/1000 + '(old)\r\naktor: ' + aktor + '\r\ncheckMinTimeErreicht: ' + checkMinTimeErreicht + '\r\nSpeedVl: ' + Math.round(speedVL*1000)/1000 + ' <= ' + checkMinSpeedVL + '\r\nRL/VL Temp: ' + (getState(idTempRL).val+4.0) + '/' + getState(idTempVL).val + ' = ' + Math.round(((getState(idTempRL).val+4.0)/getState(idTempVL).val)*100)/100 + ' > ' +  minPercent;
              sendTo("telegram", "send", { text: 'Zirkulationspumpe läuft seit mehr als ' + iAlarmTimer/60000 + ' Minuten!\r\n\r\n' + messageText });
            }, iAlarmTimer);
         }
      });
      
      /* Ausschalten bei fallender Rücklauftemperatur, nach minimaler Zeit, bei stagnierender Vorlauftemperatur */
      /* neu: minPercent */
      on(idTempRL, function(dp) {  // Triggern bei Wertänderung
          h2 = 60000 * (dp.state.val - dp.oldState.val) / (dp.state.lc - dp.oldState.lc);  // K/min
          speedRL = (h2 + speedRLold)/2;
          //if (LOG_DEBUG) console.debug(([Math.round(speedRL*100)/100,' speedRL = (',Math.round(h2*100)/100,' + ',Math.round(speedRLold*100)/100,')/2 K/min'].join('')));
          speedRLold = h2;
          if (speedRL < -5 || speedRL > 5) {return;}
          setState(iddTRL, Math.round(speedRL*1000)/1000, true);
          var messageText = 'speedRL: ' + Math.round(speedRL*1000)/1000 + ' <= ' + swOff + '\r\nspeedRL: ' + Math.round(speedRL*1000)/1000 + ' > 0 (deaktiviert) \r\nspeedRL: ' + Math.round(speedRL*1000)/1000 + ' < ' + Math.round(speedRLold*1000)/1000 + '(old)\r\naktor: ' + aktor + '\r\ncheckMinTimeErreicht: ' + checkMinTimeErreicht + '\r\nSpeedVl: ' + Math.round(speedVL*1000)/1000 + ' <= ' + checkMinSpeedVL + '\r\nRL/VL Temp: ' + (getState(idTempRL).val+4.0) + '/' + getState(idTempVL).val + ' = ' + Math.round(((getState(idTempRL).val+4.0)/getState(idTempVL).val)*100)/100 + ' > ' +  minPercent;
          if (LOG_DEBUG) console.debug('RL! ' + messageText);
          //if(speedRL <= swOff && speedRL > 0 && speedRL < speedRLold && aktor && checkMinTimeErreicht && speedVL <= checkMinSpeedVL && (getState(idTempRL).val/getState(idTempVL).val) > minPercent) {
          if(speedRL <= swOff && speedRL < speedRLold && aktor && checkMinTimeErreicht && speedVL <= checkMinSpeedVL && (getState(idTempRL).val/getState(idTempVL).val) > minPercent) {
              clearTimeout(timer);
              checkMinTimeErreicht = false
              setState(idAktor,false);
              messageText = 'Zirkulationspumpe aus\r\n' + messageText
              if (Telegram_DEBUG) sendTo("telegram", "send", { text: messageText });
              if (LOG_INFO) console.log((messageText));
              clearTimeout(alarmTimer);
          }
      });
      
      //Debug
      /*
      if (LOG_DEBUG) {
      on({id: new RegExp(idTempVL + "$|" + idTempRL + "$"), change: "ne"}, async function (obj) {
          console.debug((['(dTVL: ',Math.round(speedVL*1000)/1000,', dTRL: ',Math.round(speedRL*1000)/1000,', aktor: ',aktor,', timeout: ',checkMinTimeErreicht ,')'].join('')));
      });
      }
      */
      

      Das läuft so jetzt schon seit mehr als zwei Jahren und meine Frau hat sich nicht beschwert 😁 Die Infos per Telegram müsste ich eigentlich mal einstampfen. Der Alarm bei zu langer Laufzeit ist auf jeden Fall hilfreich, manchmal ist es in Fehlalarm, wenn der Aktor seit der Aktivierung keine WLAN Verbindung hat z.B.. Wie oben schon erwähnt, ist es nicht zu erwarten, dass beim Zapfen direkt Heißwasser kommt, aber nach kurzer Zeit, oder wenn man kurz zapft und dann wartet.

      posted in Praktische Anwendungen (Showcase)
      H
      h07d0q
    • RE: [Vorstellung] Shelly Style Widgets

      Hallo zusammen,

      funktionieren die Widgets bei euch noch? Ich bekomme die bei mir nicht importiert, muss aber gestehen, dass ich es direkt in der Vis-2-beta probiere...
      Mir geht's speziell um den Shutter.

      Hat sich erledigt - in Vis 1 funktioniert der Import. Muss also an Vis-2 liegen.

      posted in Visualisierung
      H
      h07d0q
    • RE: Wunschliste Blockly-Elemente

      Lebt dieses Thema noch?
      Ich bin aktuell auf das gleiche Problem gestoßen, dass ich aus einer Liste einen bekannten Wert löschen wollte und so einen Block nicht gefunden habe. Man könnte natürlich eine Schleife drüber laufen lassen und falls der Wert dem gesuchten Wert entspricht, die betroffene Stelle aus der Liste entfernen.
      Die Javascript Lösung sieht so aus:

      var arr = ['three', 'seven', 'eleven'];
      var filteredArray = arr.filter(e => e !== 'seven')
      

      Letztendlich wird auch hier wie ich verstehe das Array durchlaufen und ein neues ohne den gesuchten Wert erzeugt, es sei aber wohl schneller als mit der slice Funktion von Javascript.
      Man könnte das in einen Javascript Block mit Ergebnis packen, oder aber man führt einen neuen Block ein?
      4261f9af-d1c6-4a82-849a-eed62adb11fd-image.png
      in der Funktion steckt:

      liste.filter(e => e !== filter);
      

      Wenn man die ursprüngliche Liste nicht verlieren möchte, muss man das Ganze so machen:
      bbd69e00-f4fc-43cd-994d-354faf3713b5-image.png
      in der Funktion steckt:

      var f = liste.filter(e => e !== filter);
      return f;
      
      posted in Entwicklung
      H
      h07d0q
    • RE: [Gelöst] Listen durchforsten u. bestimmte Elemente entfernen

      @DAN78
      Ich bin aktuell auf das gleiche Problem gestoßen, dass ich aus einer Liste einen bekannten Wert löschen wollte und so einen Block nicht gefunden habe. Man könnte natürlich eine Schleife drüber laufen lassen und falls der Wert dem gesuchten Wert entspricht, die betroffene Stelle aus der Liste entfernen.
      Die Javascript Lösung sieht so aus:

      var arr = ['three', 'seven', 'eleven'];
      var filteredArray = arr.filter(e => e !== 'seven')
      

      Letztendlich wird auch hier wie ich verstehe das Array durchlaufen und ein neues ohne den gesuchten Wert erzeugt, es sei aber wohl schneller als mit der slice Funktion von Javascript.
      Man könnte das in einen Javascript Block mit Ergebnis packen, oder aber man führt einen neuen Block ein?
      4261f9af-d1c6-4a82-849a-eed62adb11fd-image.png
      in der Funktion steckt:

      liste.filter(e => e !== filter);
      

      Wenn man die ursprüngliche Liste nicht verlieren möchte, muss man das Ganze so machen:
      bbd69e00-f4fc-43cd-994d-354faf3713b5-image.png
      in der Funktion steckt:

      var f = liste.filter(e => e !== filter);
      return f;
      

      Ich hoffe ich kann dem ein oder anderen helfen, der auf diesen Post stößt.

      posted in Blockly
      H
      h07d0q
    • RE: ERR_REQUIRE_ESM digest-fetch Fehler

      Bei mir haben die Tipps oben leider nicht geholfen bzw. hatte ich diese falsch verstanden...

      So sah es bei mir zu Beginn aus:

      cd /opt/iobroker/
      npm ls digest-fetch
      iobroker.inst
      |-iobroker.javascript
        |-digest-fetch@3.x.x
      

      Die Version 3 ist nur noch in ESM möglich, dazu müsste man die Skripte anpassen. Wir löschen jetzt die V3:

      cd /opt/iobroker/node_modules/iobroker.javascript/
      npm uninstall digest fetch
      

      Im javascript adapter löschen wir das digest-fetch raus und schreiben digest-fetch@v2 rein:
      40aa0321-5481-4857-b6b4-6cb6a39977ae-image.png
      Adapter neu starten und in der Konsole die Version prüfen:

      npm ls digest-fetch
      iobroker.inst
      |-iobroker.javascript
        |-digest-fetch@2.0.3
      

      ggf. muss man das auch mit node-fetch machen.

      posted in JavaScript
      H
      h07d0q
    • RE: Node.js Script in iobroker integrieren

      @init5 Vielen Dank für's Teilen!

      Habe für mich das Skript angepasst, dass ich keinen MQTT Broker benötige. Es funktioniert bei mir so weit, dass Events ankommen und geloggt werden. Ich reagiere derzeit nur auf das eines Klingelns. Da werden im 2s Abstand Fotos aufgenommen und gespeichert, dann mittels ffmpeg zu einem gif zusammengefasst und per telegram versendet 🙂

      const DigestFetch = require('digest-fetch');
      const net = require('net');
      const fs = require('fs');
      const path = require('path');
      const md5 = require('md5');
      const __dirname = '/opt/iobroker/iobroker-data/files/';
      
      // Erweiterter Log im ioBroker
      const LOG_INFO = true;    // Informationen loggen
      const LOG_DEBUG = false;   // Erweiterter Log für Debugging
      
      /**
       * Class to abstract a dahua doorbell.
       *
       * On instantiation it automatically connects with the doorbell, logs in and
       * subscribes to all events.
       *
       * The Data is written to iobroker datapoints
       *
       */
       
      class DahuaVTO {
        deviceType;
        serialNumber;
       
        /**
         * {Number} requestId
         *
         * Our Request / Response ID that must be in all requests and initated by us.
         * This number auto-increments every time we send a message. Once we've logged in, every
         * response contains the request id of which it's a response of, se it could be used to
         * match responses with requests.
         *
         * I haven't bothered to do so because ,for what I saw, we only care about response order
         * for the initial setup, and we do that on request at a time.
         *
         * If we ever make requests in parallel and we need to associate response to each request,
         * we could use this. For not, it's just an auto-incremental number.
         * */
       
        requestId = 0;
       
        // Session ID will be returned after successful login
        /**
         * {Number} sessionId
         *
         * When we try to log in on the doorbell we get a sessionId. From that point on every message
         * we send over the socket needs to have include the sessionID for the doorbell to recognize us.
         */
        sessionId = 0;
       
        // Will be set after the login, but we initialize to 60s because it's a reasonable default
        /**
         * {Number} keepAliveInterval
         *
         * The number of seconds we have to space our keepAlive messages so the doorbell doesn't close
         * the connection.
         */
        keepAliveInterval = 60;
       
        /**
         * The ID returned by the `setInterval` call.
         * We keep a reference in case we want to cancel it (maybe in case of failure?)
         */
        _keepAliveTimer;
       
        /**
         * TCP socket to communicate with the doorbell external unit.
         */
        doorbellSocket;
       
       
        constructor() {
          this.dahua_host = "192.168.0.10";
          this.dahua_username = "admin";
          this.dahua_password = "password";
          this.digestClient = new DigestFetch(
            this.dahua_username,
            this.dahua_password
          );
       
          this.getDeviceDetails().then(({ deviceType, serialNumber }) => {
            this.deviceType = deviceType;
            this.serialNumber = serialNumber;
            this.start();
          });
        }
       
        /**
         * Starts the app by:
         *    - Opening a TCP socket to the doorbell
         *    - Authenticating with the doorbell and subscribing to events.
         */
        start() {
          this.setupDoorbellSocket();
          this.initLogin();
        }
       
        /**
         * Makes a request to the doorbell using digest auth to retrieve the device's information.
         *
         * The information is returned in plain text (not JSON) that we have to parse.
         * For now I think we only care about device type and serial number, which can be
         * used to disambiguate in case we have more than one doorbell.
         */
        async getDeviceDetails() {
          return this.digestClient
            .fetch(
              `http://${this.dahua_host}/cgi-bin/magicBox.cgi?action=getSystemInfo`
            )
            .then((r) => r.text())
            .then((text) => {
              const deviceDetails = text
                .trim()
                .split('\n')
                .reduce((obj, str) => {
                  const [key, val] = str.split('=');
                  obj[key] = val.trim();
                  return obj;
                }, {});
              return deviceDetails;
            });
        }
       
        /**
         * Creates the TCP socket connection with the doorbell on port 5000.
         *
         * Setups the listener for when we receive data over that socket
         *
         * Also setups other listeners for logging purposes mostly.
         *
         * If something goes wrong, we close everything and try to start over again.
         */
        setupDoorbellSocket() {
          let socket = new net.Socket({ readable: true, writable: true });
          socket.on('end', function () {
            if (LOG_DEBUG) console.debug('Doorbell socket ended');
          });
          socket.on('close', function () {
            if (LOG_DEBUG) console.debug('Doorbell socket closed');
            clearInterval(this._keepAliveTimer);
          });
          socket.on('data', this.receive.bind(this));
          socket.on('error', function (e) {
            console.error('Doorbell socket error', e);
            this.doorbellSocket.destroy(); // destroy the socket
            clearInterval(this._keepAliveTimer); // Stop sending keepalive requests
            this.start(); // Start over again.
          });
          this.doorbellSocket = socket.connect({ port: 5000, host: this.dahua_host });
        }
       
        /**
         * Sends a message with the given data to the doorbell's outside unit using the TCP socket.
         * @param {string} data
         *
         * This is a fairly low level way of communication, so let's dive in.
         *
         * We write binary to the socket, so we have to use buffers.
         *
         * The first 32 bytes of the message are the header.
         * After the header we concat the actual message, which is a JSON string.
         * The header has some bits that are fixed and others that are the length of the message that will
         * come after.
         *
         * I didn't reverse-engineered this myself but it works. Take it as gospel as I did.
         */
        send(data) {
          let json = JSON.stringify(data);
          let buf = Buffer.alloc(32);
          let offset = buf.writeUInt32BE(0x20000000);
          offset = buf.writeUInt32BE(0x44484950, offset);
          offset = buf.writeDoubleBE(0, offset);
          offset = buf.writeUInt32LE(json.length, offset);
          offset = buf.writeUInt32LE(0, offset);
          offset = buf.writeUInt32LE(json.length, offset);
          offset = buf.writeUInt32LE(0, offset);
          buf = Buffer.concat([buf, Buffer.from(json)]);
          this.requestId += 1;
          this.doorbellSocket.write(buf);
        }
       
        /**
         * Handles received messages from the TCP socket.
         * @param {Buffer} buf
         *
         * The received messages are binary. Once discarded the first 32 bytes (the header),
         * the rest of the message is parsed as as a JSON string.
         *
         * The header contains the length of the received response in bytes 16..20 and the expected
         * length of the response in bytes 24..28 in case we need it, but I haven't found a
         * reason to. Perhaps responses might be sent in several chunks? So far it doesn't seem to be
         * the case.
         *
         * Since we always make requests in the exact same order, we know the first two responses are
         * for the authentication.
         * Subsequent responses can be either events or keepalive responses.
         */
        receive(buf) {
          let str = buf.slice(32).toString();
          let obj = JSON.parse(str);
          if (this.requestId === 1) {
            this.handleFirstLoginPayload(obj);
          } else if (this.requestId === 2) {
            this.handleSecondLoginPayload(obj);
          } else if (obj.method === 'client.notifyEventStream') {
            this.handleEvents(obj.params.eventList);
          } else {
            this.handleGenericPayload(obj);
          }
        }
       
        /**
         * Sends the initial login request.
         * Note that does not include any password.
         * The response to this request will be negative but that is expected, it will contain the
         * necessary information to login.
         */
        initLogin() {
          this.send({
            id: 10000,
            magic: '0x1234',
            method: 'global.login',
            params: {
              clientType: '',
              ipAddr: '(null)',
              loginType: 'Direct',
              password: '',
              userName: this.dahua_username,
            },
            session: 0,
          });
        }
       
        /**
         * Handles the response to the initial login request.
         *
         * The response contains a session ID, a realm and a random, which in combination with
         * the username and the password are used to generate an MD5 password that is used
         * for logging in.
         *
         * @param {object} payload
         */
        handleFirstLoginPayload({ session, params: { random, realm } }) {
          this.sessionId = session;
          let randomHash = this.genMD5Hash(random, realm);
          this.send({
            id: 10000, // I assume this ID a high number just because we have to send something.
            magic: '0x1234', // No idea what this is
            method: 'global.login',
            session: this.sessionId,
            params: {
              userName: this.dahua_username,
              password: randomHash,
              clientType: '',
              ipAddr: '(null)',
              loginType: 'Direct',
              authorityType: 'Default',
            },
          });
        }
       
        /**
         * Handles the response to the second (and last) response to login request.
         *
         * If successful, any subsequent message that includes the session id will be accepted for
         * as long as the socket is not closed.
         *
         * To prevent the socket from closing we send a keepalive message every so often.
         *
         * Also now that we're authenticated we subscribe to all events fired by the doorbell.
         */
        handleSecondLoginPayload(obj) {
          if (obj.result) {
            if (LOG_INFO) console.log('Login to Dahua Doorbell successful');
            this.keepAliveInterval = obj.params.keepAliveInterval - 5;
            this.attachEventManager();
            this.keepConnectionAlive();
          } else {
            console.error('Failed to login. Response was: ', obj);
          }
        }
       
        /**
         * Publishes Data of an event with the given name and payload.
         * @param {string} name
         * @param {object} payload
         */
        publishData(name, payload) {
          let message = JSON.stringify(payload);
          if (LOG_DEBUG && (name == "TimeChange" || name == "NTPAdjustTime")) {
              console.debug(message);
          } else if (!(name == "TimeChange" || name == "NTPAdjustTime")) console.log(message);
        }
      
        /**
         * Handles any response not handled by any other method. I believe only keepalive responses
         * will end up here, but added some logging just in case.
         *
         * For now keepalive events are published, but I don't see a good reason for that.
         */
        handleGenericPayload(obj) {
          if (
            obj.result === true &&
            obj.params &&
            (Object.hasOwnProperty.call(obj.params, 'timeout') || Object.hasOwnProperty.call(obj.params, 'SID'))
          ) {
            if (LOG_DEBUG) {
              console.debug('Publish KeepAlive event');
              this.publishData('keepAlive', {
                  deviceType: this.deviceType,
                  serialNumber: this.serialNumber,
              });
            }
          } else {
            console.error('handleGenericPayload# Cannot handle received payload');
            console.error(obj);
          }
        }
       
        /**
         * Generates a MD5 digest of the username, password, realms and random to send as
         * password when logging in.
         * @param {*} random
         * @param {*} realm
         */
        genMD5Hash(random, realm) {
          const base_credentials = `${this.dahua_username}:${realm}:${this.dahua_password}`;
          const pwddb_hash = md5(base_credentials).toUpperCase();
          const base_pass = `${this.dahua_username}:${random}:${pwddb_hash}`;
          return md5(base_pass).toUpperCase();
        }
       
        /**
         * Sends the message to subscribe to all dorbell events.
         */
        attachEventManager() {
          this.send({
            id: this.requestId,
            magic: '0x1234',
            method: 'eventManager.attach',
            params: {
              codes: ['All'],
            },
            session: this.sessionId,
          });
        }
       
        /**
         * Handles the events sent by the doorbell.
         *
         * It just publishes those events along with some information of the device
         * 
         */
        handleEvents(events) {
          events.forEach((event) => {
            if (LOG_INFO) console.log(`Publish event ${event.Code}`);
            
            this.publishData(event.Code, {
              Action: event.eventAction,
              Data: event.Data,
              deviceType: this.deviceType,
              serialNumber: this.serialNumber,
            });
      
            if (event.Code == "CallNoAnswered") {
                this.saveSnapshots();
            }
          });
        }
       
        /**
         * Sets up a function to be called periodically to keep the socket open by sending
         * keepalive messages.
         * @param {Number} delay (in seconds)
         */
        keepConnectionAlive(delay) {
          this._keepAliveTimer = setInterval(() => {
            let keepAlivePayload = {
              method: 'global.keepAlive',
              magic: '0x1234',
              params: {
                timeout: delay,
                active: true,
              },
              id: this.requestId,
              session: this.sessionId,
            };
       
            this.send(keepAlivePayload);
          }, this.keepAliveInterval * 1000);
        }
       
        /**
         * Remotely triggers the relay 1 (e.g. to open an electric gate).
         *
         * In my VTO 2202 F this also triggers the voice announcing the the door has been opened.
         */
        openDoor() {
          return this.digestClient
            .fetch(
              `http://${this.dahua_host}/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Remote`
            )
            .then((r) => {
              if (r.ok) {
                if (LOG_INFO) console.log('Door relay triggered');
              } else {
                console.error('Error triggering the door relay', e);
              }
            })
            .catch(e => console.error('Connection error triggering the door relay'));
        }
       
        // requestMissedCallsLog() {
        //   this.send({
        //     id: this.requestId,
        //     magic: '0x1234',
        //     method: 'RecordFinder.factory.create',
        //     params: {
        //       name: 'VideoTalkMissedLog',
        //     },
        //     session: this.sessionId,
        //   });
        // }
       
        // requestMissedCallsLog2(findToken) {
        //   this.send({
        //     id: this.requestId,
        //     magic: '0x1234',
        //     method: 'RecordFinder.startFind',
        //     object: findToken,
        //     params: { condition: null },
        //     session: this.sessionId,
        //   });
        // }
       
        // requestMissedCallsLog3(findToken) {
        //   this.send({
        //     id: this.requestId,
        //     magic: '0x1234',
        //     method: 'RecordFinder.doFind',
        //     object: findToken,
        //     params: { count: 3 }, // Number of calls to show
        //     session: this.sessionId,
        //   });
        // }
        
        /**
         * Saves a snapshot of the doorbells image into the given directory (defaults to /tmp/).
         *
         * By default the file is named with a simple timestamp of the current time (YYYY-MM-DD-H-M-S.jpg)
         * 
         */
        archiveSnapshot(p = '0_userdata.0/VTO') {
          let now = new Date();
          let dateStr = `${now.getFullYear()}-${
            now.getMonth() + 1
          }-${now.getDate()}-${now.getHours()}-${now.getMinutes()}-${now.getSeconds()}`;
          let destination = path.join(__dirname, p, `VTO_${dateStr}.jpg`);
          this.digestClient
            .fetch(`http://${this.dahua_host}/cgi-bin/snapshot.cgi`)
            .then((r) => {
              return r.buffer();
            })
            .then((buf) => {
              fs.writeFile(destination, buf, 'binary', function (err) {
                if (err) {
                  console.error(err);
                  console.error('Error saving snapshot to disk', err);
                } else {
                  if (LOG_INFO) console.log('Snapshot saved: ' + destination);
                }
              });
            });
        }
      
        async saveSnapshots() {
          for (let i = 1; i < 4; i++) {
              let destination = `/VTO/VTO_${i}.jpg`
              this.digestClient
              .fetch(`http://${this.dahua_host}/cgi-bin/snapshot.cgi`)
              .then((r) => {
                  return r.buffer();
              })
              .then((buf) => {
                  writeFile('vis.0', destination, buf, function (err) {
                      if (err) {
                          console.error(err);
                          console.error('Error saving snapshot to disk', err);
                      } else {
                          if (LOG_INFO) console.debug('Snapshot saved: ' + destination);
                          //ggf. hier schon einzelnes Bild verschicken
                      }
                  });
              });
              await new Promise(resolve => setTimeout(resolve, 2000));
          }
          // Fotos wurden erstellt
          // GIF erstellen
          if (LOG_DEBUG) console.debug('telegram.gif erstellen...');
          exec("ffmpeg -framerate 2 -pattern_type glob -i '/opt/iobroker/iobroker-data/files/vis.0/VTO/VTO_*.jpg' -y '/opt/iobroker/iobroker-data/files/vis.0/VTO/telegram.gif'", async function (error, result, stderr) {
              //nach Erstellung per Telegram versenden
              //fs.readFileSync('/opt/iobroker/iobroker-data/files/vis.0/VTO/telegram.gif');
              if (LOG_DEBUG) console.debug(stderr);
              if (LOG_INFO) console.log('GIF erstellt. Telegram Nachricht versenden.');
              sendTo("telegram", "send", {
                  text: '/opt/iobroker/iobroker-data/files/vis.0/VTO/telegram.gif', caption: 'Haustür:'
              });
          });
        }
      };
       
      exports.default = DahuaVTO;
       
      new DahuaVTO();
      

      Ich hoffe das hilft dem ein oder anderen Suchenden, der es einfach will 🙂

      posted in JavaScript
      H
      h07d0q
    • RE: admin Files/Dateien Dateibrowser zeigt nicht alle Dateien

      @fredf ok und warum funktioniert es dann auch nicht mit dem Pfad vis.0?
      Meinst du ich müsste dann unter "/opt/iobroker/iobroker-data/files/Benutzerdaten/VTO/telegram.gif" speichern bzw. "writeFile('Benutzerdaten', destination, buf, function (err) {" aufrufen?


      Hab es vorerst gelöst bekommen und es würde bestimmt auch im Ordner Benutzerdaten bzw. 0_userdata.0 funktionieren:

        async saveSnapshots() {
          for (let i = 1; i < 4; i++) {
              let destination = `/VTO/VTO_${i}.jpg`
              // etwas angepasste Variable für writeFile statt fs.writeFile
              //let destination = path.join(__dirname, `vis.0/VTO/VTO_${i}.jpg`);
              this.digestClient
              .fetch(`http://${this.dahua_host}/cgi-bin/snapshot.cgi`)
              .then((r) => {
                  return r.buffer();
              })
              .then((buf) => {
                  writeFile('vis.0', destination, buf, function (err) {
                  // so hat es nicht funktioniert:
                  //fs.writeFile(destination, buf, 'binary', function (err) {
                      if (err) {
                          console.error(err);
                          console.error('Error saving snapshot to disk', err);
                      } else {
                          if (LOG_INFO) console.debug('Snapshot saved: ' + destination);
                          //war nicht notwendig, wurde ja schon von writeFile geschrieben
                          //fs.readFileSync(destination);
                      }
                  });
              });
              await new Promise(resolve => setTimeout(resolve, 2000));
          }
          // Fotos wurden erstellt
          // GIF erstellen
          if (LOG_DEBUG) console.debug('telegram.gif erstellen...');
          exec("ffmpeg -framerate 2 -pattern_type glob -i '/opt/iobroker/iobroker-data/files/vis.0/VTO/VTO_*.jpg' -y '/opt/iobroker/iobroker-data/files/vis.0/VTO/telegram.gif'", async function (error, result, stderr) {
              //nach Erstellung per Telegram versenden
              // die Datei telegram.gif ist nicht im Dateibrowser sichtbar
              if (LOG_DEBUG) console.debug(stderr);
              if (LOG_INFO) console.log('GIF erstellt. Telegram Nachricht versenden.');
              sendTo("telegram", "send", {
                  text: '/opt/iobroker/iobroker-data/files/vis.0/VTO/telegram.gif', caption: 'Haustür:'
              });
          });
        }
      
      

      voila, die Dateien tauchen auf:
      8bb5a83d-c684-40d1-bcd1-e1902f1ae71f-image.png
      Ne Idee was an den zwei Zeilen der Unterschied ist? Beide haben eine Datei erzeugt und man konnte weiter damit arbeiten, nur tauchten diese nicht im Dateibrowser auf.

      Jetzt hänge ich noch an der von ffmpeg erstellten gif Datei... gibt's einen besseren Weg als diese irgendwo anders zu speichern und dann über readFile und writeFile in den Pfad schreiben zu lassen?

      posted in ioBroker Allgemein
      H
      h07d0q
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo