Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. ioBroker Allgemein
  4. HEX in RGB Umwandeln?

NEWS

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    17
    1
    3.0k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.1k

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.4k

HEX in RGB Umwandeln?

Geplant Angeheftet Gesperrt Verschoben ioBroker Allgemein
88 Beiträge 3 Kommentatoren 7.9k Aufrufe 3 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • mickymM mickym

    @denjo hast Du Fehlermeldungen im Log?

    D Offline
    D Offline
    denjo
    schrieb am zuletzt editiert von denjo
    #23

    @mickym nein nix, sonst lass ruhig trotzdem danke für deine mühe ich werd ein riesen aufwändiges blockly sonst machen. wird zwar ewig dauern aber geht auch anders

    mickymM 1 Antwort Letzte Antwort
    0
    • D denjo

      @mickym nein nix, sonst lass ruhig trotzdem danke für deine mühe ich werd ein riesen aufwändiges blockly sonst machen. wird zwar ewig dauern aber geht auch anders

      mickymM Online
      mickymM Online
      mickym
      Most Active
      schrieb am zuletzt editiert von
      #24

      @denjo Dann schau nochmal ob der Pfad im Topic der out Node stimmt

      Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

      D mickymM 2 Antworten Letzte Antwort
      0
      • mickymM mickym

        @denjo Dann schau nochmal ob der Pfad im Topic der out Node stimmt

        D Offline
        D Offline
        denjo
        schrieb am zuletzt editiert von
        #25

        @mickym der stimmt

        1 Antwort Letzte Antwort
        0
        • mickymM mickym

          @denjo Dann schau nochmal ob der Pfad im Topic der out Node stimmt

          mickymM Online
          mickymM Online
          mickym
          Most Active
          schrieb am zuletzt editiert von
          #26

          und die InNode - auch nochmal checken
          Du hast was geschrieben dass Du die nochmal korrigiert hast

          Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

          D mickymM 2 Antworten Letzte Antwort
          0
          • mickymM mickym

            und die InNode - auch nochmal checken
            Du hast was geschrieben dass Du die nochmal korrigiert hast

            D Offline
            D Offline
            denjo
            schrieb am zuletzt editiert von
            #27

            @mickym ja hatte ich aber mit dein ersten script klappe es und dann hab ich das objekt nicht mehr geändert

            1 Antwort Letzte Antwort
            0
            • mickymM mickym

              und die InNode - auch nochmal checken
              Du hast was geschrieben dass Du die nochmal korrigiert hast

              mickymM Online
              mickymM Online
              mickym
              Most Active
              schrieb am zuletzt editiert von mickym
              #28

              @mickym Ja aber ich hab ja nochmal den Flow neu gemacht und da hatte ich doch nicht deine andere InNode - also nochmal anpassen bitte.

              Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

              D 1 Antwort Letzte Antwort
              0
              • mickymM mickym

                @mickym Ja aber ich hab ja nochmal den Flow neu gemacht und da hatte ich doch nicht deine andere InNode - also nochmal anpassen bitte.

                D Offline
                D Offline
                denjo
                schrieb am zuletzt editiert von
                #29

                @mickym der name des objekt und der pfad ist der gleiche geblieben

                mickymM 1 Antwort Letzte Antwort
                0
                • D denjo

                  @mickym der name des objekt und der pfad ist der gleiche geblieben

                  mickymM Online
                  mickymM Online
                  mickym
                  Most Active
                  schrieb am zuletzt editiert von
                  #30

                  @denjo Mach bitte einen Screenshot - unter den Nodes sollten eigentlich die Werte stehen.

                  1dd4f57e-be3d-4b16-9606-4b906e444f98-image.png

                  Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                  D 1 Antwort Letzte Antwort
                  0
                  • mickymM mickym

                    @denjo Mach bitte einen Screenshot - unter den Nodes sollten eigentlich die Werte stehen.

                    1dd4f57e-be3d-4b16-9606-4b906e444f98-image.png

                    D Offline
                    D Offline
                    denjo
                    schrieb am zuletzt editiert von
                    #31

                    @mickym Screenshot 2021-03-14 020956.jpg

                    mickymM 1 Antwort Letzte Antwort
                    0
                    • D denjo

                      @mickym Screenshot 2021-03-14 020956.jpg

                      mickymM Online
                      mickymM Online
                      mickym
                      Most Active
                      schrieb am zuletzt editiert von mickym
                      #32

                      @denjo Na und hast Du in dem Datenpunkt einen neuen Wert eingegeben?
                      Und wie gesagt nochmals die Pfade zu dem Datenpunkt prüfen ggf. den Pfad über die Zwischenablage in den Topic reinkopieren.

                      So sieht man dass gar nichts ankommt. In dem In Node muss der Wert aus dem Datenpunkt auftauchen

                      Hier hst Du vor einer Std. geschrieben, dass du nochwas angepasst hast - aber leider nicht was.

                      Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                      D 1 Antwort Letzte Antwort
                      0
                      • mickymM mickym

                        @denjo Na und hast Du in dem Datenpunkt einen neuen Wert eingegeben?
                        Und wie gesagt nochmals die Pfade zu dem Datenpunkt prüfen ggf. den Pfad über die Zwischenablage in den Topic reinkopieren.

                        So sieht man dass gar nichts ankommt. In dem In Node muss der Wert aus dem Datenpunkt auftauchen

                        Hier hst Du vor einer Std. geschrieben, dass du nochwas angepasst hast - aber leider nicht was.

                        D Offline
                        D Offline
                        denjo
                        schrieb am zuletzt editiert von
                        #33

                        @mickym hab das objekt neu gemacht, jetzt klappt es glaub ich alles

                        mickymM 1 Antwort Letzte Antwort
                        0
                        • D denjo

                          @mickym hab das objekt neu gemacht, jetzt klappt es glaub ich alles

                          mickymM Online
                          mickymM Online
                          mickym
                          Most Active
                          schrieb am zuletzt editiert von
                          #34

                          @denjo Dann poste doch nochmal einen Screenshot - dann glaub ich es auch. ;)
                          War ja holprig - aber Du siehst eigentlich nicht kompliziert. ;)

                          Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                          D 1 Antwort Letzte Antwort
                          0
                          • mickymM mickym

                            @denjo Dann poste doch nochmal einen Screenshot - dann glaub ich es auch. ;)
                            War ja holprig - aber Du siehst eigentlich nicht kompliziert. ;)

                            D Offline
                            D Offline
                            denjo
                            schrieb am zuletzt editiert von
                            #35

                            @mickym doch haut hin und nu kann ich es auch über alexa steuern, fetten dank an dir

                            1 Antwort Letzte Antwort
                            0
                            • mickymM mickym

                              @denjo sagte in HEX in RGB Umwandeln?:

                              hyperion_ng.0.general.control.setColorRGB

                              So das ist es dann:

                              6b6c2810-1d34-4719-bad3-f781d0bc82bb-image.png

                              [
                                  {
                                      "id": "c9bd97db.0bd1c8",
                                      "type": "function",
                                      "z": "6e170384.60c96c",
                                      "name": "HEX zu RGB",
                                      "func": "msg.payload=hex_to_RGB(msg.payload)\n\n\nreturn msg;\n\nfunction hex_to_RGB(hex) {\n    var m = hex.match(/^#?([\\da-f]{2})([\\da-f]{2})([\\da-f]{2})$/i);\n    return {\n        r: parseInt(m[1], 16),\n        g: parseInt(m[2], 16),\n        b: parseInt(m[3], 16)\n    };\n}",
                                      "outputs": 1,
                                      "noerr": 0,
                                      "initialize": "",
                                      "finalize": "",
                                      "x": 1410,
                                      "y": 3180,
                                      "wires": [
                                          [
                                              "62344cad.180284"
                                          ]
                                      ]
                                  },
                                  {
                                      "id": "28743d11.362b72",
                                      "type": "ioBroker in",
                                      "z": "6e170384.60c96c",
                                      "name": "",
                                      "topic": "javascript.0.hyperionng",
                                      "payloadType": "value",
                                      "onlyack": "",
                                      "func": "all",
                                      "gap": "",
                                      "fireOnStart": "false",
                                      "x": 1140,
                                      "y": 3180,
                                      "wires": [
                                          [
                                              "c9bd97db.0bd1c8"
                                          ]
                                      ]
                                  },
                                  {
                                      "id": "32bd27af.6eff68",
                                      "type": "ioBroker out",
                                      "z": "6e170384.60c96c",
                                      "name": "",
                                      "topic": "hyperion_ng.0.general.control.setColorRGB",
                                      "ack": "false",
                                      "autoCreate": "false",
                                      "stateName": "",
                                      "role": "",
                                      "payloadType": "",
                                      "readonly": "",
                                      "stateUnit": "",
                                      "stateMin": "",
                                      "stateMax": "",
                                      "x": 1870,
                                      "y": 3180,
                                      "wires": []
                                  },
                                  {
                                      "id": "62344cad.180284",
                                      "type": "json",
                                      "z": "6e170384.60c96c",
                                      "name": "",
                                      "property": "payload",
                                      "action": "",
                                      "pretty": false,
                                      "x": 1590,
                                      "y": 3180,
                                      "wires": [
                                          [
                                              "32bd27af.6eff68"
                                          ]
                                      ]
                                  }
                              ]
                              

                              Zum Importieren:

                              1. Den Code hier in die Zwischenablage kopieren.
                              2. In Node Red - das Menü mit den 3 Strichen rechts oben öffne und auf Import klicken.
                              3. Inhalt der Zwischenablage in das rosa Fenster
                              4. Auf Import klicken und den Flow plazieren.
                              5. dann auf den roten Deploy Button klicken und das wars.

                              Test einfach - in dem Du dann in javascript.0.hyperionng den hex-String einträgst und schaust was dann in dem Ausgabepunkt ankommt.

                              Habs gerade mit eigenen Datenpunkten getestet. Das schaut in meinen Augen gut aus. ;)

                              b4352ac2-036c-4610-b005-f7a0cfa14922-image.png

                              B Offline
                              B Offline
                              Bacado
                              schrieb am zuletzt editiert von
                              #36

                              @mickym hey, wie würde das ganze den anders rum aussehen von RBG zu HEX hab zwar bei nodered nen Converter gefunden aber der gibt keinen wert raus. Scheinbar bin ich einfach noch zu unerfahren in nodered.

                              mickymM 1 Antwort Letzte Antwort
                              0
                              • B Bacado

                                @mickym hey, wie würde das ganze den anders rum aussehen von RBG zu HEX hab zwar bei nodered nen Converter gefunden aber der gibt keinen wert raus. Scheinbar bin ich einfach noch zu unerfahren in nodered.

                                mickymM Online
                                mickymM Online
                                mickym
                                Most Active
                                schrieb am zuletzt editiert von mickym
                                #37

                                @bacado sagte in HEX in RGB Umwandeln?:

                                @mickym hey, wie würde das ganze den anders rum aussehen von RBG zu HEX hab zwar bei nodered nen Converter gefunden aber der gibt keinen wert raus. Scheinbar bin ich einfach noch zu unerfahren in nodered.

                                Schau mal - da hab ich mal was gebastelt. ;)

                                https://forum.iobroker.net/assets/uploads/files/1616066608668-9ea2e8be-570b-430d-80f4-b81fb8520f83-image.png

                                Sorry wollte den Thread posten: https://forum.iobroker.net/topic/43271/konvertierung-byte-nach-dezimal-und-umgekehrt

                                Wenn Du den unteren Flow importierst bekommst eine neue Nodes als Subflow:

                                f544a80b-d84e-4ce0-a187-bf98fe55b8ac-image.png

                                dem kannst entweder ein RGB Objekt oder Array übergeben oder auch einen mit Kommas separierten String der RGB Werte nutzen.

                                Basis des Flows ist der .toString(16) Kommando im JS: https://stackoverflow.com/questions/39651531/why-does-tostring16-convert-rgb-decimal-or-other-inputs-into-a-hexidecimal

                                So was kann man natürlich auch im Blockly implementieren, aber dafür bin ich kein Fan.

                                Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                                B 2 Antworten Letzte Antwort
                                0
                                • mickymM mickym

                                  @bacado sagte in HEX in RGB Umwandeln?:

                                  @mickym hey, wie würde das ganze den anders rum aussehen von RBG zu HEX hab zwar bei nodered nen Converter gefunden aber der gibt keinen wert raus. Scheinbar bin ich einfach noch zu unerfahren in nodered.

                                  Schau mal - da hab ich mal was gebastelt. ;)

                                  https://forum.iobroker.net/assets/uploads/files/1616066608668-9ea2e8be-570b-430d-80f4-b81fb8520f83-image.png

                                  Sorry wollte den Thread posten: https://forum.iobroker.net/topic/43271/konvertierung-byte-nach-dezimal-und-umgekehrt

                                  Wenn Du den unteren Flow importierst bekommst eine neue Nodes als Subflow:

                                  f544a80b-d84e-4ce0-a187-bf98fe55b8ac-image.png

                                  dem kannst entweder ein RGB Objekt oder Array übergeben oder auch einen mit Kommas separierten String der RGB Werte nutzen.

                                  Basis des Flows ist der .toString(16) Kommando im JS: https://stackoverflow.com/questions/39651531/why-does-tostring16-convert-rgb-decimal-or-other-inputs-into-a-hexidecimal

                                  So was kann man natürlich auch im Blockly implementieren, aber dafür bin ich kein Fan.

                                  B Offline
                                  B Offline
                                  Bacado
                                  schrieb am zuletzt editiert von
                                  #38

                                  @mickym ja genau das funtz aber hab glaube ich den falschen flow den mir fehlt noch die Ausgabe mit # bin gerade etwas überflutet mit informationen. Aber denke damit werd ich klar kommen. Brauch nur etwas zeit um bissel durchzusteigen.

                                  mickymM 1 Antwort Letzte Antwort
                                  0
                                  • B Bacado

                                    @mickym ja genau das funtz aber hab glaube ich den falschen flow den mir fehlt noch die Ausgabe mit # bin gerade etwas überflutet mit informationen. Aber denke damit werd ich klar kommen. Brauch nur etwas zeit um bissel durchzusteigen.

                                    mickymM Online
                                    mickymM Online
                                    mickym
                                    Most Active
                                    schrieb am zuletzt editiert von mickym
                                    #39

                                    @bacado Das 2. Posting:

                                    [
                                      {
                                          "id": "ab16e708.7973e8",
                                          "type": "subflow",
                                          "name": "Decimal to Byte",
                                          "info": "# Decimal to Byte\r\nThe node accepts any decimal number as number, string, comma separated string with decimal values, arrays or objects as `msg.payload`. \r\nIf strings can not be converted into numbers the whole string, object, array will be ignored.\r\nFlot numbers will be converted to integers. \r\n\r\nThe output will always be a string, representing each number as a string, representing each byte with 2 characters (i.e. 8 ==> '08').\r\n\r\nPrefixes can be added by consecutive change nodes. Using a hashtag ('#'), follwed by 3 bytes will be detected in the debug window as color code.\r\n\r\n\r\n# Dezimal nach Byte\r\nDie Node akzeptiert jede Dezimalzahl als Zahl, String, durch Kommas getrennte Zahlen als String/Zeichenkette, Array oder Objekt als `msg.payload`.\r\n\r\nWenn ein String nicht in eine Zahl umgewandelt werden kann, wird die gesamte Eingabe ignoriert. Fließkommazahlen werden in Ganzzahlen/Integerwerte umgewandelt. \r\n\r\nDie Ausgabe ist immer ein String/Zeichenkette. Jede Dezimalzahl wird als Zeichenkette ausgegeben, wobei jedes Byte mit 2 Zeichen dargestellt wird (z.Bsp. 8 ==> '08').  \r\n\r\nPräfixe müssen durch nachfolgende Change-Nodes selbst vorangestellt werden. Stellt man einer Bytefolge von 3 Zahlen ein Hashtag ('#') voran, wird dieser im Debug-Fenster bereits als Farbcode interpretiert.",
                                          "category": "",
                                          "in": [
                                              {
                                                  "x": 60,
                                                  "y": 160,
                                                  "wires": [
                                                      {
                                                          "id": "da75483e.1f9f18"
                                                      }
                                                  ]
                                              }
                                          ],
                                          "out": [
                                              {
                                                  "x": 1300,
                                                  "y": 80,
                                                  "wires": [
                                                      {
                                                          "id": "1a81a4c8.b8095b",
                                                          "port": 0
                                                      },
                                                      {
                                                          "id": "4b071cab.37d0c4",
                                                          "port": 0
                                                      },
                                                      {
                                                          "id": "65fca19a.41ef9",
                                                          "port": 0
                                                      }
                                                  ]
                                              }
                                          ],
                                          "env": [],
                                          "color": "#E2D96E",
                                          "icon": "node-red/hash.svg"
                                      },
                                      {
                                          "id": "1a81a4c8.b8095b",
                                          "type": "function",
                                          "z": "ab16e708.7973e8",
                                          "name": "to HEX String Byte Format",
                                          "func": "if (typeof(msg.payload) === \"string\"){\n    msg.payload = Number(msg.payload);\n    if (isNaN(msg.payload) ) return null;\n}\nmsg.payload=Math.floor(msg.payload);\nmsg.payload= (msg.payload.toString(16)).toUpperCase();\nif ((msg.payload).length%2 > 0) msg.payload = '0' + msg.payload;\n\nreturn msg;",
                                          "outputs": 1,
                                          "noerr": 0,
                                          "initialize": "",
                                          "finalize": "",
                                          "x": 520,
                                          "y": 80,
                                          "wires": [
                                              []
                                          ]
                                      },
                                      {
                                          "id": "da75483e.1f9f18",
                                          "type": "switch",
                                          "z": "ab16e708.7973e8",
                                          "name": "",
                                          "property": "payload",
                                          "propertyType": "msg",
                                          "rules": [
                                              {
                                                  "t": "istype",
                                                  "v": "number",
                                                  "vt": "number"
                                              },
                                              {
                                                  "t": "istype",
                                                  "v": "string",
                                                  "vt": "string"
                                              },
                                              {
                                                  "t": "istype",
                                                  "v": "array",
                                                  "vt": "array"
                                              },
                                              {
                                                  "t": "istype",
                                                  "v": "object",
                                                  "vt": "object"
                                              }
                                          ],
                                          "checkall": "true",
                                          "repair": false,
                                          "outputs": 4,
                                          "x": 190,
                                          "y": 160,
                                          "wires": [
                                              [
                                                  "1a81a4c8.b8095b"
                                              ],
                                              [
                                                  "4349febf.96d86"
                                              ],
                                              [
                                                  "fabf9af5.c72b38"
                                              ],
                                              [
                                                  "fabf9af5.c72b38"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "4349febf.96d86",
                                          "type": "split",
                                          "z": "ab16e708.7973e8",
                                          "name": "",
                                          "splt": ",",
                                          "spltType": "str",
                                          "arraySplt": 1,
                                          "arraySpltType": "len",
                                          "stream": false,
                                          "addname": "",
                                          "x": 380,
                                          "y": 140,
                                          "wires": [
                                              [
                                                  "370c9cd2.a93664"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "370c9cd2.a93664",
                                          "type": "function",
                                          "z": "ab16e708.7973e8",
                                          "name": "to HEX String Byte Format",
                                          "func": "if (typeof(msg.payload) === \"string\"){\n    msg.payload = Number(msg.payload);\n    if (isNaN(msg.payload) ) return null;\n}\nmsg.payload=Math.floor(msg.payload);\nmsg.payload= (msg.payload.toString(16)).toUpperCase();\nif ((msg.payload).length%2 > 0) msg.payload = '0' + msg.payload;\n\nreturn msg;",
                                          "outputs": 1,
                                          "noerr": 0,
                                          "initialize": "",
                                          "finalize": "",
                                          "x": 600,
                                          "y": 140,
                                          "wires": [
                                              [
                                                  "c3312bd6.16ea18"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "c3312bd6.16ea18",
                                          "type": "join",
                                          "z": "ab16e708.7973e8",
                                          "name": "",
                                          "mode": "auto",
                                          "build": "string",
                                          "property": "payload",
                                          "propertyType": "msg",
                                          "key": "topic",
                                          "joiner": "",
                                          "joinerType": "str",
                                          "accumulate": false,
                                          "timeout": "",
                                          "count": "",
                                          "reduceRight": false,
                                          "reduceExp": "",
                                          "reduceInit": "",
                                          "reduceInitType": "",
                                          "reduceFixup": "",
                                          "x": 810,
                                          "y": 140,
                                          "wires": [
                                              [
                                                  "4b071cab.37d0c4"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "fabf9af5.c72b38",
                                          "type": "split",
                                          "z": "ab16e708.7973e8",
                                          "name": "",
                                          "splt": "\\n",
                                          "spltType": "str",
                                          "arraySplt": 1,
                                          "arraySpltType": "len",
                                          "stream": false,
                                          "addname": "",
                                          "x": 380,
                                          "y": 180,
                                          "wires": [
                                              [
                                                  "2c13cf5c.73981"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "2c13cf5c.73981",
                                          "type": "function",
                                          "z": "ab16e708.7973e8",
                                          "name": "to HEX String Byte Format",
                                          "func": "if (typeof(msg.payload) === \"string\"){\n    msg.payload = Number(msg.payload);\n    if (isNaN(msg.payload) ) return null;\n}\nmsg.payload=Math.floor(msg.payload);\nmsg.payload= (msg.payload.toString(16)).toUpperCase();\nif ((msg.payload).length%2 > 0) msg.payload = '0' + msg.payload;\n\nreturn msg;",
                                          "outputs": 1,
                                          "noerr": 0,
                                          "initialize": "",
                                          "finalize": "",
                                          "x": 600,
                                          "y": 180,
                                          "wires": [
                                              [
                                                  "63d1eccf.a09034"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "63d1eccf.a09034",
                                          "type": "join",
                                          "z": "ab16e708.7973e8",
                                          "name": "",
                                          "mode": "auto",
                                          "build": "string",
                                          "property": "payload",
                                          "propertyType": "msg",
                                          "key": "topic",
                                          "joiner": "",
                                          "joinerType": "str",
                                          "accumulate": false,
                                          "timeout": "",
                                          "count": "",
                                          "reduceRight": false,
                                          "reduceExp": "",
                                          "reduceInit": "",
                                          "reduceInitType": "num",
                                          "reduceFixup": "",
                                          "x": 810,
                                          "y": 180,
                                          "wires": [
                                              [
                                                  "19ca6af6.1e37c5"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "4b071cab.37d0c4",
                                          "type": "change",
                                          "z": "ab16e708.7973e8",
                                          "name": "",
                                          "rules": [
                                              {
                                                  "t": "change",
                                                  "p": "payload",
                                                  "pt": "msg",
                                                  "from": ",",
                                                  "fromt": "str",
                                                  "to": "",
                                                  "tot": "str"
                                              }
                                          ],
                                          "action": "",
                                          "property": "",
                                          "from": "",
                                          "to": "",
                                          "reg": false,
                                          "x": 1000,
                                          "y": 140,
                                          "wires": [
                                              []
                                          ]
                                      },
                                      {
                                          "id": "19ca6af6.1e37c5",
                                          "type": "split",
                                          "z": "ab16e708.7973e8",
                                          "name": "",
                                          "splt": "\\n",
                                          "spltType": "str",
                                          "arraySplt": 1,
                                          "arraySpltType": "len",
                                          "stream": false,
                                          "addname": "",
                                          "x": 960,
                                          "y": 180,
                                          "wires": [
                                              [
                                                  "65fca19a.41ef9"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "65fca19a.41ef9",
                                          "type": "join",
                                          "z": "ab16e708.7973e8",
                                          "name": "",
                                          "mode": "custom",
                                          "build": "string",
                                          "property": "payload",
                                          "propertyType": "msg",
                                          "key": "topic",
                                          "joiner": "",
                                          "joinerType": "str",
                                          "accumulate": false,
                                          "timeout": "",
                                          "count": "",
                                          "reduceRight": false,
                                          "reduceExp": "",
                                          "reduceInit": "",
                                          "reduceInitType": "",
                                          "reduceFixup": "",
                                          "x": 1110,
                                          "y": 180,
                                          "wires": [
                                              []
                                          ]
                                      },
                                      {
                                          "id": "2191832.9e0d37c",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "1040403",
                                          "payloadType": "num",
                                          "x": 2120,
                                          "y": 3600,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "9b87093.1e4b4f8",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "1040403",
                                          "payloadType": "str",
                                          "x": 2120,
                                          "y": 3640,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "6862064f.d059e8",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "104,04,03",
                                          "payloadType": "str",
                                          "x": 2120,
                                          "y": 3680,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "4470c439.42ae6c",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "255,0,255",
                                          "payloadType": "str",
                                          "x": 2120,
                                          "y": 3760,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "a612a150.79fa",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "Hallo",
                                          "payloadType": "str",
                                          "x": 2130,
                                          "y": 3560,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "a807801e.86536",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "[2,6,99]",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "[2,6,99]",
                                          "payloadType": "jsonata",
                                          "x": 2130,
                                          "y": 3800,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "3ee98195.e48d4e",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "['ab','cd',99]",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "['ab','cd',99]",
                                          "payloadType": "jsonata",
                                          "x": 2110,
                                          "y": 3840,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "69d5b78b.9a1348",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "[99]",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "[99]",
                                          "payloadType": "jsonata",
                                          "x": 2130,
                                          "y": 3880,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "620be0a5.46383",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "[99,'255']",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "[99,'255']",
                                          "payloadType": "jsonata",
                                          "x": 2120,
                                          "y": 3920,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "81373293.b970d",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "[99,'ef']",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "[99,'ef']",
                                          "payloadType": "jsonata",
                                          "x": 2130,
                                          "y": 3960,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "a41dba5d.037848",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "{\"Rot\":255,\"Grün\":255,\"Blau\":0}",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "{\"Rot\":255,\"Grün\":0,\"Blau\":255}",
                                          "payloadType": "json",
                                          "x": 2050,
                                          "y": 4000,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "a2229b55.07ef38",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "{\"Rot\":255,\"Grün\":\"128\",\"Blau\":0}",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "{\"Rot\":255,\"Grün\":\"128\",\"Blau\":0}",
                                          "payloadType": "json",
                                          "x": 2050,
                                          "y": 4040,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "8455c0a1.f7aab",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "{\"Rot\":255,\"Grün\":\"gh\",\"Blau\":0}",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "{\"Rot\":255,\"Grün\":\"gh\",\"Blau\":0}",
                                          "payloadType": "json",
                                          "x": 2050,
                                          "y": 4080,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "bdc50d1b.f93bd",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "\"11806311026742\"",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "11806311026742",
                                          "payloadType": "str",
                                          "x": 2090,
                                          "y": 3720,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "aa69cddf.3210e",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "15.6",
                                          "payloadType": "str",
                                          "x": 2130,
                                          "y": 3520,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "f5cea9b4.72e1a8",
                                          "type": "inject",
                                          "z": "6e170384.60c96c",
                                          "name": "",
                                          "props": [
                                              {
                                                  "p": "payload"
                                              }
                                          ],
                                          "repeat": "",
                                          "crontab": "",
                                          "once": false,
                                          "onceDelay": 0.1,
                                          "topic": "",
                                          "payload": "15.6",
                                          "payloadType": "num",
                                          "x": 2130,
                                          "y": 3480,
                                          "wires": [
                                              [
                                                  "333333a7.cfa17c"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "333333a7.cfa17c",
                                          "type": "subflow:ab16e708.7973e8",
                                          "z": "6e170384.60c96c",
                                          "name": "",
                                          "env": [],
                                          "x": 2600,
                                          "y": 3840,
                                          "wires": [
                                              [
                                                  "5fb9015.fbd98",
                                                  "7af82e5f.719f4",
                                                  "f4d59886.753238"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "7af82e5f.719f4",
                                          "type": "change",
                                          "z": "6e170384.60c96c",
                                          "name": "Präfix 0x",
                                          "rules": [
                                              {
                                                  "t": "set",
                                                  "p": "payload",
                                                  "pt": "msg",
                                                  "to": "'0x' & payload",
                                                  "tot": "jsonata"
                                              }
                                          ],
                                          "action": "",
                                          "property": "",
                                          "from": "",
                                          "to": "",
                                          "reg": false,
                                          "x": 2790,
                                          "y": 3880,
                                          "wires": [
                                              [
                                                  "5fb9015.fbd98"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "f4d59886.753238",
                                          "type": "change",
                                          "z": "6e170384.60c96c",
                                          "name": "Präfix #",
                                          "rules": [
                                              {
                                                  "t": "set",
                                                  "p": "payload",
                                                  "pt": "msg",
                                                  "to": "'#' & payload",
                                                  "tot": "jsonata"
                                              }
                                          ],
                                          "action": "",
                                          "property": "",
                                          "from": "",
                                          "to": "",
                                          "reg": false,
                                          "x": 2800,
                                          "y": 3920,
                                          "wires": [
                                              [
                                                  "5fb9015.fbd98"
                                              ]
                                          ]
                                      },
                                      {
                                          "id": "5fb9015.fbd98",
                                          "type": "debug",
                                          "z": "6e170384.60c96c",
                                          "name": "",
                                          "active": true,
                                          "tosidebar": true,
                                          "console": false,
                                          "tostatus": false,
                                          "complete": "false",
                                          "statusVal": "",
                                          "statusType": "auto",
                                          "x": 2990,
                                          "y": 3840,
                                          "wires": []
                                      }
                                    ]
                                    
                                    

                                    Der Hashtag wird über eine ChangeNode- vorangestellt.

                                    Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                                    B 1 Antwort Letzte Antwort
                                    0
                                    • mickymM mickym

                                      @bacado Das 2. Posting:

                                      [
                                        {
                                            "id": "ab16e708.7973e8",
                                            "type": "subflow",
                                            "name": "Decimal to Byte",
                                            "info": "# Decimal to Byte\r\nThe node accepts any decimal number as number, string, comma separated string with decimal values, arrays or objects as `msg.payload`. \r\nIf strings can not be converted into numbers the whole string, object, array will be ignored.\r\nFlot numbers will be converted to integers. \r\n\r\nThe output will always be a string, representing each number as a string, representing each byte with 2 characters (i.e. 8 ==> '08').\r\n\r\nPrefixes can be added by consecutive change nodes. Using a hashtag ('#'), follwed by 3 bytes will be detected in the debug window as color code.\r\n\r\n\r\n# Dezimal nach Byte\r\nDie Node akzeptiert jede Dezimalzahl als Zahl, String, durch Kommas getrennte Zahlen als String/Zeichenkette, Array oder Objekt als `msg.payload`.\r\n\r\nWenn ein String nicht in eine Zahl umgewandelt werden kann, wird die gesamte Eingabe ignoriert. Fließkommazahlen werden in Ganzzahlen/Integerwerte umgewandelt. \r\n\r\nDie Ausgabe ist immer ein String/Zeichenkette. Jede Dezimalzahl wird als Zeichenkette ausgegeben, wobei jedes Byte mit 2 Zeichen dargestellt wird (z.Bsp. 8 ==> '08').  \r\n\r\nPräfixe müssen durch nachfolgende Change-Nodes selbst vorangestellt werden. Stellt man einer Bytefolge von 3 Zahlen ein Hashtag ('#') voran, wird dieser im Debug-Fenster bereits als Farbcode interpretiert.",
                                            "category": "",
                                            "in": [
                                                {
                                                    "x": 60,
                                                    "y": 160,
                                                    "wires": [
                                                        {
                                                            "id": "da75483e.1f9f18"
                                                        }
                                                    ]
                                                }
                                            ],
                                            "out": [
                                                {
                                                    "x": 1300,
                                                    "y": 80,
                                                    "wires": [
                                                        {
                                                            "id": "1a81a4c8.b8095b",
                                                            "port": 0
                                                        },
                                                        {
                                                            "id": "4b071cab.37d0c4",
                                                            "port": 0
                                                        },
                                                        {
                                                            "id": "65fca19a.41ef9",
                                                            "port": 0
                                                        }
                                                    ]
                                                }
                                            ],
                                            "env": [],
                                            "color": "#E2D96E",
                                            "icon": "node-red/hash.svg"
                                        },
                                        {
                                            "id": "1a81a4c8.b8095b",
                                            "type": "function",
                                            "z": "ab16e708.7973e8",
                                            "name": "to HEX String Byte Format",
                                            "func": "if (typeof(msg.payload) === \"string\"){\n    msg.payload = Number(msg.payload);\n    if (isNaN(msg.payload) ) return null;\n}\nmsg.payload=Math.floor(msg.payload);\nmsg.payload= (msg.payload.toString(16)).toUpperCase();\nif ((msg.payload).length%2 > 0) msg.payload = '0' + msg.payload;\n\nreturn msg;",
                                            "outputs": 1,
                                            "noerr": 0,
                                            "initialize": "",
                                            "finalize": "",
                                            "x": 520,
                                            "y": 80,
                                            "wires": [
                                                []
                                            ]
                                        },
                                        {
                                            "id": "da75483e.1f9f18",
                                            "type": "switch",
                                            "z": "ab16e708.7973e8",
                                            "name": "",
                                            "property": "payload",
                                            "propertyType": "msg",
                                            "rules": [
                                                {
                                                    "t": "istype",
                                                    "v": "number",
                                                    "vt": "number"
                                                },
                                                {
                                                    "t": "istype",
                                                    "v": "string",
                                                    "vt": "string"
                                                },
                                                {
                                                    "t": "istype",
                                                    "v": "array",
                                                    "vt": "array"
                                                },
                                                {
                                                    "t": "istype",
                                                    "v": "object",
                                                    "vt": "object"
                                                }
                                            ],
                                            "checkall": "true",
                                            "repair": false,
                                            "outputs": 4,
                                            "x": 190,
                                            "y": 160,
                                            "wires": [
                                                [
                                                    "1a81a4c8.b8095b"
                                                ],
                                                [
                                                    "4349febf.96d86"
                                                ],
                                                [
                                                    "fabf9af5.c72b38"
                                                ],
                                                [
                                                    "fabf9af5.c72b38"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "4349febf.96d86",
                                            "type": "split",
                                            "z": "ab16e708.7973e8",
                                            "name": "",
                                            "splt": ",",
                                            "spltType": "str",
                                            "arraySplt": 1,
                                            "arraySpltType": "len",
                                            "stream": false,
                                            "addname": "",
                                            "x": 380,
                                            "y": 140,
                                            "wires": [
                                                [
                                                    "370c9cd2.a93664"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "370c9cd2.a93664",
                                            "type": "function",
                                            "z": "ab16e708.7973e8",
                                            "name": "to HEX String Byte Format",
                                            "func": "if (typeof(msg.payload) === \"string\"){\n    msg.payload = Number(msg.payload);\n    if (isNaN(msg.payload) ) return null;\n}\nmsg.payload=Math.floor(msg.payload);\nmsg.payload= (msg.payload.toString(16)).toUpperCase();\nif ((msg.payload).length%2 > 0) msg.payload = '0' + msg.payload;\n\nreturn msg;",
                                            "outputs": 1,
                                            "noerr": 0,
                                            "initialize": "",
                                            "finalize": "",
                                            "x": 600,
                                            "y": 140,
                                            "wires": [
                                                [
                                                    "c3312bd6.16ea18"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "c3312bd6.16ea18",
                                            "type": "join",
                                            "z": "ab16e708.7973e8",
                                            "name": "",
                                            "mode": "auto",
                                            "build": "string",
                                            "property": "payload",
                                            "propertyType": "msg",
                                            "key": "topic",
                                            "joiner": "",
                                            "joinerType": "str",
                                            "accumulate": false,
                                            "timeout": "",
                                            "count": "",
                                            "reduceRight": false,
                                            "reduceExp": "",
                                            "reduceInit": "",
                                            "reduceInitType": "",
                                            "reduceFixup": "",
                                            "x": 810,
                                            "y": 140,
                                            "wires": [
                                                [
                                                    "4b071cab.37d0c4"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "fabf9af5.c72b38",
                                            "type": "split",
                                            "z": "ab16e708.7973e8",
                                            "name": "",
                                            "splt": "\\n",
                                            "spltType": "str",
                                            "arraySplt": 1,
                                            "arraySpltType": "len",
                                            "stream": false,
                                            "addname": "",
                                            "x": 380,
                                            "y": 180,
                                            "wires": [
                                                [
                                                    "2c13cf5c.73981"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "2c13cf5c.73981",
                                            "type": "function",
                                            "z": "ab16e708.7973e8",
                                            "name": "to HEX String Byte Format",
                                            "func": "if (typeof(msg.payload) === \"string\"){\n    msg.payload = Number(msg.payload);\n    if (isNaN(msg.payload) ) return null;\n}\nmsg.payload=Math.floor(msg.payload);\nmsg.payload= (msg.payload.toString(16)).toUpperCase();\nif ((msg.payload).length%2 > 0) msg.payload = '0' + msg.payload;\n\nreturn msg;",
                                            "outputs": 1,
                                            "noerr": 0,
                                            "initialize": "",
                                            "finalize": "",
                                            "x": 600,
                                            "y": 180,
                                            "wires": [
                                                [
                                                    "63d1eccf.a09034"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "63d1eccf.a09034",
                                            "type": "join",
                                            "z": "ab16e708.7973e8",
                                            "name": "",
                                            "mode": "auto",
                                            "build": "string",
                                            "property": "payload",
                                            "propertyType": "msg",
                                            "key": "topic",
                                            "joiner": "",
                                            "joinerType": "str",
                                            "accumulate": false,
                                            "timeout": "",
                                            "count": "",
                                            "reduceRight": false,
                                            "reduceExp": "",
                                            "reduceInit": "",
                                            "reduceInitType": "num",
                                            "reduceFixup": "",
                                            "x": 810,
                                            "y": 180,
                                            "wires": [
                                                [
                                                    "19ca6af6.1e37c5"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "4b071cab.37d0c4",
                                            "type": "change",
                                            "z": "ab16e708.7973e8",
                                            "name": "",
                                            "rules": [
                                                {
                                                    "t": "change",
                                                    "p": "payload",
                                                    "pt": "msg",
                                                    "from": ",",
                                                    "fromt": "str",
                                                    "to": "",
                                                    "tot": "str"
                                                }
                                            ],
                                            "action": "",
                                            "property": "",
                                            "from": "",
                                            "to": "",
                                            "reg": false,
                                            "x": 1000,
                                            "y": 140,
                                            "wires": [
                                                []
                                            ]
                                        },
                                        {
                                            "id": "19ca6af6.1e37c5",
                                            "type": "split",
                                            "z": "ab16e708.7973e8",
                                            "name": "",
                                            "splt": "\\n",
                                            "spltType": "str",
                                            "arraySplt": 1,
                                            "arraySpltType": "len",
                                            "stream": false,
                                            "addname": "",
                                            "x": 960,
                                            "y": 180,
                                            "wires": [
                                                [
                                                    "65fca19a.41ef9"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "65fca19a.41ef9",
                                            "type": "join",
                                            "z": "ab16e708.7973e8",
                                            "name": "",
                                            "mode": "custom",
                                            "build": "string",
                                            "property": "payload",
                                            "propertyType": "msg",
                                            "key": "topic",
                                            "joiner": "",
                                            "joinerType": "str",
                                            "accumulate": false,
                                            "timeout": "",
                                            "count": "",
                                            "reduceRight": false,
                                            "reduceExp": "",
                                            "reduceInit": "",
                                            "reduceInitType": "",
                                            "reduceFixup": "",
                                            "x": 1110,
                                            "y": 180,
                                            "wires": [
                                                []
                                            ]
                                        },
                                        {
                                            "id": "2191832.9e0d37c",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "1040403",
                                            "payloadType": "num",
                                            "x": 2120,
                                            "y": 3600,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "9b87093.1e4b4f8",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "1040403",
                                            "payloadType": "str",
                                            "x": 2120,
                                            "y": 3640,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "6862064f.d059e8",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "104,04,03",
                                            "payloadType": "str",
                                            "x": 2120,
                                            "y": 3680,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "4470c439.42ae6c",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "255,0,255",
                                            "payloadType": "str",
                                            "x": 2120,
                                            "y": 3760,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "a612a150.79fa",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "Hallo",
                                            "payloadType": "str",
                                            "x": 2130,
                                            "y": 3560,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "a807801e.86536",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "[2,6,99]",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "[2,6,99]",
                                            "payloadType": "jsonata",
                                            "x": 2130,
                                            "y": 3800,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "3ee98195.e48d4e",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "['ab','cd',99]",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "['ab','cd',99]",
                                            "payloadType": "jsonata",
                                            "x": 2110,
                                            "y": 3840,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "69d5b78b.9a1348",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "[99]",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "[99]",
                                            "payloadType": "jsonata",
                                            "x": 2130,
                                            "y": 3880,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "620be0a5.46383",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "[99,'255']",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "[99,'255']",
                                            "payloadType": "jsonata",
                                            "x": 2120,
                                            "y": 3920,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "81373293.b970d",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "[99,'ef']",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "[99,'ef']",
                                            "payloadType": "jsonata",
                                            "x": 2130,
                                            "y": 3960,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "a41dba5d.037848",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "{\"Rot\":255,\"Grün\":255,\"Blau\":0}",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "{\"Rot\":255,\"Grün\":0,\"Blau\":255}",
                                            "payloadType": "json",
                                            "x": 2050,
                                            "y": 4000,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "a2229b55.07ef38",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "{\"Rot\":255,\"Grün\":\"128\",\"Blau\":0}",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "{\"Rot\":255,\"Grün\":\"128\",\"Blau\":0}",
                                            "payloadType": "json",
                                            "x": 2050,
                                            "y": 4040,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "8455c0a1.f7aab",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "{\"Rot\":255,\"Grün\":\"gh\",\"Blau\":0}",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "{\"Rot\":255,\"Grün\":\"gh\",\"Blau\":0}",
                                            "payloadType": "json",
                                            "x": 2050,
                                            "y": 4080,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "bdc50d1b.f93bd",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "\"11806311026742\"",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "11806311026742",
                                            "payloadType": "str",
                                            "x": 2090,
                                            "y": 3720,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "aa69cddf.3210e",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "15.6",
                                            "payloadType": "str",
                                            "x": 2130,
                                            "y": 3520,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "f5cea9b4.72e1a8",
                                            "type": "inject",
                                            "z": "6e170384.60c96c",
                                            "name": "",
                                            "props": [
                                                {
                                                    "p": "payload"
                                                }
                                            ],
                                            "repeat": "",
                                            "crontab": "",
                                            "once": false,
                                            "onceDelay": 0.1,
                                            "topic": "",
                                            "payload": "15.6",
                                            "payloadType": "num",
                                            "x": 2130,
                                            "y": 3480,
                                            "wires": [
                                                [
                                                    "333333a7.cfa17c"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "333333a7.cfa17c",
                                            "type": "subflow:ab16e708.7973e8",
                                            "z": "6e170384.60c96c",
                                            "name": "",
                                            "env": [],
                                            "x": 2600,
                                            "y": 3840,
                                            "wires": [
                                                [
                                                    "5fb9015.fbd98",
                                                    "7af82e5f.719f4",
                                                    "f4d59886.753238"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "7af82e5f.719f4",
                                            "type": "change",
                                            "z": "6e170384.60c96c",
                                            "name": "Präfix 0x",
                                            "rules": [
                                                {
                                                    "t": "set",
                                                    "p": "payload",
                                                    "pt": "msg",
                                                    "to": "'0x' & payload",
                                                    "tot": "jsonata"
                                                }
                                            ],
                                            "action": "",
                                            "property": "",
                                            "from": "",
                                            "to": "",
                                            "reg": false,
                                            "x": 2790,
                                            "y": 3880,
                                            "wires": [
                                                [
                                                    "5fb9015.fbd98"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "f4d59886.753238",
                                            "type": "change",
                                            "z": "6e170384.60c96c",
                                            "name": "Präfix #",
                                            "rules": [
                                                {
                                                    "t": "set",
                                                    "p": "payload",
                                                    "pt": "msg",
                                                    "to": "'#' & payload",
                                                    "tot": "jsonata"
                                                }
                                            ],
                                            "action": "",
                                            "property": "",
                                            "from": "",
                                            "to": "",
                                            "reg": false,
                                            "x": 2800,
                                            "y": 3920,
                                            "wires": [
                                                [
                                                    "5fb9015.fbd98"
                                                ]
                                            ]
                                        },
                                        {
                                            "id": "5fb9015.fbd98",
                                            "type": "debug",
                                            "z": "6e170384.60c96c",
                                            "name": "",
                                            "active": true,
                                            "tosidebar": true,
                                            "console": false,
                                            "tostatus": false,
                                            "complete": "false",
                                            "statusVal": "",
                                            "statusType": "auto",
                                            "x": 2990,
                                            "y": 3840,
                                            "wires": []
                                        }
                                      ]
                                      
                                      

                                      Der Hashtag wird über eine ChangeNode- vorangestellt.

                                      B Offline
                                      B Offline
                                      Bacado
                                      schrieb am zuletzt editiert von
                                      #40

                                      @mickym hatte ich dann auch gefunden und es klappt auch schon... verstehe auch nicht wieso man im HabPanel nicht direkt das ganze als Hex oder RGB oder HSL ausgeben kann. Ne da muss man erst nen translate machen. Vielen lieben dank das du da so krassen support leistest :+1:

                                      1 Antwort Letzte Antwort
                                      1
                                      • mickymM mickym

                                        @bacado sagte in HEX in RGB Umwandeln?:

                                        @mickym hey, wie würde das ganze den anders rum aussehen von RBG zu HEX hab zwar bei nodered nen Converter gefunden aber der gibt keinen wert raus. Scheinbar bin ich einfach noch zu unerfahren in nodered.

                                        Schau mal - da hab ich mal was gebastelt. ;)

                                        https://forum.iobroker.net/assets/uploads/files/1616066608668-9ea2e8be-570b-430d-80f4-b81fb8520f83-image.png

                                        Sorry wollte den Thread posten: https://forum.iobroker.net/topic/43271/konvertierung-byte-nach-dezimal-und-umgekehrt

                                        Wenn Du den unteren Flow importierst bekommst eine neue Nodes als Subflow:

                                        f544a80b-d84e-4ce0-a187-bf98fe55b8ac-image.png

                                        dem kannst entweder ein RGB Objekt oder Array übergeben oder auch einen mit Kommas separierten String der RGB Werte nutzen.

                                        Basis des Flows ist der .toString(16) Kommando im JS: https://stackoverflow.com/questions/39651531/why-does-tostring16-convert-rgb-decimal-or-other-inputs-into-a-hexidecimal

                                        So was kann man natürlich auch im Blockly implementieren, aber dafür bin ich kein Fan.

                                        B Offline
                                        B Offline
                                        Bacado
                                        schrieb am zuletzt editiert von
                                        #41

                                        @mickym okay also das funtz aber noch nicht so ganz rund. Evtl. hab ich was übersehen aber Hex farbcodes sind immer #+6 zeichen, der Ausgabewert den ich bekomm sind aber immer 8 zeichen. Hab ich was übersehen was ich noch umstellen muss?

                                        mickymM 1 Antwort Letzte Antwort
                                        0
                                        • B Bacado

                                          @mickym okay also das funtz aber noch nicht so ganz rund. Evtl. hab ich was übersehen aber Hex farbcodes sind immer #+6 zeichen, der Ausgabewert den ich bekomm sind aber immer 8 zeichen. Hab ich was übersehen was ich noch umstellen muss?

                                          mickymM Online
                                          mickymM Online
                                          mickym
                                          Most Active
                                          schrieb am zuletzt editiert von mickym
                                          #42

                                          @bacado Also wenn Du meinen Beispielflow importiert hast, das sind doch 6 Zeichen. Wie schaut denn Dein Input aus?
                                          c1805139-3551-45b0-9d92-ebdd78eb501d-image.png

                                          Wenn Du übrigens ein Objekt verwendest, ist die Bezeichnung egal, das 1. Byte ist immer Rot, dann Grün und dann Blau:

                                          2d4deb0e-428b-422d-9994-330243f76a98-image.png

                                          Jeder Flow bzw. jedes Script, das ich hier poste implementiert jeder auf eigene Gefahr. Flows und Scripts können Fehler aufweisen und weder der Seitenbetreiber noch ich persönlich können hierfür haftbar gemacht werden. Das gleiche gilt für Empfehlungen aller Art.

                                          B 1 Antwort Letzte Antwort
                                          0
                                          Antworten
                                          • In einem neuen Thema antworten
                                          Anmelden zum Antworten
                                          • Älteste zuerst
                                          • Neuste zuerst
                                          • Meiste Stimmen


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate
                                          FAQ Cloud / IOT
                                          HowTo: Node.js-Update
                                          HowTo: Backup/Restore
                                          Downloads
                                          BLOG

                                          531

                                          Online

                                          32.7k

                                          Benutzer

                                          82.3k

                                          Themen

                                          1.3m

                                          Beiträge
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Anmelden

                                          • Du hast noch kein Konto? Registrieren

                                          • Anmelden oder registrieren, um zu suchen
                                          • Erster Beitrag
                                            Letzter Beitrag
                                          0
                                          • Home
                                          • Aktuell
                                          • Tags
                                          • Ungelesen 0
                                          • Kategorien
                                          • Unreplied
                                          • Beliebt
                                          • GitHub
                                          • Docu
                                          • Hilfe