Hello to all,
I want to make a bar graph with these values below. I read them from a file.
They are values taken every 30 minutes over a whole day.
But I'm not too comfortable with formatting this data to pass it to the Ui_graph node. I've looked at the documentation but I'm still stuck. I'm hoping to get some help with formatting this data. I'm looking for this kind of graph:
In a second step, I would like also to push the data into InfluxDb. I haven't dived into how to do it yet.
Thanks in advance for your help.
here is the flow view:
and the flow itself:
[
{
"id": "d62dd3291e2c9479",
"type": "file in",
"z": "899cbc0f626ba209",
"name": "",
"filename": "/home/pi/Documents/ma_conso.json",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 360,
"y": 320,
"wires": [
[
"39f6aff4a2f6119b"
]
]
},
{
"id": "8c23a9f2506e9cc8",
"type": "inject",
"z": "899cbc0f626ba209",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 120,
"y": 320,
"wires": [
[
"d62dd3291e2c9479"
]
]
},
{
"id": "df13b076bc200117",
"type": "debug",
"z": "899cbc0f626ba209",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 770,
"y": 320,
"wires": []
},
{
"id": "39f6aff4a2f6119b",
"type": "json",
"z": "899cbc0f626ba209",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 610,
"y": 320,
"wires": [
[
"df13b076bc200117"
]
]
}
]
Here is the result of the debug node:
{"unit":"W","data":[{"date":"2022-05-08 00:30:00","value":14},{"date":"2022-05-08 01:00:00","value":16},{"date":"2022-05-08 01:30:00","value":16},{"date":"2022-05-08 02:00:00","value":16},{"date":"2022-05-08 02:30:00","value":16},{"date":"2022-05-08 03:00:00","value":16},{"date":"2022-05-08 03:30:00","value":16},{"date":"2022-05-08 04:00:00","value":16},{"date":"2022-05-08 04:30:00","value":44},{"date":"2022-05-08 05:00:00","value":14},{"date":"2022-05-08 05:30:00","value":16},{"date":"2022-05-08 06:00:00","value":16},{"date":"2022-05-08 06:30:00","value":60},{"date":"2022-05-08 07:00:00","value":64},{"date":"2022-05-08 07:30:00","value":64},{"date":"2022-05-08 08:00:00","value":60},{"date":"2022-05-08 08:30:00","value":64},{"date":"2022-05-08 09:00:00","value":64},{"date":"2022-05-08 09:30:00","value":62},{"date":"2022-05-08 10:00:00","value":62},{"date":"2022-05-08 10:30:00","value":62},{"date":"2022-05-08 11:00:00","value":62},{"date":"2022-05-08 11:30:00","value":18},{"date":"2022-05-08 12:00:00","value":16},{"date":"2022-05-08 12:30:00","value":16},{"date":"2022-05-08 13:00:00","value":32},{"date":"2022-05-08 13:30:00","value":48},{"date":"2022-05-08 14:00:00","value":16},{"date":"2022-05-08 14:30:00","value":36},{"date":"2022-05-08 15:00:00","value":20},{"date":"2022-05-08 15:30:00","value":16},{"date":"2022-05-08 16:00:00","value":16},{"date":"2022-05-08 16:30:00","value":16},{"date":"2022-05-08 17:00:00","value":16},{"date":"2022-05-08 17:30:00","value":16},{"date":"2022-05-08 18:00:00","value":16},{"date":"2022-05-08 18:30:00","value":14},{"date":"2022-05-08 19:00:00","value":18},{"date":"2022-05-08 19:30:00","value":32},{"date":"2022-05-08 20:00:00","value":16},{"date":"2022-05-08 20:30:00","value":16},{"date":"2022-05-08 21:00:00","value":16},{"date":"2022-05-08 21:30:00","value":16},{"date":"2022-05-08 22:00:00","value":14},{"date":"2022-05-08 22:30:00","value":16},{"date":"2022-05-08 23:00:00","value":16},{"date":"2022-05-08 23:30:00","value":16},{"date":"2022-05-09 00:00:00","value":16}]}
and here is the file in case of testing:
ma_conso.json (4.2 KB)