Hello all, I am new to node red as of 2 weeks ago, so Im sure theres something simple im missing here. I have a Raspberry pi zero W, with a neopixel stick and an adafruit BME680. I have used several different guides to build this dashboard.
My main issue im having is that the line charts work completely fine until after the browser refreshes the page. After the refresh, the time scale changes and adds several hours to the x axis. The issue can be solved by either deleting the chart and adding a new one or rebooting the device, however when the page refreshes, the same thing occurs. Im baffled by this.
^Here you can see the chart is working perfectly fine
^Here you can see that the page has been refreshed, the data points are still there, however the x axis has for some reason added 9 hours, although the chart is only set to view the last 1 hour.
you also might notice that the other charts are having the same issue although the value is the same after each poll.
In the screenshots, you might notice that VOC is currently the only working data coming from the sensor, This is because I got some hot glue in the sensor port and it has ruined most of it.
Any input would be greatly appreciated. you can find my flow here:
[{"id":"d551e5.6a5cfe18","type":"tab","label":"BME680","disabled":false,"info":""},{"id":"2a49f37b.3cc24c","type":"group","z":"d551e5.6a5cfe18","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["bbe40d5a.9fa9e","b77fa80c.11ed38"],"x":1254,"y":219,"w":232,"h":142},{"id":"4da19e82.5ebb2","type":"group","z":"d551e5.6a5cfe18","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["5b7698f6.faafc8","5fd30172.4d4c58","9d6fbcc2.49f4b8"],"x":1234,"y":579,"w":252,"h":162},{"id":"b0696838.676458","type":"group","z":"d551e5.6a5cfe18","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["e3e148eb.6c59d","f7a4502f.f25b58","b3022fd7.ba64f8"],"x":1234,"y":39,"w":312,"h":162},{"id":"c4a3f0fe.2d866","type":"group","z":"d551e5.6a5cfe18","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["8c364894.a362a8","85b65f56.e570b","a1e5062c.50b028","e4934e73.c49b8"],"x":1234,"y":379,"w":232,"h":182},{"id":"a1e5062c.50b028","type":"ui_chart","z":"d551e5.6a5cfe18","g":"c4a3f0fe.2d866","name":"","group":"ff8a4ab5.f3ed5","order":0,"width":"10","height":"4","label":"chart","chartType":"line","legend":"false","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"500","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1330,"y":440,"wires":[[]]},{"id":"ff8a4ab5.f3ed5","type":"ui_group","name":"VOC (Ohms)","tab":"6c90afc.b3623d","order":3,"disp":true,"width":"15","collapse":false},{"id":"6c90afc.b3623d","type":"ui_tab","name":"BME680","icon":"dashboard","order":2,"disabled":false,"hidden":false},{"id":"da3a1383.9e211","type":"group","z":"d551e5.6a5cfe18","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["9bce8f10.5d73a","e91b44a2.210da8","9f7adbf3.d62af8"],"x":1234,"y":759,"w":252,"h":162},{"id":"45811201.43cc8c","type":"pythonshell in","z":"d551e5.6a5cfe18","name":"BME680 Reader","pyfile":"/home/pi/bme680-python/examples/digi-env.py","virtualenv":"","continuous":true,"stdInData":false,"x":750,"y":240,"wires":[["56540ed2.e2842","c91d3262.08155"]]},{"id":"552a34f5.caaf84","type":"debug","z":"d551e5.6a5cfe18","name":"","active":false,"tosidebar":false,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":710,"y":440,"wires":[]},{"id":"ddc4d3ef.871be","type":"debug","z":"d551e5.6a5cfe18","name":"","active":false,"tosidebar":false,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":710,"y":340,"wires":[]},{"id":"9bce8f10.5d73a","type":"ui_gauge","z":"d551e5.6a5cfe18","g":"da3a1383.9e211","name":"Pressure Gauge","group":"e66437e4.1a68e8","order":5,"width":"8","height":"4","gtype":"gage","title":"","label":"Pressure HPA","format":"{{msg.payload.Pressure_HPA}}","min":0,"max":"1500","colors":["#00b500","#e6e600","#ca3838"],"seg1":"500","seg2":"1000","x":1340,"y":840,"wires":[]},{"id":"e3e148eb.6c59d","type":"ui_gauge","z":"d551e5.6a5cfe18","g":"b0696838.676458","name":"Temperature Gauge","group":"e66437e4.1a68e8","order":1,"width":"8","height":"4","gtype":"gage","title":"","label":"Temperature oCelsius","format":"{{msg.payload.Temperature_oC}}","min":0,"max":"40","colors":["#00b500","#e6e600","#ca3838"],"seg1":"20","seg2":"30","x":1360,"y":120,"wires":[]},{"id":"f7a4502f.f25b58","type":"ui_chart","z":"d551e5.6a5cfe18","g":"b0696838.676458","name":"Temperature Chart (oCelsius)","group":"863f6151.2b3ca8","order":1,"width":"10","height":"4","label":"","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"60","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1390,"y":80,"wires":[[]]},{"id":"408a9812.361928","type":"function","z":"d551e5.6a5cfe18","name":"Prepare Temperature","func":"var newMsg={};\nnewMsg.topic = 'Temperature_oC';\nnewMsg.payload = msg.payload.Temperature_oC;\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1100,"y":320,"wires":[["f7a4502f.f25b58"]]},{"id":"e12687de.a17a","type":"function","z":"d551e5.6a5cfe18","name":"Prepare Pressure","func":"var newMsg={};\nnewMsg.topic = 'Pressure_HPA';\nnewMsg.payload = msg.payload.Pressure_HPA\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1090,"y":440,"wires":[["e91b44a2.210da8"]]},{"id":"e91b44a2.210da8","type":"ui_chart","z":"d551e5.6a5cfe18","g":"da3a1383.9e211","name":"Pressure Chart (HPA)","group":"b4c4e00d.cbf16","order":2,"width":"15","height":"4","label":"","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1360,"y":800,"wires":[[]]},{"id":"3434c172.45b926","type":"function","z":"d551e5.6a5cfe18","name":"Prepare Humidity","func":"var newMsg={};\nnewMsg.topic = 'RelativeHumidity_percent';\nnewMsg.payload = msg.payload.RelativeHumidity_percent;\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1090,"y":400,"wires":[["5fd30172.4d4c58"]]},{"id":"5b7698f6.faafc8","type":"ui_gauge","z":"d551e5.6a5cfe18","g":"4da19e82.5ebb2","name":"Humidity Gauge","group":"e66437e4.1a68e8","order":6,"width":"8","height":"4","gtype":"gage","title":"","label":"Humidity %","format":"{{msg.payload.RelativeHumidity_percent}}","min":0,"max":"100","colors":["#00b500","#80ff00","#ca3838"],"seg1":"30","seg2":"40","x":1340,"y":660,"wires":[]},{"id":"5fd30172.4d4c58","type":"ui_chart","z":"d551e5.6a5cfe18","g":"4da19e82.5ebb2","name":"Humidity Chart (%)","group":"a7a0d7.6c039f28","order":1,"width":"10","height":"4","label":"","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1350,"y":620,"wires":[[]]},{"id":"8aee2381.d5cf3","type":"function","z":"d551e5.6a5cfe18","name":"Prepare VOC","func":"var newMsg={};\nnewMsg.topic = 'Resistance_Ohms';\nnewMsg.payload = msg.payload.Resistance_Ohms;\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1080,"y":360,"wires":[["1064d2f5.6920ad","e4934e73.c49b8"]]},{"id":"8c364894.a362a8","type":"ui_gauge","z":"d551e5.6a5cfe18","g":"c4a3f0fe.2d866","name":"VOC Gauge","group":"e66437e4.1a68e8","order":2,"width":"8","height":"4","gtype":"gage","title":"","label":"VOC Ohms","format":"{{msg.payload.Resistance_Ohms}}","min":0,"max":"300000","colors":["#ff0000","#e6e600","#6df906"],"seg1":"100000","seg2":"200000","x":1330,"y":480,"wires":[]},{"id":"b3022fd7.ba64f8","type":"ui_template","z":"d551e5.6a5cfe18","g":"b0696838.676458","group":"e66437e4.1a68e8","name":"Temperature Max and Min","order":3,"width":"8","height":"1","format":"<div layout=\"row\" layout-align=\"start center\">\n <span flex>    Min (oC): <span style=\"color: green\">{{msg.temp.min}}</span>\n   Max: <span flex style=\"color: red\">{{msg.temp.max}}</span></span>\n</div>","storeOutMessages":false,"fwdInMessages":true,"templateScope":"local","x":1370,"y":160,"wires":[[]]},{"id":"d24141b4.8ed88","type":"function","z":"d551e5.6a5cfe18","name":"Prepare data","func":"var newMsg={temp:{},pressure:{},humidity:{},voc:{}};\nvar temp_min=flow.get('temp_min') || 100;\nvar temp_max=flow.get('temp_max') || -100;\nvar pressure_min=flow.get('pressure_min') || 5000;\nvar pressure_max=flow.get('pressure_max') || -5000;\nvar humidity_min=flow.get('humidity_min') || 100;\nvar humidity_max=flow.get('humidity_max') || -100;\nvar voc_min=flow.get('voc_min') || 500000;\nvar voc_max=flow.get('voc_max') || -500000;\n//\nnewMsg.payload = msg.payload;\n\n//\n\nif (msg.payload.Temperature_oC < temp_min) {\n newMsg.temp.min = msg.payload.Temperature_oC;\n flow.set('temp_min', msg.payload.Temperature_oC);\n} else {\n newMsg.temp.min = temp_min;\n}\nif (msg.payload.Temperature_oC > temp_max) {\n newMsg.temp.max = msg.payload.Temperature_oC;\n flow.set('temp_max', msg.payload.Temperature_oC);\n} else {\n newMsg.temp.max = temp_max;\n}\n\n//\n\nif (msg.payload.Pressure_HPA < pressure_min) {\n newMsg.pressure.min = msg.payload.Pressure_HPA;\n flow.set('pressure_min', msg.payload.Pressure_HPA);\n} else {\n newMsg.pressure.min = pressure_min;\n}\nif (msg.payload.Pressure_HPA > pressure_max) {\n newMsg.pressure.max = msg.payload.Pressure_HPA;\n flow.set('pressure_max', msg.payload.Pressure_HPA);\n} else {\n newMsg.pressure.max = pressure_max;\n}\n\n//\n\nif (msg.payload.RelativeHumidity_percent < humidity_min) {\n newMsg.humidity.min = msg.payload.RelativeHumidity_percent;\n flow.set('humidity_min', msg.payload.RelativeHumidity_percent);\n} else {\n newMsg.humidity.min = humidity_min;\n}\nif (msg.payload.RelativeHumidity_percent > humidity_max) {\n newMsg.humidity.max = msg.payload.RelativeHumidity_percent;\n flow.set('humidity_max', msg.payload.RelativeHumidity_percent);\n} else {\n newMsg.humidity.max = humidity_max;\n}\n\n//\n\nif (msg.payload.Resistance_Ohms < voc_min) {\n newMsg.voc.min = msg.payload.Resistance_Ohms;\n flow.set('voc_min', msg.payload.Resistance_Ohms);\n} else {\n newMsg.voc.min = voc_min;\n}\nif (msg.payload.Resistance_Ohms > voc_max) {\n newMsg.voc.max = msg.payload.Resistance_Ohms;\n flow.set('voc_max', msg.payload.Resistance_Ohms);\n} else {\n newMsg.voc.max = voc_max;\n}\n\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":730,"y":380,"wires":[["552a34f5.caaf84","408a9812.361928","e3e148eb.6c59d","b3022fd7.ba64f8","8aee2381.d5cf3","3434c172.45b926","e12687de.a17a","8c364894.a362a8","5b7698f6.faafc8","9bce8f10.5d73a","9f7adbf3.d62af8","9d6fbcc2.49f4b8","85b65f56.e570b"]]},{"id":"b323191b.6a76d","type":"join","z":"d551e5.6a5cfe18","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":340,"wires":[["d24141b4.8ed88","ddc4d3ef.871be"]]},{"id":"9f7adbf3.d62af8","type":"ui_template","z":"d551e5.6a5cfe18","g":"da3a1383.9e211","group":"e66437e4.1a68e8","name":"Pressure max and min","order":7,"width":"8","height":"1","format":"<div layout=\"row\" layout-align=\"start center\">\n <span flex>    Min (HPA): <span style=\"color: green\">{{msg.pressure.min}}</span>\n   Max: <span flex style=\"color: red\">{{msg.pressure.max}}</span></span>\n</div>","storeOutMessages":false,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":1360,"y":880,"wires":[[]]},{"id":"9d6fbcc2.49f4b8","type":"ui_template","z":"d551e5.6a5cfe18","g":"4da19e82.5ebb2","group":"e66437e4.1a68e8","name":"Humidity max and min","order":8,"width":"8","height":"1","format":"<div layout=\"row\" layout-align=\"start center\">\n <span flex>    Min (%): <span style=\"color: green\">{{msg.humidity.min}}</span>\n   Max: <span flex style=\"color: red\">{{msg.humidity.max}}</span></span>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1360,"y":700,"wires":[[]]},{"id":"85b65f56.e570b","type":"ui_template","z":"d551e5.6a5cfe18","g":"c4a3f0fe.2d866","group":"e66437e4.1a68e8","name":"VOC max and min","order":4,"width":"8","height":"1","format":"<div layout=\"row\" layout-align=\"start center\">\n <span flex>   Min (Ohms): <span style=\"color: green\">{{msg.voc.min}}</span>\n   Max: <span flex style=\"color: red\">{{msg.voc.max}}</span></span>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1350,"y":520,"wires":[[]]},{"id":"452a5198.520f6","type":"ui_button","z":"d551e5.6a5cfe18","name":"Halt","group":"b4c4e00d.cbf16","order":4,"width":"2","height":"1","passthru":false,"label":"Shutdown","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","topicType":"str","x":410,"y":460,"wires":[["64212229.98256c"]]},{"id":"64212229.98256c","type":"exec","z":"d551e5.6a5cfe18","command":"sudo poweroff #","addpay":false,"append":"","useSpawn":"","timer":"","name":"turn off Pi","x":540,"y":460,"wires":[[],[],[]]},{"id":"4926710d.cc6af","type":"ui_button","z":"d551e5.6a5cfe18","name":"","group":"b4c4e00d.cbf16","order":2,"width":"1","height":"1","passthru":false,"label":"Reset","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":410,"y":400,"wires":[["82d547b0.18997"]]},{"id":"82d547b0.18997","type":"function","z":"d551e5.6a5cfe18","name":"Reset","func":"flow.set('temp_min', 100);\nflow.set('temp_max', -100);\nflow.set('pressure_min', 5000);\nflow.set('pressure_max', -5000);\nflow.set('humidity_min', 100);\nflow.set('humidity_max', -100);\nflow.set('voc_min', 5000000);\nflow.set('voc_max', -5000000);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":530,"y":400,"wires":[["d24141b4.8ed88"]]},{"id":"56540ed2.e2842","type":"split","z":"d551e5.6a5cfe18","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":320,"y":300,"wires":[["aca78c5f.5728a"]]},{"id":"aca78c5f.5728a","type":"json","z":"d551e5.6a5cfe18","name":"","property":"payload","action":"obj","pretty":false,"x":410,"y":340,"wires":[["b323191b.6a76d"]]},{"id":"15dc7f0b.66b7e1","type":"exec","z":"d551e5.6a5cfe18","command":"sudo reboot #","addpay":false,"append":"","useSpawn":"","timer":"","name":"Reboot","x":560,"y":520,"wires":[[],[],[]]},{"id":"8764f680.eaed08","type":"ui_button","z":"d551e5.6a5cfe18","name":"Reboot","group":"b4c4e00d.cbf16","order":4,"width":"2","height":"1","passthru":false,"label":"Reboot","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","topicType":"str","x":420,"y":520,"wires":[["15dc7f0b.66b7e1"]]},{"id":"1064d2f5.6920ad","type":"range","z":"d551e5.6a5cfe18","minin":"10000","maxin":"150000","minout":"100","maxout":"0","action":"clamp","round":true,"property":"payload","name":"LED Range VOC","x":1570,"y":400,"wires":[["72618df0.784504"]]},{"id":"72618df0.784504","type":"rpi-neopixels","z":"d551e5.6a5cfe18","name":"","gpio":18,"pixels":"8","bgnd":"255,255,255","fgnd":"000,255,000","wipe":"40","mode":"pcent","rgb":"rgb","brightness":"60","gamma":false,"x":1670,"y":320,"wires":[]},{"id":"b77fa80c.11ed38","type":"function","z":"d551e5.6a5cfe18","d":true,"g":"2a49f37b.3cc24c","name":"LED Function","func":"m=msg.payload\n\nif (m == 1)\n{\nreturn {Resistance_Ohms:payload};\n}\nelse if (m == 2)\n{\n return {RelativeHumidity_percent:payload};\n}\n\nreturn msg;\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1380,"y":320,"wires":[[]]},{"id":"bbe40d5a.9fa9e","type":"ui_dropdown","z":"d551e5.6a5cfe18","d":true,"g":"2a49f37b.3cc24c","name":"","label":"LED Mode","tooltip":"","place":"Select option","group":"e66437e4.1a68e8","order":8,"width":0,"height":0,"passthru":false,"multiple":false,"options":[{"label":"VOC","value":1,"type":"num"},{"label":"Humidity","value":2,"type":"num"},{"label":"Pressure","value":3,"type":"num"}],"payload":"","topic":"mode","topicType":"msg","x":1350,"y":260,"wires":[["b77fa80c.11ed38"]]},{"id":"c91d3262.08155","type":"debug","z":"d551e5.6a5cfe18","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":980,"y":180,"wires":[]},{"id":"e4934e73.c49b8","type":"ui_chart","z":"d551e5.6a5cfe18","g":"c4a3f0fe.2d866","name":"","group":"e66437e4.1a68e8","order":9,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1330,"y":420,"wires":[[]]},{"id":"e66437e4.1a68e8","type":"ui_group","name":"Dashboard","tab":"6c90afc.b3623d","order":1,"disp":false,"width":"16","collapse":false},{"id":"863f6151.2b3ca8","type":"ui_group","name":"Temperature (oCelsius)","tab":"6c90afc.b3623d","order":2,"disp":true,"width":"15","collapse":false},{"id":"b4c4e00d.cbf16","type":"ui_group","name":"Pressure (HPA)","tab":"6c90afc.b3623d","order":5,"disp":true,"width":"15","collapse":false},{"id":"a7a0d7.6c039f28","type":"ui_group","name":"Humidity (%)","tab":"6c90afc.b3623d","order":4,"disp":true,"width":"15","collapse":false}]