Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. kWh für jeden Monat in ein DP

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    kWh für jeden Monat in ein DP

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

      Hallo alle zusammen,

      Meine Strommesser für Steckdosen messen in einem DP jeweils die Verbrauchten kWh allerdings durchgängig.
      Nun habe ich ein Script erstellt wo ich den DP als Tageswert und Monatswert abspeichern kann.
      Ich würde allerdings gerne denn DP Monat erweitern so daß ich auch jeweils die Stromwerte der tatsächlichen Monate ablesen kann. Also Mai Juni usw. Ich habe im Blockly ja auch die Datum und KW, gefunden aber so recht weiß ich nicht wie ich das ganze so umsetzen kann das ich auch wirklich jeden 01. im Monat dann ein neuen Wert schreibe bis zum Monatsende.
      Da wäre ich für Hilfen dankbar.

      Anbei mein bisheriges Blockly jeweils für eine Steckdose.

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="4*3Qh%0MU8Dol-a-_*YX">Stromwert schreiber3a</variable>
          <variable id="+!IR==r2PFX=T?p=3l+,">24 kWh ermitteln1a</variable>
          <variable id="fru2(z9y*VS*IB[QRCXp">Stromwert ermitteln 3a</variable>
        </variables>
        <block type="schedule" id="a;2UI0aoNFu+=QZa$vyD" x="-537" y="-437">
          <field name="SCHEDULE">{"time":{"exactTime":true,"start":"11:28"},"period":{"days":1}}</field>
          <statement name="STATEMENT">
            <block type="comment" id="aU/-7V!x@-C[u8;8fo@K">
              <field name="COMMENT">Ermitteln des Monatsverbrauches</field>
              <next>
                <block type="variables_set" id="~GOG8Gn3xFT7DFoK3OmU">
                  <field name="VAR" id="4*3Qh%0MU8Dol-a-_*YX">Stromwert schreiber3a</field>
                  <value name="VALUE">
                    <block type="math_arithmetic" id="uLGJ/W7~Ler3[GC!~O/S">
                      <field name="OP">DIVIDE</field>
                      <value name="A">
                        <shadow type="math_number" id="!Ql-9v,H%lXW/)Uja53S">
                          <field name="NUM">1</field>
                        </shadow>
                        <block type="get_value" id="H(XwgC_Nc+fsR/uE-3?=">
                          <field name="ATTR">val</field>
                          <field name="OID">0_userdata.0.Stromwerteberechnung.Stromplug.Stromplug_kWh/simulation_verbrauch</field>
                        </block>
                      </value>
                      <value name="B">
                        <shadow type="math_number" id="OctXlX}b5~#JtZf`p3^}">
                          <field name="NUM">1000</field>
                        </shadow>
                      </value>
                    </block>
                  </value>
                  <next>
                    <block type="update" id="K;m}_{G[mPt+Ss1r{CLD">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                      <field name="OID">0_userdata.0.Stromwerteberechnung.Stromplug.Stromplug_kWh/Berechnung</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="variables_get" id="B%2c]dAbKot9a6_iB+w#">
                          <field name="VAR" id="4*3Qh%0MU8Dol-a-_*YX">Stromwert schreiber3a</field>
                        </block>
                      </value>
                      <next>
                        <block type="update" id="bD+t^SaP?!Bt1te*.D~y">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">0_userdata.0.Stromwerteberechnung.Stromplug.Stromplug_kWh/Monat</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="variables_get" id="N5;C{mH*5]6s:*t0u7b9">
                              <field name="VAR" id="4*3Qh%0MU8Dol-a-_*YX">Stromwert schreiber3a</field>
                            </block>
                          </value>
                          <next>
                            <block type="comment" id="({(82p?/MWAY4H6V$@yV">
                              <field name="COMMENT">Ermitteln des Tagesverbrauches</field>
                              <next>
                                <block type="variables_set" id="~S_/%Wxe-:8ma!W%~*A,">
                                  <field name="VAR" id="+!IR==r2PFX=T?p=3l+,">24 kWh ermitteln1a</field>
                                  <value name="VALUE">
                                    <block type="get_value" id="w4pp;B5QVf/UQ]mEJyk-">
                                      <field name="ATTR">val</field>
                                      <field name="OID">0_userdata.0.Stromwerteberechnung.Stromplug.Stromplug_kWh/Monat_Berechnung</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="variables_set" id="OSwwu%YQ%N(|JJIurlVo">
                                      <field name="VAR" id="fru2(z9y*VS*IB[QRCXp">Stromwert ermitteln 3a</field>
                                      <value name="VALUE">
                                        <block type="math_arithmetic" id="-)i`ZGIX/6u-Z$H`EOCX">
                                          <field name="OP">MINUS</field>
                                          <value name="A">
                                            <shadow type="math_number" id="O3^[!@pT7_O^,xS,jm:I">
                                              <field name="NUM">1</field>
                                            </shadow>
                                            <block type="get_value" id="Xty%9Ga4]fl`L-Cewi[?">
                                              <field name="ATTR">val</field>
                                              <field name="OID">0_userdata.0.Stromwerteberechnung.Stromplug.Stromplug_kWh/Monat</field>
                                            </block>
                                          </value>
                                          <value name="B">
                                            <shadow type="math_number" id="|}@]:o6HzRpNt#DOI-1U">
                                              <field name="NUM">0</field>
                                            </shadow>
                                            <block type="variables_get" id="RO8E-cOtYiY8X_9vXOr.">
                                              <field name="VAR" id="+!IR==r2PFX=T?p=3l+,">24 kWh ermitteln1a</field>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="update" id="B/3j|2MF}Ed8DL#7l6XS">
                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                          <field name="OID">0_userdata.0.Stromwerteberechnung.Stromplug.Stromplug_kWh/24</field>
                                          <field name="WITH_DELAY">FALSE</field>
                                          <value name="VALUE">
                                            <block type="variables_get" id="G_Z]gGd)EkEnDUt)ipbS">
                                              <field name="VAR" id="fru2(z9y*VS*IB[QRCXp">Stromwert ermitteln 3a</field>
                                            </block>
                                          </value>
                                          <next>
                                            <block type="update" id="BAYi*gU%_P+b9uWF)J2#">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                              <field name="OID">0_userdata.0.Stromwerteberechnung.Stromplug.Stromplug_kWh/Monat_Berechnung</field>
                                              <field name="WITH_DELAY">FALSE</field>
                                              <value name="VALUE">
                                                <block type="get_value" id="cj)^5]Z[(CY.0+h5)o3!">
                                                  <field name="ATTR">val</field>
                                                  <field name="OID">0_userdata.0.Stromwerteberechnung.Stromplug.Stromplug_kWh/Monat</field>
                                                </block>
                                              </value>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </statement>
        </block>
      </xml>
      

      Und das entsprechende Foto.

      Screenshot 2024-04-30 150222.png

      Gruß
      Mico

      DJMarc75 1 Reply Last reply Reply Quote 0
      • DJMarc75
        DJMarc75 @Mico last edited by

        @mico

        Scha mal den Adapter Sourceanalytix an - findet man im BetaRepo 😉

        1 Reply Last reply Reply Quote 0
        • mickym
          mickym Most Active last edited by

          Lass einfach Deinen Monatsdatenpunkt triggern, sprich wenn Du den schreibst, starte ein neues Skript und ermittle den aktuellen oder Vormonat und schreibe den Wert in einen entsprechenden Datenpunkt.

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

          Support us

          ioBroker
          Community Adapters
          Donate

          1.1k
          Online

          31.7k
          Users

          79.7k
          Topics

          1.3m
          Posts

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