#how to turn off computer with home assistant
1 messages · Page 1 of 1 (latest)
Depends what exactly you're asking.... safe as in others external to your network can't shutdown your PC, yes probably if you're using Home Assistant locally only as you say.
Safe as in others in your home can't turn off your computer, maybe not. All depends on how you have things configured. You'd need to give more details on what exactly you're asking about.
You didn't specify Windows or Linux as the target OS, but if Windows, typically there's an embedded user account password that lands in a config file, as well, which would be visible to any user w/ HA access.
and if Linux, likely similar but (hopefully) a private key
Wake-On-LAN to turn on a PC should be perfectly fine (provided your devce supports it). Alternatively you can attach a suitable power plug and then set the BIOS to always turn on when power is restored.
Shutting down is a bit different as you shouldn't really just turn off the power. Instead you should run a script on the machine to perform the shutdown. For Linux / Mac should be easy to do with a CommandLine / Shell script using SSH. Windows would be a bit harder although this should help https://community.home-assistant.io/t/turning-off-a-windows-pc-with-home-assistant/27970
A key thing to consider when allowing shutdown, is what the system would be doing - are there any users on the machine? Any open windows with unsaved work? etc.
So, I found this great project on github to turn off a windows machine and wanted to share it as it’s something I’ve wanted to do for ages. go to the releases section and download the zip file and the rest should be easy here is the link and how I’ve integrated it into my home assistant switch: - platform: command_line switches: ...
I am running windows pc also my homeassistant machine running in native os in my old laptop , my goal is turn on my laptop and turn it off using home assistant and change wallpaper automatically according time like 8 pm