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

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. [gelöst] Blockly zwei Nachkommastellen hochzählen

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    18
    1
    783

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    18
    1
    6.2k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.5k

[gelöst] Blockly zwei Nachkommastellen hochzählen

Scheduled Pinned Locked Moved Skripten / Logik
7 Posts 4 Posters 1.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    watcherkb
    wrote on last edited by
    #1

    Ich dachte es ist einfach aber irgendwie klappt es nicht.

    ich möchte eine Zahl mit 2 Nachkommastellen bei jedem Trigger um 0.01 erhöhen. Ich bekomme aber krumme Werte wie 5178.430000000006 raus. Wie kann ich das besser lösen?
    4971_2018-10-22_2158.png

    CC2538+CC2592 PA-Zigbee-Funkmodul

    1 Reply Last reply
    0
    • Mahe3006M Offline
      Mahe3006M Offline
      Mahe3006
      wrote on last edited by
      #2

      Hallo,

      hast du eine Lösung für das Problem gefunden?

      Ich bin in der selben Situation.

      1 Reply Last reply
      0
      • W Offline
        W Offline
        watcherkb
        wrote on last edited by
        #3

        Ich habe es so gelöst und funktioniert auch gut. Einfach das Blockly Script importieren, dann hast du alles was du brauchst. Dann die Datenpunkte entsprechend anpassen.

        ! <xml 1999/xmlns="<URL url=" http:/www.w3.org/xhtml"="">http://www.w3.org/1999/xhtml">
        ! <block type="on" id="FLfW;pWblQWz(Q[b#+X" x="-362" y="13"><field name="OID">mqtt.0.ESP_Easy.Gaszähler.Total</field>
        ! <field name="CONDITION">ne</field>
        ! <statement name="STATEMENT"><block type="update" id=";U_YCxKC8`kW/x:Pf2^f"><mutation delay_input="false"></mutation>
        ! <field name="OID">admin.0.Datenpunkte.Energie.Gaszähler.aktuell</field>
        ! <field name="WITH_DELAY">FALSE</field>
        ! <value name="VALUE"><block type="math_arithmetic" id="/4z_8{jyU.mc
        UHD4a"><field name="OP">DIVIDE</field>
        ! <value name="A"><shadow type="math_number" id="_=F{;Hj`K5PXnG/@8?Kk"><field name="NUM">1</field></shadow>
        ! <block type="math_round" id="/F|ys`NU_tU9SX.i;;75"><field name="OP">ROUND</field>
        ! <value name="NUM"><shadow type="math_number" id="*0+clnLO~49o1Sk8(})Q"><field name="NUM">3.1</field></shadow>
        ! <block type="math_arithmetic" id="GBaV#d-^I/FL8A}qyAxm"><field name="OP">ADD</field>
        ! <value name="A"><shadow type="math_number" id="_ip@-v!b.Z{aIe/[;q4"><field name="NUM">1</field></shadow>
        ! <block type="math_arithmetic" id="D!S~7^yemymGKv|qr,M"><field name="OP">MULTIPLY</field>
        ! <value name="A"><shadow type="math_number" id="!%,K=_VNlA{uJx8JOhoT"><field name="NUM">1</field></shadow>
        ! <block type="get_value" id="Xs9D=~/ldXt):|=!Y?@s"><field name="ATTR">val</field>
        ! <field name="OID">admin.0.Datenpunkte.Energie.Gaszähler.aktuell</field></block></value>
        ! <value name="B"><shadow type="math_number" id="KuIG{1oQ19d
        g/x(RG7D"><field name="NUM">100</field></shadow></value></block></value>
        ! <value name="B"><shadow type="math_number" id="B~XKQ.av?6IL(]uaS]@+"><field name="NUM">1</field></shadow></value></block></value></block></value>
        ! <value name="B"><shadow type="math_number" id="6,+@/5O
        vU7u7isTD@x("><field name="NUM">0.01</field></shadow>
        ! <block type="math_number" id="gaLsE_p2yz7)PLGI;b2Q"><field name="NUM">100</field></block></value></block></value></block></statement></block></xml>

        CC2538+CC2592 PA-Zigbee-Funkmodul

        M 1 Reply Last reply
        0
        • MatzebhvM Offline
          MatzebhvM Offline
          Matzebhv
          wrote on last edited by
          #4

          Über dieses Problem ist wohl jeder schon mal gestolpert der Rechenoperationen unter Javascript durchführen will.

          http://www.dcljs.de/faq/antwort.php?Ant … en_rechnen

          Gruß

          Matze

          1 Reply Last reply
          0
          • W watcherkb

            Ich habe es so gelöst und funktioniert auch gut. Einfach das Blockly Script importieren, dann hast du alles was du brauchst. Dann die Datenpunkte entsprechend anpassen.

            ! <xml 1999/xmlns="<URL url=" http:/www.w3.org/xhtml"="">http://www.w3.org/1999/xhtml">
            ! <block type="on" id="FLfW;pWblQWz(Q[b#+X" x="-362" y="13"><field name="OID">mqtt.0.ESP_Easy.Gaszähler.Total</field>
            ! <field name="CONDITION">ne</field>
            ! <statement name="STATEMENT"><block type="update" id=";U_YCxKC8`kW/x:Pf2^f"><mutation delay_input="false"></mutation>
            ! <field name="OID">admin.0.Datenpunkte.Energie.Gaszähler.aktuell</field>
            ! <field name="WITH_DELAY">FALSE</field>
            ! <value name="VALUE"><block type="math_arithmetic" id="/4z_8{jyU.mc
            UHD4a"><field name="OP">DIVIDE</field>
            ! <value name="A"><shadow type="math_number" id="_=F{;Hj`K5PXnG/@8?Kk"><field name="NUM">1</field></shadow>
            ! <block type="math_round" id="/F|ys`NU_tU9SX.i;;75"><field name="OP">ROUND</field>
            ! <value name="NUM"><shadow type="math_number" id="*0+clnLO~49o1Sk8(})Q"><field name="NUM">3.1</field></shadow>
            ! <block type="math_arithmetic" id="GBaV#d-^I/FL8A}qyAxm"><field name="OP">ADD</field>
            ! <value name="A"><shadow type="math_number" id="_ip@-v!b.Z{aIe/[;q4"><field name="NUM">1</field></shadow>
            ! <block type="math_arithmetic" id="D!S~7^yemymGKv|qr,M"><field name="OP">MULTIPLY</field>
            ! <value name="A"><shadow type="math_number" id="!%,K=_VNlA{uJx8JOhoT"><field name="NUM">1</field></shadow>
            ! <block type="get_value" id="Xs9D=~/ldXt):|=!Y?@s"><field name="ATTR">val</field>
            ! <field name="OID">admin.0.Datenpunkte.Energie.Gaszähler.aktuell</field></block></value>
            ! <value name="B"><shadow type="math_number" id="KuIG{1oQ19d
            g/x(RG7D"><field name="NUM">100</field></shadow></value></block></value>
            ! <value name="B"><shadow type="math_number" id="B~XKQ.av?6IL(]uaS]@+"><field name="NUM">1</field></shadow></value></block></value></block></value>
            ! <value name="B"><shadow type="math_number" id="6,+@/5O
            vU7u7isTD@x("><field name="NUM">0.01</field></shadow>
            ! <block type="math_number" id="gaLsE_p2yz7)PLGI;b2Q"><field name="NUM">100</field></block></value></block></value></block></statement></block></xml>

            M Offline
            M Offline
            markus397
            wrote on last edited by
            #5

            @watcherkb said in [gelöst] Blockly zwei Nachkommastellen hochzählen:

            Ich habe es so gelöst und funktioniert auch gut. Einfach das Blockly Script importieren, dann hast du alles was du brauchst. Dann die Datenpunkte entsprechend anpassen.

            ! <xml 1999/xmlns="<URL url=" http:/www.w3.org/xhtml"="">http://www.w3.org/1999/xhtml">
            ! <block type="on" id="FLfW;pWblQWz(Q[b#+X" x="-362" y="13"><field name="OID">mqtt.0.ESP_Easy.Gaszähler.Total</field>
            ! <field name="CONDITION">ne</field>
            ! <statement name="STATEMENT"><block type="update" id=";U_YCxKC8`kW/x:Pf2^f"><mutation delay_input="false"></mutation>
            ! <field name="OID">admin.0.Datenpunkte.Energie.Gaszähler.aktuell</field>
            ! <field name="WITH_DELAY">FALSE</field>
            ! <value name="VALUE"><block type="math_arithmetic" id="/4z_8{jyU.mc
            UHD4a"><field name="OP">DIVIDE</field>
            ! <value name="A"><shadow type="math_number" id="_=F{;Hj`K5PXnG/@8?Kk"><field name="NUM">1</field></shadow>
            ! <block type="math_round" id="/F|ys`NU_tU9SX.i;;75"><field name="OP">ROUND</field>
            ! <value name="NUM"><shadow type="math_number" id="*0+clnLO~49o1Sk8(})Q"><field name="NUM">3.1</field></shadow>
            ! <block type="math_arithmetic" id="GBaV#d-^I/FL8A}qyAxm"><field name="OP">ADD</field>
            ! <value name="A"><shadow type="math_number" id="_ip@-v!b.Z{aIe/[;q4"><field name="NUM">1</field></shadow>
            ! <block type="math_arithmetic" id="D!S~7^yemymGKv|qr,M"><field name="OP">MULTIPLY</field>
            ! <value name="A"><shadow type="math_number" id="!%,K=_VNlA{uJx8JOhoT"><field name="NUM">1</field></shadow>
            ! <block type="get_value" id="Xs9D=~/ldXt):|=!Y?@s"><field name="ATTR">val</field>
            ! <field name="OID">admin.0.Datenpunkte.Energie.Gaszähler.aktuell</field></block></value>
            ! <value name="B"><shadow type="math_number" id="KuIG{1oQ19d
            g/x(RG7D"><field name="NUM">100</field></shadow></value></block></value>
            ! <value name="B"><shadow type="math_number" id="B~XKQ.av?6IL(]uaS]@+"><field name="NUM">1</field></shadow></value></block></value></block></value>
            ! <value name="B"><shadow type="math_number" id="6,+@/5O
            vU7u7isTD@x("><field name="NUM">0.01</field></shadow>
            ! <block type="math_number" id="gaLsE_p2yz7)PLGI;b2Q"><field name="NUM">100</field></block></value></block></value></block></statement></block></xml>

            Habe versucht deinen Code zu importieren, aber hat nicht geklappt. Kommt nur ein schwarzer Baustein. Kannst du noch mal den Code gier rein stellen oder auch ein Bild machen?

            Gruß
            Markus

            W 1 Reply Last reply
            0
            • M markus397

              @watcherkb said in [gelöst] Blockly zwei Nachkommastellen hochzählen:

              Ich habe es so gelöst und funktioniert auch gut. Einfach das Blockly Script importieren, dann hast du alles was du brauchst. Dann die Datenpunkte entsprechend anpassen.

              ! <xml 1999/xmlns="<URL url=" http:/www.w3.org/xhtml"="">http://www.w3.org/1999/xhtml">
              ! <block type="on" id="FLfW;pWblQWz(Q[b#+X" x="-362" y="13"><field name="OID">mqtt.0.ESP_Easy.Gaszähler.Total</field>
              ! <field name="CONDITION">ne</field>
              ! <statement name="STATEMENT"><block type="update" id=";U_YCxKC8`kW/x:Pf2^f"><mutation delay_input="false"></mutation>
              ! <field name="OID">admin.0.Datenpunkte.Energie.Gaszähler.aktuell</field>
              ! <field name="WITH_DELAY">FALSE</field>
              ! <value name="VALUE"><block type="math_arithmetic" id="/4z_8{jyU.mc
              UHD4a"><field name="OP">DIVIDE</field>
              ! <value name="A"><shadow type="math_number" id="_=F{;Hj`K5PXnG/@8?Kk"><field name="NUM">1</field></shadow>
              ! <block type="math_round" id="/F|ys`NU_tU9SX.i;;75"><field name="OP">ROUND</field>
              ! <value name="NUM"><shadow type="math_number" id="*0+clnLO~49o1Sk8(})Q"><field name="NUM">3.1</field></shadow>
              ! <block type="math_arithmetic" id="GBaV#d-^I/FL8A}qyAxm"><field name="OP">ADD</field>
              ! <value name="A"><shadow type="math_number" id="_ip@-v!b.Z{aIe/[;q4"><field name="NUM">1</field></shadow>
              ! <block type="math_arithmetic" id="D!S~7^yemymGKv|qr,M"><field name="OP">MULTIPLY</field>
              ! <value name="A"><shadow type="math_number" id="!%,K=_VNlA{uJx8JOhoT"><field name="NUM">1</field></shadow>
              ! <block type="get_value" id="Xs9D=~/ldXt):|=!Y?@s"><field name="ATTR">val</field>
              ! <field name="OID">admin.0.Datenpunkte.Energie.Gaszähler.aktuell</field></block></value>
              ! <value name="B"><shadow type="math_number" id="KuIG{1oQ19d
              g/x(RG7D"><field name="NUM">100</field></shadow></value></block></value>
              ! <value name="B"><shadow type="math_number" id="B~XKQ.av?6IL(]uaS]@+"><field name="NUM">1</field></shadow></value></block></value></block></value>
              ! <value name="B"><shadow type="math_number" id="6,+@/5O
              vU7u7isTD@x("><field name="NUM">0.01</field></shadow>
              ! <block type="math_number" id="gaLsE_p2yz7)PLGI;b2Q"><field name="NUM">100</field></block></value></block></value></block></statement></block></xml>

              Habe versucht deinen Code zu importieren, aber hat nicht geklappt. Kommt nur ein schwarzer Baustein. Kannst du noch mal den Code gier rein stellen oder auch ein Bild machen?

              W Offline
              W Offline
              watcherkb
              wrote on last edited by
              #6

              @markus397

              <xml xmlns="http://www.w3.org/1999/xhtml">
                <block type="on" id="FLfW;pWblQWz(Q[*b#+X" x="-362" y="13">
                  <field name="OID">mqtt.0.ESP_Easy.Gaszähler.Total</field>
                  <field name="CONDITION">ne</field>
                  <field name="ACK_CONDITION"></field>
                  <statement name="STATEMENT">
                    <block type="update" id=";U_YCxKC8`kW/x:Pf2^f">
                      <mutation delay_input="false"></mutation>
                      <field name="OID">admin.0.Datenpunkte.Energie.Gaszähler.aktuell</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="math_arithmetic" id="/*4z_8{j*yU.mc*UHD4a">
                          <field name="OP">DIVIDE</field>
                          <value name="A">
                            <shadow type="math_number" id="_=F{;Hj`K5PXnG/@8?Kk">
                              <field name="NUM">1</field>
                            </shadow>
                            <block type="math_round" id="/F|ys`NU_tU9SX.i;;75">
                              <field name="OP">ROUND</field>
                              <value name="NUM">
                                <shadow type="math_number" id="*0+clnLO~49o1Sk8(})Q">
                                  <field name="NUM">3.1</field>
                                </shadow>
                                <block type="math_arithmetic" id="GBaV#d-^I/FL8A}qyAxm">
                                  <field name="OP">ADD</field>
                                  <value name="A">
                                    <shadow type="math_number" id="_ip@-*v!b.Z{aIe/[;q4">
                                      <field name="NUM">1</field>
                                    </shadow>
                                    <block type="math_arithmetic" id="D!S~7^*yemymGKv|qr,M">
                                      <field name="OP">MULTIPLY</field>
                                      <value name="A">
                                        <shadow type="math_number" id="!%,K=_VNlA{uJx8JOhoT">
                                          <field name="NUM">1</field>
                                        </shadow>
                                        <block type="get_value" id="Xs9D=~/ldXt):|=!Y?@s">
                                          <field name="ATTR">val</field>
                                          <field name="OID">admin.0.Datenpunkte.Energie.Gaszähler.aktuell</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <shadow type="math_number" id="KuIG{1oQ19d*g/x(RG7D">
                                          <field name="NUM">100</field>
                                        </shadow>
                                      </value>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <shadow type="math_number" id="B~XKQ.av?6IL(]uaS]@+">
                                      <field name="NUM">1</field>
                                    </shadow>
                                  </value>
                                </block>
                              </value>
                            </block>
                          </value>
                          <value name="B">
                            <shadow type="math_number" id="6,+@/5O*vU7u7isTD@x(">
                              <field name="NUM">0.01</field>
                            </shadow>
                            <block type="math_number" id="gaLsE_p2yz7)PLGI;b2Q">
                              <field name="NUM">100</field>
                            </block>
                          </value>
                        </block>
                      </value>
                    </block>
                  </statement>
                </block>
              </xml>
              

              2019-02-14_1445.png

              CC2538+CC2592 PA-Zigbee-Funkmodul

              1 Reply Last reply
              0
              • M Offline
                M Offline
                markus397
                wrote on last edited by
                #7

                Danke nun hat der Import geklappt und es funktioniert prima.

                Gruß
                Markus

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                Support us

                ioBroker
                Community Adapters
                Donate

                264

                Online

                32.8k

                Users

                82.7k

                Topics

                1.3m

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

                • Don't have an account? Register

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