[ { "id": "c64944b8e1931832", "type": "tab", "label": "Flow 2", "disabled": false, "info": "", "env": [] }, { "id": "128499f8.93e056", "type": "ncd-gateway-node", "z": "c64944b8e1931832", "name": "", "connection": "3a158777559a1790", "unknown_devices": false, "outputs": 1, "x": 230, "y": 140, "wires": [ [ "1ceeec511f8008a2", "eb4483332f266888" ] ] }, { "id": "b8b2f766.dcbb48", "type": "switch", "z": "c64944b8e1931832", "name": "", "property": "topic", "propertyType": "msg", "rules": [ { "t": "eq", "v": "input_1", "vt": "str" }, { "t": "eq", "v": "input_2", "vt": "str" }, { "t": "eq", "v": "input_3", "vt": "str" }, { "t": "eq", "v": "input_4", "vt": "str" }, { "t": "eq", "v": "input_5", "vt": "str" }, { "t": "eq", "v": "input_6", "vt": "str" }, { "t": "eq", "v": "input_7", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 7, "x": 790, "y": 320, "wires": [ [ "3eef1d3b.4a4d52", "b015d4f18bb2ac5c", "cca1fcb1e7627637" ], [ "84b7717b.36328", "10b7adfc47be453e" ], [ "8d44da5fc535c964", "8c99e4c19f1d3fd5" ], [ "81f806e923833bba", "e5b5509d55370eb8" ], [ "0e7329190b4561dc", "84cb704d960a1066" ], [ "e1b32cd23e805f76", "411b99e570d607a5" ], [ "e6b43414ac1f4d69", "f44473ae4faf48fa" ] ] }, { "id": "a092304c.8edce", "type": "split", "z": "c64944b8e1931832", "name": "", "splt": "\\n", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "topic", "x": 470, "y": 320, "wires": [ [ "a595e2f8.33b25", "4a2f8cd1.664784", "b8adec59aca4aac8" ] ] }, { "id": "f4cbd0e4.11b03", "type": "ncd-wireless-node", "z": "c64944b8e1931832", "name": "", "connection": "3a158777559a1790", "config_comm": "3a158777559a1790", "addr": "", "sensor_type": "37", "auto_config": true, "on_the_fly_enable": false, "node_id_delay_active": true, "node_id": 0, "delay": "0", "form_network": false, "destination_active": false, "destination": "0000FFFF", "power_active": false, "power": 4, "retries_active": false, "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_active": false, "impact_accel": "0", "impact_data_rate_active": false, "impact_data_rate": "4", "impact_threshold_active": false, "impact_threshold": 25, "impact_duration_active": false, "impact_duration": 1, "activ_interr_x": 1, "activ_interr_y": 2, "activ_interr_z": 4, "activ_interr_op": 8, "force_calibration_co2_auto_config": false, "force_calibration_co2": "400", "filtering": "0", "data_rate": "5", "time_series": "0", "reading_type": "1", "mode_80_active": false, "measurement_mode_80_active": false, "on_request_timeout_80_active": false, "on_request_timeout_80": "1", "sensor_boot_time_420ma_active": false, "sensor_boot_time_420ma": "0", "sensor_boot_time_78_active": false, "sensor_boot_time_78": "0", "deadband_80_active": false, "deadband_80": "0", "filter_80_active": false, "output_data_rate_p1_81_active": false, "output_data_rate_p2_81_active": false, "sampling_duration_p1_81_active": false, "sampling_duration_p1_81": "", "sampling_duration_p2_81_active": false, "sampling_duration_p2_81": "", "led_alert_mode_84_active": false, "led_accelerometer_threshold_84_active": false, "led_accelerometer_threshold_84": "", "led_velocity_threshold_84_active": false, "led_velocity_threshold_84": "", "acceleration_interrupt_threshold_84_active": false, "acceleration_interrupt_threshold_84": "", "set_rtc_101": false, "current_calibration_82": "", "current_calibration_82_active": false, "current_calibration_c1_80": "178", "current_calibration_c1_80_active": false, "current_calibration_c2_80": "178", "current_calibration_c2_80_active": false, "current_calibration_c3_80": "178", "current_calibration_c3_80_active": false, "output_data_rate_101_active": false, "output_data_rate_101_m2_active": false, "sampling_duration_101_active": false, "sampling_duration_101": "1", "sampling_interval_101_active": false, "full_scale_range_101_active": false, "full_scale_range_101_m2_active": false, "x_axis_101": false, "y_axis_101": false, "z_axis_101": false, "low_pass_filter_80_active": false, "high_pass_filter_80_active": false, "low_pass_filter_81_p2_active": false, "high_pass_filter_81_p2_active": false, "roll_angle_threshold_47": "0", "roll_angle_threshold_47_active": false, "pitch_angle_threshold_47": "0", "pitch_angle_threshold_47_active": false, "counter_threshold_35": "50", "counter_threshold_35_active": false, "payload_length_80_active": false, "payload_length_80": "3", "motion_threshold_46_active": false, "motion_threshold_46": "100", "low_calibration_420ma_active": false, "low_calibration_420ma": "68805", "mid_calibration_420ma_active": false, "mid_calibration_420ma": "68724", "high_calibration_420ma_active": false, "high_calibration_420ma": "68714", "x": 210, "y": 320, "wires": [ [ "a092304c.8edce", "d5c92f84.b9e07" ] ] }, { "id": "542cdc32.ad6d24", "type": "ui_chart", "z": "c64944b8e1931832", "name": "", "group": "b8a7bc9b.086d6", "order": 1, "width": "0", "height": "0", "label": "Submain volume count since midnight", "chartType": "bar", "legend": "true", "xformat": "HH:mm:ss", "interpolate": "linear", "nodata": "", "dot": false, "ymin": "0", "ymax": "3000", "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, "className": "", "x": 1110, "y": 200, "wires": [ [] ] }, { "id": "a595e2f8.33b25", "type": "change", "z": "c64944b8e1931832", "name": "", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "1", "fromt": "num", "to": "Flowing", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "0", "fromt": "num", "to": "Off", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 640, "y": 320, "wires": [ [ "b8b2f766.dcbb48" ] ] }, { "id": "3eef1d3b.4a4d52", "type": "ui_text", "z": "c64944b8e1931832", "group": "b8a7bc9b.086d6", "order": 2, "width": 0, "height": 0, "name": "", "label": "AB Sub Main 1", "format": "{{msg.payload}}", "layout": "row-center", "className": "", "x": 1120, "y": 260, "wires": [] }, { "id": "84b7717b.36328", "type": "ui_text", "z": "c64944b8e1931832", "group": "b8a7bc9b.086d6", "order": 3, "width": 0, "height": 0, "name": "", "label": "AB Sub Main 2", "format": "{{msg.payload}}", "layout": "row-center", "className": "", "x": 1120, "y": 340, "wires": [] }, { "id": "4a2f8cd1.664784", "type": "function", "z": "c64944b8e1931832", "name": "build the data for historic graph", "func": "var total = flow.get(msg.topic) || 0;\nvar last = flow.get(msg.topic+'_last');\nflow.set(msg.topic+'_last', msg.payload);\nif(!last && msg.payload){\n msg.payload = total + msg.payload;\n flow.set(msg.topic, msg.payload);\n}else{\n msg.payload = total;\n}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 710, "y": 200, "wires": [ [ "542cdc32.ad6d24" ] ] }, { "id": "2daa15.908a15ec", "type": "ui_gauge", "z": "c64944b8e1931832", "name": "", "group": "b8a7bc9b.086d6", "order": 9, "width": "2", "height": "2", "gtype": "gage", "title": "sensor Power Status", "label": "V", "format": "{{value | number:2}}", "min": 0, "max": "3.3", "colors": [ "#ff0011", "#e6e600", "#09ca00" ], "seg1": "", "seg2": "", "diff": false, "className": "", "x": 360, "y": 600, "wires": [] }, { "id": "d5c92f84.b9e07", "type": "change", "z": "c64944b8e1931832", "name": "", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "data.battery", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 360, "y": 520, "wires": [ [ "2daa15.908a15ec" ] ] }, { "id": "8d44da5fc535c964", "type": "ui_text", "z": "c64944b8e1931832", "group": "b8a7bc9b.086d6", "order": 4, "width": 0, "height": 0, "name": "", "label": "AB Sub Main 3", "format": "{{msg.payload}}", "layout": "row-center", "className": "", "x": 1120, "y": 420, "wires": [] }, { "id": "81f806e923833bba", "type": "ui_text", "z": "c64944b8e1931832", "group": "b8a7bc9b.086d6", "order": 5, "width": 0, "height": 0, "name": "", "label": "AB Sub Main 4", "format": "{{msg.payload}}", "layout": "row-center", "className": "", "x": 1120, "y": 520, "wires": [] }, { "id": "0e7329190b4561dc", "type": "ui_text", "z": "c64944b8e1931832", "group": "b8a7bc9b.086d6", "order": 6, "width": 0, "height": 0, "name": "", "label": "AB Sub Main 5", "format": "{{msg.payload}}", "layout": "row-center", "className": "", "x": 1120, "y": 600, "wires": [] }, { "id": "e1b32cd23e805f76", "type": "ui_text", "z": "c64944b8e1931832", "group": "b8a7bc9b.086d6", "order": 7, "width": 0, "height": 0, "name": "", "label": "AB Sub Main 6", "format": "{{msg.payload}}", "layout": "row-center", "className": "", "x": 1120, "y": 680, "wires": [] }, { "id": "e6b43414ac1f4d69", "type": "ui_text", "z": "c64944b8e1931832", "group": "b8a7bc9b.086d6", "order": 8, "width": 0, "height": 0, "name": "", "label": "AB Sub Main 7", "format": "{{msg.payload}}", "layout": "row-center", "className": "", "x": 1140, "y": 780, "wires": [] }, { "id": "d8692f9c7f7bb62e", "type": "ui_text", "z": "c64944b8e1931832", "group": "b8a7bc9b.086d6", "order": 9, "width": 0, "height": 0, "name": "", "label": "last data received", "format": "{{msg.payload}}", "layout": "row-spread", "className": "", "x": 1050, "y": 140, "wires": [] }, { "id": "1ceeec511f8008a2", "type": "function", "z": "c64944b8e1931832", "name": "convert date to human readable", "func": "var now = new Date().toLocaleString(\"en-GB\");\nreturn { payload: now };", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 710, "y": 140, "wires": [ [ "d8692f9c7f7bb62e" ] ] }, { "id": "eb4483332f266888", "type": "debug", "z": "c64944b8e1931832", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "statusVal": "", "statusType": "auto", "x": 770, "y": 80, "wires": [] }, { "id": "b8adec59aca4aac8", "type": "bar-chart-data", "z": "c64944b8e1931832", "name": "bar-chart-data", "x_interval": "minutes", "x_size": "60", "unit": "liters per minute", "precision": 2, "is_meter_reading": "False", "agg_by": "sum", "x": 700, "y": 600, "wires": [ [ "3fed2dde3121664f" ] ] }, { "id": "3fed2dde3121664f", "type": "ui_chart", "z": "c64944b8e1931832", "name": "", "group": "b8a7bc9b.086d6", "order": 10, "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, "className": "", "x": 850, "y": 660, "wires": [ [] ] }, { "id": "cca1fcb1e7627637", "type": "function", "z": "c64944b8e1931832", "name": "Counter1", "func": "// Define Variable and get stored flow value\n// if there is no stored value, then the value is 0\nvar counter1 = flow.get(\"counter1\") || 0\n\n// Define the target string\nconst targetString = \"input_1: 1\";\n\n\n\n\n// Check the msg.topic property\n// If the topic is equal to reset then set the counter to 0\n// else add 1 to the counter value\nif (msg.topic == \"reset\") {\n counter1 = 0\n} else {\n counter1 ++\n}\n\n// save the counter value in the flow variable\nflow.set(\"counter1\", counter1)\n\n// set msg.payload to counter value\nmsg.payload = counter1\n\n// return msg Object\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1180, "y": 300, "wires": [ [ "12a134f354990eba" ] ] }, { "id": "12a134f354990eba", "type": "debug", "z": "c64944b8e1931832", "name": "Counter 1 output", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1410, "y": 300, "wires": [] }, { "id": "411b99e570d607a5", "type": "function", "z": "c64944b8e1931832", "name": "Counter6", "func": "// Define Variable and get stored flow value\n// if there is no stored value, then the value is 0\nvar counter6 = flow.get(\"counter6\") || 0\n\n//msg.payload.sensor_data.input_6\n\n// Check the msg.topic property\n// If the topic is equal to reset then set the counter to 0\n// else add 1 to the counter value\nif (msg.topic == \"reset\") {\n counter6 = 0\n} else {\n counter6 ++\n}\n\n// save the counter value in the flow variable\nflow.set(\"counter6\", counter6)\n\n// set msg.payload to counter value\nmsg.payload = counter6\n\n// return msg Object\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1180, "y": 720, "wires": [ [ "156c03eb608649c1" ] ] }, { "id": "10b7adfc47be453e", "type": "function", "z": "c64944b8e1931832", "name": "Counter2", "func": "// Define Variable and get stored flow value\n// if there is no stored value, then the value is 0\nvar counter2 = flow.get(\"counter2\") || 0\n\n// Check the msg.topic property\n// If the topic is equal to reset then set the counter to 0\n// else add 1 to the counter value\nif (msg.topic == \"reset\") {\n counter2 = 0\n} else {\n counter2 ++\n}\n\n// save the counter value in the flow variable\nflow.set(\"counter2\", counter2)\n\n// set msg.payload to counter value\nmsg.payload = counter2\n\n// return msg Object\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1180, "y": 380, "wires": [ [ "4a6e2ac1a5f44a50" ] ] }, { "id": "5313d3a940b237d6", "type": "inject", "z": "c64944b8e1931832", "name": "reset - counters", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "reset", "payload": "", "payloadType": "date", "x": 620, "y": 740, "wires": [ [ "cca1fcb1e7627637", "10b7adfc47be453e", "411b99e570d607a5", "8c99e4c19f1d3fd5", "e5b5509d55370eb8", "84cb704d960a1066", "f44473ae4faf48fa" ] ] }, { "id": "4a6e2ac1a5f44a50", "type": "debug", "z": "c64944b8e1931832", "name": "Counter 2 output", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1410, "y": 380, "wires": [] }, { "id": "156c03eb608649c1", "type": "debug", "z": "c64944b8e1931832", "name": "Counter 6 output", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1410, "y": 720, "wires": [] }, { "id": "b015d4f18bb2ac5c", "type": "debug", "z": "c64944b8e1931832", "name": "switch output 1", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1440, "y": 180, "wires": [] }, { "id": "8c99e4c19f1d3fd5", "type": "function", "z": "c64944b8e1931832", "name": "Counter3", "func": "// Define Variable and get stored flow value\n// if there is no stored value, then the value is 0\nvar counter3 = flow.get(\"counter3\") || 0\n\n// Define the target string\nconst targetString = \"input_3: 1\";\n\n\n\n\n// Check the msg.topic property\n// If the topic is equal to reset then set the counter to 0\n// else add 1 to the counter value\nif (msg.topic == \"reset\") {\n counter3 = 0\n} else {\n counter3 ++\n}\n\n// save the counter value in the flow variable\nflow.set(\"counter3\", counter3)\n\n// set msg.payload to counter value\nmsg.payload = counter3\n\n// return msg Object\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1180, "y": 460, "wires": [ [ "eda634d4749fa4e4" ] ] }, { "id": "eda634d4749fa4e4", "type": "debug", "z": "c64944b8e1931832", "name": "Counter 3 output", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1410, "y": 460, "wires": [] }, { "id": "e5b5509d55370eb8", "type": "function", "z": "c64944b8e1931832", "name": "Counter4", "func": "// Define Variable and get stored flow value\n// if there is no stored value, then the value is 0\nvar counter4 = flow.get(\"counter4\") || 0\n\n// Define the target string\nconst targetString = \"input_4: 1\";\n\n\n\n\n// Check the msg.topic property\n// If the topic is equal to reset then set the counter to 0\n// else add 1 to the counter value\nif (msg.topic == \"reset\") {\n counter4 = 0\n} else {\n counter4 ++\n}\n\n// save the counter value in the flow variable\nflow.set(\"counter4\", counter4)\n\n// set msg.payload to counter value\nmsg.payload = counter4\n\n// return msg Object\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1180, "y": 560, "wires": [ [ "50f2b58e8e402207" ] ] }, { "id": "50f2b58e8e402207", "type": "debug", "z": "c64944b8e1931832", "name": "Counter 4 output", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1410, "y": 560, "wires": [] }, { "id": "84cb704d960a1066", "type": "function", "z": "c64944b8e1931832", "name": "Counter5", "func": "// Define Variable and get stored flow value\n// if there is no stored value, then the value is 0\nvar counter5 = flow.get(\"counter5\") || 0\n\n// Define the target string\nconst targetString = \"input_5: 1\";\n\n\n\n\n// Check the msg.topic property\n// If the topic is equal to reset then set the counter to 0\n// else add 1 to the counter value\nif (msg.topic == \"reset\") {\n counter5 = 0\n} else {\n counter5 ++\n}\n\n// save the counter value in the flow variable\nflow.set(\"counter5\", counter5)\n\n// set msg.payload to counter value\nmsg.payload = counter5\n\n// return msg Object\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1180, "y": 640, "wires": [ [ "65d4b2b39a8ce8cc" ] ] }, { "id": "65d4b2b39a8ce8cc", "type": "debug", "z": "c64944b8e1931832", "name": "Counter 5 output", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1410, "y": 640, "wires": [] }, { "id": "f44473ae4faf48fa", "type": "function", "z": "c64944b8e1931832", "name": "Counter7", "func": "// Define Variable and get stored flow value\n// if there is no stored value, then the value is 0\nvar counter7 = flow.get(\"counter7\") || 0\n\n//msg.payload.sensor_data.input_6\n\n// Check the msg.topic property\n// If the topic is equal to reset then set the counter to 0\n// else add 1 to the counter value\nif (msg.topic == \"reset\") {\n counter7 = 0\n} else {\n counter7 ++\n}\n\n// save the counter value in the flow variable\nflow.set(\"counter7\", counter7)\n\n// set msg.payload to counter value\nmsg.payload = counter7\n\n// return msg Object\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1180, "y": 820, "wires": [ [ "073632b631f47426" ] ] }, { "id": "073632b631f47426", "type": "debug", "z": "c64944b8e1931832", "name": "Counter 7 output", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1410, "y": 820, "wires": [] }, { "id": "3a158777559a1790", "type": "ncd-gateway-config", "name": "", "comm_type": "serial", "ip_address": "", "tcp_port": "2101", "port": "/dev/ttymxc2", "baudRate": "115200", "pan_id": "7FFF", "rssi": false }, { "id": "b8a7bc9b.086d6", "type": "ui_group", "name": "Status", "tab": "104ce52d.cc60bb", "order": 1, "disp": true, "width": "8", "collapse": false }, { "id": "104ce52d.cc60bb", "type": "ui_tab", "name": "Current", "icon": "dashboard", "order": 1 } ]