Node-RED Dashboard – Enterprise Accelerometers

Wireless Enterprise Accelerometer Dashboard

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.

Confirm that the correct “sensor type” is selected, Asset Monitor is the default in this flow.

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.

Wireless Enterprise Accelerometer Dashboard

The Flow

[{"id":"128499f8.93e056","type":"ncd-gateway-node","z":"95b1ec27.9fae5","name":"","connection":"","x":490,"y":320,"wires":[["c46e88b2.17d308"]]},{"id":"b8b2f766.dcbb48","type":"switch","z":"95b1ec27.9fae5","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"input_1","vt":"str"},{"t":"eq","v":"input_2","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1070,"y":480,"wires":[["5021590d.bf6f68"],["8a4de388.55bc9"]]},{"id":"a092304c.8edce","type":"split","z":"95b1ec27.9fae5","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":630,"y":480,"wires":[["4a563dc7.1ad264"]]},{"id":"f4cbd0e4.11b03","type":"ncd-wireless-node","z":"95b1ec27.9fae5","name":"","connection":"","config_comm":"","addr":"","sensor_type":"3","auto_config":false,"node_id":0,"delay":300,"destination":"0000FFFF","power":4,"retries":10,"pan_id":"7FFF","change_enabled":"","change_pr":"0","change_interval":"0","cm_calibration":"60.6","bp_altitude":"0","bp_pressure":"0","bp_temp_prec":"0","bp_press_prec":"0","amgt_accel":"0","amgt_mag":"0","amgt_gyro":"0","impact_accel":"0","impact_data_rate":"4","impact_threshold":25,"impact_duration":1,"activ_interr_x":1,"activ_interr_y":2,"activ_interr_z":4,"activ_interr_op":8,"x":470,"y":480,"wires":[["a092304c.8edce","d5c92f84.b9e07"]]},{"id":"542cdc32.ad6d24","type":"ui_chart","z":"95b1ec27.9fae5","name":"","group":"8f08e849.547418","order":0,"width":0,"height":0,"label":"Input History","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"3.3","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":1090,"y":360,"wires":[[],[]]},{"id":"c46e88b2.17d308","type":"debug","z":"95b1ec27.9fae5","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":930,"y":280,"wires":[]},{"id":"2daa15.908a15ec","type":"ui_gauge","z":"95b1ec27.9fae5","name":"","group":"b8a7bc9b.086d6","order":3,"width":0,"height":0,"gtype":"gage","title":"Battery","label":"V","format":"{{value | number:2}}","min":0,"max":"3.3","colors":["#ff0011","#e6e600","#09ca00"],"seg1":"","seg2":"","x":1080,"y":580,"wires":[]},{"id":"d5c92f84.b9e07","type":"change","z":"95b1ec27.9fae5","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.battery","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":580,"wires":[["2daa15.908a15ec"]]},{"id":"4a563dc7.1ad264","type":"range","z":"95b1ec27.9fae5","minin":"0","maxin":"1023","minout":"0","maxout":"3.3","action":"clamp","round":false,"property":"payload","name":"","x":830,"y":480,"wires":[["b8b2f766.dcbb48","542cdc32.ad6d24"]]},{"id":"5021590d.bf6f68","type":"ui_gauge","z":"95b1ec27.9fae5","name":"","group":"b8a7bc9b.086d6","order":1,"width":"6","height":"6","gtype":"gage","title":"Input 1","label":"V","format":"{{value | number:2}}","min":0,"max":"3.3","colors":["#24c928","#e6e600","#ff0700"],"seg1":"","seg2":"","x":1260,"y":440,"wires":[]},{"id":"8a4de388.55bc9","type":"ui_gauge","z":"95b1ec27.9fae5","name":"","group":"b8a7bc9b.086d6","order":2,"width":"6","height":"6","gtype":"gage","title":"Input 2","label":"V","format":"{{value | number:2}}","min":0,"max":"3.3","colors":["#24c928","#e6e600","#ff0700"],"seg1":"","seg2":"","x":1260,"y":500,"wires":[]},{"id":"8f08e849.547418","type":"ui_group","z":"","name":"Default","tab":"c4f82725.5cb928","disp":false,"width":"12","collapse":false},{"id":"b8a7bc9b.086d6","type":"ui_group","z":"","name":"Status","tab":"104ce52d.cc60bb","order":1,"disp":true,"width":"12","collapse":false},{"id":"c4f82725.5cb928","type":"ui_tab","z":"","name":"History","icon":"dashboard","order":4},{"id":"104ce52d.cc60bb","type":"ui_tab","z":"","name":"Current","icon":"dashboard","order":1}]
Wireless Enterprise Accelerometer Dashboard