NCD Wireless Sensor to Azure Time Series Insights


#1

Here is my working example to get an NCD wireless vibration sensor into Azure Time Series insights utilizing Azure IOT hub node. The azure IOT hub is then link in via events to a Time Series Insight service. I am doing a lot with Node Red and azure and I hope other people are too!

[{"id":"31d47032.760fe","type":"ncd-wireless-node","z":"bf9e7a18.ad7a98","name":"","connection":"b48ef438.350bf8","config_comm":"","addr":"","sensor_type":"8","auto_config":"","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":95.00000381469727,"y":551.0000152587891,"wires":[["23883a20.c74436"]]},{"id":"334c53c7.e9390c","type":"function","z":"bf9e7a18.ad7a98","name":"","func":"//msg.payload = '\"id\":\"cgMfgVibration\"' +  msg.payload + ', \"time\":'+flow.get(\"currenttime\")\nmsg.payload = {\n    \"id\":\"cfgMfgVibration\",\n    \"timestamp\":flow.get(\"currenttime\"),\n    \"value\":msg.payload\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":298,"y":698,"wires":[["b9033366.efb6a"]]},{"id":"a3ffdab5.691018","type":"debug","z":"bf9e7a18.ad7a98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":836,"y":708,"wires":[]},{"id":"b9033366.efb6a","type":"json","z":"bf9e7a18.ad7a98","name":"","property":"payload","action":"","pretty":false,"x":438,"y":708,"wires":[["228c7f34.28b41","eab83c97.5f8b1"]]},{"id":"23883a20.c74436","type":"moment","z":"bf9e7a18.ad7a98","name":"","topic":"","input":"","inputType":"date","inTz":"America/Chicago","adjAmount":0,"adjType":"days","adjDir":"add","format":"","locale":"en_US","output":"currenttime","outputType":"flow","outTz":"America/Chicago","x":205.00001525878906,"y":637.0000190734863,"wires":[["334c53c7.e9390c"]]},{"id":"228c7f34.28b41","type":"azureiothub","z":"bf9e7a18.ad7a98","name":"Azure IoT Hub","protocol":"amqp","x":617,"y":708,"wires":[["a3ffdab5.691018"]]},{"id":"eab83c97.5f8b1","type":"debug","z":"bf9e7a18.ad7a98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":625,"wires":[]},{"id":"b48ef438.350bf8","type":"ncd-gateway-config","z":"","name":"","port":"COM4","baudRate":"115200","pan_id":"7fff","rssi":false}]

(edited by dceejay to format flow correctly)


#2

As it stands, this flow cannot be used by others. Please re-do between back-ticks.

Also please consider putting the flow on the flows site.

Thanks.