[
{
“id”: “91bf6b4e.b87aa8”,
“type”: “tab”,
“label”: “Type 81”,
“disabled”: false,
“info”: “”
},
{
“id”: “2cb944f97f2f2662”,
“type”: “ncd-gateway-node”,
“z”: “91bf6b4e.b87aa8”,
“name”: “USB Modem”,
“connection”: “a2af30673810cf0b”,
“unknown_devices”: false,
“outputs”: 1,
“x”: 490,
“y”: 640,
“wires”: [
[
“f9b31f4654f4211d”,
“773d4dc0c842c2b5”
]
]
},
{
“id”: “e51f107d34f108ad”,
“type”: “inject”,
“z”: “91bf6b4e.b87aa8”,
“name”: “”,
“props”: [
{
“p”: “payload”
},
{
“p”: “payload”
}
],
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“topic”: “”,
“payload”: “{"devices":["00:13:a2:00:41:f6:c6:85"]}”,
“payloadType”: “json”,
“x”: 210,
“y”: 200,
“wires”: [
[
“aa1b68917410c301”
]
]
},
{
“id”: “aa1b68917410c301”,
“type”: “function”,
“z”: “91bf6b4e.b87aa8”,
“name”: “Add incomming device to context”,
“func”: “var newDevices = msg.payload.devices;\nvar existingDevices = flow.get(‘devices’);\n\nif(typeof existingDevices == ‘undefined’){\n flow.set(‘devices’,newDevices);\n msg.payload.devices = newDevices;\n return msg;\n}else{\n for(let newDevice of newDevices){\n exists = false;\n for(let existingDevice of existingDevices){\n if(newDevice == existingDevice){\n exists = true;\n break;\n }\n }\n if(!exists){\n existingDevices.push(newDevice);\n } \n }\n}\nflow.set(‘devices’,existingDevices);\nmsg.payload.devices = existingDevices;\nreturn msg;”,
“outputs”: 1,
“noerr”: 0,
“initialize”: “”,
“finalize”: “”,
“x”: 580,
“y”: 280,
“wires”: [
[]
]
},
{
“id”: “67e10176eaf721f7”,
“type”: “function”,
“z”: “91bf6b4e.b87aa8”,
“name”: “Check Devices”,
“func”: “var devices = flow.get(‘devices’);\nvar ramdevices = flow.get(‘ramdevices’);\nvar deviceID = msg.payload.addr;\nif(typeof devices == ‘undefined’)return;\nif(typeof ramdevices == ‘undefined’){\n ramdevices = [];\n flow.set(‘ramdevices’,ramdevices);\n \n}\nfor(var i = 0; i < devices.length; i++){\n // console.log('device: ‘+devices[i]+’ deviceID: '+deviceID);\n // if (deviceID == devices[i] && msg.payload.sensor_data.hasOwnProperty("x_rms_ACC_G")) {\n if(deviceID == devices[i] && msg.payload.sensor_data.hasOwnProperty("x1_rms_ACC_G")){\n if(ramdevices.includes(deviceID)){\n msg.payload.address = deviceID; \n }\n else{\n msg.payload.address = "00:00:00:00:00:00:ff:ff" ;\n ramdevices.push(deviceID);\n }\n // msg.payload.address = deviceID;\n // msg.payload.address = "00:00:00:00:00:00:ff:ff"\n // msg.payload.data = [0xF4,0x4F,0x00,0x00,0x50,0x13]; // type 80 0r 84\n // msg.payload.data = [0xF4,0x4F,0x00,0x00,0x50,0x13,0x01]; // type 81 probe one\n msg.payload.data = [0xF4,0x4F,0x00,0x00,0x50,0x13,0x02]; // type 81 probe two\n // devices.splice(i,1);\n flow.set("ramdevices",ramdevices);\n return msg;\n \n }\n}”,
“outputs”: 1,
“noerr”: 0,
“initialize”: “”,
“finalize”: “”,
“libs”: [],
“x”: 260,
“y”: 400,
“wires”: [
[
“5810af138bac6e84”,
“6225b1420c8d6104”
]
]
},
{
“id”: “f9b31f4654f4211d”,
“type”: “switch”,
“z”: “91bf6b4e.b87aa8”,
“name”: “Vibration Check Valve”,
“property”: “payload.sensor_type”,
“propertyType”: “msg”,
“rules”: [
{
“t”: “eq”,
“v”: “80”,
“vt”: “num”
},
{
“t”: “eq”,
“v”: “81”,
“vt”: “num”
},
{
“t”: “eq”,
“v”: “84”,
“vt”: “num”
},
{
“t”: “eq”,
“v”: “82”,
“vt”: “num”
}
],
“checkall”: “true”,
“repair”: false,
“outputs”: 4,
“x”: 720,
“y”: 640,
“wires”: [
[
“fef8d6ed0368c16b”,
“67e10176eaf721f7”
],
[
“67e10176eaf721f7”
],
[
“67e10176eaf721f7”
],
[
“67e10176eaf721f7”
]
]
},
{
“id”: “5810af138bac6e84”,
“type”: “delay”,
“z”: “91bf6b4e.b87aa8”,
“name”: “”,
“pauseType”: “delay”,
“timeout”: “100”,
“timeoutUnits”: “milliseconds”,
“rate”: “1”,
“nbRateUnits”: “1”,
“rateUnits”: “second”,
“randomFirst”: “1”,
“randomLast”: “5”,
“randomUnits”: “seconds”,
“drop”: false,
“outputs”: 1,
“x”: 270,
“y”: 620,
“wires”: [
[
“2cb944f97f2f2662”
]
]
},
{
“id”: “fef8d6ed0368c16b”,
“type”: “debug”,
“z”: “91bf6b4e.b87aa8”,
“name”: “check vib”,
“active”: false,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “payload”,
“targetType”: “msg”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 920,
“y”: 680,
“wires”: []
},
{
“id”: “6225b1420c8d6104”,
“type”: “debug”,
“z”: “91bf6b4e.b87aa8”,
“name”: “check device”,
“active”: false,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “payload”,
“targetType”: “msg”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 570,
“y”: 420,
“wires”: []
},
{
“id”: “773d4dc0c842c2b5”,
“type”: “debug”,
“z”: “91bf6b4e.b87aa8”,
“name”: “zigmo out”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “payload”,
“targetType”: “msg”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 730,
“y”: 720,
“wires”: []
},
{
“id”: “69b587f707d23948”,
“type”: “ncd-wireless-node”,
“z”: “91bf6b4e.b87aa8”,
“name”: “”,
“connection”: “a2af30673810cf0b”,
“config_comm”: “a2af30673810cf0b”,
“addr”: “”,
“sensor_type”: “81”,
“auto_config”: false,
“on_the_fly_enable”: true,
“node_id_delay_active”: true,
“node_id”: “0”,
“delay”: “0”,
“form_network”: false,
“destination_active”: true,
“destination”: “0000FFFF”,
“power_active”: true,
“power”: 4,
“retries_active”: true,
“retries”: 10,
“pan_id_active”: false,
“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,
“force_calibration_co2_auto_config”: “”,
“force_calibration_co2”: 400,
“filtering”: 0,
“data_rate”: 5,
“time_series”: 0,
“reading_type”: 1,
“mode_80_active”: true,
“mode_80”: “2”,
“measurement_mode_80_active”: true,
“measurement_mode_80”: 0,
“on_request_timeout_80_active”: true,
“on_request_timeout_80”: “1”,
“sensor_boot_time_420ma_active”: false,
“sensor_boot_time_420ma”: “0”,
“deadband_80_active”: “”,
“deadband_80”: 0,
“filter_80_active”: true,
“filter_80”: “1”,
“output_data_rate_p1_81_active”: true,
“output_data_rate_p1_81”: “15”,
“output_data_rate_p2_81_active”: true,
“output_data_rate_p2_81”: “15”,
“sampling_duration_p1_81_active”: true,
“sampling_duration_p1_81”: “10”,
“sampling_duration_p2_81_active”: “”,
“sampling_duration_p2_81”: 0,
“led_alert_mode_84_active”: “”,
“led_alert_mode_84”: 0,
“led_accelerometer_threshold_84_active”: “”,
“led_accelerometer_threshold_84”: “”,
“led_velocity_threshold_84_active”: “”,
“led_velocity_threshold_84”: “”,
“acceleration_interrupt_threshold_84_active”: “”,
“acceleration_interrupt_threshold_84”: “”,
“set_rtc_101”: true,
“current_calibration_82”: “”,
“current_calibration_82_active”: false,
“current_calibration_c1_80”: 178,
“current_calibration_c1_80_active”: “”,
“current_calibration_c2_80”: 178,
“current_calibration_c2_80_active”: “”,
“current_calibration_c3_80”: 178,
“current_calibration_c3_80_active”: “”,
“output_data_rate_101_active”: true,
“output_data_rate_101”: “9”,
“output_data_rate_101_m2_active”: “”,
“output_data_rate_101_m2”: 0,
“sampling_duration_101_active”: “”,
“sampling_duration_101”: 1,
“sampling_interval_101_active”: true,
“sampling_interval_101”: “0”,
“full_scale_range_101_active”: true,
“full_scale_range_101”: “0”,
“full_scale_range_101_m2_active”: “”,
“full_scale_range_101_m2”: 1,
“x_axis_101”: “”,
“y_axis_101”: “”,
“z_axis_101”: “”,
“low_pass_filter_80_active”: “”,
“low_pass_filter_80”: 0,
“high_pass_filter_80_active”: “”,
“high_pass_filter_80”: 0,
“low_pass_filter_81_p2_active”: “”,
“low_pass_filter_81_p2”: 0,
“high_pass_filter_81_p2_active”: “”,
“high_pass_filter_81_p2”: 0,
“roll_angle_threshold_47”: “0”,
“roll_angle_threshold_47_active”: false,
“pitch_angle_threshold_47”: “0”,
“pitch_angle_threshold_47_active”: false,
“payload_length_80_active”: true,
“payload_length_80”: “3”,
“x”: 240,
“y”: 80,
“wires”: [
[
“6a32ee40216d33ea”
]
]
},
{
“id”: “6a32ee40216d33ea”,
“type”: “debug”,
“z”: “91bf6b4e.b87aa8”,
“name”: “debug 10”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “true”,
“targetType”: “full”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 540,
“y”: 140,
“wires”: []
},
{
“id”: “a2af30673810cf0b”,
“type”: “ncd-gateway-config”,
“name”: “”,
“comm_type”: “serial”,
“ip_address”: “”,
“tcp_port”: “2101”,
“port”: “COM7”,
“baudRate”: “115200”,
“pan_id”: “7fff”,
“rssi”: false
}
]