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. Node Red Flow Werte vergleichen

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Node Red Flow Werte vergleichen

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

      Hallo,

      Ich benötige Hilfe bei einem flow. Ich bin da am verzweifeln. Habe es Sundenlang versucht und google bringt mich nicht weiter.

      Ich habe eine node die mir 1 oder 2 ausgibt
      Eine zweite node gibt mir 3 oder 4 aus.

      1 bedeutet daheim Person 1
      2 bedeutet nicht daheim Person 1

      3 bedeutet daheim Person 2
      4 bedeutet nicht daheim Person 2

      Die Ausgabe müsste sein einer weg(Person 1 oder 2), beide weg beide daheim

      vlt kann mir hier jemand helfen, das wäre wirklich sehr nett.

      Danke

      Mousenray

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

        @mousenray Finde zwar diese Zahlen mit den Personen etwas eigenartig, aber jeder wie er mag. 😉

        Hier mal ein Vorschlag:

        f4821b9a-9f9e-4da1-802b-e7aa413c61e2-image.png

        [
            {
                "id": "520b6c0934f33782",
                "type": "inject",
                "z": "7e6af0015415146d",
                "name": "",
                "props": [
                    {
                        "p": "payload"
                    }
                ],
                "repeat": "",
                "crontab": "",
                "once": false,
                "onceDelay": 0.1,
                "topic": "",
                "payload": "1",
                "payloadType": "num",
                "x": 130,
                "y": 2680,
                "wires": [
                    [
                        "40df5071ec88ea95"
                    ]
                ]
            },
            {
                "id": "e23fb862b9a58495",
                "type": "inject",
                "z": "7e6af0015415146d",
                "name": "",
                "props": [
                    {
                        "p": "payload"
                    }
                ],
                "repeat": "",
                "crontab": "",
                "once": false,
                "onceDelay": 0.1,
                "topic": "",
                "payload": "2",
                "payloadType": "num",
                "x": 130,
                "y": 2720,
                "wires": [
                    [
                        "40df5071ec88ea95"
                    ]
                ]
            },
            {
                "id": "16165bcebb279065",
                "type": "inject",
                "z": "7e6af0015415146d",
                "name": "",
                "props": [
                    {
                        "p": "payload"
                    }
                ],
                "repeat": "",
                "crontab": "",
                "once": false,
                "onceDelay": 0.1,
                "topic": "",
                "payload": "3",
                "payloadType": "num",
                "x": 130,
                "y": 2780,
                "wires": [
                    [
                        "40df5071ec88ea95"
                    ]
                ]
            },
            {
                "id": "52529e19f90021de",
                "type": "inject",
                "z": "7e6af0015415146d",
                "name": "",
                "props": [
                    {
                        "p": "payload"
                    }
                ],
                "repeat": "",
                "crontab": "",
                "once": false,
                "onceDelay": 0.1,
                "topic": "",
                "payload": "4",
                "payloadType": "num",
                "x": 130,
                "y": 2820,
                "wires": [
                    [
                        "40df5071ec88ea95"
                    ]
                ]
            },
            {
                "id": "40df5071ec88ea95",
                "type": "change",
                "z": "7e6af0015415146d",
                "name": "wieder in Personen wandeln",
                "rules": [
                    {
                        "t": "set",
                        "p": "topic",
                        "pt": "msg",
                        "to": "\"Person \" & ($floor((payload-1)/2) + 1)",
                        "tot": "jsonata"
                    },
                    {
                        "t": "set",
                        "p": "payload",
                        "pt": "msg",
                        "to": "payload % 2",
                        "tot": "jsonata"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 380,
                "y": 2740,
                "wires": [
                    [
                        "498f5def46a8c9c9"
                    ]
                ]
            },
            {
                "id": "498f5def46a8c9c9",
                "type": "join",
                "z": "7e6af0015415146d",
                "name": "",
                "mode": "custom",
                "build": "object",
                "property": "payload",
                "propertyType": "msg",
                "key": "topic",
                "joiner": "\\n",
                "joinerType": "str",
                "accumulate": true,
                "timeout": "",
                "count": "1",
                "reduceRight": false,
                "reduceExp": "",
                "reduceInit": "",
                "reduceInitType": "",
                "reduceFixup": "",
                "x": 590,
                "y": 2740,
                "wires": [
                    [
                        "cb655b5d69808d8a",
                        "0a344758c59647c4"
                    ]
                ]
            },
            {
                "id": "cb655b5d69808d8a",
                "type": "debug",
                "z": "7e6af0015415146d",
                "name": "Personenstatus",
                "active": true,
                "tosidebar": true,
                "console": false,
                "tostatus": false,
                "complete": "payload",
                "targetType": "msg",
                "statusVal": "",
                "statusType": "auto",
                "x": 780,
                "y": 2680,
                "wires": []
            },
            {
                "id": "0a344758c59647c4",
                "type": "split",
                "z": "7e6af0015415146d",
                "name": "",
                "splt": "\\n",
                "spltType": "str",
                "arraySplt": 1,
                "arraySpltType": "len",
                "stream": false,
                "addname": "",
                "x": 750,
                "y": 2740,
                "wires": [
                    [
                        "56eac638f7ba4894"
                    ]
                ]
            },
            {
                "id": "56eac638f7ba4894",
                "type": "join",
                "z": "7e6af0015415146d",
                "name": "",
                "mode": "reduce",
                "build": "object",
                "property": "payload",
                "propertyType": "msg",
                "key": "topic",
                "joiner": "\\n",
                "joinerType": "str",
                "accumulate": true,
                "timeout": "",
                "count": "",
                "reduceRight": false,
                "reduceExp": "$A + payload",
                "reduceInit": "0",
                "reduceInitType": "num",
                "reduceFixup": "",
                "x": 890,
                "y": 2740,
                "wires": [
                    [
                        "73e6f13cc632894c",
                        "f0c36b93a59e2371"
                    ]
                ]
            },
            {
                "id": "73e6f13cc632894c",
                "type": "debug",
                "z": "7e6af0015415146d",
                "name": "Anzahl Personen zuhause",
                "active": false,
                "tosidebar": true,
                "console": false,
                "tostatus": false,
                "complete": "payload",
                "targetType": "msg",
                "statusVal": "",
                "statusType": "auto",
                "x": 1110,
                "y": 2680,
                "wires": []
            },
            {
                "id": "f0c36b93a59e2371",
                "type": "change",
                "z": "7e6af0015415146d",
                "name": "",
                "rules": [
                    {
                        "t": "change",
                        "p": "payload",
                        "pt": "msg",
                        "from": "0",
                        "fromt": "num",
                        "to": "Keiner daheim",
                        "tot": "str"
                    },
                    {
                        "t": "change",
                        "p": "payload",
                        "pt": "msg",
                        "from": "1",
                        "fromt": "num",
                        "to": "Einer von beiden daheim",
                        "tot": "str"
                    },
                    {
                        "t": "change",
                        "p": "payload",
                        "pt": "msg",
                        "from": "2",
                        "fromt": "num",
                        "to": "Beide daheim",
                        "tot": "str"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 1070,
                "y": 2740,
                "wires": [
                    [
                        "9568f12ecdabc626"
                    ]
                ]
            },
            {
                "id": "9568f12ecdabc626",
                "type": "debug",
                "z": "7e6af0015415146d",
                "name": "Text",
                "active": true,
                "tosidebar": true,
                "console": false,
                "tostatus": false,
                "complete": "payload",
                "targetType": "msg",
                "statusVal": "",
                "statusType": "auto",
                "x": 1270,
                "y": 2740,
                "wires": []
            }
        ]
        

        M 1 Reply Last reply Reply Quote 0
        • M
          Mousenray @mickym last edited by

          @mickym

          Vielen Dank, das funktioniert wie ich es wollte. Das mit den Zahlen ändere ich noch ab und passe dann den Flow an. So war es einfacher es zu erklären!

          Mousenray

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

          Support us

          ioBroker
          Community Adapters
          Donate

          1.0k
          Online

          31.7k
          Users

          79.7k
          Topics

          1.3m
          Posts

          node-red
          2
          3
          199
          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