Turning lights of a room off if the person's phone is not detected

Hey guys, I wanted to make a project using nodemcu, where wifi sniffer sniffs the network and detects if the specified mobile device is present or not. In the absence, it sends the command to nodemcu to turn off the light corresponding to the room, using node red by sending mqtt request. If someone can help me develop the program, would be of great help.

For the WiFi sniffer, look here: https://www.hackster.io/rayburne/esp8266-mini-sniff-f6b93a

Read also the comments for "improved" versions. I guess you want to detect phones even if these are not connected to a WiFi network (detect probing attempts).