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. Toggle-Funktion auf zwei unterschiedliche Datenpunkte

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Toggle-Funktion auf zwei unterschiedliche Datenpunkte

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

      Hallo,

      meine vorherigen Rollladenschalter hatten jeweils einen Datenpunkt für "hoch" und einen für "runter" die auf true fürs "fahren" gesetzt wurden und auf "false" zum stoppen.
      Jetzt habe ich diese Schalter gegen Shelly plus 2PM ausgetauscht und dort ist es etwas anders. Bei diesen gibt es jeweils einen Datenpunkt für "hoch", für "runter" und einen für "stop".
      Mit den alten Schaltern klappte es einfach mit "setze Gegenteil", dass klappt mit den Shelly so leider nicht und ich bräuchte da mal etwas Hilfe.
      Taster (Aqara Opple über Zigbee) für "hoch" einmal drücken soll Shelly Datenpunkt für "hoch" auf true setzen und Taster "hoch" nochmals drücken soll "stop" auf true setzen, das gleiche dann auch für das herunterfahren.

      Für Ideen oder Ansätze zur Umsetzung wäre ich dankbar.

      Vielen Dank und einen schönen Sonntag noch.

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

        @michmein Probier das mal.

        0d0b1a72-0c4f-4f0a-a58b-f53f9a88e109-image.png

        [
           {
               "id": "f2380c85b44f0dad",
               "type": "inject",
               "z": "517cd16e4d7e6ae4",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   },
                   {
                       "p": "topic",
                       "vt": "str"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "hoch",
               "payload": "true",
               "payloadType": "bool",
               "x": 320,
               "y": 5640,
               "wires": [
                   [
                       "64286c7cb5fe07ae"
                   ]
               ]
           },
           {
               "id": "dbf9c6a11467cc0c",
               "type": "inject",
               "z": "517cd16e4d7e6ae4",
               "name": "",
               "props": [
                   {
                       "p": "payload"
                   },
                   {
                       "p": "topic",
                       "vt": "str"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": false,
               "onceDelay": 0.1,
               "topic": "runter",
               "payload": "true",
               "payloadType": "bool",
               "x": 320,
               "y": 5760,
               "wires": [
                   [
                       "694e0d353ed4ccd1"
                   ]
               ]
           },
           {
               "id": "fec351f12f44c2a2",
               "type": "switch",
               "z": "517cd16e4d7e6ae4",
               "name": "Rollladen stoppen?",
               "property": "Rollladen_Stopp",
               "propertyType": "flow",
               "rules": [
                   {
                       "t": "false"
                   },
                   {
                       "t": "true"
                   }
               ],
               "checkall": "true",
               "repair": false,
               "outputs": 2,
               "x": 790,
               "y": 5640,
               "wires": [
                   [
                       "a22fb3243a243327"
                   ],
                   [
                       "e3f4fe631327ae6f"
                   ]
               ]
           },
           {
               "id": "b6261215d62ec5e9",
               "type": "switch",
               "z": "517cd16e4d7e6ae4",
               "name": "Rollladen stoppen?",
               "property": "Rollladen_Stopp",
               "propertyType": "flow",
               "rules": [
                   {
                       "t": "true"
                   },
                   {
                       "t": "false"
                   }
               ],
               "checkall": "true",
               "repair": false,
               "outputs": 2,
               "x": 790,
               "y": 5760,
               "wires": [
                   [
                       "e3f4fe631327ae6f"
                   ],
                   [
                       "cb8e77546558e81d"
                   ]
               ]
           },
           {
               "id": "e3f4fe631327ae6f",
               "type": "debug",
               "z": "517cd16e4d7e6ae4",
               "name": "STOPP",
               "active": true,
               "tosidebar": true,
               "console": false,
               "tostatus": false,
               "complete": "payload",
               "targetType": "msg",
               "statusVal": "",
               "statusType": "auto",
               "x": 1020,
               "y": 5700,
               "wires": []
           },
           {
               "id": "a22fb3243a243327",
               "type": "debug",
               "z": "517cd16e4d7e6ae4",
               "name": "HOCH",
               "active": true,
               "tosidebar": true,
               "console": false,
               "tostatus": false,
               "complete": "payload",
               "targetType": "msg",
               "statusVal": "",
               "statusType": "auto",
               "x": 1010,
               "y": 5620,
               "wires": []
           },
           {
               "id": "cb8e77546558e81d",
               "type": "debug",
               "z": "517cd16e4d7e6ae4",
               "name": "RUNTER",
               "active": true,
               "tosidebar": true,
               "console": false,
               "tostatus": false,
               "complete": "payload",
               "targetType": "msg",
               "statusVal": "",
               "statusType": "auto",
               "x": 1020,
               "y": 5780,
               "wires": []
           },
           {
               "id": "64286c7cb5fe07ae",
               "type": "change",
               "z": "517cd16e4d7e6ae4",
               "name": "",
               "rules": [
                   {
                       "t": "set",
                       "p": "Rollladen_Stopp",
                       "pt": "flow",
                       "to": "$flowContext(\"Rollladen_Stopp\") ? false : true\t",
                       "tot": "jsonata"
                   }
               ],
               "action": "",
               "property": "",
               "from": "",
               "to": "",
               "reg": false,
               "x": 540,
               "y": 5640,
               "wires": [
                   [
                       "fec351f12f44c2a2"
                   ]
               ]
           },
           {
               "id": "694e0d353ed4ccd1",
               "type": "change",
               "z": "517cd16e4d7e6ae4",
               "name": "",
               "rules": [
                   {
                       "t": "set",
                       "p": "Rollladen_Stopp",
                       "pt": "flow",
                       "to": "$flowContext(\"Rollladen_Stopp\") ? false : true\t",
                       "tot": "jsonata"
                   }
               ],
               "action": "",
               "property": "",
               "from": "",
               "to": "",
               "reg": false,
               "x": 540,
               "y": 5760,
               "wires": [
                   [
                       "b6261215d62ec5e9"
                   ]
               ]
           },
           {
               "id": "6afc01b0db35dc24",
               "type": "change",
               "z": "517cd16e4d7e6ae4",
               "name": "",
               "rules": [
                   {
                       "t": "set",
                       "p": "Rollladen_Stopp",
                       "pt": "flow",
                       "to": "true",
                       "tot": "bool"
                   }
               ],
               "action": "",
               "property": "",
               "from": "",
               "to": "",
               "reg": false,
               "x": 540,
               "y": 5700,
               "wires": [
                   []
               ]
           },
           {
               "id": "7676ddadc4f0eaeb",
               "type": "inject",
               "z": "517cd16e4d7e6ae4",
               "name": "",
               "props": [
                   {
                       "p": "topic",
                       "vt": "str"
                   }
               ],
               "repeat": "",
               "crontab": "",
               "once": true,
               "onceDelay": 0.1,
               "topic": "Init",
               "x": 330,
               "y": 5700,
               "wires": [
                   [
                       "6afc01b0db35dc24"
                   ]
               ]
           }
        ]
        

        EDIT: Etwas Kosmetik - Switch in "Rollladen stoppen?" umbenannt.

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

          @mickym danke
          Wofür ist der „init“ Button?
          Den Rest schaue ich mir später am Rechner mal an und teste es.

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

            @michmein sagte in Toggle-Funktion auf zwei unterschiedliche Datenpunkte:

            @mickym danke
            Wofür ist der „init“ Button?
            Den Rest schaue ich mir später am Rechner mal an und teste es.

            Damit die Flowvariable gesetzt wird, wenn Du Node-Red oder den iobroker neu startest.

            88585c50-8428-4648-b810-fe31e9a67266-image.png

            Wenn Du es nicht setzt, ist nicht so schlimm, aber dann wird der Schalter erst beim 2. Mal reagieren, wenn Du Deinen iob oder Node-Red neu gestartet hast. Weil dann beim 1. Mal erst STOPP gesetzt wird.

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

              Guten Morgen @mickym,

              ich bin nun dazu gekommen deinen flow zu integrieren und es funktioniert ganz hervorragend.

              Vielen Dank für deine Hilfe und einen schönen Sonntag noch!

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

              Support us

              ioBroker
              Community Adapters
              Donate

              892
              Online

              31.7k
              Users

              79.7k
              Topics

              1.3m
              Posts

              node-red
              2
              5
              212
              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