I have been using node-red for several years, but I've only learned just enough to get by. I've attached a screenshot of my flow that does the following:
Captures wifi probe requests (lower left which is a pcap node)
Publishes detected MAC addresses to MQTT Topic
Listens to same MQTT Topic (upper left)
Routes message by MAC address, one output is my phone, one output is my wife's phone, all other MAC addresses are ignored
Forwards to watchdog timers - one each for Jeff and Tracey that after 5 minutes of inactivity triggers a network scan, and one each for Jeff and Tracey that after 12 minutes of inactivity triggers an "away" message, and one that after 12 minutes of inactivity of both Jeff and Tracey turns on my motion detection camera
Then there is some logic to keep scanning the network once per minute after the motion detection is turned on, and some other nodes to turn off the motion detection as soon as anyone is detected, either from the detection of the probe request or by the active network scan.
It would be interesting to hear how others might design a similar flow.