Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Node-Red
    5. Node Red Priorisierung von Switch im Dashboard

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Node Red Priorisierung von Switch im Dashboard

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

      Hallo, leider komme ich bei meinen Vorhaben leider nicht weiter.
      Ist denk ich auch keine Einsteigerfrage deswegen habe ich es hier gepostet.

      Ich habe meine Hausautomatisierung mittlerweile zu meiner großen Zufrieden hinbekommen.

      Jetzt bin ich aber an einen Punkt wo ich nicht weiter weis.

      Was habe ich vor? Ich würde gern wie in meinen Beispielflow zusehen, das der Dashboardswitch Vorrang hat gegenüber den zugelieferten Werten (im Beispiel -3000 und 500) wenn dieser über das Dashboard geschalten wird. Ich möchte damit quasi die automatische on off Schaltung aufgrund von zugelieferten Werten unterbinden. Jetzt weis ich nicht ob dies so überhaupt möglich ist. Eine Möglichkeit die ich mir überlegt habe, wäre ein weiterer DashboardSwitch der die Zulieferung der Werte einfach unterbindet (Wäre bei den vielen Switch die ich ansteuere dann im Dashboard sicher unübersichtlich). Auch hier weis ich nicht so recht wie ich das dann mache.

      Am allerliebsten wäre mir ein Dasboardswitch mit 3 Einstellstufen: On (dauerhaft), Off (dauerhaft), Steuerung über zugelieferte Werte.

      Zu Guter Letzt würde ich auch noch gern, wahrscheinlich ein Trigger einbauen der wirklich nur bei Zustandsänderung einmalig ein on bzw. off schickt. Aktuell wird wie die Werte kommen (minütlich) auch wenn das Relay schon auf on steht ein weiters on ans Relay geschickt.

      Ich hoffe Ihr könnt mir da mal irgendwie weiterhelfen.

      Danke schon mal im Voraus.

      [
          {
              "id": "83ea19d9f3c7a02c",
              "type": "tab",
              "label": "Flow 2",
              "disabled": false,
              "info": "",
              "env": []
          },
          {
              "id": "9d4c5a2fabb90024",
              "type": "mqtt in",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "topic": "tele/Keller/STATE",
              "qos": "2",
              "datatype": "auto",
              "broker": "5fc36d085397ac76",
              "nl": false,
              "rap": true,
              "rh": 0,
              "inputs": 0,
              "x": 360,
              "y": 100,
              "wires": [
                  [
                      "f427c327c70df223"
                  ]
              ]
          },
          {
              "id": "b00161350d1014d1",
              "type": "switch",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "property": "payload",
              "propertyType": "msg",
              "rules": [
                  {
                      "t": "btwn",
                      "v": "500",
                      "vt": "num",
                      "v2": "20000",
                      "v2t": "num"
                  },
                  {
                      "t": "btwn",
                      "v": "-3000",
                      "vt": "num",
                      "v2": "-10000",
                      "v2t": "num"
                  }
              ],
              "checkall": "true",
              "repair": false,
              "outputs": 2,
              "x": 350,
              "y": 200,
              "wires": [
                  [
                      "a2e1f88777ee4b5a"
                  ],
                  [
                      "58d724091e61ba4f"
                  ]
              ]
          },
          {
              "id": "a2e1f88777ee4b5a",
              "type": "change",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "rules": [
                  {
                      "t": "set",
                      "p": "payload",
                      "pt": "msg",
                      "to": "off",
                      "tot": "str"
                  }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 630,
              "y": 200,
              "wires": [
                  [
                      "afc1ca654faa0953"
                  ]
              ]
          },
          {
              "id": "58d724091e61ba4f",
              "type": "change",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "rules": [
                  {
                      "t": "set",
                      "p": "payload",
                      "pt": "msg",
                      "to": "on",
                      "tot": "str"
                  }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 630,
              "y": 260,
              "wires": [
                  [
                      "afc1ca654faa0953"
                  ]
              ]
          },
          {
              "id": "afc1ca654faa0953",
              "type": "ui_switch",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "label": "WW Elektro",
              "tooltip": "",
              "group": "2361e78c.9b49c8",
              "order": 15,
              "width": 2,
              "height": 1,
              "passthru": true,
              "decouple": "false",
              "topic": "topic",
              "topicType": "msg",
              "style": "",
              "onvalue": "on",
              "onvalueType": "str",
              "onicon": "",
              "oncolor": "",
              "offvalue": "off",
              "offvalueType": "str",
              "officon": "",
              "offcolor": "",
              "animate": false,
              "className": "",
              "x": 890,
              "y": 200,
              "wires": [
                  [
                      "af0bf45b7e9d1287",
                      "dab91925d2dca690"
                  ]
              ]
          },
          {
              "id": "dab91925d2dca690",
              "type": "debug",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "active": true,
              "tosidebar": true,
              "console": false,
              "tostatus": false,
              "complete": "false",
              "statusVal": "",
              "statusType": "auto",
              "x": 1030,
              "y": 80,
              "wires": []
          },
          {
              "id": "af0bf45b7e9d1287",
              "type": "mqtt out",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "topic": "cmnd/Keller/POWER1",
              "qos": "1",
              "retain": "",
              "respTopic": "",
              "contentType": "",
              "userProps": "",
              "correl": "",
              "expiry": "",
              "broker": "5fc36d085397ac76",
              "x": 1040,
              "y": 280,
              "wires": []
          },
          {
              "id": "5d6b0f7b4fea59c1",
              "type": "change",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "rules": [
                  {
                      "t": "set",
                      "p": "payload",
                      "pt": "msg",
                      "to": "payload.POWER",
                      "tot": "msg"
                  },
                  {
                      "t": "change",
                      "p": "payload",
                      "pt": "msg",
                      "from": "OFF",
                      "fromt": "str",
                      "to": "off",
                      "tot": "str"
                  },
                  {
                      "t": "change",
                      "p": "payload",
                      "pt": "msg",
                      "from": "ON",
                      "fromt": "str",
                      "to": "on",
                      "tot": "str"
                  }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 670,
              "y": 100,
              "wires": [
                  [
                      "afc1ca654faa0953"
                  ]
              ]
          },
          {
              "id": "f427c327c70df223",
              "type": "json",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "property": "payload",
              "action": "",
              "pretty": false,
              "x": 510,
              "y": 100,
              "wires": [
                  [
                      "5d6b0f7b4fea59c1"
                  ]
              ]
          },
          {
              "id": "ef034eebf5117f88",
              "type": "inject",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "props": [
                  {
                      "p": "payload"
                  }
              ],
              "repeat": "",
              "crontab": "",
              "once": false,
              "onceDelay": 0.1,
              "topic": "",
              "payload": "-3000",
              "payloadType": "num",
              "x": 130,
              "y": 200,
              "wires": [
                  [
                      "b00161350d1014d1"
                  ]
              ]
          },
          {
              "id": "c807eafa8c32ea61",
              "type": "inject",
              "z": "83ea19d9f3c7a02c",
              "name": "",
              "props": [
                  {
                      "p": "payload"
                  }
              ],
              "repeat": "",
              "crontab": "",
              "once": false,
              "onceDelay": 0.1,
              "topic": "",
              "payload": "500",
              "payloadType": "num",
              "x": 140,
              "y": 260,
              "wires": [
                  [
                      "b00161350d1014d1"
                  ]
              ]
          },
          {
              "id": "5fc36d085397ac76",
              "type": "mqtt-broker",
              "name": "sol",
              "broker": "localhost",
              "port": "1883",
              "clientid": "",
              "autoConnect": true,
              "usetls": false,
              "protocolVersion": "4",
              "keepalive": "60",
              "cleansession": true,
              "birthTopic": "",
              "birthQos": "0",
              "birthPayload": "",
              "birthMsg": {},
              "closeTopic": "",
              "closeQos": "0",
              "closePayload": "",
              "closeMsg": {},
              "willTopic": "",
              "willQos": "0",
              "willPayload": "",
              "willMsg": {},
              "sessionExpiry": ""
          },
          {
              "id": "2361e78c.9b49c8",
              "type": "ui_group",
              "name": "HOME",
              "tab": "d02fd18cf63f0e19",
              "order": 1,
              "disp": false,
              "width": "7",
              "collapse": false,
              "className": ""
          },
          {
              "id": "d02fd18cf63f0e19",
              "type": "ui_tab",
              "name": "Zuhause",
              "icon": "dashboard",
              "disabled": false,
              "hidden": false
          }
      ]
      

      iobroker.PNG

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

        @milanissimo Nun ehrlich gesagt wenn Du über 3 Prioritäten steuern willst, dann musst Du mit 2 Switches arbeiten.
        Einen in dem Du quasi die Automatik schaltest und einem mit dem Du On oder Off schaltest. Am Besten nutzt man dafür eine Flowvariable. Sonst musst Du Dir halt so quasi Halbautomatiken überlegen. Sprich AUTO ist wertebasierend, EIN oder AUS ist manuell. Wie gesagt das ist aber Logik und hat nichts mit dem Tool zu tun.

        Zu Guter Letzt würde ich auch noch gern, wahrscheinlich ein Trigger einbauen der wirklich nur bei Zustandsänderung einmalig ein on bzw. off schickt. Aktuell wird wie die Werte kommen (minütlich) auch wenn das Relay schon auf on steht ein weiters on ans Relay geschickt.

        Ansonsten um nur einmalig eine Zustandsänderung zu liefern, nutzt Du am Besten eine filter oder eine trigger Node.
        Das Einfachste ist aber erst mal - das Passthrough im Switch auszuschalten und am Besten nur über den Eingang den aktuellen Status anzeigen zu lassen. In dem Fall ist es dann egal, selbst wenn die Nachrichten mehrfach ankommen, werden sie im Switch ja geblockt und nicht weitergeleitet.

        4c4221c1-b918-4865-ad2d-16fa7e44b36a-image.png

        [
            {
                "id": "afaa6665cab552d5",
                "type": "mqtt in",
                "z": "54b226bc.0793e8",
                "name": "",
                "topic": "tele/Keller/STATE",
                "qos": "2",
                "datatype": "auto",
                "broker": "5fc36d085397ac76",
                "nl": false,
                "rap": true,
                "rh": 0,
                "inputs": 0,
                "x": 320,
                "y": 2860,
                "wires": [
                    [
                        "0225594d5371ab63"
                    ]
                ]
            },
            {
                "id": "ae077b159d75728c",
                "type": "switch",
                "z": "54b226bc.0793e8",
                "name": "",
                "property": "payload",
                "propertyType": "msg",
                "rules": [
                    {
                        "t": "btwn",
                        "v": "500",
                        "vt": "num",
                        "v2": "20000",
                        "v2t": "num"
                    },
                    {
                        "t": "btwn",
                        "v": "-3000",
                        "vt": "num",
                        "v2": "-10000",
                        "v2t": "num"
                    }
                ],
                "checkall": "true",
                "repair": false,
                "outputs": 2,
                "x": 430,
                "y": 2980,
                "wires": [
                    [
                        "539d01695e364c9d"
                    ],
                    [
                        "9446859974d9a930"
                    ]
                ]
            },
            {
                "id": "539d01695e364c9d",
                "type": "change",
                "z": "54b226bc.0793e8",
                "name": "",
                "rules": [
                    {
                        "t": "set",
                        "p": "payload",
                        "pt": "msg",
                        "to": "off",
                        "tot": "str"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 690,
                "y": 2940,
                "wires": [
                    [
                        "b852977951a4090d"
                    ]
                ]
            },
            {
                "id": "9446859974d9a930",
                "type": "change",
                "z": "54b226bc.0793e8",
                "name": "",
                "rules": [
                    {
                        "t": "set",
                        "p": "payload",
                        "pt": "msg",
                        "to": "on",
                        "tot": "str"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 690,
                "y": 3000,
                "wires": [
                    [
                        "b852977951a4090d"
                    ]
                ]
            },
            {
                "id": "aadad0d4b76af2cf",
                "type": "ui_switch",
                "z": "54b226bc.0793e8",
                "name": "",
                "label": "WW Elektro",
                "tooltip": "",
                "group": "2361e78c.9b49c8",
                "order": 15,
                "width": 2,
                "height": 1,
                "passthru": false,
                "decouple": "true",
                "topic": "topic",
                "topicType": "msg",
                "style": "",
                "onvalue": "on",
                "onvalueType": "str",
                "onicon": "",
                "oncolor": "",
                "offvalue": "off",
                "offvalueType": "str",
                "officon": "",
                "offcolor": "",
                "animate": false,
                "className": "",
                "x": 870,
                "y": 2860,
                "wires": [
                    [
                        "914b23040edfacd3",
                        "3f2fcc39ef7ffb06"
                    ]
                ]
            },
            {
                "id": "3f2fcc39ef7ffb06",
                "type": "debug",
                "z": "54b226bc.0793e8",
                "name": "",
                "active": true,
                "tosidebar": true,
                "console": false,
                "tostatus": false,
                "complete": "false",
                "statusVal": "",
                "statusType": "auto",
                "x": 1090,
                "y": 2800,
                "wires": []
            },
            {
                "id": "914b23040edfacd3",
                "type": "mqtt out",
                "z": "54b226bc.0793e8",
                "name": "",
                "topic": "cmnd/Keller/POWER1",
                "qos": "1",
                "retain": "",
                "respTopic": "",
                "contentType": "",
                "userProps": "",
                "correl": "",
                "expiry": "",
                "broker": "5fc36d085397ac76",
                "x": 1140,
                "y": 2900,
                "wires": []
            },
            {
                "id": "726cc3c68c91362f",
                "type": "change",
                "z": "54b226bc.0793e8",
                "name": "",
                "rules": [
                    {
                        "t": "set",
                        "p": "payload",
                        "pt": "msg",
                        "to": "payload.POWER",
                        "tot": "msg"
                    },
                    {
                        "t": "change",
                        "p": "payload",
                        "pt": "msg",
                        "from": "OFF",
                        "fromt": "str",
                        "to": "off",
                        "tot": "str"
                    },
                    {
                        "t": "change",
                        "p": "payload",
                        "pt": "msg",
                        "from": "ON",
                        "fromt": "str",
                        "to": "on",
                        "tot": "str"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 630,
                "y": 2860,
                "wires": [
                    [
                        "aadad0d4b76af2cf"
                    ]
                ]
            },
            {
                "id": "0225594d5371ab63",
                "type": "json",
                "z": "54b226bc.0793e8",
                "name": "",
                "property": "payload",
                "action": "",
                "pretty": false,
                "x": 470,
                "y": 2860,
                "wires": [
                    [
                        "726cc3c68c91362f"
                    ]
                ]
            },
            {
                "id": "5196e13f61b89cd0",
                "type": "inject",
                "z": "54b226bc.0793e8",
                "name": "",
                "props": [
                    {
                        "p": "payload"
                    }
                ],
                "repeat": "",
                "crontab": "",
                "once": false,
                "onceDelay": 0.1,
                "topic": "",
                "payload": "-3000",
                "payloadType": "num",
                "x": 190,
                "y": 2940,
                "wires": [
                    [
                        "ae077b159d75728c"
                    ]
                ]
            },
            {
                "id": "26ae14e2c5d33c1f",
                "type": "inject",
                "z": "54b226bc.0793e8",
                "name": "",
                "props": [
                    {
                        "p": "payload"
                    }
                ],
                "repeat": "",
                "crontab": "",
                "once": false,
                "onceDelay": 0.1,
                "topic": "",
                "payload": "500",
                "payloadType": "num",
                "x": 200,
                "y": 3000,
                "wires": [
                    [
                        "ae077b159d75728c"
                    ]
                ]
            },
            {
                "id": "69f049c217639b75",
                "type": "ui_switch",
                "z": "54b226bc.0793e8",
                "name": "",
                "label": "Auto WW Elektro",
                "tooltip": "",
                "group": "2361e78c.9b49c8",
                "order": 15,
                "width": 2,
                "height": 1,
                "passthru": false,
                "decouple": "true",
                "topic": "topic",
                "topicType": "msg",
                "style": "",
                "onvalue": "auto",
                "onvalueType": "str",
                "onicon": "",
                "oncolor": "",
                "offvalue": "manual",
                "offvalueType": "str",
                "officon": "",
                "offcolor": "",
                "animate": false,
                "className": "",
                "x": 690,
                "y": 3080,
                "wires": [
                    [
                        "9646ae16c1b43f49"
                    ]
                ]
            },
            {
                "id": "9646ae16c1b43f49",
                "type": "change",
                "z": "54b226bc.0793e8",
                "name": "",
                "rules": [
                    {
                        "t": "set",
                        "p": "AutoWWElektro",
                        "pt": "flow",
                        "to": "payload",
                        "tot": "msg"
                    }
                ],
                "action": "",
                "property": "",
                "from": "",
                "to": "",
                "reg": false,
                "x": 940,
                "y": 3080,
                "wires": [
                    []
                ]
            },
            {
                "id": "b852977951a4090d",
                "type": "switch",
                "z": "54b226bc.0793e8",
                "name": "",
                "property": "AutoWWElektro",
                "propertyType": "flow",
                "rules": [
                    {
                        "t": "eq",
                        "v": "auto",
                        "vt": "str"
                    }
                ],
                "checkall": "true",
                "repair": false,
                "outputs": 1,
                "x": 890,
                "y": 2960,
                "wires": [
                    [
                        "914b23040edfacd3"
                    ]
                ]
            },
            {
                "id": "5fc36d085397ac76",
                "type": "mqtt-broker",
                "name": "sol",
                "broker": "localhost",
                "port": "1883",
                "clientid": "",
                "autoConnect": true,
                "usetls": false,
                "protocolVersion": "4",
                "keepalive": "60",
                "cleansession": true,
                "birthTopic": "",
                "birthQos": "0",
                "birthPayload": "",
                "birthMsg": {},
                "closeTopic": "",
                "closeQos": "0",
                "closePayload": "",
                "closeMsg": {},
                "willTopic": "",
                "willQos": "0",
                "willPayload": "",
                "willMsg": {},
                "sessionExpiry": ""
            },
            {
                "id": "2361e78c.9b49c8",
                "type": "ui_group",
                "name": "HOME",
                "tab": "d02fd18cf63f0e19",
                "order": 1,
                "disp": false,
                "width": "7",
                "collapse": false,
                "className": ""
            },
            {
                "id": "d02fd18cf63f0e19",
                "type": "ui_tab",
                "name": "Zuhause",
                "icon": "dashboard",
                "disabled": false,
                "hidden": false
            }
        ]
        

        Ansonsten musst Du Dich halt umschauen - es gibt auch Multi-State Switches, die aber nicht im Standard sind:
        https://github.com/bartbutenaers/node-red-contrib-ui-multistate-switch

        Mit diesem Auto- Switch oder der Flow Variablen kannst natürlich generell steuern, ob du bei allen Werten die Switches oder die Werte Vorrang haben. Die Logik ist zwangsweise komplizierter je mehr Fälle Du berücksichtigen willst.

        EDIT: war noch ein Fehler im Flow - habe ich gerade ausgebessert (22:52)

        Eine andere Möglichkeit, wenn Du auf Deiner passthrough Methode bestehst, dass Du über den Ursprung (topic) unterscheidest, woher der Wert kommt. Aber auch hier brauchst Du eine Steuerung, die dann Prio gewährt oder nicht.

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

          @mickym

          Vielen dank mit den Tipp zu diesen Multistate Switch.

          Hab alles soweit hinbekommen, dass wenn ich auf on und off stelle (über das Dashboard), keine Werte mehr durchgelassen werden. Sobald ich auf auto stell werden wieder Werte durchgereicht das funktioniert gut.

          Ich hab jetzt nur ein Problem, sobald ich das Dashboard einmal verlasse und wieder lade springt der Switch (Visuell wieder auf auto) so das man nicht wirklich sieht wie gerade der aktuelle Zustand ist.

          Vielleicht hast du ja noch ne Idee wo hier das Problem liegt.

          Am liebsten hätte ich auch noch einen kleinen grün/rot Button der mir den realen Schaltzustand anzeigt, hab da was mit integriert zieht aber irgendwie nicht gut aus.

          iobroker2.PNG

          [
              {
                  "id": "0d30e281996aaebd",
                  "type": "tab",
                  "label": "Flow 2",
                  "disabled": false,
                  "info": "",
                  "env": []
              },
              {
                  "id": "11506b7d5d6627a3",
                  "type": "ui_multistate_switch",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "group": "2361e78c.9b49c8",
                  "order": 33,
                  "width": 3,
                  "height": 1,
                  "label": " {{label}}",
                  "stateField": "state",
                  "enableField": "enable",
                  "passthroughField": "passthrough",
                  "inputMsgField": "inputmsg",
                  "rounded": true,
                  "useThemeColors": true,
                  "hideSelectedLabel": false,
                  "multilineLabel": false,
                  "passThrough": "always",
                  "inputMsg": "all",
                  "userInput": "enabled_show",
                  "options": [
                      {
                          "label": "Auto",
                          "value": "auto",
                          "valueType": "str",
                          "color": "#ff6666"
                      },
                      {
                          "label": "On",
                          "value": "on",
                          "valueType": "str",
                          "color": "#009933"
                      },
                      {
                          "label": "Off",
                          "value": "off",
                          "valueType": "str",
                          "color": "#999999"
                      }
                  ],
                  "topic": "",
                  "x": 760,
                  "y": 440,
                  "wires": [
                      [
                          "feb30fabfe6ed27e",
                          "67f4a4c3e7740f0d"
                      ]
                  ]
              },
              {
                  "id": "5855f71ddd5a2c3d",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "ON",
                  "props": [
                      {
                          "p": "state",
                          "v": "ON",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payloadType": "str",
                  "x": 510,
                  "y": 420,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "ed9d477deb467c5c",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "OFF",
                  "props": [
                      {
                          "p": "state",
                          "v": "OFF",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payloadType": "str",
                  "x": 510,
                  "y": 460,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "a425953ee814b3b2",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "Enabled and show",
                  "props": [
                      {
                          "p": "enable",
                          "v": "enabled_show",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payloadType": "str",
                  "x": 470,
                  "y": 560,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "e9666d623e1d868d",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "Enabled but don't show",
                  "props": [
                      {
                          "p": "enable",
                          "v": "enabled_not_show",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "x": 460,
                  "y": 600,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "37a286db4c7748ee",
                  "type": "comment",
                  "z": "0d30e281996aaebd",
                  "name": "User input mode",
                  "info": "",
                  "x": 480,
                  "y": 520,
                  "wires": []
              },
              {
                  "id": "609e76e4f916aa15",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "Disabled",
                  "props": [
                      {
                          "p": "enable",
                          "v": "disabled",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payloadType": "str",
                  "x": 500,
                  "y": 640,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "e4705650f84cb8d3",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "Never",
                  "props": [
                      {
                          "p": "passthrough",
                          "v": "never",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payloadType": "str",
                  "x": 510,
                  "y": 740,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "238d490fc8b97ec8",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "Always",
                  "props": [
                      {
                          "p": "passthrough",
                          "v": "always",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payloadType": "str",
                  "x": 510,
                  "y": 780,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "c0107c6053d6714f",
                  "type": "comment",
                  "z": "0d30e281996aaebd",
                  "name": "Passthrough mode",
                  "info": "",
                  "x": 470,
                  "y": 700,
                  "wires": []
              },
              {
                  "id": "ceeed4ba0ecacb38",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "If state changes",
                  "props": [
                      {
                          "p": "passthrough",
                          "v": "change",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payloadType": "str",
                  "x": 480,
                  "y": 820,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "fca788f1b8bd013a",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "None",
                  "props": [
                      {
                          "p": "inputmsg",
                          "v": "none",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payloadType": "str",
                  "x": 510,
                  "y": 920,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "0d0325d920a6cc8d",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "All",
                  "props": [
                      {
                          "p": "inputmsg",
                          "v": "all",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payloadType": "str",
                  "x": 510,
                  "y": 960,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "9e0df016e26a9159",
                  "type": "comment",
                  "z": "0d30e281996aaebd",
                  "name": "Input msg mode",
                  "info": "",
                  "x": 480,
                  "y": 880,
                  "wires": []
              },
              {
                  "id": "e2eec88a1195e351",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "Auto",
                  "props": [
                      {
                          "p": "state",
                          "v": "auto",
                          "vt": "str"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": true,
                  "onceDelay": "2",
                  "topic": "",
                  "payloadType": "str",
                  "x": 480,
                  "y": 380,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "7dc085ac32e6ce58",
                  "type": "switch",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "property": "payload",
                  "propertyType": "msg",
                  "rules": [
                      {
                          "t": "eq",
                          "v": "on",
                          "vt": "str"
                      },
                      {
                          "t": "eq",
                          "v": "off",
                          "vt": "str"
                      },
                      {
                          "t": "eq",
                          "v": "auto",
                          "vt": "str"
                      }
                  ],
                  "checkall": "true",
                  "repair": false,
                  "outputs": 3,
                  "x": 1210,
                  "y": 380,
                  "wires": [
                      [
                          "010e9bf3d7c0a902",
                          "3b21e3a1dc123bde"
                      ],
                      [
                          "010e9bf3d7c0a902",
                          "3b21e3a1dc123bde"
                      ],
                      [
                          "5119c646c34863cc"
                      ]
                  ]
              },
              {
                  "id": "010e9bf3d7c0a902",
                  "type": "change",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "rules": [
                      {
                          "t": "set",
                          "p": "passthrough",
                          "pt": "msg",
                          "to": "never",
                          "tot": "str"
                      },
                      {
                          "t": "delete",
                          "p": "payload",
                          "pt": "msg"
                      }
                  ],
                  "action": "",
                  "property": "",
                  "from": "",
                  "to": "",
                  "reg": false,
                  "x": 1510,
                  "y": 380,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "feb30fabfe6ed27e",
                  "type": "change",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "rules": [
                      {
                          "t": "set",
                          "p": "payload",
                          "pt": "msg",
                          "to": "state",
                          "tot": "msg"
                      },
                      {
                          "t": "delete",
                          "p": "state",
                          "pt": "msg"
                      }
                  ],
                  "action": "",
                  "property": "",
                  "from": "",
                  "to": "",
                  "reg": false,
                  "x": 1010,
                  "y": 420,
                  "wires": [
                      [
                          "7dc085ac32e6ce58"
                      ]
                  ]
              },
              {
                  "id": "5119c646c34863cc",
                  "type": "change",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "rules": [
                      {
                          "t": "set",
                          "p": "passthrough",
                          "pt": "msg",
                          "to": "always",
                          "tot": "str"
                      },
                      {
                          "t": "delete",
                          "p": "payload",
                          "pt": "msg"
                      }
                  ],
                  "action": "",
                  "property": "",
                  "from": "",
                  "to": "",
                  "reg": false,
                  "x": 1450,
                  "y": 500,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "3b21e3a1dc123bde",
                  "type": "debug",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "active": true,
                  "tosidebar": true,
                  "console": false,
                  "tostatus": false,
                  "complete": "payload",
                  "targetType": "msg",
                  "statusVal": "",
                  "statusType": "auto",
                  "x": 1530,
                  "y": 240,
                  "wires": []
              },
              {
                  "id": "67f4a4c3e7740f0d",
                  "type": "change",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "rules": [
                      {
                          "t": "change",
                          "p": "payload",
                          "pt": "msg",
                          "from": "1",
                          "fromt": "str",
                          "to": "on",
                          "tot": "str"
                      },
                      {
                          "t": "change",
                          "p": "payload",
                          "pt": "msg",
                          "from": "2",
                          "fromt": "str",
                          "to": "off",
                          "tot": "str"
                      }
                  ],
                  "action": "",
                  "property": "",
                  "from": "",
                  "to": "",
                  "reg": false,
                  "x": 820,
                  "y": 260,
                  "wires": [
                      [
                          "3b21e3a1dc123bde"
                      ]
                  ]
              },
              {
                  "id": "6f526c1d7e7d592d",
                  "type": "change",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "rules": [
                      {
                          "t": "change",
                          "p": "payload",
                          "pt": "msg",
                          "from": "on",
                          "fromt": "str",
                          "to": "🟢",
                          "tot": "str"
                      },
                      {
                          "t": "change",
                          "p": "payload",
                          "pt": "msg",
                          "from": "off",
                          "fromt": "str",
                          "to": "🔴",
                          "tot": "str"
                      }
                  ],
                  "action": "",
                  "property": "",
                  "from": "",
                  "to": "",
                  "reg": false,
                  "x": 370,
                  "y": 40,
                  "wires": [
                      [
                          "4e271289e933b0d4"
                      ]
                  ]
              },
              {
                  "id": "4e271289e933b0d4",
                  "type": "ui_text_input",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "label": "",
                  "tooltip": "",
                  "group": "2361e78c.9b49c8",
                  "order": 36,
                  "width": 1,
                  "height": 1,
                  "passthru": true,
                  "mode": "text",
                  "delay": 300,
                  "topic": "topic",
                  "sendOnBlur": true,
                  "className": "",
                  "topicType": "msg",
                  "x": 560,
                  "y": 40,
                  "wires": [
                      []
                  ]
              },
              {
                  "id": "a7711b7ee36418e3",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "props": [
                      {
                          "p": "payload"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payload": "on",
                  "payloadType": "str",
                  "x": 90,
                  "y": 180,
                  "wires": [
                      [
                          "6f526c1d7e7d592d",
                          "87885d0a3fc890c8"
                      ]
                  ]
              },
              {
                  "id": "498a333bec260df8",
                  "type": "inject",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "props": [
                      {
                          "p": "payload"
                      }
                  ],
                  "repeat": "",
                  "crontab": "",
                  "once": false,
                  "onceDelay": 0.1,
                  "topic": "",
                  "payload": "off",
                  "payloadType": "str",
                  "x": 90,
                  "y": 340,
                  "wires": [
                      [
                          "6f526c1d7e7d592d",
                          "87885d0a3fc890c8"
                      ]
                  ]
              },
              {
                  "id": "87885d0a3fc890c8",
                  "type": "change",
                  "z": "0d30e281996aaebd",
                  "name": "",
                  "rules": [
                      {
                          "t": "change",
                          "p": "payload",
                          "pt": "msg",
                          "from": "on",
                          "fromt": "str",
                          "to": "1",
                          "tot": "str"
                      },
                      {
                          "t": "change",
                          "p": "payload",
                          "pt": "msg",
                          "from": "off",
                          "fromt": "str",
                          "to": "2",
                          "tot": "str"
                      }
                  ],
                  "action": "",
                  "property": "",
                  "from": "",
                  "to": "",
                  "reg": false,
                  "x": 390,
                  "y": 260,
                  "wires": [
                      [
                          "11506b7d5d6627a3"
                      ]
                  ]
              },
              {
                  "id": "2361e78c.9b49c8",
                  "type": "ui_group",
                  "name": "HOME",
                  "tab": "d02fd18cf63f0e19",
                  "order": 1,
                  "disp": false,
                  "width": "7",
                  "collapse": false,
                  "className": ""
              },
              {
                  "id": "d02fd18cf63f0e19",
                  "type": "ui_tab",
                  "name": "Zuhause",
                  "icon": "dashboard",
                  "disabled": false,
                  "hidden": false
              }
          ]
          
          mickym 1 Reply Last reply Reply Quote 0
          • mickym
            mickym Most Active @milanissimo last edited by mickym

            So ich habe das getestet und funktioniert einwandfrei. Das Problem warum es bei Dir den Status nicht behält weil Du die Node mit ungültigen Werten befüllst? Man muss hier sehr wohl Groß- und Kleinschreibung beachten. Du kannst nicht ON injecten und der Value ist on oder On.

            Du musst das genau, wie die values befüllen. Ausserdem kannst Dir das umkopieren vom msg.state in msg.payload sparen, wenn Du den State gleich als payload verwendest.

            Was Du damit bezweckst statt on und off 1 und 2 in die Node zu speisen, das erschliesst sich mir auch nicht. Ausser Du willst das auch noch als State haben. Was die komische Umwandlerei in 1 und 2 soll erschliesst sich mir auch nicht.

            Also damit bleibt bei mir auch der Status erhalten. Den Passthrough hinten über den Switch wieder zu enablen funktioniert nicht. Warum Du 1 und 2 brauchst weiss ich nicht - so hat der Switch halt mal 5 States. 😉

            Also das Hauptptoblem ist, wenn Du in den switch einen state eingibst für den Du keinen value definiert hast.

            Ich hab halt mal was abgeändert - schau mal ob Du damit zurecht kommst:

            [
               {
                   "id": "0d30e281996aaebd",
                   "type": "tab",
                   "label": "Flow 2",
                   "disabled": false,
                   "info": "",
                   "env": []
               },
               {
                   "id": "11506b7d5d6627a3",
                   "type": "ui_multistate_switch",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "group": "2361e78c.9b49c8",
                   "order": 33,
                   "width": 3,
                   "height": 1,
                   "label": " {{label}}",
                   "stateField": "payload",
                   "enableField": "enable",
                   "passthroughField": "passthrough",
                   "inputMsgField": "inputmsg",
                   "rounded": true,
                   "useThemeColors": true,
                   "hideSelectedLabel": false,
                   "multilineLabel": false,
                   "passThrough": "always",
                   "inputMsg": "all",
                   "userInput": "enabled_show",
                   "options": [
                       {
                           "label": "Auto",
                           "value": "auto",
                           "valueType": "str",
                           "color": "#ff6666"
                       },
                       {
                           "label": "On",
                           "value": "on",
                           "valueType": "str",
                           "color": "#009933"
                       },
                       {
                           "label": "Off",
                           "value": "off",
                           "valueType": "str",
                           "color": "#999999"
                       },
                       {
                           "label": "On",
                           "value": "1",
                           "valueType": "num",
                           "color": "#009999"
                       },
                       {
                           "label": "Off",
                           "value": "2",
                           "valueType": "num",
                           "color": "#cccc00"
                       }
                   ],
                   "topic": "",
                   "x": 760,
                   "y": 440,
                   "wires": [
                       [
                           "7dc085ac32e6ce58",
                           "43b11938d7c2e9df"
                       ]
                   ]
               },
               {
                   "id": "5855f71ddd5a2c3d",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "ON",
                   "props": [
                       {
                           "p": "payload"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payload": "on",
                   "payloadType": "str",
                   "x": 510,
                   "y": 420,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "ed9d477deb467c5c",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "OFF",
                   "props": [
                       {
                           "p": "payload"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payload": "off",
                   "payloadType": "str",
                   "x": 510,
                   "y": 460,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "a425953ee814b3b2",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "Enabled and show",
                   "props": [
                       {
                           "p": "enable",
                           "v": "enabled_show",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payloadType": "str",
                   "x": 470,
                   "y": 560,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "e9666d623e1d868d",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "Enabled but don't show",
                   "props": [
                       {
                           "p": "enable",
                           "v": "enabled_not_show",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "x": 460,
                   "y": 600,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "37a286db4c7748ee",
                   "type": "comment",
                   "z": "0d30e281996aaebd",
                   "name": "User input mode",
                   "info": "",
                   "x": 480,
                   "y": 520,
                   "wires": []
               },
               {
                   "id": "609e76e4f916aa15",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "Disabled",
                   "props": [
                       {
                           "p": "enable",
                           "v": "disabled",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payloadType": "str",
                   "x": 500,
                   "y": 640,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "e4705650f84cb8d3",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "Never",
                   "props": [
                       {
                           "p": "passthrough",
                           "v": "never",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payloadType": "str",
                   "x": 510,
                   "y": 740,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "238d490fc8b97ec8",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "Always",
                   "props": [
                       {
                           "p": "passthrough",
                           "v": "always",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payloadType": "str",
                   "x": 510,
                   "y": 780,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "c0107c6053d6714f",
                   "type": "comment",
                   "z": "0d30e281996aaebd",
                   "name": "Passthrough mode",
                   "info": "",
                   "x": 470,
                   "y": 700,
                   "wires": []
               },
               {
                   "id": "ceeed4ba0ecacb38",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "If state changes",
                   "props": [
                       {
                           "p": "passthrough",
                           "v": "change",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payloadType": "str",
                   "x": 480,
                   "y": 820,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "fca788f1b8bd013a",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "None",
                   "props": [
                       {
                           "p": "inputmsg",
                           "v": "none",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payloadType": "str",
                   "x": 510,
                   "y": 920,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "0d0325d920a6cc8d",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "All",
                   "props": [
                       {
                           "p": "inputmsg",
                           "v": "all",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payloadType": "str",
                   "x": 510,
                   "y": 960,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "9e0df016e26a9159",
                   "type": "comment",
                   "z": "0d30e281996aaebd",
                   "name": "Input msg mode",
                   "info": "",
                   "x": 480,
                   "y": 880,
                   "wires": []
               },
               {
                   "id": "e2eec88a1195e351",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "Auto",
                   "props": [
                       {
                           "p": "payload"
                       },
                       {
                           "p": "passthrough",
                           "v": "always",
                           "vt": "str"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": true,
                   "onceDelay": "2",
                   "topic": "",
                   "payload": "auto",
                   "payloadType": "str",
                   "x": 480,
                   "y": 380,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "7dc085ac32e6ce58",
                   "type": "switch",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "property": "payload",
                   "propertyType": "msg",
                   "rules": [
                       {
                           "t": "eq",
                           "v": "1",
                           "vt": "num"
                       },
                       {
                           "t": "eq",
                           "v": "2",
                           "vt": "num"
                       }
                   ],
                   "checkall": "true",
                   "repair": false,
                   "outputs": 2,
                   "x": 1210,
                   "y": 380,
                   "wires": [
                       [
                           "010e9bf3d7c0a902",
                           "3b21e3a1dc123bde"
                       ],
                       [
                           "010e9bf3d7c0a902",
                           "3b21e3a1dc123bde"
                       ]
                   ]
               },
               {
                   "id": "010e9bf3d7c0a902",
                   "type": "change",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "rules": [
                       {
                           "t": "set",
                           "p": "passthrough",
                           "pt": "msg",
                           "to": "never",
                           "tot": "str"
                       },
                       {
                           "t": "delete",
                           "p": "payload",
                           "pt": "msg"
                       }
                   ],
                   "action": "",
                   "property": "",
                   "from": "",
                   "to": "",
                   "reg": false,
                   "x": 1510,
                   "y": 380,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "3b21e3a1dc123bde",
                   "type": "debug",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "active": true,
                   "tosidebar": true,
                   "console": false,
                   "tostatus": false,
                   "complete": "payload",
                   "targetType": "msg",
                   "statusVal": "",
                   "statusType": "auto",
                   "x": 1530,
                   "y": 240,
                   "wires": []
               },
               {
                   "id": "6f526c1d7e7d592d",
                   "type": "change",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "rules": [
                       {
                           "t": "change",
                           "p": "payload",
                           "pt": "msg",
                           "from": "on",
                           "fromt": "str",
                           "to": "🟢",
                           "tot": "str"
                       },
                       {
                           "t": "change",
                           "p": "payload",
                           "pt": "msg",
                           "from": "off",
                           "fromt": "str",
                           "to": "🔴",
                           "tot": "str"
                       }
                   ],
                   "action": "",
                   "property": "",
                   "from": "",
                   "to": "",
                   "reg": false,
                   "x": 370,
                   "y": 40,
                   "wires": [
                       [
                           "4e271289e933b0d4"
                       ]
                   ]
               },
               {
                   "id": "4e271289e933b0d4",
                   "type": "ui_text_input",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "label": "",
                   "tooltip": "",
                   "group": "2361e78c.9b49c8",
                   "order": 36,
                   "width": 1,
                   "height": 1,
                   "passthru": true,
                   "mode": "text",
                   "delay": 300,
                   "topic": "topic",
                   "sendOnBlur": true,
                   "className": "",
                   "topicType": "msg",
                   "x": 560,
                   "y": 40,
                   "wires": [
                       []
                   ]
               },
               {
                   "id": "a7711b7ee36418e3",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "props": [
                       {
                           "p": "payload"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payload": "on",
                   "payloadType": "str",
                   "x": 90,
                   "y": 180,
                   "wires": [
                       [
                           "6f526c1d7e7d592d",
                           "87885d0a3fc890c8"
                       ]
                   ]
               },
               {
                   "id": "498a333bec260df8",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "props": [
                       {
                           "p": "payload"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payload": "off",
                   "payloadType": "str",
                   "x": 90,
                   "y": 340,
                   "wires": [
                       [
                           "6f526c1d7e7d592d",
                           "87885d0a3fc890c8"
                       ]
                   ]
               },
               {
                   "id": "87885d0a3fc890c8",
                   "type": "change",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "rules": [
                       {
                           "t": "change",
                           "p": "payload",
                           "pt": "msg",
                           "from": "on",
                           "fromt": "str",
                           "to": "1",
                           "tot": "str"
                       },
                       {
                           "t": "change",
                           "p": "payload",
                           "pt": "msg",
                           "from": "off",
                           "fromt": "str",
                           "to": "2",
                           "tot": "str"
                       }
                   ],
                   "action": "",
                   "property": "",
                   "from": "",
                   "to": "",
                   "reg": false,
                   "x": 390,
                   "y": 260,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "dec32bacdd7cf943",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "ON",
                   "props": [
                       {
                           "p": "payload"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payload": "1",
                   "payloadType": "num",
                   "x": 650,
                   "y": 280,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "f9069f6ad70bd659",
                   "type": "inject",
                   "z": "0d30e281996aaebd",
                   "name": "OFF",
                   "props": [
                       {
                           "p": "payload"
                       }
                   ],
                   "repeat": "",
                   "crontab": "",
                   "once": false,
                   "onceDelay": 0.1,
                   "topic": "",
                   "payload": "2",
                   "payloadType": "num",
                   "x": 650,
                   "y": 320,
                   "wires": [
                       [
                           "11506b7d5d6627a3"
                       ]
                   ]
               },
               {
                   "id": "dcde8fafeb147e5a",
                   "type": "debug",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "active": true,
                   "tosidebar": true,
                   "console": false,
                   "tostatus": false,
                   "complete": "false",
                   "statusVal": "",
                   "statusType": "auto",
                   "x": 70,
                   "y": 180,
                   "wires": []
               },
               {
                   "id": "43b11938d7c2e9df",
                   "type": "debug",
                   "z": "0d30e281996aaebd",
                   "name": "",
                   "active": true,
                   "tosidebar": true,
                   "console": false,
                   "tostatus": false,
                   "complete": "true",
                   "targetType": "full",
                   "statusVal": "",
                   "statusType": "auto",
                   "x": 970,
                   "y": 320,
                   "wires": []
               },
               {
                   "id": "2361e78c.9b49c8",
                   "type": "ui_group",
                   "name": "HOME",
                   "tab": "d02fd18cf63f0e19",
                   "order": 1,
                   "disp": false,
                   "width": "7",
                   "collapse": false,
                   "className": ""
               },
               {
                   "id": "d02fd18cf63f0e19",
                   "type": "ui_tab",
                   "name": "Zuhause",
                   "icon": "dashboard",
                   "disabled": false,
                   "hidden": false
               }
            ]
            

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

              @mickym

              hey kam in letzter Zeit leider nicht dazu. Bei deinen Flow hab ich immer das Problem das es mir im Dashboard nicht den richtigen Schaltzustand angezeigt hatte. Ich denke das Problem liegt bei den Passthrough der bei on oder off ja aus ist.

              Habe das jetzt wie folgt gelöst, funktioniert so einwandfrei. Bei auto werden die errechneten on off werte durchgelassen und sobald ich auf on off im Dashboard schalte werden diese gesperrt und einmalig ein on oder off gesendet, zudem wird mir auch der aktuelle Schaltzustand korrekt angezeigt. Wird jetzt nicht die Gold Lösung sein geht aber so.

              [
                  {
                      "id": "eeb85c27a9a061c0",
                      "type": "tab",
                      "label": "Flow 2",
                      "disabled": false,
                      "info": "",
                      "env": []
                  },
                  {
                      "id": "efecc435cbe469bc",
                      "type": "inject",
                      "z": "eeb85c27a9a061c0",
                      "name": "None",
                      "props": [
                          {
                              "p": "inputmsg",
                              "v": "none",
                              "vt": "str"
                          }
                      ],
                      "repeat": "",
                      "crontab": "",
                      "once": false,
                      "onceDelay": 0.1,
                      "topic": "",
                      "payloadType": "str",
                      "x": 510,
                      "y": 920,
                      "wires": [
                          []
                      ]
                  },
                  {
                      "id": "8fc85f04d65d9d7b",
                      "type": "inject",
                      "z": "eeb85c27a9a061c0",
                      "name": "All",
                      "props": [
                          {
                              "p": "inputmsg",
                              "v": "all",
                              "vt": "str"
                          }
                      ],
                      "repeat": "",
                      "crontab": "",
                      "once": false,
                      "onceDelay": 0.1,
                      "topic": "",
                      "payloadType": "str",
                      "x": 510,
                      "y": 960,
                      "wires": [
                          []
                      ]
                  },
                  {
                      "id": "cf79aa2977aabf31",
                      "type": "comment",
                      "z": "eeb85c27a9a061c0",
                      "name": "Input msg mode",
                      "info": "",
                      "x": 480,
                      "y": 880,
                      "wires": []
                  },
                  {
                      "id": "62310eca805de6ee",
                      "type": "debug",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "active": true,
                      "tosidebar": true,
                      "console": false,
                      "tostatus": false,
                      "complete": "payload",
                      "targetType": "msg",
                      "statusVal": "",
                      "statusType": "auto",
                      "x": 1890,
                      "y": 100,
                      "wires": []
                  },
                  {
                      "id": "cc37e3355a81889e",
                      "type": "inject",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "props": [
                          {
                              "p": "payload"
                          }
                      ],
                      "repeat": "",
                      "crontab": "",
                      "once": false,
                      "onceDelay": 0.1,
                      "topic": "",
                      "payload": "on",
                      "payloadType": "str",
                      "x": 90,
                      "y": 280,
                      "wires": [
                          [
                              "43fecd69490f24eb"
                          ]
                      ]
                  },
                  {
                      "id": "2c6d0d42856204a0",
                      "type": "inject",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "props": [
                          {
                              "p": "payload"
                          }
                      ],
                      "repeat": "",
                      "crontab": "",
                      "once": false,
                      "onceDelay": 0.1,
                      "topic": "",
                      "payload": "off",
                      "payloadType": "str",
                      "x": 90,
                      "y": 340,
                      "wires": [
                          [
                              "43fecd69490f24eb"
                          ]
                      ]
                  },
                  {
                      "id": "b11714a6388e76fa",
                      "type": "inject",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "props": [
                          {
                              "p": "payload"
                          }
                      ],
                      "repeat": "1",
                      "crontab": "",
                      "once": true,
                      "onceDelay": 0.1,
                      "topic": "",
                      "payloadType": "date",
                      "x": 510,
                      "y": 220,
                      "wires": [
                          [
                              "8489d5e1a2678080"
                          ]
                      ]
                  },
                  {
                      "id": "8489d5e1a2678080",
                      "type": "file in",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "filename": "/home/pi/logs/multisw.log",
                      "format": "utf8",
                      "chunk": false,
                      "sendError": false,
                      "encoding": "none",
                      "allProps": false,
                      "x": 550,
                      "y": 260,
                      "wires": [
                          [
                              "43fecd69490f24eb"
                          ]
                      ]
                  },
                  {
                      "id": "43fecd69490f24eb",
                      "type": "ui_multistate_switch",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "group": "2361e78c.9b49c8",
                      "order": 33,
                      "width": 3,
                      "height": 1,
                      "label": " {{label}}",
                      "stateField": "payload",
                      "enableField": "enable",
                      "passthroughField": "passthrough",
                      "inputMsgField": "inputmsg",
                      "rounded": true,
                      "useThemeColors": true,
                      "hideSelectedLabel": false,
                      "multilineLabel": false,
                      "passThrough": "always",
                      "inputMsg": "all",
                      "userInput": "enabled_show",
                      "options": [
                          {
                              "label": "Auto",
                              "value": "3",
                              "valueType": "str",
                              "color": "#ff6666"
                          },
                          {
                              "label": "On",
                              "value": "1",
                              "valueType": "str",
                              "color": "#009933"
                          },
                          {
                              "label": "Off",
                              "value": "2",
                              "valueType": "str",
                              "color": "#999999"
                          }
                      ],
                      "topic": "",
                      "x": 300,
                      "y": 520,
                      "wires": [
                          [
                              "7a5919f604d9db1a",
                              "716ac3679b53dbda"
                          ]
                      ]
                  },
                  {
                      "id": "4861775a37b35355",
                      "type": "change",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "rules": [
                          {
                              "t": "set",
                              "p": "passthrough",
                              "pt": "msg",
                              "to": "always",
                              "tot": "str"
                          },
                          {
                              "t": "delete",
                              "p": "payload",
                              "pt": "msg"
                          }
                      ],
                      "action": "",
                      "property": "",
                      "from": "",
                      "to": "",
                      "reg": false,
                      "x": 670,
                      "y": 620,
                      "wires": [
                          [
                              "43fecd69490f24eb"
                          ]
                      ]
                  },
                  {
                      "id": "5b454092467f26ee",
                      "type": "rbe",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "func": "rbe",
                      "gap": "",
                      "start": "",
                      "inout": "out",
                      "septopics": false,
                      "property": "payload",
                      "topi": "topic",
                      "x": 410,
                      "y": 700,
                      "wires": [
                          [
                              "2b57b770e938c06f"
                          ]
                      ]
                  },
                  {
                      "id": "7a5919f604d9db1a",
                      "type": "switch",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "property": "payload",
                      "propertyType": "msg",
                      "rules": [
                          {
                              "t": "eq",
                              "v": "1",
                              "vt": "num"
                          },
                          {
                              "t": "eq",
                              "v": "2",
                              "vt": "num"
                          },
                          {
                              "t": "eq",
                              "v": "3",
                              "vt": "num"
                          },
                          {
                              "t": "eq",
                              "v": "on",
                              "vt": "str"
                          },
                          {
                              "t": "eq",
                              "v": "off",
                              "vt": "str"
                          }
                      ],
                      "checkall": "true",
                      "repair": false,
                      "outputs": 5,
                      "x": 770,
                      "y": 480,
                      "wires": [
                          [
                              "7dfa2057e75f5a7a",
                              "3189c51abb3cc8cb"
                          ],
                          [
                              "7dfa2057e75f5a7a",
                              "0b748c903c5dfe60"
                          ],
                          [
                              "4861775a37b35355"
                          ],
                          [
                              "5b454092467f26ee"
                          ],
                          [
                              "5b454092467f26ee"
                          ]
                      ]
                  },
                  {
                      "id": "716ac3679b53dbda",
                      "type": "file",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "filename": "/home/pi/logs/multisw.log",
                      "appendNewline": false,
                      "createDir": false,
                      "overwriteFile": "true",
                      "encoding": "none",
                      "x": 810,
                      "y": 380,
                      "wires": [
                          []
                      ]
                  },
                  {
                      "id": "0b748c903c5dfe60",
                      "type": "change",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "rules": [
                          {
                              "t": "set",
                              "p": "payload",
                              "pt": "msg",
                              "to": "off",
                              "tot": "str"
                          }
                      ],
                      "action": "",
                      "property": "",
                      "from": "",
                      "to": "",
                      "reg": false,
                      "x": 1170,
                      "y": 340,
                      "wires": [
                          [
                              "5b454092467f26ee"
                          ]
                      ]
                  },
                  {
                      "id": "3189c51abb3cc8cb",
                      "type": "change",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "rules": [
                          {
                              "t": "set",
                              "p": "payload",
                              "pt": "msg",
                              "to": "on",
                              "tot": "str"
                          }
                      ],
                      "action": "",
                      "property": "",
                      "from": "",
                      "to": "",
                      "reg": false,
                      "x": 1180,
                      "y": 420,
                      "wires": [
                          [
                              "5b454092467f26ee"
                          ]
                      ]
                  },
                  {
                      "id": "7dfa2057e75f5a7a",
                      "type": "change",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "rules": [
                          {
                              "t": "set",
                              "p": "passthrough",
                              "pt": "msg",
                              "to": "never",
                              "tot": "str"
                          },
                          {
                              "t": "delete",
                              "p": "payload",
                              "pt": "msg"
                          }
                      ],
                      "action": "",
                      "property": "",
                      "from": "",
                      "to": "",
                      "reg": false,
                      "x": 1230,
                      "y": 500,
                      "wires": [
                          [
                              "43fecd69490f24eb"
                          ]
                      ]
                  },
                  {
                      "id": "2b57b770e938c06f",
                      "type": "debug",
                      "z": "eeb85c27a9a061c0",
                      "name": "",
                      "active": true,
                      "tosidebar": true,
                      "console": false,
                      "tostatus": false,
                      "complete": "false",
                      "statusVal": "",
                      "statusType": "auto",
                      "x": 620,
                      "y": 720,
                      "wires": []
                  },
                  {
                      "id": "2361e78c.9b49c8",
                      "type": "ui_group",
                      "name": "HOME",
                      "tab": "d02fd18cf63f0e19",
                      "order": 1,
                      "disp": false,
                      "width": "7",
                      "collapse": false,
                      "className": ""
                  },
                  {
                      "id": "d02fd18cf63f0e19",
                      "type": "ui_tab",
                      "name": "Zuhause",
                      "icon": "dashboard",
                      "disabled": false,
                      "hidden": false
                  }
              ]
              
              mickym 1 Reply Last reply Reply Quote 0
              • mickym
                mickym Most Active @milanissimo last edited by

                @milanissimo Hauptsache es funktioniert. 🙂

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

                Support us

                ioBroker
                Community Adapters
                Donate

                879
                Online

                31.6k
                Users

                79.6k
                Topics

                1.3m
                Posts

                2
                6
                857
                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