How to switch of PC that's running HA linux via terminal command

I use smart plugs for many things now, my cable/fiber routeur, base station for my Wyze camera setups, I can boot all of these from may other home, sometimes saving me having to drive 400km just to switch of and back on a plug

OK, I just remembered that you can shutdown the host from within HA. And in fact there is a service called hassio.host_shutdown
So all you need to do is to call this service either from the developer tools or from an automation.
Very simple. :grinning:

1 Like

No ssh, no certificates etc needed!

does that work regardless of the host? I’ve always run mine from a raspberry so never tried it on other configurations.

Just tried that and it WORKS

Just changed the -service to the following, and the PC shuts down

  • service: hassio.host_shutdown

starob
You are the man

Many many thanks for your patience and help
This may be useful to many as I came across many people asking hwo to shut down their PC

Yes it should work. You can simply try develper tools->services search for hassio.host_shutdown and execute it. It will not work if the HA host is also virtalized like on Proxmox etc.

should do,
click on developer tools
copy : Home Assistant Supervisor: Power off the host system. then click on the Call service button, and wait as it takes about a minute to run

Great that I finally could help. Please mark it as the solution.
Thanks

1 Like