Using dashboard drop down to pass payload based on topic

Hi, I am new to node red. I am trying to get data from multiple devices and sent it to a dashboard page using drop down to pass the right payload.

here is the example


[
    {
        "id": "626ec5dce53a65fc",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "23bec8e04e6406c5",
        "type": "eth-ip in",
        "z": "626ec5dce53a65fc",
        "endpoint": "da4721585531cece",
        "mode": "all",
        "variable": "",
        "program": "",
        "name": "",
        "gatherMetrics": false,
        "includeTimestamp": false,
        "x": 150,
        "y": 200,
        "wires": [
            [
                "4d475625e7ec1cc9"
            ]
        ]
    },
    {
        "id": "ae66af99dfa009a3",
        "type": "eth-ip in",
        "z": "626ec5dce53a65fc",
        "endpoint": "eb6f7232de6999ca",
        "mode": "all",
        "variable": "",
        "program": "",
        "name": "",
        "x": 150,
        "y": 260,
        "wires": [
            [
                "1f5ee82823ba4c6d"
            ]
        ]
    },
    {
        "id": "e3692c990159e0f5",
        "type": "eth-ip in",
        "z": "626ec5dce53a65fc",
        "endpoint": "926eb7ee9b1aedaa",
        "mode": "all",
        "variable": "",
        "program": "",
        "name": "",
        "gatherMetrics": false,
        "includeTimestamp": false,
        "x": 150,
        "y": 140,
        "wires": [
            [
                "0d36b2ee0175208a"
            ]
        ]
    },
    {
        "id": "0d36b2ee0175208a",
        "type": "change",
        "z": "626ec5dce53a65fc",
        "name": "msg.topic=1",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 310,
        "y": 140,
        "wires": [
            [
                "fca6e19d63574137",
                "fe4926d785b2f1ed"
            ]
        ]
    },
    {
        "id": "4d475625e7ec1cc9",
        "type": "change",
        "z": "626ec5dce53a65fc",
        "name": "msg.topic=2",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "2",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 310,
        "y": 200,
        "wires": [
            [
                "fca6e19d63574137",
                "9294d4feb069bba0"
            ]
        ]
    },
    {
        "id": "1f5ee82823ba4c6d",
        "type": "change",
        "z": "626ec5dce53a65fc",
        "name": "msg.topic=2",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "3",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 310,
        "y": 260,
        "wires": [
            [
                "fca6e19d63574137"
            ]
        ]
    },
    {
        "id": "fca6e19d63574137",
        "type": "ui_dropdown",
        "z": "626ec5dce53a65fc",
        "name": "",
        "label": "",
        "tooltip": "",
        "place": "Select option",
        "group": "d315711a6f3aaf83",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": true,
        "multiple": false,
        "options": [
            {
                "label": "Cell1",
                "value": "1",
                "type": "str"
            },
            {
                "label": "Cell2",
                "value": "2",
                "type": "str"
            },
            {
                "label": "Cell3",
                "value": "3",
                "type": "str"
            }
        ],
        "payload": "",
        "topic": "topic",
        "topicType": "msg",
        "className": "",
        "x": 640,
        "y": 160,
        "wires": [
            [
                "4eea6591cc091c48"
            ]
        ]
    },
    {
        "id": "4eea6591cc091c48",
        "type": "ui_numeric",
        "z": "626ec5dce53a65fc",
        "name": "",
        "label": "numeric",
        "tooltip": "",
        "group": "d315711a6f3aaf83",
        "order": 2,
        "width": 0,
        "height": 0,
        "wrap": false,
        "passthru": true,
        "topic": "topic",
        "topicType": "msg",
        "format": "{{msg.payload.PDM.Month.Day[18].Done_Part}}",
        "min": 0,
        "max": 10,
        "step": 1,
        "className": "",
        "x": 800,
        "y": 160,
        "wires": [
            []
        ]
    },
    {
        "id": "fe4926d785b2f1ed",
        "type": "debug",
        "z": "626ec5dce53a65fc",
        "name": "debug 3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 540,
        "y": 80,
        "wires": []
    },
    {
        "id": "9294d4feb069bba0",
        "type": "debug",
        "z": "626ec5dce53a65fc",
        "name": "debug 4",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 560,
        "y": 280,
        "wires": []
    },
    {
        "id": "da4721585531cece",
        "type": "eth-ip endpoint",
        "address": "10.6.9.20",
        "slot": "0",
        "cycletime": "5000",
        "timeout": "10000",
        "name": "Cell 2",
        "connectedMess": false,
        "vartable": {
            "": {
                "PDM.Month.Day[18].Done_Part": {
                    "type": "INT",
                    "mapping": ""
                }
            }
        }
    },
    {
        "id": "eb6f7232de6999ca",
        "type": "eth-ip endpoint",
        "address": "10.6.9.30",
        "slot": "0",
        "cycletime": "3000",
        "name": "Cell 3",
        "vartable": {
            "": {
                "PDM_Live.Name": {
                    "type": "STRING",
                    "mapping": ""
                },
                "PDM_Live.Done_Part": {
                    "type": "INT",
                    "mapping": ""
                },
                "Cell_Seq_Mapping.CNC_Running": {
                    "type": "BOOL",
                    "mapping": ""
                },
                "PDM_Live.Part_Cycle_Time": {
                    "type": "REAL",
                    "mapping": ""
                },
                "PDM_Live.Tot_DownTime": {
                    "type": "REAL",
                    "mapping": ""
                },
                "PDM_Live.Raw_Part": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.L_CNC_Run_hr1": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.L_CNC_Run_hr2": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.L_CNC_Run_Min1": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.L_CNC_Run_Min2": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.L_CNC_Run_Sec1": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.L_CNC_Run_Sec2": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.ROB_Run_hr1": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.ROB_Run_hr2": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.ROB_Run_Min1": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.ROB_Run_Min2": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.ROB_Run_Sec1": {
                    "type": "INT",
                    "mapping": ""
                },
                "Timesheet.ROB_Run_Sec2": {
                    "type": "INT",
                    "mapping": ""
                },
                "PDM.Month.Day[18].Done_Part": {
                    "type": "INT",
                    "mapping": ""
                },
                "PDM.Months[0]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[1]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[2]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[3]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[4]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[5]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[6]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[7]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[8]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[9]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[10]": {
                    "type": "",
                    "mapping": ""
                },
                "PDM.Months[11]": {
                    "type": "",
                    "mapping": ""
                }
            }
        }
    },
    {
        "id": "926eb7ee9b1aedaa",
        "type": "eth-ip endpoint",
        "address": "10.6.9.10",
        "slot": "0",
        "cycletime": "3000",
        "timeout": 10000,
        "name": "Cell 1",
        "vartable": {
            "": {
                "PDM.Month.Day[18].Done_Part": {
                    "type": "INT",
                    "mapping": ""
                }
            }
        }
    },
    {
        "id": "d315711a6f3aaf83",
        "type": "ui_group",
        "name": "Default",
        "tab": "4e4e12d7425ccf54",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "4e4e12d7425ccf54",
        "type": "ui_tab",
        "name": "Live data",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

Hi and welcome

You maybe better of switching to dashboard 2 , as it is new and DB 1 is deprecated.

Here is a DB1 example to give you some ideas.

[{"id":"0c71a1906bca51a9","type":"inject","z":"626ec5dce53a65fc","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"test\":1}","payloadType":"json","x":120,"y":140,"wires":[["0d36b2ee0175208a"]]},{"id":"0d36b2ee0175208a","type":"change","z":"626ec5dce53a65fc","name":"msg.topic=1","rules":[{"t":"set","p":"topic","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":140,"wires":[["ed9f86f6cceb927d"]]},{"id":"ed9f86f6cceb927d","type":"join","z":"626ec5dce53a65fc","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":false,"accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":590,"y":260,"wires":[["9294d4feb069bba0","870bbd4478ef81cd"]]},{"id":"4d475625e7ec1cc9","type":"change","z":"626ec5dce53a65fc","name":"msg.topic=2","rules":[{"t":"set","p":"topic","pt":"msg","to":"2","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":200,"wires":[["ed9f86f6cceb927d"]]},{"id":"1f5ee82823ba4c6d","type":"change","z":"626ec5dce53a65fc","name":"msg.topic=2","rules":[{"t":"set","p":"topic","pt":"msg","to":"3","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":260,"wires":[["ed9f86f6cceb927d"]]},{"id":"fca6e19d63574137","type":"ui_dropdown","z":"626ec5dce53a65fc","name":"","label":"","tooltip":"","place":"Select option","group":"d315711a6f3aaf83","order":1,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"Cell1","value":"1","type":"str"},{"label":"Cell2","value":"2","type":"str"},{"label":"Cell3","value":"3","type":"str"}],"payload":"","topic":"dropdown","topicType":"str","className":"","x":280,"y":360,"wires":[["ed9f86f6cceb927d"]]},{"id":"9294d4feb069bba0","type":"debug","z":"626ec5dce53a65fc","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":80,"wires":[]},{"id":"870bbd4478ef81cd","type":"change","z":"626ec5dce53a65fc","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload[msg.payload.dropdown].test","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":260,"wires":[["4eea6591cc091c48"]]},{"id":"10a603ab445f5812","type":"inject","z":"626ec5dce53a65fc","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"test\":2}","payloadType":"json","x":120,"y":200,"wires":[["4d475625e7ec1cc9"]]},{"id":"661c97a6bd3bfc65","type":"inject","z":"626ec5dce53a65fc","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"test\":3}","payloadType":"json","x":120,"y":260,"wires":[["1f5ee82823ba4c6d"]]},{"id":"4eea6591cc091c48","type":"ui_numeric","z":"626ec5dce53a65fc","name":"","label":"numeric","tooltip":"","group":"d315711a6f3aaf83","order":2,"width":0,"height":0,"wrap":false,"passthru":false,"topic":"topic","topicType":"msg","format":"{{value}}","min":0,"max":10,"step":1,"className":"","x":800,"y":160,"wires":[[]]},{"id":"d315711a6f3aaf83","type":"ui_group","name":"Default","tab":"4e4e12d7425ccf54","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"4e4e12d7425ccf54","type":"ui_tab","name":"Live data","icon":"dashboard","disabled":false,"hidden":false}]

How to import/export a flow

Thank you, I will look into Dashboard 2.0

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.