I always wondered how they did that and actually it is quite simple. You can use Ping for this. Most people have a smart phone which automatically connects to your router. If it does it will get an IP adress and you can Ping that.
So if the IP adress reacts (the smart phone is connected) the lampos will go on.
Simple and efficient.
I wrote the software in Arduino (C++) and in ESP Basic.
And there is an example that will switch leds on depending on the availability of the IP adresses.
Find the source code in Arduino and Basic on my weblog:
http://lucstechblog.blogspot.com/2019/0 ... -home.html