As a newbie I've gone throught many example and I'm still coming up short.
I'm extracting date and temperature (later humidity and BarrPress) into a 3 line chart using ui.
[
{
"id": "a4402592cf598c06",
"type": "group",
"z": "0c9ff52ffb12dd79",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
"fill": "none",
"fill-opacity": "1",
"label": true,
"label-position": "nw",
"color": "#a4a4a4"
},
"nodes": [
"b5c1e5f33511c385",
"8c2a4e5ecd6480b9",
"3286cef8e843ceda",
"c1df8b4410ac5bdb",
"952e7af643987cd3",
"aa9e4cf2be594eb8",
"183469b5fe81fb17",
"55a1ee694d1ea654",
"5da7cdfd7ba6bbb4"
],
"x": 134,
"y": 199,
"w": 1332,
"h": 362
},
{
"id": "b5c1e5f33511c385",
"type": "function",
"z": "0c9ff52ffb12dd79",
"g": "a4402592cf598c06",
"name": "send string to db-WORKS",
"func": "//var myMsg = msg.payload\nvar myMsgCount = 10\nvar t = \"SELECT `DateAndTime`, `Temperature` FROM `weather_1` GROUP BY DATE(`DateAndTime`), HOUR(`DateAndTime`) order by DateAndTime DESC LIMIT \" + myMsgCount\n\nreturn {topic:t}\n",
"outputs": 2,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 630,
"y": 300,
"wires": [
[
"8c2a4e5ecd6480b9"
],
[]
]
},
{
"id": "8c2a4e5ecd6480b9",
"type": "mysql",
"z": "0c9ff52ffb12dd79",
"g": "a4402592cf598c06",
"mydb": "ad71bc68fa7f0805",
"name": "MyTemplog",
"x": 830,
"y": 340,
"wires": [
[
"c1df8b4410ac5bdb",
"aa9e4cf2be594eb8"
]
]
},
{
"id": "3286cef8e843ceda",
"type": "comment",
"z": "0c9ff52ffb12dd79",
"g": "a4402592cf598c06",
"name": "https://discourse.nodered.org/t/value-from-slider/20757/2",
"info": "",
"x": 950,
"y": 240,
"wires": []
},
{
"id": "c1df8b4410ac5bdb",
"type": "debug",
"z": "0c9ff52ffb12dd79",
"g": "a4402592cf598c06",
"name": "new test-temp only",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1190,
"y": 280,
"wires": []
},
{
"id": "952e7af643987cd3",
"type": "inject",
"z": "0c9ff52ffb12dd79",
"g": "a4402592cf598c06",
"name": "60 minute repeat",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": "5",
"topic": "75",
"payload": "75",
"payloadType": "str",
"x": 270,
"y": 240,
"wires": [
[
"b5c1e5f33511c385"
]
]
},
{
"id": "aa9e4cf2be594eb8",
"type": "ui-chart",
"z": "0c9ff52ffb12dd79",
"g": "a4402592cf598c06",
"group": "8e94577be9e7d37d",
"name": "Temperature plot 10-30",
"label": "chart1-temperature",
"order": 4,
"chartType": "line",
"category": "topic",
"categoryType": "msg",
"xAxisLabel": "date",
"xAxisProperty": "",
"xAxisPropertyType": "timestamp",
"xAxisType": "time",
"xAxisFormat": "",
"xAxisFormatType": "auto",
"xmin": "",
"xmax": "",
"yAxisLabel": "Temperature",
"yAxisProperty": "payload",
"yAxisPropertyType": "msg",
"ymin": "30",
"ymax": "110",
"bins": 10,
"action": "replace",
"stackSeries": false,
"pointShape": "circle",
"pointRadius": 4,
"showLegend": true,
"removeOlder": "10",
"removeOlderUnit": "3600",
"removeOlderPoints": "",
"colors": [
"#0095ff",
"#ff0000",
"#ff7f0e",
"#2ca02c",
"#a347e1",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"textColor": [
"#666666"
],
"textColorDefault": true,
"gridColor": [
"#e5e5e5"
],
"gridColorDefault": true,
"width": 6,
"height": 8,
"className": "",
"x": 1230,
"y": 360,
"wires": [
[
"5da7cdfd7ba6bbb4"
]
]
},
{
"id": "183469b5fe81fb17",
"type": "inject",
"z": "0c9ff52ffb12dd79",
"g": "a4402592cf598c06",
"name": "Clear Chart",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "[]",
"payloadType": "json",
"x": 1050,
"y": 520,
"wires": [
[
"aa9e4cf2be594eb8"
]
]
},
{
"id": "55a1ee694d1ea654",
"type": "ui-slider",
"z": "0c9ff52ffb12dd79",
"g": "a4402592cf598c06",
"group": "8e94577be9e7d37d",
"name": "slider-10-30",
"label": "slider-10-30",
"tooltip": "",
"order": 0,
"width": 0,
"height": 0,
"passthru": false,
"outs": "all",
"topic": "topic",
"topicType": "msg",
"thumbLabel": "true",
"showTicks": "always",
"min": "1",
"max": 10,
"step": 1,
"className": "",
"iconPrepend": "",
"iconAppend": "",
"color": "",
"colorTrack": "",
"colorThumb": "",
"x": 1050,
"y": 480,
"wires": [
[
"aa9e4cf2be594eb8"
]
]
},
{
"id": "5da7cdfd7ba6bbb4",
"type": "debug",
"z": "0c9ff52ffb12dd79",
"g": "a4402592cf598c06",
"name": "debug output from chart",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1310,
"y": 440,
"wires": []
},
{
"id": "ad71bc68fa7f0805",
"type": "MySQLdatabase",
"name": "My Database",
"host": "127.0.0.1",
"port": "3306",
"db": "bme680_v1",
"tz": "UTC + 4",
"charset": ""
},
{
"id": "8e94577be9e7d37d",
"type": "ui-group",
"name": "group 10-30",
"page": "4ae37ee26f45a7a6",
"width": "6",
"height": "1",
"order": -1,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{
"id": "4ae37ee26f45a7a6",
"type": "ui-page",
"name": "new chart 10-30",
"ui": "d65ae8163ef966dd",
"path": "/page16",
"icon": "home",
"layout": "grid",
"theme": "c2ff5ba1f92a0f0e",
"breakpoints": [
{
"name": "Default",
"px": "0",
"cols": "3"
},
{
"name": "Tablet",
"px": "576",
"cols": "6"
},
{
"name": "Small Desktop",
"px": "768",
"cols": "9"
},
{
"name": "Desktop",
"px": "1024",
"cols": "12"
}
],
"order": -1,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "d65ae8163ef966dd",
"type": "ui-base",
"name": "Node-red-2",
"path": "/dashboard",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control"
],
"showPathInSidebar": true,
"showPageTitle": true,
"navigationStyle": "default",
"titleBarStyle": "default"
},
{
"id": "c2ff5ba1f92a0f0e",
"type": "ui-theme",
"name": "Default",
"colors": {
"surface": "#ffffff",
"primary": "#0094ce",
"bgPage": "#eeeeee",
"groupBg": "#ffffff",
"groupOutline": "#cccccc"
},
"sizes": {
"pagePadding": "12px",
"groupGap": "12px",
"groupBorderRadius": "4px",
"widgetGap": "12px"
}
}
]
The sql will provide hourly readings of temperature however, the chart is blank.
The input to the chart:
0/29/2024, 4:13:13 PMnode: debug output from chartSELECT DateAndTime
, Temperature
FROM weather_1
GROUP BY DATE(DateAndTime
), HOUR(DateAndTime
) order by DateAndTime DESC LIMIT 10 : msg.payload : array[10]
array[10]
0: object
DateAndTime: "2024-10-29T16:07:05.000Z"
Temperature: 87.6
1: object
DateAndTime: "2024-10-29T15:07:03.000Z"
Temperature: 87.19
2: object
DateAndTime: "2024-10-29T14:07:04.000Z"
Temperature: 87.12
etc,etc,etc
Any help would be appreciated.
Thanks.