I'd say your missing the biggest part of the equation..
What are you using are your conditional to determine if a user is current connected to the target router?
Does this router provide some of API? a feed? a query/response service?.. and even at that point, let say it 'does'..(which I highly doubt)...
Does it know who 'users' are? by IP address? by device name/profile?
If its a DHCP router (assigns IP addresses dynamically when a new device connects).. you might get one IP address returned for a user who was on at 8:00am... but then leaves. Another user joins network, get assigned this same IP address.... how do you know anything about the user?
These are all questions you need to have answers to.
IMHO.... (without having done any R&D on the topic to be clear)... the best approach might be to try and get this info using a scripting language or something.. that dumps things to a database or some sort of feed/return... then have the Arduino with an ESP8266 device poll this script/database.....etc..
The keys things you need to identify are:
- How/What you consider 'identifying' information for a network user
- How to get this information (or any data) from your router.
Perhaps taking a look at all those ESP wi-fi 'jammer' (really wifi- de-auth packet) project work.. as I believe they get a list of connected devices? (or perhaps just devices in the local area looking for network? I havent played any of them that much)
Also.. what router?
While I consider myself a noobie/beginner as well... I'm guessing I have more experience than you do... and I would find myself in the same situation