Hello, I am still a beginner:
voila: I have a function with an if / else test which gives me either a "TATA" message or a "RORO" message and I would like if it is the tata message to display it in black or if it is the roro message display it in red.
at the same location in the dasboard. thank you
here is the little program to illustrate
[
{
"id": "4ab3cb90.f07ccc",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "a10b8dce.8e39e",
"type": "function",
"z": "4ab3cb90.f07ccc",
"name": "calcul",
"func": "let toto=\"1\"\nif (toto==\"0\") {\n msg.payload = \"TATA\"\n}\nelse{\n msg.payload = \"RORO\" \n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 250,
"y": 120,
"wires": [
[
"9f03c6.20d5e438",
"b8503ac.0a7bdc8"
]
]
},
{
"id": "b8503ac.0a7bdc8",
"type": "ui_template",
"z": "4ab3cb90.f07ccc",
"group": "11d854fd.c64afb",
"name": "",
"order": 16,
"width": 0,
"height": 0,
"format": "<span style=\"color:#F89606;font-size:45px;font-weight:bold\">{{msg.payload}}</span>",
"storeOutMessages": true,
"fwdInMessages": true,
"resendOnRefresh": true,
"templateScope": "local",
"x": 420,
"y": 180,
"wires": [
[]
]
},
{
"id": "9f03c6.20d5e438",
"type": "debug",
"z": "4ab3cb90.f07ccc",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 430,
"y": 120,
"wires": []
},
{
"id": "f0fc4f92.6806e",
"type": "inject",
"z": "4ab3cb90.f07ccc",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "5",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 110,
"y": 120,
"wires": [
[
"a10b8dce.8e39e"
]
]
},
{
"id": "11d854fd.c64afb",
"type": "ui_group",
"z": "",
"name": "heure",
"tab": "9f36b601.175468",
"order": 1,
"disp": false,
"width": 25,
"collapse": false
},
{
"id": "9f36b601.175468",
"type": "ui_tab",
"z": "",
"name": "Station Météo",
"icon": "dashboard",
"order": 1,
"disabled": false,
"hidden": false
}
]