Well, in that flow you are just sending the messages for each window back to the MQTT broker, I guess that is not what you want to do?
I assume you receive correct messages now for each window?? Did you check with a debug node?
Let's start with some thoughts about your requirements
When a window is opening/closing, the tamper alarm goes on or the battery is low, I assume you will get a message only when they happens? Best is to store current states for the opening/closing since you will need to keep that when you evaluate if you shall send an alert or not. If the window is opened outside 10pm and 6am and kept open, you want to get informed "later" when the time is within the valid range. The other messages for tamper and battery will be sent immediately around the clock. So since you seem to feel pretty familiar with function nodes and javascript, I have made an example below with function nodes and code. There are many other node types available that could be used instead like gates, cron+, switch, change etc etc. Plenty of room for alternatives....
The rbe nodes in the flow is to prevent repeated messages during 10pm to 6am
[{"id":"b7f640b2.ef338","type":"mqtt in","z":"27d1839a.8c260c","name":"","topic":"tele/sonoff/bridge2/RESULT","qos":"2","datatype":"auto","broker":"4606d9fb.a64278","x":170,"y":140,"wires":[["d0f8db9f.685b28"]]},{"id":"d0f8db9f.685b28","type":"json","z":"27d1839a.8c260c","name":"","property":"payload","action":"","pretty":false,"x":380,"y":140,"wires":[["56253c5d.49a5a4"]]},{"id":"56253c5d.49a5a4","type":"function","z":"27d1839a.8c260c","name":"Window Sensors","func":"// Code below is for the rf door sensor at front door\n\n\n// Left Window Sensor\nif (msg.payload.RfReceived.Data==\"48B5E7\"){\n flow.set('Left_Window_Sensor',\"CLOSED\")\n}\nif (msg.payload.RfReceived.Data==\"48B5EE\"){\n flow.set('Left_Window_Sensor',\"OPEN\")\n}\nif (msg.payload.RfReceived.Data==\"48B5EB\"){\n return [{payload:\"TAMPER\"},null,null,null]}\nif (msg.payload.RfReceived.Data==\"48B5EF\"){\n return [{payload:\"LOW BATTERY\"},null,null,null]} \n\n// Middle Top Window Sensor\nif (msg.payload.RfReceived.Data==\"BDAC17\"){\n flow.set('Middle_Top_Window',\"CLOSED\")\n}\nif (msg.payload.RfReceived.Data==\"BDAC1E\"){\n flow.set('Middle_Top_Window',\"OPEN\")\n}\nif (msg.payload.RfReceived.Data==\"BDAC1B\"){\n return [null,{payload:\"TAMPER\"},null,null]}\nif (msg.payload.RfReceived.Data==\"BDAC1F\"){\n return [null,{payload:\"LOW BATTERY\"},null,null]} \n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":600,"y":140,"wires":[["7815fd50.235484"],["4bdce9ca.39ead8"]]},{"id":"d20c6df8.53f2c","type":"inject","z":"27d1839a.8c260c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":290,"wires":[["3ef83812.dd2f68"]]},{"id":"3ef83812.dd2f68","type":"function","z":"27d1839a.8c260c","name":"h >= 22 || h < 6","func":"var h = new Date(msg.payload).getHours();\n//node.warn(h);\n\nif (h >= 22 || h < 6){\n if (flow.get('Left_Window_Sensor') == \"OPEN\"){\n node.send([{payload:\"Left Window OPEN\"},null]);\n }\n else{\n node.send([{payload:\"Left Window CLOSED\"},null]);\n }\n if (flow.get('Middle_Top_Window') == \"OPEN\"){\n node.send([null,{payload:\"Middle Top Window OPEN\"}]);\n }\n else{\n node.send([null,{payload:\"Middle Top Window CLOSED\"}]);\n }\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":350,"y":290,"wires":[["8103e63f.f50498"],["3ac173b2.049a1c"]]},{"id":"8d38725.02ed89","type":"debug","z":"27d1839a.8c260c","name":"Left Window open alerts","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":260,"wires":[]},{"id":"7815fd50.235484","type":"debug","z":"27d1839a.8c260c","name":"Left window","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":100,"wires":[]},{"id":"4bdce9ca.39ead8","type":"debug","z":"27d1839a.8c260c","name":"Middle top window","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":180,"wires":[]},{"id":"8cb6cef1.ea121","type":"comment","z":"27d1839a.8c260c","name":"Tamper & Battery alerts","info":"","x":860,"y":60,"wires":[]},{"id":"a090f6e.b37c408","type":"comment","z":"27d1839a.8c260c","name":"Tamper & Battery alerts","info":"","x":860,"y":140,"wires":[]},{"id":"8103e63f.f50498","type":"rbe","z":"27d1839a.8c260c","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":560,"y":260,"wires":[["8d38725.02ed89"]]},{"id":"3fba7250.7ba2ce","type":"debug","z":"27d1839a.8c260c","name":"Middle Top Window open alerts","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":320,"wires":[]},{"id":"3ac173b2.049a1c","type":"rbe","z":"27d1839a.8c260c","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":560,"y":320,"wires":[["3fba7250.7ba2ce"]]},{"id":"6c7cbb6a.1c5654","type":"inject","z":"27d1839a.8c260c","name":"48B5EE","props":[{"p":"payload.RfReceived.Data","v":"48B5EE","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":380,"y":40,"wires":[["56253c5d.49a5a4"]]},{"id":"36e5b508.b3096a","type":"inject","z":"27d1839a.8c260c","name":"48B5E7","props":[{"p":"payload.RfReceived.Data","v":"48B5E7","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":380,"y":80,"wires":[["56253c5d.49a5a4"]]},{"id":"4606d9fb.a64278","type":"mqtt-broker","z":"","name":"mosquitto","broker":"192.168.0.150","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"1","birthRetain":"true","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]