Test if computer is turned on

I thought it would be simple to just use the same iPhone wifi presence sensor I use for mine and my wife's phone and just plug in my computer's IP (I have all of them DHCP reserved).

But then I learned the computer will still respond to pings when it's asleep. During the day, when we're done with the computer we just put it to sleep so it's using less power. I usually shut it down before I go to bed.

An ideal fix would be a setting I can somehow change in the OS (Windows 10) to make it not respond to pings only when sleeping. Anyone else do this and what method did you use?

I basically just want to set a variable based on if the computer is being used, which will dictate how some automations run.

You could plug the computer into a smart outlet that monitors power.

1 Like

you could set a cron job on the computer to call a maker API with the time.

From Device Manager, find the network card, go to properties, go to power management, and disable the option "allow the computer to turn off this device."

While I setup a script to look for use of the keyboard or mouse on mine to act as a virtual presence sensor, it's not for everyone. It really comes down to what you are wanting to use the information for and whether there may be alternatives available, such as alternate presence options, scripts or other software options.

While a smart plug with energy monitoring could give some false positives, I do like it from the point of view that it avoids some of the complications around potential configuration required like scripts on the PC or accepting pings, etc.