[
{
"id": "mqtt-broker-1",
"type": "mqtt-broker",
"name": "HiveMQ Cloud",
"broker": "914e6269132b47a4826a00f6fdd436a2.s1.eu.hivemq.cloud",
"port": "8883",
"tls": true,
"clientid": "nodered-sfm",
"usetls": true,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"credentials": {
"user": "Maram",
"password": "Maram2026"
}
},
{
"id": "tab-sfm",
"type": "tab",
"label": "SFM Master",
"disabled": false
},
{
"id": "ui-group-relais",
"type": "ui_group",
"name": "Commande Relais",
"tab": "ui-tab-main",
"order": 1,
"disp": true,
"width": "6"
},
{
"id": "ui-group-capteurs",
"type": "ui_group",
"name": "Capteurs",
"tab": "ui-tab-main",
"order": 2,
"disp": true,
"width": "6"
},
{
"id": "ui-group-alertes",
"type": "ui_group",
"name": "Alertes",
"tab": "ui-tab-main",
"order": 3,
"disp": true,
"width": "12"
},
{
"id": "ui-tab-main",
"type": "ui_tab",
"name": "Dashboard SFM",
"icon": "dashboard",
"order": 1
},
{
"id": "switch-relais-1",
"type": "ui_switch",
"z": "tab-sfm",
"name": "Relais 1",
"label": "Relais 1",
"tooltip": "",
"group": "ui-group-relais",
"order": 1,
"width": "3",
"height": "1",
"passthru": false,
"decouple": false,
"topic": "sfm/relais/1/cmd",
"topicType": "str",
"style": "",
"onvalue": "1",
"onvalueType": "str",
"offvalue": "0",
"offvalueType": "str",
"oncolor": "#00897B",
"offcolor": "#E53935",
"animate": true,
"x": 200,
"y": 100,
"wires": [["mqtt-out-relais-1"]]
},
{
"id": "switch-relais-2",
"type": "ui_switch",
"z": "tab-sfm",
"name": "Relais 2",
"label": "Relais 2",
"tooltip": "",
"group": "ui-group-relais",
"order": 2,
"width": "3",
"height": "1",
"passthru": false,
"decouple": false,
"topic": "sfm/relais/2/cmd",
"topicType": "str",
"style": "",
"onvalue": "1",
"onvalueType": "str",
"offvalue": "0",
"offvalueType": "str",
"oncolor": "#00897B",
"offcolor": "#E53935",
"animate": true,
"x": 200,
"y": 160,
"wires": [["mqtt-out-relais-2"]]
},
{
"id": "mqtt-out-relais-1",
"type": "mqtt out",
"z": "tab-sfm",
"name": "Pub Relais 1",
"topic": "sfm/relais/1/cmd",
"qos": "1",
"retain": "false",
"broker": "mqtt-broker-1",
"x": 450,
"y": 100,
"wires":
},
{
"id": "mqtt-out-relais-2",
"type": "mqtt out",
"z": "tab-sfm",
"name": "Pub Relais 2",
"topic": "sfm/relais/2/cmd",
"qos": "1",
"retain": "false",
"broker": "mqtt-broker-1",
"x": 450,
"y": 160,
"wires":
},
{
"id": "mqtt-in-temp",
"type": "mqtt in",
"z": "tab-sfm",
"name": "Sub Température",
"topic": "sfm/capteur/temp",
"qos": "1",
"datatype": "auto",
"broker": "mqtt-broker-1",
"x": 160,
"y": 300,
"wires": [["gauge-temp", "func-parse-temp"]]
},
{
"id": "func-parse-temp",
"type": "function",
"z": "tab-sfm",
"name": "Parse JSON capteur",
"func": "try {\n var data = JSON.parse(msg.payload);\n msg.payload = data.value;\n} catch(e) {\n msg.payload = parseFloat(msg.payload);\n}\nreturn msg;",
"outputs": 1,
"x": 400,
"y": 300,
"wires": [["gauge-temp"]]
},
{
"id": "gauge-temp",
"type": "ui_gauge",
"z": "tab-sfm",
"name": "Température",
"group": "ui-group-capteurs",
"order": 1,
"width": "3",
"height": "3",
"gtype": "gage",
"title": "Température",
"label": "°C",
"format": "{{value}}",
"min": 0,
"max": 100,
"colors": ["#00B5AD", "#F5A623", "#E53935"],
"seg1": "40",
"seg2": "70",
"x": 620,
"y": 300,
"wires":
},
{
"id": "mqtt-in-courant",
"type": "mqtt in",
"z": "tab-sfm",
"name": "Sub Courant",
"topic": "sfm/capteur/courant",
"qos": "1",
"datatype": "auto",
"broker": "mqtt-broker-1",
"x": 160,
"y": 380,
"wires": [["gauge-courant"]]
},
{
"id": "gauge-courant",
"type": "ui_gauge",
"z": "tab-sfm",
"name": "Courant",
"group": "ui-group-capteurs",
"order": 2,
"width": "3",
"height": "3",
"gtype": "gage",
"title": "Courant",
"label": "A",
"format": "{{value}}",
"min": 0,
"max": 50,
"colors": ["#00B5AD", "#F5A623", "#E53935"],
"seg1": "20",
"seg2": "40",
"x": 400,
"y": 380,
"wires":
},
{
"id": "mqtt-in-alerte",
"type": "mqtt in",
"z": "tab-sfm",
"name": "Sub Alertes",
"topic": "sfm/alerte",
"qos": "1",
"datatype": "auto",
"broker": "mqtt-broker-1",
"x": 160,
"y": 500,
"wires": [["func-alerte"]]
},
{
"id": "func-alerte",
"type": "function",
"z": "tab-sfm",
"name": "Format Alerte",
"func": "var now = new Date().toLocaleTimeString('fr-FR');\nvar payload = msg.payload;\ntry { payload = JSON.parse(msg.payload).message; } catch(e) {}\nmsg.payload = '[' + now + ']
' + payload;\nreturn msg;",
"outputs": 1,
"x": 370,
"y": 500,
"wires": [["notif-alerte", "text-alerte"]]
},
{
"id": "notif-alerte",
"type": "ui_toast",
"z": "tab-sfm",
"position": "top right",
"displayTime": "5",
"highlight": "#E53935",
"sendall": true,
"outputs": 0,
"ok": "OK",
"cancel": "",
"raw": false,
"topic": "",
"name": "Toast Alerte",
"x": 580,
"y": 480,
"wires":
},
{
"id": "text-alerte",
"type": "ui_text",
"z": "tab-sfm",
"group": "ui-group-alertes",
"order": 1,
"width": "12",
"height": "1",
"name": "Dernière alerte",
"label": "Dernière alerte :",
"format": "{{msg.payload}}",
"layout": "row-left",
"x": 580,
"y": 520,
"wires":
}
]
Is there a question there?
That looks like an AI built dashboard 1 flow, not dashboard 2.