# Sfm/relais/1/cmd

**URL:** <https://discourse.nodered.org/t/sfm-relais-1-cmd/101218>\
**Category:** Dashboard\
**Tags:** node-red-dashboard, dashboard-2\
**Created:** [8 June 2026 00:19 UTC](https://discourse.nodered.org/t/sfm-relais-1-cmd/101218 "2026-06-08T00:19:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maramblg12345-commit](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maramblg12345-commit/32/107459_2.png) [@maramblg12345-commit](https://discourse.nodered.org/u/maramblg12345-commit)\
**Post date:** [8 June 2026 00:19 UTC](https://discourse.nodered.org/t/sfm-relais-1-cmd/101218/1 "2026-06-08T00:19:47Z")

</div>

[  
{  
"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":   
}  
]

---

<div class="post-metadata">

**Author:** ![discourse\_ai\_spam](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@discourse\_ai\_spam](https://discourse.nodered.org/u/discourse_ai_spam)\
**Post date:** [8 June 2026 00:19 UTC](https://discourse.nodered.org/t/sfm-relais-1-cmd/101218/2 "2026-06-08T00:19:50Z")

</div>



---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 June 2026 06:20 UTC](https://discourse.nodered.org/t/sfm-relais-1-cmd/101218/3 "2026-06-08T06:20:22Z")

</div>

Is there a question there?

That looks like an AI built dashboard 1 flow, not dashboard 2.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 June 2026 11:54 UTC](https://discourse.nodered.org/t/sfm-relais-1-cmd/101218/4 "2026-06-08T11:54:14Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 July 2026 11:54 UTC](https://discourse.nodered.org/t/sfm-relais-1-cmd/101218/5 "2026-07-08T11:54:27Z")

</div>

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