Thank you @zenofmud and @colin for your help so far!
Here is my current code if want to better understand my implementation.
[
{
"id": "5230c72.fadcf38",
"type": "tab",
"label": "Sheet 1",
"disabled": false,
"info": ""
},
{
"id": "56312c48.8f0e6c",
"type": "csv",
"z": "5230c72.fadcf38",
"name": "CSV",
"sep": ";",
"hdrin": "",
"hdrout": "",
"multi": "one",
"ret": "\\n",
"temp": "",
"skip": "0",
"x": 590,
"y": 360,
"wires": [
[
"160cad.9edb9353"
]
]
},
{
"id": "160cad.9edb9353",
"type": "switch",
"z": "5230c72.fadcf38",
"name": "",
"property": "payload.col1",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "str"
},
{
"t": "eq",
"v": "2",
"vt": "str"
},
{
"t": "eq",
"v": "3",
"vt": "str"
},
{
"t": "eq",
"v": "4",
"vt": "str"
},
{
"t": "eq",
"v": "5",
"vt": "str"
},
{
"t": "eq",
"v": "6",
"vt": "str"
},
{
"t": "eq",
"v": "7",
"vt": "str"
},
{
"t": "eq",
"v": "8",
"vt": "str"
},
{
"t": "eq",
"v": "9",
"vt": "str"
},
{
"t": "eq",
"v": "10",
"vt": "str"
},
{
"t": "eq",
"v": "",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 11,
"x": 780,
"y": 360,
"wires": [
[
"6ddda6b4.aaf7b8"
],
[
"b6e9d176.0eb6d8"
],
[],
[],
[],
[],
[],
[],
[],
[],
[]
]
},
{
"id": "29d7e93d.23936e",
"type": "mqtt in",
"z": "5230c72.fadcf38",
"name": "",
"topic": "test/t1",
"qos": "2",
"broker": "59cb4e43.e42fb",
"x": 210,
"y": 360,
"wires": [
[
"97ed4c25.d1a7c8"
]
]
},
{
"id": "53dbb778.2f0b08",
"type": "ui_text",
"z": "5230c72.fadcf38",
"group": "e638b37.019e95",
"order": 2,
"width": "2",
"height": "1",
"name": "",
"label": "",
"format": "{{msg.payload.col3}}",
"layout": "col-center",
"x": 1430,
"y": 200,
"wires": []
},
{
"id": "32832b61.5bba9c",
"type": "inject",
"z": "5230c72.fadcf38",
"name": "",
"topic": "",
"payload": "1;A;B;200",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 200,
"y": 480,
"wires": [
[
"97ed4c25.d1a7c8"
]
]
},
{
"id": "deea77d3.2c814",
"type": "inject",
"z": "5230c72.fadcf38",
"name": "",
"topic": "",
"payload": "2;C;D;400",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 200,
"y": 520,
"wires": [
[
"97ed4c25.d1a7c8"
]
]
},
{
"id": "7409000e.9243e8",
"type": "ui_text",
"z": "5230c72.fadcf38",
"group": "e638b37.019e95",
"order": 3,
"width": "2",
"height": "1",
"name": "",
"label": "",
"format": "{{msg.payload.col2}}",
"layout": "col-center",
"x": 1290,
"y": 180,
"wires": []
},
{
"id": "808c8415.6bc02",
"type": "ui_text",
"z": "5230c72.fadcf38",
"group": "8c992532.5fe8e8",
"order": 0,
"width": "0",
"height": "0",
"name": "",
"label": "",
"format": "{{msg.payload.col1}}",
"layout": "col-center",
"x": 1170,
"y": 280,
"wires": []
},
{
"id": "1513e89d.dee047",
"type": "ui_text",
"z": "5230c72.fadcf38",
"group": "8c992532.5fe8e8",
"order": 0,
"width": "2",
"height": "1",
"name": "",
"label": "",
"format": "{{msg.payload.col3}}",
"layout": "col-center",
"x": 1430,
"y": 320,
"wires": []
},
{
"id": "c7ab36ea.ffa0b8",
"type": "ui_text",
"z": "5230c72.fadcf38",
"group": "8c992532.5fe8e8",
"order": 0,
"width": "0",
"height": "0",
"name": "",
"label": "",
"format": "{{msg.payload.col2}}",
"layout": "col-center",
"x": 1290,
"y": 300,
"wires": []
},
{
"id": "bbb3d26d.3212e8",
"type": "ui_text_input",
"z": "5230c72.fadcf38",
"name": "",
"label": "Max value",
"group": "5751eef7.ce4d1",
"order": 0,
"width": "4",
"height": "1",
"passthru": true,
"mode": "text",
"delay": "0",
"topic": "ui_gauge.max",
"x": 1190,
"y": 560,
"wires": [
[
"b84d275d.4a5a38"
]
]
},
{
"id": "8faaab0b.bbb8d8",
"type": "ui_gauge",
"z": "5230c72.fadcf38",
"name": "",
"group": "8c992532.5fe8e8",
"order": 0,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "",
"label": "",
"format": "{{msg.payload.col4}}",
"min": 0,
"max": "10000",
"colors": [
"#b3022f",
"#e6e600",
"#56fa07"
],
"seg1": "",
"seg2": "",
"x": 1570,
"y": 340,
"wires": []
},
{
"id": "b84d275d.4a5a38",
"type": "function",
"z": "5230c72.fadcf38",
"name": "",
"func": "var x=msg.payload\nmsg.ui_control = {\"min\":0,\"max\":x}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1390,
"y": 560,
"wires": [
[
"8faaab0b.bbb8d8",
"dc05a1ae.070ef8"
]
]
},
{
"id": "dc05a1ae.070ef8",
"type": "ui_gauge",
"z": "5230c72.fadcf38",
"name": "",
"group": "e638b37.019e95",
"order": 5,
"width": "2",
"height": "2",
"gtype": "wave",
"title": "",
"label": "",
"format": "{{msg.payload.col4}}",
"min": 0,
"max": "10000",
"colors": [
"#b3022f",
"#e6e600",
"#56fa07"
],
"seg1": "",
"seg2": "",
"x": 1570,
"y": 220,
"wires": []
},
{
"id": "438d53d0.20f9f4",
"type": "ui_text",
"z": "5230c72.fadcf38",
"group": "e638b37.019e95",
"order": 1,
"width": "2",
"height": "1",
"name": "",
"label": "",
"format": "{{msg.payload.col1}}",
"layout": "col-center",
"x": 1170,
"y": 160,
"wires": []
},
{
"id": "97ed4c25.d1a7c8",
"type": "function",
"z": "5230c72.fadcf38",
"name": "",
"func": "\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 450,
"y": 360,
"wires": [
[
"56312c48.8f0e6c"
]
]
},
{
"id": "6ddda6b4.aaf7b8",
"type": "function",
"z": "5230c72.fadcf38",
"name": "",
"func": "\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1030,
"y": 160,
"wires": [
[
"438d53d0.20f9f4",
"7409000e.9243e8",
"53dbb778.2f0b08",
"dc05a1ae.070ef8"
]
]
},
{
"id": "b6e9d176.0eb6d8",
"type": "function",
"z": "5230c72.fadcf38",
"name": "",
"func": "\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1030,
"y": 280,
"wires": [
[
"808c8415.6bc02",
"c7ab36ea.ffa0b8",
"1513e89d.dee047",
"8faaab0b.bbb8d8"
]
]
},
{
"id": "83c555f2.9042d",
"type": "inject",
"z": "5230c72.fadcf38",
"name": "",
"topic": "",
"payload": "1;E;F;300",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 200,
"y": 580,
"wires": [
[
"97ed4c25.d1a7c8"
]
]
},
{
"id": "138d9a7c.1cadc6",
"type": "inject",
"z": "5230c72.fadcf38",
"name": "",
"topic": "",
"payload": "2;G;H;400",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 200,
"y": 620,
"wires": [
[
"97ed4c25.d1a7c8"
]
]
},
{
"id": "5d41fd9c.cf4584",
"type": "comment",
"z": "5230c72.fadcf38",
"name": "I did the switch to divide the msg.payload according to msg.payload.col1",
"info": "",
"x": 580,
"y": 220,
"wires": []
},
{
"id": "91fec1c2.a94e",
"type": "comment",
"z": "5230c72.fadcf38",
"name": "Display the values on textboxes where each dashboard group corresponds to msg.payload.col1",
"info": "",
"x": 1300,
"y": 120,
"wires": []
},
{
"id": "cc622d36.d44948",
"type": "comment",
"z": "5230c72.fadcf38",
"name": "To emulate the MQTT messages",
"info": "",
"x": 150,
"y": 420,
"wires": []
},
{
"id": "59cb4e43.e42fb",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "test.mosquitto.org",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "e638b37.019e95",
"type": "ui_group",
"z": "5230c72.fadcf38",
"name": "Posto1",
"tab": "84499b6b.8ac208",
"order": 2,
"disp": false,
"width": "2",
"collapse": false
},
{
"id": "8c992532.5fe8e8",
"type": "ui_group",
"z": "",
"name": "Posto2",
"tab": "84499b6b.8ac208",
"order": 3,
"disp": false,
"width": "2",
"collapse": false
},
{
"id": "5751eef7.ce4d1",
"type": "ui_group",
"z": "",
"name": "ADMIN",
"tab": "ce27b287.88fe38",
"order": 1,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "84499b6b.8ac208",
"type": "ui_tab",
"z": "5230c72.fadcf38",
"name": "Home",
"icon": "assessment",
"order": "1"
},
{
"id": "ce27b287.88fe38",
"type": "ui_tab",
"z": "",
"name": "ADMIN",
"icon": "dashboard",
"order": 2
}
]
@Colin, this is exactly what I intend. To save my current dashboard data to a file but I do not know which strategy should I use. Could you please give me an idea?
Thanks again!