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. Schrittwerk mit einer Bedingung begrenzen

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Schrittwerk mit einer Bedingung begrenzen

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

      Hallo zusammen,
      ich benötige Hilfe bei einem Flow.

      In node-red habe ich ein Schrittwerk, welches 14 Ausgänge der Reihe nach (hoch oder runter) schaltet. Dies kann ich über die +1 oder -1 nodes auch gut machen.

      Nun stehe ich aber vor der Aufgabe, dass ich unter einer weiteren Bedingung die Schritte begrenzen will (z.B. auf 0-7), und wenn zuweit gezährt ist, der höchste Wert ( 7 ) genommen wird.

      Screenshot 2023-10-07 233611.png

      if (flow.get('counter') === undefined) {
      flow.set('counter', 0);
      }
      
      if (flow.get('counter') >13) {
          flow.set('counter', 0);
      }
      
      if (flow.get('counter') <= 12) {
          if (msg.action === '+1') {
              flow.set('counter', flow.get('counter') + 1);
          }
      }
      
      if (flow.get('counter') >= 1) {
          if (msg.action === '-1') {
                  flow.set('counter', flow.get('counter') - 1);
          }
      }
      
      msg.payload = flow.get('counter');
      return msg;
      

      ich bin neu in node-red - steht es mir nach, wenn ich es komliziert angehe 😉

      danke vorab.
      Rico

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

        @hawell Nun weil Du programmierst anstelle einfach die Nodes zu verwenden, die Dir zur Verfügung stehen machst Du Dir es kompliziert. Ich werde Dir mal einen Flow zeigen, wie Du das ganze ohne viel Programmtext schreiben kannst.

        ce9c9fca-b2f6-46d9-97b7-f585a95e0bf5-image.png

        Hier der Import:

        [
           {
               "id": "e5e7dad99e3b689c",
               "type": "range",
               "z": "7e6af0015415146d",
               "minin": "0",
               "maxin": "7",
               "minout": "0",
               "maxout": "7",
               "action": "clamp",
               "round": false,
               "property": "payload",
               "name": "",
               "x": 650,
               "y": 2760,
               "wires": [
                   [
                       "69f8cd673af4fc87"
                   ]
               ]
           },
           {
               "id": "d16fae2745c78af7",
               "type": "range",
               "z": "7e6af0015415146d",
               "minin": "0",
               "maxin": "13",
               "minout": "0",
               "maxout": "13",
               "action": "clamp",
               "round": false,
               "property": "payload",
               "name": "",
               "x": 650,
               "y": 2800,
               "wires": [
                   [
                       "69f8cd673af4fc87"
                   ]
               ]
           },
           {
               "id": "dd0c031ed616d00a",
               "type": "inject",
               "z": "7e6af0015415146d",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   },
                   {
                       "p": "topic",
                       "vt": "str"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "action",
               "payload": "-1",
               "payloadType": "num",
               "x": 160,
               "y": 2760,
               "wires": [
                   [
                       "21266c46640c4769"
                   ]
               ]
           },
           {
               "id": "64c3e798af427910",
               "type": "inject",
               "z": "7e6af0015415146d",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   },
                   {
                       "p": "topic",
                       "vt": "str"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "action",
               "payload": "1",
               "payloadType": "num",
               "x": 170,
               "y": 2800,
               "wires": [
                   [
                       "21266c46640c4769"
                   ]
               ]
           },
           {
               "id": "2630c35c16cd4c9d",
               "type": "debug",
               "z": "7e6af0015415146d",
               "name": "Ausgabe",
               "active": true,
               "tosidebar": true,
               "console": false,
               "tostatus": false,
               "complete": "payload",
               "targetType": "msg",
               "statusVal": "",
               "statusType": "auto",
               "x": 940,
               "y": 2700,
               "wires": []
           },
           {
               "id": "247f423fc9825a34",
               "type": "inject",
               "z": "7e6af0015415146d",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   },
                   {
                       "p": "topic",
                       "vt": "str"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "Begrenzung",
               "payload": "true",
               "payloadType": "bool",
               "x": 240,
               "y": 2920,
               "wires": [
                   [
                       "b58479dc79a97e4e"
                   ]
               ]
           },
           {
               "id": "fcac5eba3c7e6fd4",
               "type": "inject",
               "z": "7e6af0015415146d",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   },
                   {
                       "p": "topic",
                       "vt": "str"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "Begrenzung",
               "payload": "false",
               "payloadType": "bool",
               "x": 240,
               "y": 2960,
               "wires": [
                   [
                       "b58479dc79a97e4e"
                   ]
               ]
           },
           {
               "id": "b58479dc79a97e4e",
               "type": "change",
               "z": "7e6af0015415146d",
               "name": "",
               "rules": [
                   {
                       "t": "set",
                       "p": "Begrenzung",
                       "pt": "flow",
                       "to": "payload",
                       "tot": "msg"
                   }
               ],
               "action": "",
               "property": "",
               "from": "",
               "to": "",
               "reg": false,
               "x": 500,
               "y": 2940,
               "wires": [
                   []
               ]
           },
           {
               "id": "21266c46640c4769",
               "type": "change",
               "z": "7e6af0015415146d",
               "name": "modify counter",
               "rules": [
                   {
                       "t": "set",
                       "p": "counter",
                       "pt": "msg",
                       "to": "counter",
                       "tot": "flow"
                   },
                   {
                       "t": "set",
                       "p": "payload",
                       "pt": "msg",
                       "to": "payload + (counter ? counter : 0)",
                       "tot": "jsonata"
                   },
                   {
                       "t": "delete",
                       "p": "counter",
                       "pt": "msg"
                   }
               ],
               "action": "",
               "property": "",
               "from": "",
               "to": "",
               "reg": false,
               "x": 340,
               "y": 2780,
               "wires": [
                   [
                       "82cc5b856c79bdde"
                   ]
               ]
           },
           {
               "id": "82cc5b856c79bdde",
               "type": "switch",
               "z": "7e6af0015415146d",
               "name": "",
               "property": "Begrenzung",
               "propertyType": "flow",
               "rules": [
                   {
                       "t": "true"
                   },
                   {
                       "t": "false"
                   }
               ],
               "checkall": "true",
               "repair": false,
               "outputs": 2,
               "x": 510,
               "y": 2780,
               "wires": [
                   [
                       "e5e7dad99e3b689c"
                   ],
                   [
                       "d16fae2745c78af7"
                   ]
               ]
           },
           {
               "id": "3b1b342c0212bcc9",
               "type": "switch",
               "z": "7e6af0015415146d",
               "name": "Schrittwerk",
               "property": "payload",
               "propertyType": "msg",
               "rules": [
                   {
                       "t": "eq",
                       "v": "0",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "1",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "2",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "3",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "4",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "5",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "6",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "7",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "8",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "9",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "10",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "11",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "12",
                       "vt": "num"
                   },
                   {
                       "t": "eq",
                       "v": "13",
                       "vt": "num"
                   }
               ],
               "checkall": "true",
               "repair": false,
               "outputs": 14,
               "x": 1170,
               "y": 2780,
               "wires": [
                   [],
                   [],
                   [],
                   [],
                   [],
                   [],
                   [],
                   [],
                   [],
                   [],
                   [],
                   [],
                   [],
                   []
               ]
           },
           {
               "id": "69f8cd673af4fc87",
               "type": "rbe",
               "z": "7e6af0015415146d",
               "name": "",
               "func": "rbe",
               "gap": "",
               "start": "",
               "inout": "out",
               "septopics": true,
               "property": "payload",
               "topi": "topic",
               "x": 790,
               "y": 2780,
               "wires": [
                   [
                       "fedd4f4e1118cec1",
                       "2630c35c16cd4c9d"
                   ]
               ]
           },
           {
               "id": "fedd4f4e1118cec1",
               "type": "change",
               "z": "7e6af0015415146d",
               "name": "",
               "rules": [
                   {
                       "t": "set",
                       "p": "counter",
                       "pt": "flow",
                       "to": "payload",
                       "tot": "msg"
                   }
               ],
               "action": "",
               "property": "",
               "from": "",
               "to": "",
               "reg": false,
               "x": 970,
               "y": 2780,
               "wires": [
                   [
                       "3b1b342c0212bcc9"
                   ]
               ]
           }
        ]
        

        Tipp: Versuche function Nodes nur zu verwenden, wenn unbedingt erforderlich.

        Wie gesagt Du kannst auch alles in eine function Node packen - aber es macht es halt nur kompliziert um Programmtext zu schreiben. Außerdem tust Du Dir bei der Fehlersuche viel schwerer - wenn Du mit node.warn innerhalb einer function Node Fehler suchen musst. Wenn Du einzelne Nodes hast - kannst Du die schneller mal abkabeln oder eine debug Node dahinter hängen.

        Den einzigen Vorteil hättest Du wenn Du in einer function Node den Node Kontext für Deinen counter verwenden könntest, dann brauchst aber auch keinen flow Kontext.

        Wenn du bei deinem Flow halt die Begrenzung in der function Node einfügen willst musst Du halt entweder über die Nachricht (das topic oder die Eigenschaft innerhalb der Nachricht) kenntlich machen, ob der Ursprung aus Deinen Begrenzungs-Inject Nodes oder den Action Inject Nodes kommt. Wie gesagt - Du fängst nur an unnötig viel Code zu schreiben.

        Im Übrigen arbeitest Du wohl in Deinen msg.action Inject Nodes mit Strings - anstelle gleich mit Zahlen zu arbeiten:

        b4d92b4b-dadb-459e-841d-92c39afa6140-image.png

        8d0deac6-e073-41b4-8470-f77445040921-image.png

        Also einfach schauen, was Du für einen Datentyp verwendest - das muss kein String sein. Somit könntest Du Deinen counter gleich mit der msg.action in einer Anweisung erhöhen oder erniedrigen.

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

          Was im Flow noch fehlt ist eine Initialisierung der Begrenzung Flowvariablen. Dazu einfach die gewünschte Inject-Node einmal triggern lassen.

          H 1 Reply Last reply Reply Quote 0
          • H
            hawell @mickym last edited by

            @mickym
            es ist frustrierend zu sehen, dass man immer vieeeeel zu kompliziert denkt 😉

            ich habe nun mal deinen Code in meinen Flow eingebettet.

            anbei das Ergebniss. sicher auch zu komliziert ?

            Screenshot 2023-10-07 233611.png

            [
                {
                    "id": "a4df471f006c7c29",
                    "type": "switch",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "property": "payload",
                    "propertyType": "msg",
                    "rules": [
                        {
                            "t": "eq",
                            "v": "0",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "1",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "2",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "3",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "4",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "5",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "6",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "7",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "8",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "9",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "10",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "11",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "12",
                            "vt": "num"
                        },
                        {
                            "t": "eq",
                            "v": "13",
                            "vt": "num"
                        }
                    ],
                    "checkall": "true",
                    "repair": false,
                    "outputs": 14,
                    "x": 2130,
                    "y": 400,
                    "wires": [
                        [
                            "398312eeeb8ccd46",
                            "3ff1604bf5bca832",
                            "5fc2d946dd666aca",
                            "28762e0360464d57"
                        ],
                        [
                            "b93d2ce896558684",
                            "3ff1604bf5bca832",
                            "5fc2d946dd666aca",
                            "28762e0360464d57"
                        ],
                        [
                            "398312eeeb8ccd46",
                            "a48f000b08ef6896",
                            "5fc2d946dd666aca",
                            "28762e0360464d57"
                        ],
                        [
                            "b93d2ce896558684",
                            "a48f000b08ef6896",
                            "5fc2d946dd666aca",
                            "28762e0360464d57"
                        ],
                        [
                            "398312eeeb8ccd46",
                            "3ff1604bf5bca832",
                            "5a78c3af30a68905",
                            "28762e0360464d57"
                        ],
                        [
                            "b93d2ce896558684",
                            "3ff1604bf5bca832",
                            "5a78c3af30a68905",
                            "28762e0360464d57"
                        ],
                        [
                            "398312eeeb8ccd46",
                            "a48f000b08ef6896",
                            "5a78c3af30a68905",
                            "28762e0360464d57"
                        ],
                        [
                            "b93d2ce896558684",
                            "a48f000b08ef6896",
                            "5a78c3af30a68905",
                            "28762e0360464d57"
                        ],
                        [
                            "398312eeeb8ccd46",
                            "a48f000b08ef6896",
                            "5fc2d946dd666aca",
                            "210fe10072b7d40a"
                        ],
                        [
                            "b93d2ce896558684",
                            "a48f000b08ef6896",
                            "5fc2d946dd666aca",
                            "210fe10072b7d40a"
                        ],
                        [
                            "398312eeeb8ccd46",
                            "3ff1604bf5bca832",
                            "5a78c3af30a68905",
                            "210fe10072b7d40a"
                        ],
                        [
                            "b93d2ce896558684",
                            "3ff1604bf5bca832",
                            "5a78c3af30a68905",
                            "210fe10072b7d40a"
                        ],
                        [
                            "398312eeeb8ccd46",
                            "a48f000b08ef6896",
                            "5a78c3af30a68905",
                            "210fe10072b7d40a"
                        ],
                        [
                            "b93d2ce896558684",
                            "a48f000b08ef6896",
                            "5a78c3af30a68905",
                            "210fe10072b7d40a"
                        ]
                    ]
                },
                {
                    "id": "310bc8c1fa0df514",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "rules": [
                        {
                            "t": "set",
                            "p": "reset",
                            "pt": "msg",
                            "to": "payload",
                            "tot": "msg"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 640,
                    "y": 460,
                    "wires": [
                        [
                            "de5c12b8131d105f",
                            "1614f195f326e63e"
                        ]
                    ]
                },
                {
                    "id": "4fbf3fe3e30e859d",
                    "type": "trigger",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "op1": "1",
                    "op2": "0",
                    "op1type": "str",
                    "op2type": "str",
                    "duration": "0",
                    "extend": false,
                    "overrideDelay": false,
                    "units": "ms",
                    "reset": "",
                    "bytopic": "all",
                    "topic": "topic",
                    "outputs": 1,
                    "x": 640,
                    "y": 260,
                    "wires": [
                        [
                            "310bc8c1fa0df514",
                            "a4be58efb147f789"
                        ]
                    ]
                },
                {
                    "id": "4aecd62772296f97",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "rules": [
                        {
                            "t": "set",
                            "p": "reset",
                            "pt": "msg",
                            "to": "payload",
                            "tot": "msg"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 640,
                    "y": 340,
                    "wires": [
                        [
                            "4fbf3fe3e30e859d",
                            "a4be58efb147f789"
                        ]
                    ]
                },
                {
                    "id": "de5c12b8131d105f",
                    "type": "trigger",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "op1": "",
                    "op2": "1",
                    "op1type": "nul",
                    "op2type": "str",
                    "duration": "5",
                    "extend": false,
                    "overrideDelay": false,
                    "units": "s",
                    "reset": "",
                    "bytopic": "all",
                    "topic": "topic",
                    "outputs": 1,
                    "x": 860,
                    "y": 540,
                    "wires": [
                        [
                            "310bc8c1fa0df514",
                            "07f087d511c8b3e2"
                        ]
                    ]
                },
                {
                    "id": "a4be58efb147f789",
                    "type": "trigger",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "op1": "",
                    "op2": "1",
                    "op1type": "nul",
                    "op2type": "str",
                    "duration": "5",
                    "extend": false,
                    "overrideDelay": false,
                    "units": "s",
                    "reset": "",
                    "bytopic": "all",
                    "topic": "topic",
                    "outputs": 1,
                    "x": 860,
                    "y": 260,
                    "wires": [
                        [
                            "4aecd62772296f97",
                            "034c5314770775c6"
                        ]
                    ]
                },
                {
                    "id": "1614f195f326e63e",
                    "type": "trigger",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "op1": "1",
                    "op2": "1",
                    "op1type": "str",
                    "op2type": "str",
                    "duration": "0",
                    "extend": false,
                    "overrideDelay": false,
                    "units": "s",
                    "reset": "",
                    "bytopic": "all",
                    "topic": "topic",
                    "outputs": 1,
                    "x": 640,
                    "y": 540,
                    "wires": [
                        [
                            "de5c12b8131d105f",
                            "4aecd62772296f97"
                        ]
                    ]
                },
                {
                    "id": "4bbe3cb139220b42",
                    "type": "switch",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "property": "payload",
                    "propertyType": "msg",
                    "rules": [
                        {
                            "t": "gte",
                            "v": "2",
                            "vt": "num"
                        },
                        {
                            "t": "btwn",
                            "v": "-699",
                            "vt": "num",
                            "v2": "1",
                            "v2t": "num"
                        },
                        {
                            "t": "lt",
                            "v": "-700",
                            "vt": "num"
                        }
                    ],
                    "checkall": "true",
                    "repair": false,
                    "outputs": 3,
                    "x": 330,
                    "y": 400,
                    "wires": [
                        [
                            "4fbf3fe3e30e859d"
                        ],
                        [
                            "4aecd62772296f97",
                            "310bc8c1fa0df514"
                        ],
                        [
                            "1614f195f326e63e"
                        ]
                    ]
                },
                {
                    "id": "034c5314770775c6",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "name": "-1",
                    "rules": [
                        {
                            "t": "delete",
                            "p": "payload",
                            "pt": "msg"
                        },
                        {
                            "t": "set",
                            "p": "payload",
                            "pt": "msg",
                            "to": "-1",
                            "tot": "num"
                        },
                        {
                            "t": "set",
                            "p": "topic",
                            "pt": "msg",
                            "to": "action",
                            "tot": "str"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 1050,
                    "y": 260,
                    "wires": [
                        [
                            "e16d9f5e94d3229f"
                        ]
                    ]
                },
                {
                    "id": "2a3e252e4ffab885",
                    "type": "inject",
                    "z": "555a0da86fcbd59e",
                    "name": "0",
                    "props": [
                        {
                            "p": "payload"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": false,
                    "onceDelay": 0.1,
                    "topic": "",
                    "payload": "1",
                    "payloadType": "num",
                    "x": 1050,
                    "y": 720,
                    "wires": [
                        [
                            "63bd6c3bb3e651dc"
                        ]
                    ]
                },
                {
                    "id": "75c57efdef71160f",
                    "type": "ha-button",
                    "z": "555a0da86fcbd59e",
                    "name": "Heizstäbe ausschalten",
                    "version": 0,
                    "debugenabled": false,
                    "outputs": 1,
                    "entityConfig": "f3f4583ca540c2a8",
                    "outputProperties": [
                        {
                            "property": "payload",
                            "propertyType": "msg",
                            "value": "1",
                            "valueType": "num"
                        }
                    ],
                    "x": 1000,
                    "y": 660,
                    "wires": [
                        [
                            "63bd6c3bb3e651dc"
                        ]
                    ]
                },
                {
                    "id": "4471327821c29be8",
                    "type": "range",
                    "z": "555a0da86fcbd59e",
                    "minin": "0",
                    "maxin": "7",
                    "minout": "0",
                    "maxout": "7",
                    "action": "clamp",
                    "round": false,
                    "property": "payload",
                    "name": "",
                    "x": 1610,
                    "y": 380,
                    "wires": [
                        [
                            "aaf51c77abf2d92b"
                        ]
                    ]
                },
                {
                    "id": "c9e90412a78aa937",
                    "type": "range",
                    "z": "555a0da86fcbd59e",
                    "minin": "0",
                    "maxin": "13",
                    "minout": "0",
                    "maxout": "13",
                    "action": "clamp",
                    "round": false,
                    "property": "payload",
                    "name": "",
                    "x": 1610,
                    "y": 420,
                    "wires": [
                        [
                            "aaf51c77abf2d92b"
                        ]
                    ]
                },
                {
                    "id": "0ba84e543119bf12",
                    "type": "inject",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "props": [
                        {
                            "p": "payload"
                        },
                        {
                            "p": "topic",
                            "vt": "str"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": false,
                    "onceDelay": 0.1,
                    "topic": "action",
                    "payload": "-1",
                    "payloadType": "num",
                    "x": 1040,
                    "y": 340,
                    "wires": [
                        [
                            "e16d9f5e94d3229f"
                        ]
                    ]
                },
                {
                    "id": "80c924d4eb2de24c",
                    "type": "inject",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "props": [
                        {
                            "p": "payload"
                        },
                        {
                            "p": "topic",
                            "vt": "str"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": false,
                    "onceDelay": 0.1,
                    "topic": "action",
                    "payload": "1",
                    "payloadType": "num",
                    "x": 1050,
                    "y": 460,
                    "wires": [
                        [
                            "e16d9f5e94d3229f"
                        ]
                    ]
                },
                {
                    "id": "27d4c6a16dae68c3",
                    "type": "debug",
                    "z": "555a0da86fcbd59e",
                    "name": "Ausgabe",
                    "active": false,
                    "tosidebar": true,
                    "console": false,
                    "tostatus": true,
                    "complete": "payload",
                    "targetType": "msg",
                    "statusVal": "payload",
                    "statusType": "auto",
                    "x": 1960,
                    "y": 240,
                    "wires": []
                },
                {
                    "id": "e16d9f5e94d3229f",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "name": "modify counter",
                    "rules": [
                        {
                            "t": "set",
                            "p": "counter",
                            "pt": "msg",
                            "to": "counter",
                            "tot": "flow"
                        },
                        {
                            "t": "set",
                            "p": "payload",
                            "pt": "msg",
                            "to": "payload + (counter ? counter : 0)",
                            "tot": "jsonata"
                        },
                        {
                            "t": "delete",
                            "p": "counter",
                            "pt": "msg"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 1300,
                    "y": 400,
                    "wires": [
                        [
                            "f1bea7b4b7a79206"
                        ]
                    ]
                },
                {
                    "id": "f1bea7b4b7a79206",
                    "type": "switch",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "property": "Begrenzung",
                    "propertyType": "flow",
                    "rules": [
                        {
                            "t": "true"
                        },
                        {
                            "t": "false"
                        }
                    ],
                    "checkall": "true",
                    "repair": false,
                    "outputs": 2,
                    "x": 1470,
                    "y": 400,
                    "wires": [
                        [
                            "4471327821c29be8"
                        ],
                        [
                            "c9e90412a78aa937"
                        ]
                    ]
                },
                {
                    "id": "aaf51c77abf2d92b",
                    "type": "rbe",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "func": "rbe",
                    "gap": "",
                    "start": "",
                    "inout": "out",
                    "septopics": true,
                    "property": "payload",
                    "topi": "topic",
                    "x": 1750,
                    "y": 400,
                    "wires": [
                        [
                            "3556052e013cfd33",
                            "27d4c6a16dae68c3"
                        ]
                    ]
                },
                {
                    "id": "3556052e013cfd33",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "name": "",
                    "rules": [
                        {
                            "t": "set",
                            "p": "counter",
                            "pt": "flow",
                            "to": "payload",
                            "tot": "msg"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 1930,
                    "y": 400,
                    "wires": [
                        [
                            "a4df471f006c7c29"
                        ]
                    ]
                },
                {
                    "id": "07f087d511c8b3e2",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "name": "+1",
                    "rules": [
                        {
                            "t": "delete",
                            "p": "payload",
                            "pt": "msg"
                        },
                        {
                            "t": "set",
                            "p": "payload",
                            "pt": "msg",
                            "to": "1",
                            "tot": "num"
                        },
                        {
                            "t": "set",
                            "p": "topic",
                            "pt": "msg",
                            "to": "action",
                            "tot": "str"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 1050,
                    "y": 540,
                    "wires": [
                        [
                            "e16d9f5e94d3229f"
                        ]
                    ]
                },
                {
                    "id": "63bd6c3bb3e651dc",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "name": "set 0 counter",
                    "rules": [
                        {
                            "t": "set",
                            "p": "counter",
                            "pt": "msg",
                            "to": "counter",
                            "tot": "flow"
                        },
                        {
                            "t": "set",
                            "p": "payload",
                            "pt": "msg",
                            "to": "0",
                            "tot": "num"
                        },
                        {
                            "t": "set",
                            "p": "topic",
                            "pt": "msg",
                            "to": "action",
                            "tot": "str"
                        },
                        {
                            "t": "delete",
                            "p": "counter",
                            "pt": "msg"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 1310,
                    "y": 660,
                    "wires": [
                        [
                            "f1bea7b4b7a79206"
                        ]
                    ]
                },
                {
                    "id": "458ecde97817f777",
                    "type": "inject",
                    "z": "555a0da86fcbd59e",
                    "name": "100",
                    "props": [
                        {
                            "p": "payload"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": false,
                    "onceDelay": 0.1,
                    "topic": "",
                    "payload": "100",
                    "payloadType": "num",
                    "x": 110,
                    "y": 360,
                    "wires": [
                        [
                            "4bbe3cb139220b42"
                        ]
                    ]
                },
                {
                    "id": "9a176b2bfce3c5bc",
                    "type": "inject",
                    "z": "555a0da86fcbd59e",
                    "name": "-500",
                    "props": [
                        {
                            "p": "payload"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": false,
                    "onceDelay": 0.1,
                    "topic": "",
                    "payload": "-500",
                    "payloadType": "num",
                    "x": 110,
                    "y": 420,
                    "wires": [
                        [
                            "4bbe3cb139220b42"
                        ]
                    ]
                },
                {
                    "id": "dbb92ef2ecce8bdb",
                    "type": "inject",
                    "z": "555a0da86fcbd59e",
                    "name": "-2000",
                    "props": [
                        {
                            "p": "payload"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": false,
                    "onceDelay": 0.1,
                    "topic": "",
                    "payload": "-2000",
                    "payloadType": "num",
                    "x": 110,
                    "y": 480,
                    "wires": [
                        [
                            "4bbe3cb139220b42"
                        ]
                    ]
                },
                {
                    "id": "95d26de77e9ff6c8",
                    "type": "comment",
                    "z": "555a0da86fcbd59e",
                    "name": "Werte kommen sekündlich über vom Energiemanager",
                    "info": "",
                    "x": 200,
                    "y": 220,
                    "wires": []
                },
                {
                    "id": "3652f840e6df66c4",
                    "type": "comment",
                    "z": "555a0da86fcbd59e",
                    "name": "FlipFlop um schnelles hin/her Flippen zu vermeiden",
                    "info": "",
                    "x": 790,
                    "y": 220,
                    "wires": []
                },
                {
                    "id": "28056265e702d35a",
                    "type": "group",
                    "z": "555a0da86fcbd59e",
                    "style": {
                        "stroke": "#999999",
                        "stroke-opacity": "1",
                        "fill": "none",
                        "fill-opacity": "1",
                        "label": true,
                        "label-position": "nw",
                        "color": "#a4a4a4"
                    },
                    "nodes": [
                        "47e4b4c1a5719f97",
                        "2cbf219ba70e288d",
                        "dbca6aa2a28f48cc",
                        "f41294d7e6bd742a",
                        "23d944158c2afb9d",
                        "2c066e034e22725f",
                        "93c130968fd0aff6",
                        "56baed6c9d62d302",
                        "73503abeceb4a948",
                        "2434e456aab4e422",
                        "698c0b8feeb927ab",
                        "dca67830bec17864",
                        "e9c9475635add4b0",
                        "5cb56a40dbb6fe16",
                        "6d5b8d54b80f3aec",
                        "ea9e0233a1fc4285",
                        "b6225626acfb1315"
                    ],
                    "x": 74,
                    "y": 819,
                    "w": 1712,
                    "h": 402
                },
                {
                    "id": "47e4b4c1a5719f97",
                    "type": "switch",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": " WR-Leistung kleiner 3500W",
                    "property": "payload",
                    "propertyType": "msg",
                    "rules": [
                        {
                            "t": "lt",
                            "v": "3500",
                            "vt": "num"
                        },
                        {
                            "t": "gte",
                            "v": "3500",
                            "vt": "num"
                        }
                    ],
                    "checkall": "true",
                    "repair": false,
                    "outputs": 2,
                    "x": 460,
                    "y": 1040,
                    "wires": [
                        [
                            "56baed6c9d62d302"
                        ],
                        [
                            "dca67830bec17864"
                        ]
                    ]
                },
                {
                    "id": "2cbf219ba70e288d",
                    "type": "inject",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "",
                    "props": [
                        {
                            "p": "payload"
                        },
                        {
                            "p": "topic",
                            "vt": "str"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": false,
                    "onceDelay": 0.1,
                    "topic": "Begrenzung",
                    "payload": "true",
                    "payloadType": "bool",
                    "x": 1180,
                    "y": 1020,
                    "wires": [
                        [
                            "f41294d7e6bd742a"
                        ]
                    ]
                },
                {
                    "id": "dbca6aa2a28f48cc",
                    "type": "inject",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "",
                    "props": [
                        {
                            "p": "payload"
                        },
                        {
                            "p": "topic",
                            "vt": "str"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": true,
                    "onceDelay": 0.1,
                    "topic": "Begrenzung",
                    "payload": "false",
                    "payloadType": "bool",
                    "x": 1170,
                    "y": 1100,
                    "wires": [
                        [
                            "f41294d7e6bd742a"
                        ]
                    ]
                },
                {
                    "id": "f41294d7e6bd742a",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "",
                    "rules": [
                        {
                            "t": "set",
                            "p": "Begrenzung",
                            "pt": "flow",
                            "to": "payload",
                            "tot": "msg"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 1440,
                    "y": 1060,
                    "wires": [
                        [
                            "ea9e0233a1fc4285"
                        ]
                    ]
                },
                {
                    "id": "23d944158c2afb9d",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "false",
                    "rules": [
                        {
                            "t": "set",
                            "p": "payload",
                            "pt": "msg",
                            "to": "false",
                            "tot": "bool"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 1210,
                    "y": 1180,
                    "wires": [
                        [
                            "f41294d7e6bd742a"
                        ]
                    ]
                },
                {
                    "id": "2c066e034e22725f",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "true",
                    "rules": [
                        {
                            "t": "set",
                            "p": "payload",
                            "pt": "msg",
                            "to": "true",
                            "tot": "bool"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 1210,
                    "y": 920,
                    "wires": [
                        [
                            "f41294d7e6bd742a"
                        ]
                    ]
                },
                {
                    "id": "93c130968fd0aff6",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "",
                    "rules": [
                        {
                            "t": "set",
                            "p": "reset",
                            "pt": "msg",
                            "to": "payload",
                            "tot": "msg"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 780,
                    "y": 1100,
                    "wires": [
                        [
                            "2434e456aab4e422",
                            "dca67830bec17864"
                        ]
                    ]
                },
                {
                    "id": "56baed6c9d62d302",
                    "type": "trigger",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "",
                    "op1": "1",
                    "op2": "0",
                    "op1type": "str",
                    "op2type": "str",
                    "duration": "0",
                    "extend": false,
                    "overrideDelay": false,
                    "units": "ms",
                    "reset": "",
                    "bytopic": "all",
                    "topic": "topic",
                    "outputs": 1,
                    "x": 780,
                    "y": 920,
                    "wires": [
                        [
                            "698c0b8feeb927ab",
                            "93c130968fd0aff6"
                        ]
                    ]
                },
                {
                    "id": "73503abeceb4a948",
                    "type": "change",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "",
                    "rules": [
                        {
                            "t": "set",
                            "p": "reset",
                            "pt": "msg",
                            "to": "payload",
                            "tot": "msg"
                        }
                    ],
                    "action": "",
                    "property": "",
                    "from": "",
                    "to": "",
                    "reg": false,
                    "x": 780,
                    "y": 1000,
                    "wires": [
                        [
                            "56baed6c9d62d302",
                            "698c0b8feeb927ab"
                        ]
                    ]
                },
                {
                    "id": "2434e456aab4e422",
                    "type": "trigger",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "",
                    "op1": "",
                    "op2": "1",
                    "op1type": "nul",
                    "op2type": "str",
                    "duration": "5",
                    "extend": false,
                    "overrideDelay": false,
                    "units": "s",
                    "reset": "",
                    "bytopic": "all",
                    "topic": "topic",
                    "outputs": 1,
                    "x": 1020,
                    "y": 1180,
                    "wires": [
                        [
                            "93c130968fd0aff6",
                            "23d944158c2afb9d"
                        ]
                    ]
                },
                {
                    "id": "698c0b8feeb927ab",
                    "type": "trigger",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "",
                    "op1": "",
                    "op2": "1",
                    "op1type": "nul",
                    "op2type": "str",
                    "duration": "5",
                    "extend": false,
                    "overrideDelay": false,
                    "units": "s",
                    "reset": "",
                    "bytopic": "all",
                    "topic": "topic",
                    "outputs": 1,
                    "x": 1020,
                    "y": 920,
                    "wires": [
                        [
                            "73503abeceb4a948",
                            "2c066e034e22725f"
                        ]
                    ]
                },
                {
                    "id": "dca67830bec17864",
                    "type": "trigger",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "",
                    "op1": "1",
                    "op2": "1",
                    "op1type": "str",
                    "op2type": "str",
                    "duration": "0",
                    "extend": false,
                    "overrideDelay": false,
                    "units": "s",
                    "reset": "",
                    "bytopic": "all",
                    "topic": "topic",
                    "outputs": 1,
                    "x": 780,
                    "y": 1180,
                    "wires": [
                        [
                            "2434e456aab4e422",
                            "73503abeceb4a948"
                        ]
                    ]
                },
                {
                    "id": "e9c9475635add4b0",
                    "type": "link in",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "link in 6",
                    "links": [
                        "e4d0d17794144fa6"
                    ],
                    "x": 205,
                    "y": 1100,
                    "wires": [
                        [
                            "47e4b4c1a5719f97"
                        ]
                    ]
                },
                {
                    "id": "5cb56a40dbb6fe16",
                    "type": "inject",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "4000",
                    "props": [
                        {
                            "p": "payload"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": false,
                    "onceDelay": 0.1,
                    "topic": "",
                    "payload": "4000",
                    "payloadType": "num",
                    "x": 170,
                    "y": 980,
                    "wires": [
                        [
                            "47e4b4c1a5719f97"
                        ]
                    ]
                },
                {
                    "id": "6d5b8d54b80f3aec",
                    "type": "inject",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "2000",
                    "props": [
                        {
                            "p": "payload"
                        }
                    ],
                    "repeat": "",
                    "crontab": "",
                    "once": false,
                    "onceDelay": 0.1,
                    "topic": "",
                    "payload": "2000",
                    "payloadType": "num",
                    "x": 170,
                    "y": 1040,
                    "wires": [
                        [
                            "47e4b4c1a5719f97"
                        ]
                    ]
                },
                {
                    "id": "ea9e0233a1fc4285",
                    "type": "debug",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "Ausgabe",
                    "active": false,
                    "tosidebar": true,
                    "console": false,
                    "tostatus": true,
                    "complete": "payload",
                    "targetType": "msg",
                    "statusVal": "payload",
                    "statusType": "auto",
                    "x": 1680,
                    "y": 1060,
                    "wires": []
                },
                {
                    "id": "b6225626acfb1315",
                    "type": "comment",
                    "z": "555a0da86fcbd59e",
                    "g": "28056265e702d35a",
                    "name": "WR hatte für eine Dauer von 5 sec mehr als 3500W Leistung ",
                    "info": "",
                    "x": 480,
                    "y": 860,
                    "wires": []
                },
                {
                    "id": "f3f4583ca540c2a8",
                    "type": "ha-entity-config",
                    "server": "6da5c76fec0d359c",
                    "deviceConfig": "",
                    "name": "Heizstäbe ausschalten",
                    "version": "6",
                    "entityType": "button",
                    "haConfig": [
                        {
                            "property": "name",
                            "value": "Heizstäbe ausschalten"
                        },
                        {
                            "property": "icon",
                            "value": ""
                        },
                        {
                            "property": "entity_category",
                            "value": ""
                        },
                        {
                            "property": "entity_picture",
                            "value": ""
                        },
                        {
                            "property": "device_class",
                            "value": ""
                        }
                    ],
                    "resend": false,
                    "debugEnabled": false
                },
                {
                    "id": "6da5c76fec0d359c",
                    "type": "server",
                    "name": "Home Assistant",
                    "version": 5,
                    "addon": true,
                    "rejectUnauthorizedCerts": true,
                    "ha_boolean": "y|yes|true|on|home|open",
                    "connectionDelay": true,
                    "cacheJson": true,
                    "heartbeat": false,
                    "heartbeatInterval": "30",
                    "areaSelector": "friendlyName",
                    "deviceSelector": "friendlyName",
                    "entitySelector": "friendlyName",
                    "statusSeparator": ": ",
                    "statusYear": "hidden",
                    "statusMonth": "short",
                    "statusDay": "numeric",
                    "statusHourCycle": "default",
                    "statusTimeFormat": "h:m",
                    "enableGlobalContextStore": false
                }
            ]
            

            ich bin in der Funktion Node hängen geblieben wegen dem if/else - dass es aber auch anders geht - hatte ich noch nicht gewusst.

            danke schon mal - fürs helfen

            Gruß Rico

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

              @hawell Nun dieses Gewirr in der Mitte - geht es darum dass für 5s stabil ist?

              H 1 Reply Last reply Reply Quote 0
              • H
                hawell @mickym last edited by

                @mickym

                korrekt, poduktiv sind es aber 60Sek. anstatt 5

                es soll der flippen zwischen 2 Zuständen verhindern,

                die Eingangswerte kommen von einen Energiezähler, und diese Werte können bekanntlich durch eine PV-Anlage auf dem Dach etwas schwanken.

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

                  @hawell Aber wenn der gleiche Ast kommt soll alle 5s (bzw. 60s) der counter eines hochgezählt werden?

                  H 1 Reply Last reply Reply Quote 0
                  • H
                    hawell @mickym last edited by

                    @mickym

                    ja, wenn die die Bedingung zum hochzählen 5 sec gegeben ist, dann einen Schritt hochzählen (am Schrittwerk hängen Heizstäbe, welche dann den Eingangswert (Stromüberschuss) reduzieren).
                    wenn Bedingung nicht erfüllt, dann nichts machen.
                    die Britte Bedingung ist runterzählen und somit Leistung abschalten.

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

                      @hawell Ok - ich meine es funktioniert bei Dir ja. Insofern ist es doch OK. Ich mach mal eine Alternative ohne 100% sicher zu sein, ob das dann tut.

                      8a62d397-5b45-42c1-be99-e916fed1bd61-image.png

                      Die erste Regel kannst Dir natürlich sparen - da Du ja mit der nächsten Regel die payload neu setzt - damit ist das was vorher in der payload war sowieso egal. 😉

                      H 1 Reply Last reply Reply Quote 0
                      • H
                        hawell @mickym last edited by

                        @mickym sagte in Schrittwerk mit einer Bedingung begrenzen:

                        @hawell Ok - ich meine es funktioniert bei Dir ja. Insofern ist es doch OK. Ich mach mal eine Alternative ohne 100% sicher zu sein, ob das dann tut.

                        ich bin mit dem Konstruckt auch nicht glücklich, da ich atkuell auch an einem "Doppelsprung" arbeite - wenn genug leistung ansteht, dann kann um "2" gesprugen werden.
                        Übersichtlicher wird es damit aber nicht

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

                          @hawell Schau mal, ob das tut was Du brauchst:

                          46b39409-dfe6-4693-820a-f5f1f6305a46-image.png

                          [
                             {
                                 "id": "4bbe3cb139220b42",
                                 "type": "switch",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "",
                                 "property": "payload",
                                 "propertyType": "msg",
                                 "rules": [
                                     {
                                         "t": "gte",
                                         "v": "2",
                                         "vt": "num"
                                     },
                                     {
                                         "t": "btwn",
                                         "v": "-699",
                                         "vt": "num",
                                         "v2": "1",
                                         "v2t": "num"
                                     },
                                     {
                                         "t": "lt",
                                         "v": "-700",
                                         "vt": "num"
                                     }
                                 ],
                                 "checkall": "true",
                                 "repair": false,
                                 "outputs": 3,
                                 "x": 330,
                                 "y": 400,
                                 "wires": [
                                     [
                                         "034c5314770775c6"
                                     ],
                                     [
                                         "b554f04062367f31"
                                     ],
                                     [
                                         "07f087d511c8b3e2"
                                     ]
                                 ]
                             },
                             {
                                 "id": "034c5314770775c6",
                                 "type": "change",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "-1",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "-1",
                                         "tot": "num"
                                     },
                                     {
                                         "t": "set",
                                         "p": "topic",
                                         "pt": "msg",
                                         "to": "action",
                                         "tot": "str"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 490,
                                 "y": 340,
                                 "wires": [
                                     [
                                         "95c9633ab4777657"
                                     ]
                                 ]
                             },
                             {
                                 "id": "07f087d511c8b3e2",
                                 "type": "change",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "+1",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "1",
                                         "tot": "num"
                                     },
                                     {
                                         "t": "set",
                                         "p": "topic",
                                         "pt": "msg",
                                         "to": "action",
                                         "tot": "str"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 490,
                                 "y": 460,
                                 "wires": [
                                     [
                                         "95c9633ab4777657"
                                     ]
                                 ]
                             },
                             {
                                 "id": "458ecde97817f777",
                                 "type": "inject",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "100",
                                 "props": [
                                     {
                                         "p": "payload"
                                     }
                                 ],
                                 "repeat": "",
                                 "crontab": "",
                                 "once": false,
                                 "onceDelay": 0.1,
                                 "topic": "",
                                 "payload": "100",
                                 "payloadType": "num",
                                 "x": 110,
                                 "y": 360,
                                 "wires": [
                                     [
                                         "4bbe3cb139220b42"
                                     ]
                                 ]
                             },
                             {
                                 "id": "9a176b2bfce3c5bc",
                                 "type": "inject",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "-500",
                                 "props": [
                                     {
                                         "p": "payload"
                                     }
                                 ],
                                 "repeat": "",
                                 "crontab": "",
                                 "once": false,
                                 "onceDelay": 0.1,
                                 "topic": "",
                                 "payload": "-500",
                                 "payloadType": "num",
                                 "x": 110,
                                 "y": 420,
                                 "wires": [
                                     [
                                         "4bbe3cb139220b42"
                                     ]
                                 ]
                             },
                             {
                                 "id": "dbb92ef2ecce8bdb",
                                 "type": "inject",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "-2000",
                                 "props": [
                                     {
                                         "p": "payload"
                                     }
                                 ],
                                 "repeat": "",
                                 "crontab": "",
                                 "once": false,
                                 "onceDelay": 0.1,
                                 "topic": "",
                                 "payload": "-2000",
                                 "payloadType": "num",
                                 "x": 110,
                                 "y": 480,
                                 "wires": [
                                     [
                                         "4bbe3cb139220b42"
                                     ]
                                 ]
                             },
                             {
                                 "id": "b554f04062367f31",
                                 "type": "change",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "0",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "0",
                                         "tot": "num"
                                     },
                                     {
                                         "t": "set",
                                         "p": "topic",
                                         "pt": "msg",
                                         "to": "action",
                                         "tot": "str"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 490,
                                 "y": 400,
                                 "wires": [
                                     [
                                         "95c9633ab4777657"
                                     ]
                                 ]
                             },
                             {
                                 "id": "95c9633ab4777657",
                                 "type": "rbe",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "",
                                 "func": "rbe",
                                 "gap": "",
                                 "start": "",
                                 "inout": "out",
                                 "septopics": false,
                                 "property": "payload",
                                 "topi": "topic",
                                 "x": 630,
                                 "y": 400,
                                 "wires": [
                                     [
                                         "85d35cf6ea80789b"
                                     ]
                                 ]
                             },
                             {
                                 "id": "85d35cf6ea80789b",
                                 "type": "trigger",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "",
                                 "op1": "",
                                 "op2": "",
                                 "op1type": "nul",
                                 "op2type": "payl",
                                 "duration": "5",
                                 "extend": true,
                                 "overrideDelay": false,
                                 "units": "s",
                                 "reset": "",
                                 "bytopic": "all",
                                 "topic": "topic",
                                 "outputs": 1,
                                 "x": 780,
                                 "y": 400,
                                 "wires": [
                                     [
                                         "712d4e4919ac7f2d"
                                     ]
                                 ]
                             },
                             {
                                 "id": "712d4e4919ac7f2d",
                                 "type": "trigger",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "",
                                 "op1": "",
                                 "op2": "0",
                                 "op1type": "pay",
                                 "op2type": "str",
                                 "duration": "-5",
                                 "extend": false,
                                 "overrideDelay": false,
                                 "units": "s",
                                 "reset": "0",
                                 "bytopic": "all",
                                 "topic": "topic",
                                 "outputs": 1,
                                 "x": 980,
                                 "y": 400,
                                 "wires": [
                                     [
                                         "f21d6c44133561ef",
                                         "e16d9f5e94d3229f"
                                     ]
                                 ]
                             },
                             {
                                 "id": "f21d6c44133561ef",
                                 "type": "debug",
                                 "z": "fbeffc2c8bcc1d00",
                                 "name": "action",
                                 "active": true,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 970,
                                 "y": 460,
                                 "wires": []
                             }
                          ]
                          

                          Falls der Energiemanager aus irgendeinem Grund gar nicht mehr tut - kannst Du das periodische Senden ja dann auch unterbinden.

                          H 1 Reply Last reply Reply Quote 0
                          • H
                            hawell @mickym last edited by

                            @mickym sagte in Schrittwerk mit einer Bedingung begrenzen:

                            erschreckenderweise tut es was es soll ...
                            bis auf, dass es immer die gleichen Zeiten nimmt, ich konnte schneller runterschalten, als hoch.

                            mickym 2 Replies Last reply Reply Quote 0
                            • mickym
                              mickym Most Active @hawell last edited by mickym

                              @hawell Ja gut - die Zyklik bleibt gleich - aber Du könntest ja in der Switch Node noch andere Werte einsetzen, um schneller hoch und runter zu schalten.

                              6797b744-9d47-4881-8c45-22f697ebd432-image.png

                              Sobald Du an der Rändern bist - wird ja durch die hintere filter Node die Nachrichtenanzahl beschränkt.

                              Aber soweit ich verstanden habe - kommt aus dem Energiemanager ja alle Sekunden ein trigger - insofern ist es ja egal, ob Du einen eigenen Taktgeber verwendest und nicht den vom Energiemanager.

                              Aber ist ja nur ein Alternativvorschlag. Deines hat ja funktioniert.

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

                                @hawell Wenn Du den Takt vom Energiemanager behalten willst - dann kannst Du dieses Mal auch eine function Node verwenden. Ich mach Dir mal einen Vorschlag.

                                1 Reply Last reply Reply Quote 0
                                • H
                                  hawell @mickym last edited by

                                  @mickym
                                  das skalieren mit größeren Schritten hatte ich schon getestet das geht super.

                                  zwei Sachen verstehe ich aber nicht.
                                  wieso sendet der letzte Trigger nur bei Zahlen außer "0" alle 5 sek ? und bei 0 Macht er nichts ??

                                  und leider gibt der Trigger den Wert aus, welcher "auf den Weg bebracht wurde", auch wenn sich schon die Richtung geändert wurde.
                                  also wenn +1 wiederholt wird, und dann auch 0 umspringt, wird trotzdem noch einmal hochgeschaltet und dann erst gestoppt.

                                  man müsste den laufenden Tigger bei Wertänderung unterbrechen.

                                  und zwei unterschiedliche zeitliche Trigger paralell laufen lassen (einen fürs hochschalten und einen fürs runter Schalten.

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

                                    @hawell sagte in Schrittwerk mit einer Bedingung begrenzen:

                                    @mickym
                                    das skalieren mit größeren Schritten hatte ich schon getestet das geht super.

                                    zwei Sachen verstehe ich aber nicht.
                                    wieso sendet der letzte Trigger nur bei Zahlen außer "0" alle 5 sek ? und bei 0 Macht er nichts ??

                                    Na das hatte ich aus Deinem alten Flow so verstanden, da alles rückgesetzt wurde - das dann nichts mehr gesendet werden soll.

                                    und leider gibt der Trigger den Wert aus, welcher "auf den Weg bebracht wurde", auch wenn sich schon die Richtung geändert wurde.
                                    also wenn +1 wiederholt wird, und dann auch 0 umspringt, wird trotzdem noch einmal hochgeschaltet und dann erst gestoppt.

                                    Nun ja - da musst aber mal logisch überlegen - dass ja EXTRA eine Zeit abgewartet wird, bis eine Änderung registriert wird.

                                    man müsste den laufenden Tigger bei Wertänderung unterbrechen.

                                    In dem Fall werde ich Dir mal mit einer function Node helfen, die Du dann wieder nur vom Energiemanager getriggert wird und nur bei +1 oder -1

                                    und zwei unterschiedliche zeitliche Trigger paralell laufen lassen (einen fürs hochschalten und einen fürs runter Schalten.

                                    Nein das ergibt Chaos.

                                    H 1 Reply Last reply Reply Quote 0
                                    • H
                                      hawell @mickym last edited by

                                      @mickym sagte in Schrittwerk mit einer Bedingung begrenzen:

                                      @hawell sagte in Schrittwerk mit einer Bedingung begrenzen:

                                      @mickym
                                      das skalieren mit größeren Schritten hatte ich schon getestet das geht super.

                                      zwei Sachen verstehe ich aber nicht.
                                      wieso sendet der letzte Trigger nur bei Zahlen außer "0" alle 5 sek ? und bei 0 Macht er nichts ??

                                      Na das hatte ich aus Deinem alten Flow so verstanden, da alles rückgesetzt wurde - das dann nichts mehr gesendet werden soll.

                                      das ist auch richtig, aber wieso macht die Node das - ich ich finde die entsprechende Einstellung nicht. oder liegt es am dem Befehl "0" dieser Stoppt den Trigger?

                                      und leider gibt der Trigger den Wert aus, welcher "auf den Weg bebracht wurde", auch wenn sich schon die Richtung geändert wurde.
                                      also wenn +1 wiederholt wird, und dann auch 0 umspringt, wird trotzdem noch einmal hochgeschaltet und dann erst gestoppt.

                                      Nun ja - da musst aber mal logisch überlegen - dass ja EXTRA eine Zeit abgewartet wird, bis eine Änderung registriert wird.

                                      man müsste den laufenden Tigger bei Wertänderung unterbrechen.

                                      In dem Fall werde ich Dir mal mit einer function Node helfen, die Du dann wieder nur vom Energiemanager getriggert wird und nur bei +1 oder -1

                                      und zwei unterschiedliche zeitliche Trigger paralell laufen lassen (einen fürs hochschalten und einen fürs runter Schalten.

                                      Nein das ergibt Chaos.

                                      geht das nicht so ? 0 hat immer Priorität und setzt die Laufenden Trigger zurück?

                                      Screenshot 2023-10-07 233611.png

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

                                        gelöscht

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

                                          Na ich glaube Du behälst Deinen ursprünglichen Flow.

                                          H 2 Replies Last reply Reply Quote 0
                                          • H
                                            hawell @mickym last edited by

                                            @mickym
                                            ich schau mir das morgen mal genauer an.
                                            aber der letzte flox ist buggy, der gibt teilweise nur 1 aus egal was man drückt (mit oder ohne warten; mit oder ohne 0 drücken)

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            906
                                            Online

                                            31.7k
                                            Users

                                            79.7k
                                            Topics

                                            1.3m
                                            Posts

                                            2
                                            22
                                            958
                                            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