Best Solution for Shutdown remote windows machines?

Hi everyone

i’m looking for a reliable and easy solution to shutting down networked windows machines i have been using kodi’s binding to send shutdown command but im finding this unreliable, my kodi install crashes some of the times and this leaves my devices and lights on as the rules wait for this machine to go offline before turning everything else off.

i have had a read of some posts but there are many options is exec binding the best option

openhab runs on windows 10 machine
htpc runs on win 7 machine
if that makes any difference

I was in similar situation like you.

I searched and tried multiple software approaches but I wasn’t successful.

Best option, IMHO, was to use mqtt and exec in windows and have windows to shutdown the system when it gets mqtt message from openhab. But since i am not a software engineer type of person, it was overwhelming to learn and adapt…

Long story short, i am now using esp8266.
I use pc LED light as an input to tell it if the PC is on or off. Then I ran parallel wires with relay to the power switch which is my output and it’ll ‘push’ power switch when it’s triggered.

With that setup, i changed power management setting in windows so that when I ‘push’ power switch, it’ll shut down the computer or turn it on.
I changed CMOS setting on back panel usb ports to keep the power on even when the computer is off. That’s my power source to the esp8266 listening to mqtt topic I assigned.

So far, i am very happy with it and it is very reliable as well.