Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Node-Red
    5. Anfänger braucht Hilfe zum Addieren von MQTT werten

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Anfänger braucht Hilfe zum Addieren von MQTT werten

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

      Hallo

      Scheinbar bin ich leider zu doof ich brings auch mit Abkupfern von anderen Flows nicht hin!
      Ich habe 4 Topics die ich zusammenzählen möchte und in einem Chart anzeigen möchte.
      anbei der exportierte Flow, mit Debug ausgänge zum schnellen checken!

      Testflow.txt testflow.jpg

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

        @schnuller So dann machen wir uns mal an Deinen Flow:

        c0db7be3-8c97-4896-9580-16ea8234d0e3-image.png

        Du erlaubst dass ich Deine mqtt Nodes gegen Inject Nodes ersetze weil ich keine Lust habe mein eigenes mqtt zu verwenden?

        Ist das so OK? - Ich kann so deinen Fehler nachvollziehen:

        e38fdf28-ea59-4997-84ca-263601e3317b-image.png

        Wenn Du dann da sein solltest - dann melde Dich - ich habe keine Lust einfach den Flow zu korrigieren und Du lernst 0,0 dabei.

        S 1 Reply Last reply Reply Quote 0
        • S
          Schnuller @mickym last edited by Schnuller

          @mickym high, wäre jetzt bereit
          Aber glaub ich würde das schon verstehen, wenn du meinen flow einfach änderst

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

            @schnuller sagte in Anfänger bracht Hilfe zum Addieren von MQTT werten:

            Aber glaub ich würde das schon verstehen, wenn du meinen flow einfach änderst

            Nein weil Dir wirklich sämtliche Grundlagen fehlen.

            e800f0b8-22d4-4e96-89c7-175fa0cbd0e2-image.png

            Mach mal Debug Nodes hinter jede Node und erkläre mir bitte was die Change Node für einen Sinn hat, wenn das Ergebnis unverändert raus kommt.

            Falls Du deine mqtt NOdes nicht direkt triggern kannst - hier die 4 Inject Nodes für Dich um manuell zu triggern

            [
               {
                   "id": "1c1c72fec90d264e",
                   "type": "inject",
                   "z": "03cbef45872e202d",
                   "name": "",
                   "props": [
                       {
                           "p": "payload"
                       },
                       {
                           "p": "topic",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "AhoyDS/Terasse/ch0/YieldDay",
                   "payload": "1822",
                   "payloadType": "num",
                   "x": 200,
                   "y": 140,
                   "wires": [
                       [
                           "c90a3ffec3f15a07",
                           "d836f60ef439219a",
                           "1303562a9ad2b28f"
                       ]
                   ]
               },
               {
                   "id": "e4ef6a006eedda71",
                   "type": "inject",
                   "z": "03cbef45872e202d",
                   "name": "",
                   "props": [
                       {
                           "p": "payload"
                       },
                       {
                           "p": "topic",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "AhoyDS/DachHaus/ch0/YieldDay",
                   "payload": "2713",
                   "payloadType": "num",
                   "x": 190,
                   "y": 200,
                   "wires": [
                       [
                           "55a4a51c4ca2a67e",
                           "d836f60ef439219a"
                       ]
                   ]
               },
               {
                   "id": "37482b6f3f633652",
                   "type": "inject",
                   "z": "03cbef45872e202d",
                   "name": "",
                   "props": [
                       {
                           "p": "payload"
                       },
                       {
                           "p": "topic",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "AhoyDS/Ostseite/ch0/YieldDay",
                   "payload": "1060",
                   "payloadType": "num",
                   "x": 200,
                   "y": 260,
                   "wires": [
                       [
                           "d836f60ef439219a",
                           "98bc371b81d12e95"
                       ]
                   ]
               },
               {
                   "id": "407ddbe8f5a86a4a",
                   "type": "inject",
                   "z": "03cbef45872e202d",
                   "name": "",
                   "props": [
                       {
                           "p": "payload"
                       },
                       {
                           "p": "topic",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "AhoyDS/Akku/ch0/YieldDay",
                   "payload": "5999",
                   "payloadType": "num",
                   "x": 210,
                   "y": 320,
                   "wires": [
                       [
                           "d836f60ef439219a"
                       ]
                   ]
               }
            ]
            

            S 1 Reply Last reply Reply Quote 0
            • S
              Schnuller @mickym last edited by

              @mickym
              Hab was gefunden und wollt es verwenden, dann ging es nicht und ich hab improvisiert.
              Hast recht versteh payload und msg nicht so ganz
              dachte mit fertiger Lösung verstehe ich es dann

              mickym haus-automatisierung 2 Replies Last reply Reply Quote 0
              • mickym
                mickym Most Active @Schnuller last edited by mickym

                @schnuller

                Na gut - Du willst also nichts lernen sondern nur die Lösung:

                [
                   {
                       "id": "19a94b071a5fdcb9",
                       "type": "mqtt in",
                       "z": "4d4f645bb79e4e57",
                       "name": "",
                       "topic": "AhoyDS/Terasse/ch0/YieldDay",
                       "qos": "0",
                       "datatype": "auto-detect",
                       "broker": "6602cc75a9a44511",
                       "nl": false,
                       "rap": false,
                       "inputs": 0,
                       "x": 180,
                       "y": 120,
                       "wires": [
                           [
                               "8e7715529a39af45",
                               "ac6a362d1bc5230b"
                           ]
                       ]
                   },
                   {
                       "id": "6ee13f88bbc89734",
                       "type": "mqtt in",
                       "z": "4d4f645bb79e4e57",
                       "name": "",
                       "topic": "AhoyDS/DachHaus/ch0/YieldDay",
                       "qos": "0",
                       "datatype": "auto-detect",
                       "broker": "6602cc75a9a44511",
                       "nl": false,
                       "rap": false,
                       "inputs": 0,
                       "x": 190,
                       "y": 180,
                       "wires": [
                           [
                               "8e7715529a39af45",
                               "ac6a362d1bc5230b"
                           ]
                       ]
                   },
                   {
                       "id": "e23d43c94fcf102e",
                       "type": "mqtt in",
                       "z": "4d4f645bb79e4e57",
                       "name": "",
                       "topic": "AhoyDS/Ostseite/ch0/YieldDay",
                       "qos": "0",
                       "datatype": "auto-detect",
                       "broker": "6602cc75a9a44511",
                       "nl": false,
                       "rap": false,
                       "inputs": 0,
                       "x": 190,
                       "y": 240,
                       "wires": [
                           [
                               "8e7715529a39af45",
                               "ac6a362d1bc5230b"
                           ]
                       ]
                   },
                   {
                       "id": "e81a73381809dc96",
                       "type": "mqtt in",
                       "z": "4d4f645bb79e4e57",
                       "name": "",
                       "topic": "AhoyDS/Akku/ch0/YieldDay",
                       "qos": "0",
                       "datatype": "auto-detect",
                       "broker": "6602cc75a9a44511",
                       "nl": false,
                       "rap": false,
                       "inputs": 0,
                       "x": 180,
                       "y": 300,
                       "wires": [
                           [
                               "8e7715529a39af45"
                           ]
                       ]
                   },
                   {
                       "id": "f123ee95affb9d7b",
                       "type": "ui_chart",
                       "z": "4d4f645bb79e4e57",
                       "name": "",
                       "group": "32b64ad3a93bea4d",
                       "order": 4,
                       "width": 10,
                       "height": 4,
                       "label": "PVA Summe",
                       "chartType": "line",
                       "legend": "false",
                       "xformat": "HH:mm:ss",
                       "interpolate": "linear",
                       "nodata": "",
                       "dot": false,
                       "ymin": "",
                       "ymax": "",
                       "removeOlder": "12",
                       "removeOlderPoints": "200",
                       "removeOlderUnit": "3600",
                       "cutout": 0,
                       "useOneColor": false,
                       "useUTC": false,
                       "colors": [
                           "#1f77b4",
                           "#aec7e8",
                           "#ff7f0e",
                           "#37b337",
                           "#98df8a",
                           "#d62728",
                           "#ff9896",
                           "#9467bd",
                           "#c5b0d5"
                       ],
                       "outputs": 1,
                       "useDifferentColor": false,
                       "className": "",
                       "x": 570,
                       "y": 300,
                       "wires": [
                           []
                       ]
                   },
                   {
                       "id": "afb56478c0f20f25",
                       "type": "join",
                       "z": "4d4f645bb79e4e57",
                       "name": "",
                       "mode": "custom",
                       "build": "object",
                       "property": "payload",
                       "propertyType": "msg",
                       "key": "topic",
                       "joiner": "\\n",
                       "joinerType": "str",
                       "accumulate": true,
                       "timeout": "",
                       "count": "3",
                       "reduceRight": false,
                       "reduceExp": "",
                       "reduceInit": "",
                       "reduceInitType": "",
                       "reduceFixup": "",
                       "x": 530,
                       "y": 120,
                       "wires": [
                           [
                               "022835d21f559c86"
                           ]
                       ]
                   },
                   {
                       "id": "022835d21f559c86",
                       "type": "change",
                       "z": "4d4f645bb79e4e57",
                       "name": "",
                       "rules": [
                           {
                               "t": "set",
                               "p": "payload",
                               "pt": "msg",
                               "to": "$sum(payload.*)",
                               "tot": "jsonata"
                           }
                       ],
                       "action": "",
                       "property": "",
                       "from": "",
                       "to": "",
                       "reg": false,
                       "x": 730,
                       "y": 120,
                       "wires": [
                           [
                               "ea596a71d9cdf593"
                           ]
                       ]
                   },
                   {
                       "id": "ea596a71d9cdf593",
                       "type": "debug",
                       "z": "4d4f645bb79e4e57",
                       "name": "Sigi T",
                       "active": true,
                       "tosidebar": true,
                       "console": false,
                       "tostatus": false,
                       "complete": "payload",
                       "targetType": "msg",
                       "statusVal": "",
                       "statusType": "auto",
                       "x": 950,
                       "y": 120,
                       "wires": []
                   },
                   {
                       "id": "8e7715529a39af45",
                       "type": "junction",
                       "z": "4d4f645bb79e4e57",
                       "x": 440,
                       "y": 300,
                       "wires": [
                           [
                               "f123ee95affb9d7b"
                           ]
                       ]
                   },
                   {
                       "id": "ac6a362d1bc5230b",
                       "type": "junction",
                       "z": "4d4f645bb79e4e57",
                       "x": 440,
                       "y": 120,
                       "wires": [
                           [
                               "afb56478c0f20f25"
                           ]
                       ]
                   },
                   {
                       "id": "6602cc75a9a44511",
                       "type": "mqtt-broker",
                       "name": "",
                       "broker": "localhost",
                       "port": "1883",
                       "clientid": "",
                       "usetls": false,
                       "compatmode": true,
                       "keepalive": "60",
                       "cleansession": true,
                       "birthTopic": "",
                       "birthQos": "0",
                       "birthPayload": "",
                       "closeTopic": "",
                       "closeQos": "0",
                       "closePayload": "",
                       "willTopic": "",
                       "willQos": "0",
                       "willPayload": ""
                   },
                   {
                       "id": "32b64ad3a93bea4d",
                       "type": "ui_group",
                       "name": "einzelnen Werte Anzeige",
                       "tab": "ca5efd2e61c52c2c",
                       "order": 2,
                       "disp": true,
                       "width": "20",
                       "collapse": true,
                       "className": ""
                   },
                   {
                       "id": "ca5efd2e61c52c2c",
                       "type": "ui_tab",
                       "name": "Dashboard",
                       "icon": "dashboard",
                       "disabled": false,
                       "hidden": false
                   }
                ]
                

                d73984f4-dc92-431f-8796-4778b28a1660-image.png

                Dann Dir noch einen schönen Abend.

                1 Reply Last reply Reply Quote 0
                • haus-automatisierung
                  haus-automatisierung Developer Most Active @Schnuller last edited by

                  @schnuller sagte in Anfänger braucht Hilfe zum Addieren von MQTT werten:

                  Hast recht versteh payload und msg nicht so ganz

                  Das sind aber absolute Node-RED Grundlagen und betreffen alle Nodes. Da wirst Du nicht drumherum kommen, Dir das Konzept genauer anzuschauen.

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    Schnuller @haus-automatisierung last edited by

                    Puh jetzt habe ich aber schelte eingefangen
                    aber danke trotzdem, denk ich verstehe es jetzt besser
                    entscheidend ist der Eintrag " $sum(payload.*) "
                    alle payloads , die mit sum zusammenaddieren

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

                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    836
                    Online

                    31.7k
                    Users

                    79.8k
                    Topics

                    1.3m
                    Posts

                    3
                    8
                    240
                    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