Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Node-Red
    5. [Gelöst] Farbe in Text node ändern

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [Gelöst] Farbe in Text node ändern

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

      Guten Abend

      Ich versuche über Node Red meine Wallbox auszulesen und in Abhängig, ob aktiv oder pause, die Farbe des eingestellten Ladestrom im Dashboard anzuzeigen

      Generell den Ladestrom anzeigen ist ja kein Problem
      Versuche nun über das hier die Farbe zu ändern, komischerweise wird dann aber der angezeigte Wert in der richtigen Farbe hochgezählt

      nodered.jpg

      [
          {
              "id": "59c32b5bc1facdbb",
              "type": "ioBroker get",
              "z": "da4e1b55.2906b",
              "name": "WB_load",
              "topic": "kecontact.0.currentUser",
              "attrname": "payload",
              "payloadType": "value",
              "x": 480,
              "y": 660,
              "wires": [
                  [
                      "3568d48737df6395"
                  ]
              ]
          },
          {
              "id": "3568d48737df6395",
              "type": "function",
              "z": "da4e1b55.2906b",
              "name": "f_WB_load",
              "func": "const str = msg.payload\nmsg.payload = str;\nreturn msg;",
              "outputs": 1,
              "timeout": "",
              "noerr": 0,
              "initialize": "",
              "finalize": "",
              "libs": [],
              "x": 650,
              "y": 660,
              "wires": [
                  [
                      "b12b5ae3ad3944c8"
                  ]
              ]
          },
          {
              "id": "1092b1c72d1424d3",
              "type": "ioBroker get",
              "z": "da4e1b55.2906b",
              "name": "Enable User",
              "topic": "kecontact.0.enableUser",
              "attrname": "incolor",
              "payloadType": "value",
              "errOnInvalidState": "nothing",
              "x": 490,
              "y": 720,
              "wires": [
                  [
                      "b12b5ae3ad3944c8"
                  ]
              ]
          },
          {
              "id": "b12b5ae3ad3944c8",
              "type": "switch",
              "z": "da4e1b55.2906b",
              "name": "",
              "property": "incolor",
              "propertyType": "msg",
              "rules": [
                  {
                      "t": "true"
                  },
                  {
                      "t": "false"
                  }
              ],
              "checkall": "true",
              "repair": false,
              "outputs": 2,
              "x": 730,
              "y": 720,
              "wires": [
                  [
                      "2d21dd1c28d55a2b"
                  ],
                  [
                      "b3142ddf6e6058e9"
                  ]
              ]
          },
          {
              "id": "2d21dd1c28d55a2b",
              "type": "change",
              "z": "da4e1b55.2906b",
              "name": "",
              "rules": [
                  {
                      "t": "set",
                      "p": "fcolor",
                      "pt": "msg",
                      "to": "blue",
                      "tot": "str"
                  }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 920,
              "y": 700,
              "wires": [
                  [
                      "5a457c3ab9243da4"
                  ]
              ]
          },
          {
              "id": "b3142ddf6e6058e9",
              "type": "change",
              "z": "da4e1b55.2906b",
              "name": "",
              "rules": [
                  {
                      "t": "set",
                      "p": "fcolor",
                      "pt": "msg",
                      "to": "green",
                      "tot": "str"
                  }
              ],
              "action": "",
              "property": "",
              "from": "",
              "to": "",
              "reg": false,
              "x": 920,
              "y": 740,
              "wires": [
                  [
                      "5a457c3ab9243da4"
                  ]
              ]
          },
          {
              "id": "5a457c3ab9243da4",
              "type": "ui_text",
              "z": "da4e1b55.2906b",
              "group": "291784c0.74fa7c",
              "order": 20,
              "width": 0,
              "height": 0,
              "name": "",
              "label": "WB_load",
              "format": "<font face='arial'><font size=4><font color={{fcolor}}>{{msg.payload}}",
              "layout": "row-spread",
              "className": "",
              "style": false,
              "font": "",
              "fontSize": 16,
              "color": "#000000",
              "x": 1120,
              "y": 680,
              "wires": []
          },
          {
              "id": "291784c0.74fa7c",
              "type": "ui_group",
              "name": "TWS",
              "tab": "ff1df1fe.ccf768",
              "order": 1,
              "disp": true,
              "width": "6",
              "collapse": true
          },
          {
              "id": "ff1df1fe.ccf768",
              "type": "ui_tab",
              "name": "Home",
              "icon": "dashboard",
              "disabled": false,
              "hidden": false
          }
      ]
      
      

      Wenn ich das jetzt nochmal umstelle, wird der Wert richtig angezeigt

      nodered1.jpg
      wb_load.jpg

      wenn ich jetzt die Farben hinzunehme
      nodered2.jpg
      kommt das dabei raus
      wb_load1.jpg

      Was mache ich falsch?

      M 1 Reply Last reply Reply Quote 0
      • M
        matthesjimte @matthesjimte last edited by matthesjimte

        @matthesjimte

        Habe es jetzt nochmal geändert
        a4afe18e-9430-42bf-9362-aa1dee92d322-image.png
        und es sieht so aus als wenn es jetzt funktionieren würde.

        Mal schauen ob es dann morgen grün wird, wenn die Wallbox aus ihrer Pause erwacht

        So geht es jetzt

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

        Support us

        ioBroker
        Community Adapters
        Donate

        1.2k
        Online

        31.7k
        Users

        79.7k
        Topics

        1.3m
        Posts

        node-red
        1
        2
        439
        Loading More Posts
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes
        Reply
        • Reply as topic
        Log in to reply
        Community
        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
        The ioBroker Community 2014-2023
        logo