Hello dear forum members,
I am a newbie and have the following problem:
I get data from different sensors (MQTT) and want to display them in the Ui table, but the data does not update with my flow. What do I have to do?
[
{
"id": "b1ec35adc40711d3",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": ""
},
{
"id": "ac8a34a64dae7348",
"type": "function",
"z": "b1ec35adc40711d3",
"name": "",
"func": "if (msg.payload.Außen_L >= 2) {\n Außen_T = msg.payload.Außen_T\n Außen_L = msg.payload.Außen_L\n}\n\nif (msg.SCHLAFEN_T >= 2) {\n SCHLAFEN_T = msg.SCHLAFEN_T\n SCHLAFEN_L = msg.SCHLAFEN_L\n}\n\n\nif (msg.WEK_T >= 2) {\n WEK_T = msg.WEK_T\n WEK_L = msg.WEK_L\n}\n\n\nif (msg.ZIMMER_T >= 2) {\n ZIMMER_T = msg.ZIMMER_T\n ZIMMER_L = msg.ZIMMER_L\n}\n\nif (msg.payload.HWR_T >= 2) {\n HWR_T = msg.payload.HWR_T\n HWR_L = msg.payload.HWR_L\n}\n\nif (msg.TECHNIK_T > 2) {\n TECHNIK_T = msg.TECHNIK_T\n TECHNIK_L = msg.TECHNIK_L\n}\n\n\nvar data = [\n {\n \"raum\":\"WEK\",\n \"temp\": WEK_T + \"°C\",\n \"humidity\":WEK_L + \"%\",\n \"quality\": 0\n },\n {\n \"raum\":\"HWR\",\n \"temp\": HWR_T + \"°C\",\n \"humidity\":HWR_L+ \"%\",\n \"quality\": 0\n\n },\n {\n \"raum\":\"Schlafen\",\n \"temp\":SCHLAFEN_T + \"°C\",\n \"humidity\":SCHLAFEN_L+ \"%\",\n \"quality\": 0\n\n },\n {\n \"raum\":\"Bad\",\n \"temp\": HWR_T + \"°C\",\n \"humidity\":HWR_L + \"%\",\n \"quality\": 0\n },\n {\n \"raum\":\"ZIMMER\",\n \"temp\": ZIMMER_T + \"°C\",\n \"humidity\":ZIMMER_L + \"%\",\n \"quality\": 0\n },\n {\n \"raum\":\"Technik\",\n \"temp\": TECHNIK_T + \"°C\",\n \"humidity\":TECHNIK_L + \"%\",\n \"quality\": 0\n\n }\n ];\nmsg.payload = data;\n \n \nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 600,
"y": 200,
"wires": [
[
"9c8b2bda7a401e75"
]
]
},
{
"id": "9c8b2bda7a401e75",
"type": "change",
"z": "b1ec35adc40711d3",
"name": "ui_control",
"rules": [
{
"t": "set",
"p": "ui_control",
"pt": "msg",
"to": "{\"tabulator\":{\"headerVisible\":false,\"movableColumns\":false}}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 800,
"y": 200,
"wires": [
[
"aa80fc821055ef1c"
]
]
},
{
"id": "aa80fc821055ef1c",
"type": "ui_table",
"z": "b1ec35adc40711d3",
"group": "951f63e6.78df",
"name": "",
"order": 1,
"width": 4,
"height": 3,
"columns": [
{
"field": "raum",
"title": "Raum",
"width": "",
"align": "left",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "temp",
"title": "Age",
"width": "",
"align": "left",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "humidity",
"title": "humidity",
"width": "",
"align": "left",
"formatter": "plaintext",
"formatterParams": {
"target": "_blank"
}
},
{
"field": "quality",
"title": "Quality",
"width": "5",
"align": "center",
"formatter": "traffic",
"formatterParams": {
"target": "_blank"
}
}
],
"outputs": 0,
"cts": false,
"x": 950,
"y": 220,
"wires": []
},
{
"id": "e04b9a488383cbea",
"type": "function",
"z": "b1ec35adc40711d3",
"name": "",
"func": "msg.WEK_T = msg.payload.tempc;\nmsg.WEK_L = msg.payload.hum;\n\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 260,
"y": 260,
"wires": [
[
"ac8a34a64dae7348"
]
]
},
{
"id": "39d8189369ea0271",
"type": "function",
"z": "b1ec35adc40711d3",
"name": "",
"func": "msg.ZIMMER_T = msg.payload.tempc;\nmsg.ZIMMER_L = msg.payload.hum;\n\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 260,
"y": 380,
"wires": [
[
"ac8a34a64dae7348"
]
]
},
{
"id": "e99c7938475fc2dd",
"type": "function",
"z": "b1ec35adc40711d3",
"name": "",
"func": "msg.SCHLAFEN_T = msg.payload.tempc;\nmsg.SCHLAFEN_L = msg.payload.hum;\n\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 280,
"y": 320,
"wires": [
[
"ac8a34a64dae7348"
]
]
},
{
"id": "e8f9d1f860fdbcfa",
"type": "function",
"z": "b1ec35adc40711d3",
"name": "",
"func": "msg.TECHNIK_T = msg.payload.tempc;\nmsg.TECHNIK_L = msg.payload.hum;\n\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 280,
"y": 440,
"wires": [
[
"ac8a34a64dae7348"
]
]
},
{
"id": "ffd23ed0bdefb8a1",
"type": "mqtt in",
"z": "b1ec35adc40711d3",
"name": "WEK",
"topic": "home/temperaturen/MQTTGateway_ESP32_BLE/BTtoMQTT/A4C13867EFB9",
"qos": "2",
"datatype": "json",
"broker": "",
"nl": false,
"rap": true,
"rh": 0,
"x": 110,
"y": 260,
"wires": [
[
"e04b9a488383cbea"
]
]
},
{
"id": "1960ccd73fc798c0",
"type": "mqtt in",
"z": "b1ec35adc40711d3",
"name": "ZIMMER",
"topic": "home/temperaturen/MQTTGateway_ESP32_BLE/BTtoMQTT/A4C138B5B9AE",
"qos": "2",
"datatype": "json",
"broker": "",
"nl": false,
"rap": true,
"rh": 0,
"x": 120,
"y": 380,
"wires": [
[
"39d8189369ea0271"
]
]
},
{
"id": "0a15cff1a8805bfb",
"type": "mqtt in",
"z": "b1ec35adc40711d3",
"name": "TECHNIK",
"topic": "home/temperaturen/MQTTGateway_ESP32_BLE/BTtoMQTT/A4C1388BB69C",
"qos": "2",
"datatype": "json",
"broker": "",
"nl": false,
"rap": true,
"rh": 0,
"x": 120,
"y": 440,
"wires": [
[
"e8f9d1f860fdbcfa"
]
]
},
{
"id": "f5cfe461fa811f77",
"type": "mqtt in",
"z": "b1ec35adc40711d3",
"name": "SCHLAFEN",
"topic": "home/temperaturen/MQTTGateway_ESP32_BLE/BTtoMQTT/A4C13892A4D2",
"qos": "2",
"datatype": "json",
"broker": "",
"nl": false,
"rap": true,
"rh": 0,
"x": 130,
"y": 320,
"wires": [
[
"e99c7938475fc2dd"
]
]
},
{
"id": "71aa81af7ecd0e04",
"type": "mqtt in",
"z": "b1ec35adc40711d3",
"name": "",
"topic": "homie/Raumqualitaet/#",
"qos": "2",
"datatype": "json",
"broker": "",
"nl": false,
"rap": true,
"rh": 0,
"x": 160,
"y": 180,
"wires": [
[
"ac8a34a64dae7348"
]
]
},
{
"id": "951f63e6.78df",
"type": "ui_group",
"name": "Garage",
"tab": "83822f15.889e6",
"order": 2,
"disp": false,
"width": "10"
},
{
"id": "83822f15.889e6",
"type": "ui_tab",
"name": "Garage",
"icon": "fa-car",
"order": 1
}
]
These are the data from 2 sensors as an example:
I look forward to your help