a) Publish MQTT command via IoTLink to hibernate a host
b) Wait couple of minutes
c) Ping the host to see if it is alive
d) If host is alive, go to a), repeating the loop 5 times
I have written all steps except c). How do I accomplish c) without creating a ping binary sensor? It is my understanding that the ping binary sensor would keep pinging the host every 5 minutes 24x7, thus generating unnecessary network traffic.
I did say that I use IoTLink to send hibernate command but I need to ping the PC on demand to make sure that it did go to hibernate. Sometimes, Windows background processes prevent hibernation/suspend and there is a need to repeat sending the hibernate/suspend command. The idea is to make sure that the PC is indeed in hibernation. This is what the question is about.
I guess the title of the question should have read how to ping a host on demand.
But the issue is NOT how to put PC to sleep, but to VERIFY that it actually went into suspend/hibernate. As I said, I should have asked “how to ping a host on demand”.