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. (Bitte um Hilfe) Switch Node Wert übernehmen klappt nicht

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    (Bitte um Hilfe) Switch Node Wert übernehmen klappt nicht

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

      Ich möchte im Zweig >= den Wert aus MaxBat übernehmen, ich denke das am Syntax was nicht stimmt.
      [
      {
      "id": "cd8dce56.ce8c28",
      "type": "tab",
      "label": "Flow 3",
      "disabled": false,
      "info": ""
      },
      {
      "id": "5fcf69d9.6b13b",
      "type": "switch",
      "z": "cd8dce56.ce8c28",
      "name": "",
      "property": "payload",
      "propertyType": "msg",
      "rules": [
      {
      "t": "lte",
      "v": "76",
      "vt": "num"
      },
      {
      "t": "gte",
      "v": "({(node-red.0.UserData.MaxBat)})",
      "vt": "num"
      }
      ],
      "checkall": "true",
      "repair": false,
      "outputs": 2,
      "x": 450,
      "y": 200,
      "wires": [
      [
      "cfaccd95.314a98"
      ],
      [
      "5628800a.aa224"
      ]
      ]
      },
      {
      "id": "cfaccd95.314a98",
      "type": "debug",
      "z": "cd8dce56.ce8c28",
      "name": "",
      "active": true,
      "tosidebar": true,
      "console": false,
      "tostatus": false,
      "complete": "false",
      "x": 610,
      "y": 160,
      "wires": []
      },
      {
      "id": "5628800a.aa224",
      "type": "debug",
      "z": "cd8dce56.ce8c28",
      "name": "",
      "active": true,
      "tosidebar": true,
      "console": false,
      "tostatus": false,
      "complete": "false",
      "x": 610,
      "y": 240,
      "wires": []
      },
      {
      "id": "6c9c8400.163fd4",
      "type": "inject",
      "z": "cd8dce56.ce8c28",
      "name": "",
      "topic": "",
      "payload": "90",
      "payloadType": "num",
      "repeat": "",
      "crontab": "",
      "once": false,
      "onceDelay": 0.1,
      "x": 290,
      "y": 200,
      "wires": [
      [
      "5fcf69d9.6b13b"
      ]
      ]
      }
      ]

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

        @Theo56 Ein Switch Node verteilt nur Nachrichten.
        Im ersten Fall gibst Du 76 an Ausgang 1 aus. Die Nachricht aus Ausgang 2 willst Du in einen iobroker Datenpunkt schreiben.

        Deshalb musst Du an iobroker out node an den Ausgang 2 klemmen und Bedingung im Switch Node ist dann "Andernfalls".

        T 1 Reply Last reply Reply Quote 0
        • T
          Theo56 @mickym last edited by

          @mickym sagte in (Bitte um Hilfe) Switch Node Wert übernehmen klappt nicht:

          @Theo56 Ein Switch Node verteilt nur Nachrichten.
          Im ersten Fall gibst Du 76 an Ausgang 1 aus. Die Nachricht aus Ausgang 2 willst Du in einen iobroker Datenpunkt schreiben.

          Deshalb musst Du an iobroker out node an den Ausgang 2 klemmen und Bedingung im Switch Node ist dann "Andernfalls".

          Sorry, ist so nicht meine Absicht,
          ich will im Ausgang 2 den Wert von IoBroker (node-red.0.UserData.MaxBat)
          eintragen um ihn dann im Node weiter zu nutzen.

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

            @Theo56 dann nimmst keinen Switch Node- sondern eine ioBroker get node

            1 Reply Last reply Reply Quote 0
            • S
              Seb_123 last edited by

              Moin,

              soweit ich es verstanden habe, kannst du in Node-Red nicht direkt auf ioBroker-Objekte zugreifen. Du müsstest also zuerst den Wert deines ioBroker-Objektes (node-red.0.UserData.MaxBat) in Node-Red einlesen und dann dort weiterverarbeiten.
              Könnte es das sein was du benötigst?

              c8162f4b-bca8-4439-9202-f2c3592df44f-image.png
              Du müsstest das Topic des ioBroker-get-Nodes noch anpassen.7fdb3947-aec9-40b4-8991-9320b9fec2b8-image.png

              [
                  {
                      "id": "21bc3a0a.07fcc6",
                      "type": "inject",
                      "z": "ea637c16.c6b6f",
                      "name": "",
                      "props": [
                          {
                              "p": "payload"
                          },
                          {
                              "p": "topic",
                              "vt": "str"
                          }
                      ],
                      "repeat": "",
                      "crontab": "",
                      "once": false,
                      "onceDelay": 0.1,
                      "topic": "",
                      "payload": "90",
                      "payloadType": "num",
                      "x": 90,
                      "y": 220,
                      "wires": [
                          [
                              "958d5445.8a3ff8"
                          ]
                      ]
                  },
                  {
                      "id": "bc8a7625.508f58",
                      "type": "switch",
                      "z": "ea637c16.c6b6f",
                      "name": "",
                      "property": "payload",
                      "propertyType": "msg",
                      "rules": [
                          {
                              "t": "lte",
                              "v": "76",
                              "vt": "num"
                          },
                          {
                              "t": "gte",
                              "v": "MaxBat",
                              "vt": "msg"
                          },
                          {
                              "t": "else"
                          }
                      ],
                      "checkall": "true",
                      "repair": false,
                      "outputs": 3,
                      "x": 870,
                      "y": 220,
                      "wires": [
                          [
                              "914e33e6.5d56b"
                          ],
                          [
                              "d07ca42.7a2ab58"
                          ],
                          [
                              "97ccfc25.b4e91"
                          ]
                      ]
                  },
                  {
                      "id": "914e33e6.5d56b",
                      "type": "debug",
                      "z": "ea637c16.c6b6f",
                      "name": "<=76",
                      "active": true,
                      "tosidebar": true,
                      "console": false,
                      "tostatus": false,
                      "complete": "payload",
                      "targetType": "msg",
                      "statusVal": "",
                      "statusType": "auto",
                      "x": 1410,
                      "y": 180,
                      "wires": []
                  },
                  {
                      "id": "d07ca42.7a2ab58",
                      "type": "debug",
                      "z": "ea637c16.c6b6f",
                      "name": ">= MaxBat",
                      "active": true,
                      "tosidebar": true,
                      "console": false,
                      "tostatus": false,
                      "complete": "payload",
                      "targetType": "msg",
                      "statusVal": "",
                      "statusType": "auto",
                      "x": 1430,
                      "y": 220,
                      "wires": []
                  },
                  {
                      "id": "97ccfc25.b4e91",
                      "type": "debug",
                      "z": "ea637c16.c6b6f",
                      "name": "alle anderen Werte ",
                      "active": true,
                      "tosidebar": true,
                      "console": false,
                      "tostatus": false,
                      "complete": "payload",
                      "targetType": "msg",
                      "statusVal": "",
                      "statusType": "auto",
                      "x": 1450,
                      "y": 260,
                      "wires": []
                  },
                  {
                      "id": "958d5445.8a3ff8",
                      "type": "ioBroker get",
                      "z": "ea637c16.c6b6f",
                      "name": "",
                      "topic": "0_userdata.0.MaxBat",
                      "attrname": "MaxBat",
                      "payloadType": "value",
                      "x": 320,
                      "y": 220,
                      "wires": [
                          [
                              "bc8a7625.508f58"
                          ]
                      ]
                  }
              ]
              
              mickym 1 Reply Last reply Reply Quote 0
              • mickym
                mickym Most Active @Seb_123 last edited by

                @Seb_123 @Theo56 hat wohl 2 Threads zum selben Thema geöffnet. Ich hab ihm nun in dem anderen Thread geantwortet - da er da den ganzen Flow exportiert hat - und hab den etwas angepasst. 😉

                https://forum.iobroker.net/topic/35394/was-ist-an-dem-switch-node-falsch

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

                Support us

                ioBroker
                Community Adapters
                Donate

                1.2k
                Online

                31.7k
                Users

                79.7k
                Topics

                1.3m
                Posts

                3
                6
                472
                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