Node-RED Dashboard Flow
The examples in this series are for use with Node-RED and our Wireless Enterprise line of products. If you haven’t already, check out this post, which will explain the packages required for this flow.
This example will set up a dashboard with 2 tabs, one containing current readings, the other showing historical data. All telemetry reported from the sensor is displayed in both tabs.
Usage
Click on the flow below to copy it to your clipboard.
From the hamburger menu on the top right of your flow window, hover over import, click clipboard, and paste in the copied flow.
Double click on the Wireless Gateway node and set up the “Serial Device” field.
At this point you can deploy (it will throw an error about unconfigured nodes, this is fine).
Go to the other node that still shows a triangle, indicating it needs additional configuration, and select the serial device you just created from the drop down.
Deploy again and you will begin receiving telemetry when the sensor is restarted, or at the interval indicated by the settings stored in the sensor.
The Flow
[{"id":"400cba0d.021bd4","type":"ncd-wireless-node","z":"13754c0b.dca3a4","name":"Accel/Mag/Gyro/Temp","connection":"","config_comm":"","addr":"","sensor_type":"5","auto_config":true,"node_id":0,"delay":"5","destination":"0000FFFF","power":"1","retries":10,"pan_id":"7FFF","change_enabled":false,"change_pr":"0","change_interval":"0","cm_calibration":"0","bp_altitude":"0","bp_pressure":"0","bp_temp_prec":"0","bp_press_prec":"0","amgt_accel":"0","amgt_mag":"0","amgt_gyro":"0","x":140,"y":380,"wires":[["af59356d.0f23f8","9a2a7cbf.76161"]]},{"id":"3800bb26.f824a4","type":"ui_chart","z":"13754c0b.dca3a4","name":"","group":"60afd6aa.b52828","order":1,"width":"12","height":"6","label":"Accel","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"10","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":830,"y":280,"wires":[[],[]]},{"id":"af59356d.0f23f8","type":"split","z":"13754c0b.dca3a4","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":330,"y":380,"wires":[["e24a52cf.d53e2"]]},{"id":"e24a52cf.d53e2","type":"switch","z":"13754c0b.dca3a4","name":"","property":"topic","propertyType":"msg","rules":[{"t":"regex","v":"accel_.*","vt":"str","case":false},{"t":"regex","v":"magneto_.*","vt":"str","case":false},{"t":"regex","v":"gyro_.*","vt":"str","case":false},{"t":"eq","v":"temperature","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":450,"y":380,"wires":[["3800bb26.f824a4","8aecc887.85b3a8"],["d70ac318.f5cce","722bb814.a1f818"],["8e302384.dab27","8dbd1766.9b52a8"],["91a15743.aa9538"]]},{"id":"d70ac318.f5cce","type":"ui_chart","z":"13754c0b.dca3a4","name":"","group":"60afd6aa.b52828","order":2,"width":"6","height":"6","label":"Mageneto","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"10","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":840,"y":380,"wires":[[],[]]},{"id":"8e302384.dab27","type":"ui_chart","z":"13754c0b.dca3a4","name":"","group":"60afd6aa.b52828","order":3,"width":"6","height":"6","label":"Gyro","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"10","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":830,"y":480,"wires":[[],[]]},{"id":"8aecc887.85b3a8","type":"ui_chart","z":"13754c0b.dca3a4","name":"","group":"8b6cb092.e5788","order":0,"width":"12","height":"6","label":"Accel","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":1010,"y":280,"wires":[[],[]]},{"id":"722bb814.a1f818","type":"ui_chart","z":"13754c0b.dca3a4","name":"","group":"8b6cb092.e5788","order":0,"width":"12","height":"6","label":"Magneto","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":1020,"y":380,"wires":[[],[]]},{"id":"8dbd1766.9b52a8","type":"ui_chart","z":"13754c0b.dca3a4","name":"","group":"8b6cb092.e5788","order":0,"width":"12","height":"6","label":"Gyro","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":970,"y":480,"wires":[[],[]]},{"id":"9a2a7cbf.76161","type":"change","z":"13754c0b.dca3a4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.battery","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":640,"wires":[["238470ce.4d10f"]]},{"id":"786bff29.83c1f","type":"ncd-gateway-node","z":"13754c0b.dca3a4","name":"","connection":"","x":270,"y":160,"wires":[["e2d8807d.240c6"]]},{"id":"e2d8807d.240c6","type":"debug","z":"13754c0b.dca3a4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":500,"y":100,"wires":[]},{"id":"91a15743.aa9538","type":"function","z":"13754c0b.dca3a4","name":"C to F","func":"msg.payload = (msg.payload * 1.8) + 32;\nreturn msg;","outputs":1,"noerr":0,"x":650,"y":560,"wires":[["4adf4a13.461a44","5cc8646d.11e81c"]]},{"id":"4adf4a13.461a44","type":"ui_gauge","z":"13754c0b.dca3a4","name":"","group":"60afd6aa.b52828","order":5,"width":"6","height":"4","gtype":"gage","title":"Temperature","label":"Fahrenheit","format":"{{value | number:2}}","min":"30","max":"100","colors":["#dad0ff","#2ce619","#ca3838"],"seg1":"","seg2":"","x":810,"y":580,"wires":[]},{"id":"238470ce.4d10f","type":"ui_gauge","z":"13754c0b.dca3a4","name":"","group":"60afd6aa.b52828","order":0,"width":"6","height":"4","gtype":"gage","title":"Battery","label":"V","format":"{{value | number:2}}","min":0,"max":"3.3","colors":["#e00600","#e6e600","#07ca00"],"seg1":"","seg2":"","x":720,"y":640,"wires":[]},{"id":"5cc8646d.11e81c","type":"ui_chart","z":"13754c0b.dca3a4","name":"","group":"8b6cb092.e5788","order":0,"width":"12","height":"6","label":"Temperature","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"bezier","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":1010,"y":560,"wires":[[],[]]},{"id":"60afd6aa.b52828","type":"ui_group","z":"","name":"Accel/Magento/Gyro","tab":"4c7c29de.f9ea38","disp":true,"width":"12","collapse":false},{"id":"8b6cb092.e5788","type":"ui_group","z":"","name":"Accel/Magento/Gyro","tab":"38410f18.307bb","disp":true,"width":"24","collapse":false},{"id":"4c7c29de.f9ea38","type":"ui_tab","z":"","name":"Current","icon":"dashboard"},{"id":"38410f18.307bb","type":"ui_tab","z":"","name":"History","icon":"dashboard"}]