If you want to do it in a function something like this should work.
let sync = context.get('sync') || {};
const nodeName = msg.nodeName;
sync[nodeName] = msg.payload.value;
const sync_array = Object.values(sync);
if (sync_array.length >= 3) {
msg.payload = sync_array.reduce((acc, num) => acc+num, 0)
sync = undefined;
}else{
msg = null;
}
context.set("sync", sync)
return msg;
e.g.
[{"id":"9d658e1986a3ca06","type":"inject","z":"452103ea51141731","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":1,\"HourDescription\":\"12 am - 1 am\",\"Value\":-0.11487,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":1,\"HourDescription\":\"12 am - 1 am\",\"Value\":16.101,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":2,\"HourDescription\":\"1 am - 2 am\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":2,\"HourDescription\":\"1 am - 2 am\",\"Value\":10.175,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":3,\"HourDescription\":\"2 am - 3 am\",\"Value\":-0.15443,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":3,\"HourDescription\":\"2 am - 3 am\",\"Value\":13.202,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":4,\"HourDescription\":\"3 am - 4 am\",\"Value\":-0.130146,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":4,\"HourDescription\":\"3 am - 4 am\",\"Value\":13.289,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":5,\"HourDescription\":\"4 am - 5 am\",\"Value\":-0.125505,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":5,\"HourDescription\":\"4 am - 5 am\",\"Value\":11.953,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":6,\"HourDescription\":\"5 am - 6 am\",\"Value\":-0.109888,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":6,\"HourDescription\":\"5 am - 6 am\",\"Value\":11.8,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":7,\"HourDescription\":\"6 am - 7 am\",\"Value\":-0.105976,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":7,\"HourDescription\":\"6 am - 7 am\",\"Value\":11.441,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":8,\"HourDescription\":\"7 am - 8 am\",\"Value\":-0.109031,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":8,\"HourDescription\":\"7 am - 8 am\",\"Value\":14.554,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":9,\"HourDescription\":\"8 am - 9 am\",\"Value\":-0.093543,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":9,\"HourDescription\":\"8 am - 9 am\",\"Value\":14.643,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":10,\"HourDescription\":\"9 am - 10 am\",\"Value\":-0.1052,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":10,\"HourDescription\":\"9 am - 10 am\",\"Value\":13.027,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":11,\"HourDescription\":\"10 am - 11 am\",\"Value\":-0.115724,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":11,\"HourDescription\":\"10 am - 11 am\",\"Value\":13.855,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":12,\"HourDescription\":\"11 am - 12 pm\",\"Value\":-0.108498,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":12,\"HourDescription\":\"11 am - 12 pm\",\"Value\":11.367,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":13,\"HourDescription\":\"12 pm - 1 pm\",\"Value\":-0.097682,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":13,\"HourDescription\":\"12 pm - 1 pm\",\"Value\":11.767,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":14,\"HourDescription\":\"1 pm - 2 pm\",\"Value\":-0.094643,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":14,\"HourDescription\":\"1 pm - 2 pm\",\"Value\":12.608,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":15,\"HourDescription\":\"2 pm - 3 pm\",\"Value\":-0.095467,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":15,\"HourDescription\":\"2 pm - 3 pm\",\"Value\":12.206,\"AirQualityCategory\":\"GOOD\",\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":16,\"HourDescription\":\"3 pm - 4 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":16,\"HourDescription\":\"3 pm - 4 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":17,\"HourDescription\":\"4 pm - 5 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":17,\"HourDescription\":\"4 pm - 5 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":18,\"HourDescription\":\"5 pm - 6 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":18,\"HourDescription\":\"5 pm - 6 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":19,\"HourDescription\":\"6 pm - 7 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":19,\"HourDescription\":\"6 pm - 7 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":20,\"HourDescription\":\"7 pm - 8 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":20,\"HourDescription\":\"7 pm - 8 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":21,\"HourDescription\":\"8 pm - 9 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":21,\"HourDescription\":\"8 pm - 9 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":22,\"HourDescription\":\"9 pm - 10 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":22,\"HourDescription\":\"9 pm - 10 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":23,\"HourDescription\":\"10 pm - 11 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":23,\"HourDescription\":\"10 pm - 11 pm\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"CO\",\"ParameterDescription\":\"Carbon monoxide\",\"Units\":\"ppm\",\"UnitsDescription\":\"parts per million\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":24,\"HourDescription\":\"11 pm - 12 am\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null},{\"Site_Id\":1001,\"Parameter\":{\"ParameterCode\":\"PM10\",\"ParameterDescription\":\"PM10\",\"Units\":\"µg/m³\",\"UnitsDescription\":\"microgram per cubic meter\",\"Category\":\"Averages\",\"SubCategory\":\"Hourly\",\"Frequency\":\"Hourly average\"},\"Date\":\"2022-12-01\",\"Hour\":24,\"HourDescription\":\"11 pm - 12 am\",\"Value\":null,\"AirQualityCategory\":null,\"DeterminingPollutant\":null}]","payloadType":"json","x":110,"y":3920,"wires":[["6f3229e0ec292e99","2b3a0fb24ed8d1d9","dc3f93e6dc631268"]]},{"id":"6f3229e0ec292e99","type":"change","z":"452103ea51141731","name":"","rules":[{"t":"set","p":"payload.value","pt":"msg","to":"2","tot":"num"},{"t":"set","p":"nodeName","pt":"msg","to":"Watts RGBW boiler","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":3860,"wires":[["5801347964bfdbb2"]]},{"id":"2b3a0fb24ed8d1d9","type":"change","z":"452103ea51141731","name":"","rules":[{"t":"set","p":"payload.value","pt":"msg","to":"2","tot":"num"},{"t":"set","p":"nodeName","pt":"msg","to":"Watts RGBW sink","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":3920,"wires":[["5801347964bfdbb2"]]},{"id":"dc3f93e6dc631268","type":"change","z":"452103ea51141731","name":"","rules":[{"t":"set","p":"payload.value","pt":"msg","to":"2","tot":"num"},{"t":"set","p":"nodeName","pt":"msg","to":"Watts RGBW micro","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":3980,"wires":[["5801347964bfdbb2"]]},{"id":"5801347964bfdbb2","type":"function","z":"452103ea51141731","name":"function 18","func":"let sync = context.get('sync') || {};\nconst nodeName = msg.nodeName;\nsync[nodeName] = msg.payload.value;\nconst sync_array = Object.values(sync);\n\nif (sync_array.length >= 3) {\n msg.payload = sync_array.reduce((acc, num) => acc+num, 0)\n sync = undefined;\n}else{\n msg = null;\n}\n\ncontext.set(\"sync\", sync)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":3920,"wires":[["265550587332c873"]]},{"id":"265550587332c873","type":"debug","z":"452103ea51141731","name":"debug 111","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":650,"y":3920,"wires":[]}]