The idea is this: I want my PC to turn on when I get home in the evening. Usually my phone always has WiFi on, it would be cool when I go to the house to have my PC turn on.
I understand the algorithm:
- The script checks the connected wireless devices every N seconds (Mikrotik scheduler can be used)
- If the desired MAC address appears among the connected devices →
2.1.Check last connected time (need to ensure that after turning off the computer at a given M time, it does not turn on immediately back)
2.2 send a WOL package → update last connected time
It can also be optimized, for example, after turning on the PC to increase the time to check the connection or even disable the script.
With the microtic scheduler, you can also limit the running time of the script (for example, run it every 10 seconds from 6 PM to 2 AM).
I understand how this should work, but I can’t write code properly. I will try tomorrow, but I call you for help, I think it will be useful not only to me. And maybe someone’s done it before.