hey my friend,if you restart from windows its show a real time status in home assistant?,i mean,you can know via home assistant if your windows[pc] is restart ?
For what it’s worth I want a different route that seems to work well and doesn’t require running services on your computer of mqtt. It does not offer as many features as other options however. I have the following.
A binary ping sensor for my computer
A low privilege user that has access only to one folder
That folder has one program in it: psshutdown
Ssh set up on that machine (I use bitvise)
A shell command for connecting to ssh and exciting psshutdown -d -t 0 to sleep the machine
A shell command to use ether-wake to WoL the machine (be sure to specify the network interface to use)
A template switch to run either of those commands. A button card tied to the binary sensor entity for state. The card executes the switch.toggle service on my template switch.
Ssh is very secure, so that makes it more secure than some other options. I created a user specifically for home assistant, as I mentioned it has access only to the One directory. I also specified that this user can only log in from the IP associated with home assistant, disabled password off, and forced public key auth.