Notification when new IP from router is leased

Hi, I have a sensor is Home Assistant that is counting the ip leases of devices in my network. Data is coming from a intergration of my router. Now i want to get a notification only when a new device is added to the network, in other words, when a new ip is leased and the state of the sensor changed. Does anyone have any tips on how to do this best in Node-RED?

The flow starts with a state change so it also takes the values ​​with it of all devices that has a leased ip, for example I have 2 devices in the lease pool of my router. (state of the sensor is 2) if a third is added (state change 2 -> 3) I get three notifications. How do I only get data from the device that has never come through before?

The situation now: if there are 3 devices in the IP lease pool and a fourth is added, again get 4 messages where I only want the message from the 4th.

To make it even more difficult, the sensor also goes from a higher to a lower number when the lease period has ended. (for example state 4 -> 3) I don’t want a message of this at all

Hopefully I explained it a bit well. Can anyone explain how I can make this?

export of the my flow:

[{"id":"745eddf3.cc3ee4","type":"server-state-changed","z":"39fbc49a.b7c3dc","name":"","server":"8e9ec046.8c74c","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.edgeos_router_unknown_devices","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"0","halt_if_type":"num","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":true,"x":285,"y":300,"wires":[["37695c25.d26664"],[]]},{"id":"37695c25.d26664","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.new_state.attributes[\"Unknown Devices\"]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":300,"wires":[["f5241cff.4eb71"]]},{"id":"f5241cff.4eb71","type":"split","z":"39fbc49a.b7c3dc","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":740,"y":300,"wires":[["a43b64e3.05a8b8"]]},{"id":"58c06391.628d0c","type":"api-call-service","z":"39fbc49a.b7c3dc","name":"In APP Notify","server":"8e9ec046.8c74c","version":1,"debugenabled":false,"service_domain":"persistent_notification","service":"create","entityId":"","data":"{\"message\":\"{{message}}\",\"title\":\"Netwerk waarschuwing! \"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1060,"y":270,"wires":[[]]},{"id":"a43b64e3.05a8b8","type":"template","z":"39fbc49a.b7c3dc","name":"","field":"message","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Client {{payload.client-hostname}} heeft zicht aangemeld in het netwerk. \\n\\n IP: {{payload.ip}}\\nMAC:{{payload.mac}}","output":"str","x":870,"y":300,"wires":[["58c06391.628d0c","fef5695e.2e5568"]]},{"id":"fef5695e.2e5568","type":"api-call-service","z":"39fbc49a.b7c3dc","name":"In APP Notify","server":"8e9ec046.8c74c","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_oneplus_06","entityId":"","data":"{\"message\":\"{{message}}\",\"title\":\"Netwerk waarschuwing! \"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1060,"y":330,"wires":[[]]},{"id":"8e9ec046.8c74c","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]