i am so confused. still same error.
ok
lets take a look.
-
change your DEBUG nodes to show complete message (like i asked about 2 hours ago)
-
Capture some REAL data for me like this...
buy clicking the copy button on the debug entry like this...
then paste it in a reply
```
like this
```
-
export your flow paste and paste it
```
like this
```
Hi. I am sorry for my late, but i am new in forum so i cant add more than 19 comments in a day. I have tried to playing with nodes, but now i get a values, but they have a incorrect format in a „Setup payload“ node and chart node.
debug entry:
Data Array node:
[{„topic":"homie/homey-5ac5f38e42b2c4296e150d77/coffeeplug/measure-power","payload":[{"series":["Data"],"data":{"dateTime":"2020-10-26, 6:27:14","payload":"0.5"},"labels":["Labels"]}],"qos":1,"retain":false,"_msgid":"daed7001.34aef“}]
Setup payload node:
[{„topic":"homie/homey-5ac5f38e42b2c4296e150d77/coffeeplug/measure-power","payload":[{"series":["Data"],"data":[{"series":["Data"],"data":{"dateTime":"2020-10-26, 6:27:14","payload":"0.5"},"labels":["Labels"]}],"labels":["Label"]}],"qos":1,"retain":false,"_msgid":"daed7001.34aef“}]**
exported flow:
[{"id":"dc26b425.e05be8","type":"tab","label":"Energy","disabled":false,"info":""},{"id":"1d190003.950bd","type":"ui_gauge","z":"dc26b425.e05be8","name":"refrigerator power","group":"c44a6c02.19ec9","order":3,"width":4,"height":2,"gtype":"gage","title":"power","label":"W","format":"{{value}}","min":0,"max":"120","colors":["#00b500","#fecb3e","#e32400"],"seg1":"50","seg2":"90","x":590,"y":50,"wires":[]},{"id":"b50ebc56.f9e0c","type":"mqtt in","z":"dc26b425.e05be8","name":"kitchenrefrigeratorplug/measure-power","topic":"homie/homey-5ac5f38e42b2c4296e150d77/kitchenrefrigeratorplug/measure-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":300,"y":50,"wires":[["1d190003.950bd","30aeb14f.1b1f2e"]]},{"id":"989b69f0.98aa28","type":"mqtt in","z":"dc26b425.e05be8","name":"Consuption","topic":"homie/homey-5ac5f38e42b2c4296e150d77/kitchenrefrigeratorplug/meter-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":220,"y":100,"wires":[["9d3f8cb6.fde778"]]},{"id":"9d3f8cb6.fde778","type":"ui_text","z":"dc26b425.e05be8","group":"c44a6c02.19ec9","order":5,"width":4,"height":1,"name":"","label":"total","format":"{{msg.payload}} kWh","layout":"row-spread","x":370,"y":100,"wires":[]},{"id":"30aeb14f.1b1f2e","type":"ui_chart","z":"dc26b425.e05be8","name":"consumption hourly","group":"c44a6c02.19ec9","order":4,"width":4,"height":3,"label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"bezier","nodata":"consumption hourly","dot":false,"ymin":"","ymax":"120","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff9300","#ffaa00","#ffaa00","#ffaa00","#ffaa00","#ffaa00","#ffaa00","#ffaa00","#ffaa00"],"useOldStyle":false,"outputs":1,"x":600,"y":90,"wires":[[]]},{"id":"f60c6771.13ee1","type":"ui_gauge","z":"dc26b425.e05be8","name":"receiver power","group":"a4ad6c56.fea06","order":3,"width":4,"height":2,"gtype":"gage","title":"power","label":"W","format":"{{value}}","min":0,"max":"120","colors":["#00b500","#fecb3e","#e32400"],"seg1":"50","seg2":"90","x":580,"y":160,"wires":[]},{"id":"afac415c.1a4478","type":"mqtt in","z":"dc26b425.e05be8","name":"receiverplug/measure-power","topic":"homie/homey-5ac5f38e42b2c4296e150d77/receiverplug/measure-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":270,"y":160,"wires":[["f60c6771.13ee1","45eae47.cb7411c"]]},{"id":"623d9811.821f9","type":"mqtt in","z":"dc26b425.e05be8","name":"Consuption","topic":"homie/homey-5ac5f38e42b2c4296e150d77/receiverplug/meter-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":220,"y":210,"wires":[["1d54151e.28ce53"]]},{"id":"1d54151e.28ce53","type":"ui_text","z":"dc26b425.e05be8","group":"a4ad6c56.fea06","order":5,"width":4,"height":1,"name":"","label":"total","format":"{{msg.payload}} kWh","layout":"row-spread","x":370,"y":210,"wires":[]},{"id":"45eae47.cb7411c","type":"ui_chart","z":"dc26b425.e05be8","name":"consumption hourly","group":"a4ad6c56.fea06","order":4,"width":4,"height":3,"label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"bezier","nodata":"consumption hourly","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff9300","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":600,"y":200,"wires":[[]]},{"id":"5e1afe38.4a96a8","type":"ui_gauge","z":"dc26b425.e05be8","name":"toilet power","group":"edfcc2b8.e0a53","order":3,"width":4,"height":2,"gtype":"gage","title":"power","label":"W","format":"{{value}}","min":0,"max":"2000","colors":["#00b500","#fecb3e","#e32400"],"seg1":"900","seg2":"1800","x":570,"y":270,"wires":[]},{"id":"9db315c3.cddd78","type":"mqtt in","z":"dc26b425.e05be8","name":"toiletwashmachineplug/measure-power","topic":"homie/homey-5ac5f38e42b2c4296e150d77/toiletwashmachineplug/measure-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":300,"y":270,"wires":[["5e1afe38.4a96a8","871dda21.ede608"]]},{"id":"44dd8818.35df3","type":"ui_text","z":"dc26b425.e05be8","group":"edfcc2b8.e0a53","order":5,"width":4,"height":1,"name":"","label":"total","format":"{{msg.payload}} kWh","layout":"row-spread","x":370,"y":320,"wires":[]},{"id":"871dda21.ede608","type":"ui_chart","z":"dc26b425.e05be8","name":"consumption hourly","group":"edfcc2b8.e0a53","order":4,"width":4,"height":3,"label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"bezier","nodata":"consumption hourly","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff9300","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":600,"y":310,"wires":[[]]},{"id":"f2739ff2.513c3","type":"mqtt in","z":"dc26b425.e05be8","name":"Consuption","topic":"homie/homey-5ac5f38e42b2c4296e150d77/toiletwashmachineplug/meter-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":220,"y":320,"wires":[["44dd8818.35df3"]]},{"id":"ba6bb376.c9361","type":"ui_gauge","z":"dc26b425.e05be8","name":"receiver power","group":"8bdefe93.650638","order":3,"width":4,"height":2,"gtype":"gage","title":"power","label":"W","format":"{{value}}","min":0,"max":"180","colors":["#00b500","#fecb3e","#e32400"],"seg1":"50","seg2":"90","x":580,"y":380,"wires":[]},{"id":"abaf8973.139538","type":"mqtt in","z":"dc26b425.e05be8","name":"serverplug/measure-power","topic":"homie/homey-5ac5f38e42b2c4296e150d77/serverplug/measure-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":260,"y":380,"wires":[["ba6bb376.c9361","8ac574b6.9e06"]]},{"id":"34ff9829.34fc","type":"mqtt in","z":"dc26b425.e05be8","name":"Consuption","topic":"homie/homey-5ac5f38e42b2c4296e150d77/serverplug/meter-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":220,"y":430,"wires":[["61538a7d.530cb4"]]},{"id":"61538a7d.530cb4","type":"ui_text","z":"dc26b425.e05be8","group":"8bdefe93.650638","order":5,"width":4,"height":1,"name":"","label":"total","format":"{{msg.payload}} kWh","layout":"row-spread","x":370,"y":430,"wires":[]},{"id":"8ac574b6.9e06","type":"ui_chart","z":"dc26b425.e05be8","name":"consumption hourly","group":"8bdefe93.650638","order":4,"width":4,"height":3,"label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"bezier","nodata":"consumption hourly","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff9300","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":600,"y":420,"wires":[[]]},{"id":"1041c58f.a1770a","type":"ui_gauge","z":"dc26b425.e05be8","name":"bedroompcplug power","group":"6fbbeefb.6ce5c","order":3,"width":4,"height":2,"gtype":"gage","title":"power","label":"W","format":"{{value}}","min":0,"max":"120","colors":["#00b500","#fecb3e","#e32400"],"seg1":"50","seg2":"90","x":600,"y":490,"wires":[]},{"id":"7c326654.896cb8","type":"mqtt in","z":"dc26b425.e05be8","name":"bedroompcplug/measure-power","topic":"homie/homey-5ac5f38e42b2c4296e150d77/bedroompcplug/measure-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":280,"y":490,"wires":[["1041c58f.a1770a","4cb9a643.494a3"]]},{"id":"1e4e51ca.5d8f96","type":"mqtt in","z":"dc26b425.e05be8","name":"Consuption","topic":"homie/homey-5ac5f38e42b2c4296e150d77/bedroompcplug/meter-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":220,"y":540,"wires":[["3bd68871.42c8d"]]},{"id":"3bd68871.42c8d","type":"ui_text","z":"dc26b425.e05be8","group":"6fbbeefb.6ce5c","order":5,"width":4,"height":1,"name":"","label":"total","format":"{{msg.payload}} kWh","layout":"row-spread","x":370,"y":540,"wires":[]},{"id":"4cb9a643.494a3","type":"ui_chart","z":"dc26b425.e05be8","name":"consumption hourly","group":"6fbbeefb.6ce5c","order":4,"width":4,"height":3,"label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"bezier","nodata":"consumption hourly","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff9300","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":600,"y":530,"wires":[[]]},{"id":"57fda489.419f3c","type":"mqtt in","z":"dc26b425.e05be8","name":"coffeeplug/measure-power","topic":"homie/homey-5ac5f38e42b2c4296e150d77/coffeeplug/measure-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":260,"y":600,"wires":[["c44b087.0631e78","4aee7d24.6bc194","73880317.157a24","b638d7cc.e9218"]]},{"id":"b7754104.af9688","type":"mqtt in","z":"dc26b425.e05be8","name":"Consuption","topic":"homie/homey-5ac5f38e42b2c4296e150d77/coffeeplug/meter-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":220,"y":650,"wires":[["3f0a66c8.62a592"]]},{"id":"3f0a66c8.62a592","type":"ui_text","z":"dc26b425.e05be8","group":"2cdaed12.b6920a","order":5,"width":4,"height":1,"name":"","label":"total","format":"{{msg.payload}} kWh","layout":"row-spread","x":370,"y":650,"wires":[]},{"id":"c44b087.0631e78","type":"ui_gauge","z":"dc26b425.e05be8","name":"coffeeplug power","group":"2cdaed12.b6920a","order":3,"width":4,"height":2,"gtype":"gage","title":"power","label":"W","format":"{{value}}","min":0,"max":"2000","colors":["#00b500","#fecb3e","#e32400"],"seg1":"50","seg2":"90","x":590,"y":600,"wires":[]},{"id":"4aee7d24.6bc194","type":"ui_chart","z":"dc26b425.e05be8","name":"consumption hourly","group":"2cdaed12.b6920a","order":4,"width":4,"height":3,"label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"bezier","nodata":"consumption hourly","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff9300","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":600,"y":640,"wires":[[]]},{"id":"7cf836cf.9c65c","type":"mqtt in","z":"dc26b425.e05be8","name":"microwaveplug/measure-power","topic":"homie/homey-5ac5f38e42b2c4296e150d77/microwaveplug/measure-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":280,"y":710,"wires":[["f66891e2.1142a8","1998112b.768e67"]]},{"id":"25ccc8b8.bd8a1","type":"mqtt in","z":"dc26b425.e05be8","name":"Consuption","topic":"homie/homey-5ac5f38e42b2c4296e150d77/microwaveplug/meter-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":220,"y":760,"wires":[["40ad9319.3f2e44"]]},{"id":"40ad9319.3f2e44","type":"ui_text","z":"dc26b425.e05be8","group":"1b2289fc.a46216","order":5,"width":4,"height":1,"name":"","label":"total","format":"{{msg.payload}} kWh","layout":"row-spread","x":370,"y":760,"wires":[]},{"id":"f66891e2.1142a8","type":"ui_gauge","z":"dc26b425.e05be8","name":"coffeeplug power","group":"1b2289fc.a46216","order":3,"width":4,"height":2,"gtype":"gage","title":"power","label":"W","format":"{{value}}","min":0,"max":"2000","colors":["#00b500","#fecb3e","#e32400"],"seg1":"50","seg2":"90","x":590,"y":710,"wires":[]},{"id":"1998112b.768e67","type":"ui_chart","z":"dc26b425.e05be8","name":"consumption hourly","group":"1b2289fc.a46216","order":4,"width":4,"height":3,"label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"bezier","nodata":"consumption hourly","dot":false,"ymin":"","ymax":"","removeOlder":"3","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff9300","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":600,"y":750,"wires":[[]]},{"id":"536d9849.8509d","type":"mqtt in","z":"dc26b425.e05be8","name":"basementplug/measure-power","topic":"homie/homey-5ac5f38e42b2c4296e150d77/basementplug/measure-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":280,"y":820,"wires":[[]]},{"id":"c81765b3.c4e85","type":"mqtt in","z":"dc26b425.e05be8","name":"Consuption","topic":"homie/homey-5ac5f38e42b2c4296e150d77/basementplug/meter-power","qos":"2","datatype":"auto","broker":"f18ffc79.bc2648","x":220,"y":870,"wires":[["a3702a69.dcf01"]]},{"id":"a3702a69.dcf01","type":"ui_text","z":"dc26b425.e05be8","group":"a5cf76d5.4e20a","order":5,"width":4,"height":1,"name":"","label":"total","format":"{{msg.payload}} kWh","layout":"row-spread","x":370,"y":870,"wires":[]},{"id":"c1000ba8.e960b8","type":"ui_gauge","z":"dc26b425.e05be8","name":"basementplug power","group":"a5cf76d5.4e20a","order":3,"width":4,"height":2,"gtype":"gage","title":"power","label":"W","format":"{{value}}","min":0,"max":"2000","colors":["#00b500","#fecb3e","#e32400"],"seg1":"50","seg2":"90","x":600,"y":820,"wires":[]},{"id":"f8163755.232328","type":"ui_chart","z":"dc26b425.e05be8","name":"consumption hourly","group":"a5cf76d5.4e20a","order":4,"width":4,"height":3,"label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"bezier","nodata":"consumption hourly","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff9300","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":600,"y":860,"wires":[[]]},{"id":"5ba76edf.d9686","type":"file","z":"dc26b425.e05be8","name":"","filename":"/home/pi/logs/test.log","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":1120,"y":590,"wires":[["3b46a832.6825a","5433eaab.9999bc"]]},{"id":"c6ec3305.53a418","type":"json","z":"dc26b425.e05be8","name":"","property":"dateTime,payload","action":"","pretty":false,"x":950,"y":590,"wires":[["5ba76edf.d9686","d0805bba.c547c"]]},{"id":"73880317.157a24","type":"function","z":"dc26b425.e05be8","name":"Modify Payload","func":"var today = new Date();\nvar date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate()+',';\nvar time = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\nvar dateTime = date+' '+time;\nvar series=[\"Data\"];\nvar labels=[\"Labels\"];\nvar data = ({\n \"dateTime\": dateTime,\n \"payload\": msg.payload,\n}); \n\nmsg.payload = [{series,data,labels}];\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":590,"wires":[["c6ec3305.53a418","c683ca2e.fbfac8"]]},{"id":"e8d22e12.54e158","type":"debug","z":"dc26b425.e05be8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1710,"y":540,"wires":[]},{"id":"8983f082.d731d8","type":"function","z":"dc26b425.e05be8","name":"Setup payload","func":"series = [];\ndata = [];\nlabels = [];\n\nseries.push(\"Data\");\ndata.push(\"data\");\nlabels.push(\"Label\");\n\nmsg.payload = [{\"series\":series,\"data\":msg.payload,\"labels\":labels}];\n\nreturn msg;","outputs":1,"noerr":0,"x":1510,"y":590,"wires":[["b723c505.8152a8","e8d22e12.54e158"]]},{"id":"b723c505.8152a8","type":"ui_chart","z":"dc26b425.e05be8","name":"","group":"2cdaed12.b6920a","order":3,"width":0,"height":0,"label":"","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1700,"y":610,"wires":[["6ae8dd4a.5b42a4"]]},{"id":"3b46a832.6825a","type":"change","z":"dc26b425.e05be8","name":"Data Array","rules":[{"t":"set","p":"data","pt":"msg","to":"$.data.{\"dateTime\":dateTime, \"data\":data}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1320,"y":590,"wires":[["8983f082.d731d8","629db919.ec3f08"]]},{"id":"6ae8dd4a.5b42a4","type":"debug","z":"dc26b425.e05be8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1780,"y":660,"wires":[]},{"id":"629db919.ec3f08","type":"debug","z":"dc26b425.e05be8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1440,"y":640,"wires":[]},{"id":"5433eaab.9999bc","type":"debug","z":"dc26b425.e05be8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1270,"y":640,"wires":[]},{"id":"d0805bba.c547c","type":"debug","z":"dc26b425.e05be8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1100,"y":640,"wires":[]},{"id":"c683ca2e.fbfac8","type":"debug","z":"dc26b425.e05be8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":940,"y":640,"wires":[]},{"id":"b638d7cc.e9218","type":"debug","z":"dc26b425.e05be8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":790,"y":650,"wires":[]},{"id":"c44a6c02.19ec9","type":"ui_group","z":"","name":"Refrigerator","tab":"57d4c334.8436d4","order":2,"disp":true,"width":4,"collapse":false},{"id":"f18ffc79.bc2648","type":"mqtt-broker","z":"","name":"Homey MQTT","broker":"192.168.1.4","port":"1883","tls":"","clientid":"","usetls":true,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""},{"id":"a4ad6c56.fea06","type":"ui_group","z":"","name":"Receiver","tab":"57d4c334.8436d4","order":1,"disp":true,"width":4,"collapse":false},{"id":"edfcc2b8.e0a53","type":"ui_group","z":"","name":"Washmachine","tab":"57d4c334.8436d4","order":3,"disp":true,"width":4,"collapse":false},{"id":"8bdefe93.650638","type":"ui_group","z":"","name":"Server","tab":"57d4c334.8436d4","order":4,"disp":true,"width":4,"collapse":false},{"id":"6fbbeefb.6ce5c","type":"ui_group","z":"","name":"Bedroom PC","tab":"57d4c334.8436d4","order":8,"disp":true,"width":4,"collapse":false},{"id":"2cdaed12.b6920a","type":"ui_group","z":"","name":"Coffee","tab":"57d4c334.8436d4","order":5,"disp":true,"width":4,"collapse":false},{"id":"1b2289fc.a46216","type":"ui_group","z":"","name":"Microwave","tab":"57d4c334.8436d4","order":6,"disp":true,"width":4,"collapse":false},{"id":"a5cf76d5.4e20a","type":"ui_group","z":"","name":"Basement","tab":"57d4c334.8436d4","order":7,"disp":true,"width":4,"collapse":false},{"id":"57d4c334.8436d4","type":"ui_tab","z":"","name":"Energy","icon":"fa-1x fa-bolt","order":3,"disabled":false,"hidden":false}]
Data array debug screenshot:
Setup payload debug screnshot:
So i am confused.
The title of this thread is "Graph with stored data"
So now you have shared the output from the "Data Array" - there is only one value in the payload - there is nothing in .data
Are you certain you captured the full message?
Perhaps it would be better if you shared the test.log file?
edit
actually, now I have your full flow - I am really struggling to understand what you are actually trying to achieve.
What I see
You have connected to a single measure coffeeplug/measure-power
that gives out single values and you are trying to build a JS object to display "stored data" in a chart
The problem
You dont have an array of values - there is no database! no list of data! - just a single payload with a value of 0.5
This literally makes no sense...
... I fear you have little idea what you are doing.
my log file:
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 6:27:14","payload":"0.5"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 6:48:34","payload":"0.9"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 6:48:41","payload":"0.5"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 7:39:56","payload":"0.9"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 7:40:1","payload":"0.5"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 7:40:16","payload":"0.9"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 7:40:16","payload":"1.2"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 7:40:17","payload":"0.9"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 7:40:29","payload":"0.5"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 7:51:18","payload":"0.9"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 7:51:31","payload":"0.5"},"labels":["Labels"]}]
[{"series":["Data"],"data":{"dateTime":"2020-10-26, 7:59:51","payload":"0.9"},"labels":["Labels"]}]
i just want to save values from my smart plug with date time and measured power, to save it to json file. date and time is generated from javascript and measured power from smart plug. when i restart raspberry pi, i want load values to graph. default graphs in node red not store datas, it means when i restart raspberry, datas from graphs are deleted.
OK, that makes sense, however there is much more to consider.
For example, if you simply save all changes as JSON to file, eventually that file will be so big your dashboard will crash. Eventually that file will be so large node-red itself will crash trying to load it.
You need to go off and explore things like
- how much data you want to keep (how many samples)
- remember, it is pointless trying to show more data points than there are pixels in your screen! (i.e. a sensible number of historical data points would be no more than the pixel width of your graph)
- where you want to store it - in a database? simple file?
- how do you contain the database / file size and prevent it getting too large?
then search this forum for "persistent chart" or search the internet for "node-red persistent chart"
Understand. I would like to store a graphs on json file because I don’t know work with database like MySQL. In a few last 2 day I learnd to save data to my test file. Which is achievement for me
My idea was a store data’s from my sensors from to separately files. For example bedroom temperature to bedr_temp.json, kitchen fridge wattage to kitch_watt.json, etc.
Understand.
My suggestion is - keep learning. 2 days is not enough time to be jumping into this level.
-
try learning about databases.
-
Get more familiar with node-red
then give it another go.
okay. thanks a lot for your time.