Notification on device connection/disconnection

Hi all! I am looking for a unique solution for getting notification when client connected or disconnected. I looked through the forum and found several solution but they all works with some limitations. I prefer the solution when i can get this action(connection || disconnection) and send ubus call or execute some script. For example this solution is good but it is using demon hostapd_cli which is running permanently https://www.google.com/url?q=https://gist.github.com/jwalanta/53f55d03fcf5265938b64ffd361502d5&sa=D&source=hangouts&ust=1600871993731000&usg=AFQjCNFq_lG-E9Tz-zxUUfeTGxxDyRZgFA. May be there are some alternatives which provide notification for both LAN and wifi clients (connection || disconnection). One more way is using dhcp leases and arp to check if they are active - but how to avoid periodical scanning - and what to do with static IP. Also read about hotplug.d scripts - they are OK, but does not handle WIFI connections||disconnections.