Node-Red organisieren mit link-in bzw. link-out am Beispiel: Covid-19 Dashboard

Wie können die Flows in NodeRED organisiert werden? Damit ein Flow nicht überladen wird und auch um die GUI von der Logik zu trennen (MVC, Model View Controller Konzept) können die link-in bzw. link-out Nodes verwendet werden. Das sind diese:

Node-Red organisieren mit link-in bzw. link-out am Beispiel: Covid-19 Dashboard

Die link-out Nodes werden in den Quell Flow integriert, z.B.
Node-Red organisieren mit link-in bzw. link-out am Beispiel: Covid-19 Dashboard

Und in den neuen Ziel Flow die link-in:

Node-Red organisieren mit link-in bzw. link-out am Beispiel: Covid-19 Dashboard

Schon haben wir ein Dashboard:

Node-Red organisieren mit link-in bzw. link-out am Beispiel: Covid-19 Dashboard

Hier der Code des Covid-19 Dashboards:

[
    {
        "id": "e5fe4838.e62b68",
        "type": "tab",
        "label": "Corona Dashboard",
        "disabled": false,
        "info": ""
    },
    {
        "id": "61f1bbef.1e19bc",
        "type": "ui_gauge",
        "z": "e5fe4838.e62b68",
        "name": "Bestätigt",
        "group": "9a7db4b9.81f32",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "Bestätigt",
        "label": "Personen",
        "format": "{{msg.payload | number:0}}",
        "min": 0,
        "max": "50000",
        "colors": [
            "#e5e500",
            "#e6e600",
            "#e5e500"
        ],
        "seg1": "",
        "seg2": "",
        "x": 680,
        "y": 160,
        "wires": []
    },
    {
        "id": "c44c7747.fd9098",
        "type": "function",
        "z": "e5fe4838.e62b68",
        "name": "Wert ermitteln",
        "func": "// Hier das gewünschte Land angeben\nvar land = \"Germany\"\n\n// Suche den Index des Land\nfor (var i = 0; i < msg.payload.length; i++){\n    if (msg.payload[i].countryRegion == land ){\n        land = i\n        break\n    }\n}        \n\nvar anzahl = msg.payload[land].confirmed\n\nmsg.payload = anzahl\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 500,
        "y": 160,
        "wires": [
            [
                "61f1bbef.1e19bc"
            ]
        ]
    },
    {
        "id": "78c20335.cf2564",
        "type": "ui_gauge",
        "z": "e5fe4838.e62b68",
        "name": "Gestorben",
        "group": "9a7db4b9.81f32",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "Gestorben",
        "label": "Personen",
        "format": "{{msg.payload | number:0}}",
        "min": 0,
        "max": "500",
        "colors": [
            "#ff4f3e",
            "#ff4c36",
            "#ff493f"
        ],
        "seg1": "",
        "seg2": "",
        "x": 690,
        "y": 200,
        "wires": []
    },
    {
        "id": "4e48b5ce.a13d24",
        "type": "function",
        "z": "e5fe4838.e62b68",
        "name": "Wert ermitteln",
        "func": "// Hier das gewünschte Land angeben\nvar land = \"Germany\"\n\n// Suche den Index des Land\nfor (var i = 0; i < msg.payload.length; i++){\n    if (msg.payload[i].countryRegion == land ){\n        land = i\n        break\n    }\n}        \n\nvar anzahl = msg.payload[land].deaths\n\nmsg.payload = anzahl\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 500,
        "y": 200,
        "wires": [
            [
                "78c20335.cf2564"
            ]
        ]
    },
    {
        "id": "3b13ce0b.da418a",
        "type": "ui_gauge",
        "z": "e5fe4838.e62b68",
        "name": "Genesen",
        "group": "9a7db4b9.81f32",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "Genesen",
        "label": "Personen",
        "format": "{{msg.payload | number:0}}",
        "min": 0,
        "max": "500",
        "colors": [
            "#46b22a",
            "#45b22a",
            "#45b22a"
        ],
        "seg1": "",
        "seg2": "",
        "x": 680,
        "y": 240,
        "wires": []
    },
    {
        "id": "42b25b9.3a079a4",
        "type": "function",
        "z": "e5fe4838.e62b68",
        "name": "Wert ermitteln",
        "func": "// Hier das gewünschte Land angeben\nvar land = \"Germany\"\n\n// Suche den Index des Land\nfor (var i = 0; i < msg.payload.length; i++){\n    if (msg.payload[i].countryRegion == land ){\n        land = i\n        break\n    }\n}        \n\nvar anzahl = msg.payload[land].recovered\n\nmsg.payload = anzahl\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 500,
        "y": 240,
        "wires": [
            [
                "3b13ce0b.da418a"
            ]
        ]
    },
    {
        "id": "ab1d62f3.d098f8",
        "type": "link in",
        "z": "e5fe4838.e62b68",
        "name": "Corona Dashboard",
        "links": [
            "ca102a5a.f531e",
            "fa301f7e.a515e8"
        ],
        "x": 275,
        "y": 200,
        "wires": [
            [
                "c44c7747.fd9098",
                "4e48b5ce.a13d24",
                "42b25b9.3a079a4"
            ]
        ]
    },
    {
        "id": "53442036.3b67b8",
        "type": "comment",
        "z": "e5fe4838.e62b68",
        "name": "www.wenzlaff.info",
        "info": "",
        "x": 710,
        "y": 80,
        "wires": []
    },
    {
        "id": "3fca9c6d.9cd794",
        "type": "link in",
        "z": "e5fe4838.e62b68",
        "name": "",
        "links": [
            "fa301f7e.a515e8"
        ],
        "x": 275,
        "y": 380,
        "wires": [
            [
                "fd2d76fa.0bb928",
                "86e1a9de.f78a8",
                "7f0f952f.fb10c4"
            ]
        ]
    },
    {
        "id": "747550fc.314aa8",
        "type": "ui_gauge",
        "z": "e5fe4838.e62b68",
        "name": "Bestätigt",
        "group": "24fb8d4d.6a1dba",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "Bestätigt",
        "label": "Personen",
        "format": "{{msg.payload | number:0}}",
        "min": 0,
        "max": "500000",
        "colors": [
            "#e5e500",
            "#e6e600",
            "#e5e500"
        ],
        "seg1": "",
        "seg2": "",
        "x": 680,
        "y": 340,
        "wires": []
    },
    {
        "id": "fd2d76fa.0bb928",
        "type": "function",
        "z": "e5fe4838.e62b68",
        "name": "Wert ermitteln",
        "func": "var anzahl = msg.payload.confirmed.value\n\nmsg.payload = anzahl\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 500,
        "y": 340,
        "wires": [
            [
                "747550fc.314aa8"
            ]
        ]
    },
    {
        "id": "68266eb.034aa1",
        "type": "ui_gauge",
        "z": "e5fe4838.e62b68",
        "name": "Gestorben",
        "group": "24fb8d4d.6a1dba",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "Gestorben",
        "label": "Personen",
        "format": "{{msg.payload | number:0}}",
        "min": 0,
        "max": "50000",
        "colors": [
            "#ff4f3e",
            "#ff4c36",
            "#ff493f"
        ],
        "seg1": "",
        "seg2": "",
        "x": 690,
        "y": 380,
        "wires": []
    },
    {
        "id": "86e1a9de.f78a8",
        "type": "function",
        "z": "e5fe4838.e62b68",
        "name": "Wert ermitteln",
        "func": "var anzahl = msg.payload.deaths.value\n\nmsg.payload = anzahl\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 500,
        "y": 380,
        "wires": [
            [
                "68266eb.034aa1"
            ]
        ]
    },
    {
        "id": "f3857e2c.676af8",
        "type": "ui_gauge",
        "z": "e5fe4838.e62b68",
        "name": "Genesen",
        "group": "24fb8d4d.6a1dba",
        "order": 0,
        "width": 0,
        "height": 0,
        "gtype": "gage",
        "title": "Genesen",
        "label": "Personen",
        "format": "{{msg.payload | number:0}}",
        "min": 0,
        "max": "500000",
        "colors": [
            "#46b22a",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "x": 680,
        "y": 420,
        "wires": []
    },
    {
        "id": "7f0f952f.fb10c4",
        "type": "function",
        "z": "e5fe4838.e62b68",
        "name": "Wert ermitteln",
        "func": "var anzahl = msg.payload.recovered.value\n\nmsg.payload = anzahl\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 500,
        "y": 420,
        "wires": [
            [
                "f3857e2c.676af8"
            ]
        ]
    },
    {
        "id": "b4c4712e.2309a8",
        "type": "comment",
        "z": "e5fe4838.e62b68",
        "name": "Covid-19 Dashboard",
        "info": "",
        "x": 510,
        "y": 80,
        "wires": []
    },
    {
        "id": "9a7db4b9.81f32",
        "type": "ui_group",
        "z": "",
        "name": "Covid-19 in Deutschland",
        "tab": "9f205757.68494",
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "24fb8d4d.6a1dba",
        "type": "ui_group",
        "z": "",
        "name": "Covid-19 Weltweit",
        "tab": "9f205757.68494",
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "9f205757.68494",
        "type": "ui_tab",
        "z": "",
        "name": "wenzlaff.de",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

Bleib Gesund!

Ähnliche Artikel:

  1. Corona Dashboard mit NodeRed erstellen
  2. Covid-19 NodeRED Ticker an Pushover und Twitter – update
  3. Wie können live Covid-19 Daten per Node-RED an Twitter und Pushover gesendet werden?

wallpaper-1019588
Algarve-Tourismus: Grünes Licht aus Großbritannien
wallpaper-1019588
#1100 [Session-Life] „Picture my Day“ Day #2021 ~ April
wallpaper-1019588
Neue Powerbank Xoro MPB 3000 erschienen
wallpaper-1019588
Mädels aufgepasst…