How turn PC on through home assistant

Has anyone enabled the ability to turn on their PC with their voice, or is there a way to turn on a computer through home assistant?

I do not really care about voice, but it would ne nice to be able to turn Computers on and off through home assistant. For turn on and Off PCs, with voice through Alexa see the below sites:

So, this would leave you with a possible cloud dependency. The route I took uses a WOL switch defined in my switch.yaml file that is able to both boot and shutdown a computer. It works in conjunction with the RPC Shutdown app installed on HA

As a nice bit of touch up, you can expose the switch in the emulated Hue hub built into HA and then you can have that control via Alexa without any special Alexa skills needed and still have full local control via HA if Alexa or the internet is down.

It does not bother me much, but with out using Alexa to control an input boolean which triggers the actual switch, via a simple automation, Alexa will complain because the PC is not instantly responding like a light bulb would. This method can be used to boot or shutdown Linux systems as well, but can be done without or with the RPC Shutdown app if you run an RPC process on your Linux system.

I am sure someone may even offer a cleaner way of doing this, but it has been working very well for me for years.

yaml config:

  - platform: wake_on_lan    
    mac: "e0:3f:49:xx:xx:xx"
    name: "Desktop"
    host: 192.168.1.117
    broadcast_address: 192.168.1.255
    turn_off:
        service: hassio.addon_stdin
        data:
            addon: core_rpc_shutdown
            input: desktop

Associated Emulated Hue configuration.yaml config:

    group.desktop:
      name: "desktop"
      hidden: false

There are many ways to do this.

Which OS are your PCs using, Linux, Windows or other?

If you add it as a switch, Hue emulated isn’t required. Alexa will pick it up!

That works for on but for the off part the method is OS dependant.

Definitely, I use HASS.Agent for that. Thus your inquiry and yes, that info is definitely needed for the off command. I was focusing more on Hue Emulated is not really required anymore.

Yep so do I. Link: Home - HASS.Agent Documentation

For Linux there are ssh command instructions in the WoL documentation: Wake on LAN - Home Assistant

@robertsaron To add to Tom’s advice, if using Windows, HASS.Agent commands will also add easily to Alexa.

I use this config entry with WOL and HASS.Agent. The host field is necessary to report the state of the switch to Alexa

switch:
  - platform: wake_on_lan
    name: "Main PC"
    mac: "XX:XX:XX:XX:XX:XX"
    host: "192.168.1.XXX" 
    turn_off:
      service: button.press
      target:
        entity_id: button.main_pc_shutdown

I use sayboot that you listed above. Works really well and reliably. Author is very responsive. I got caught out initially as I use Sonos Alexa compatible devices. But you need at least one genuine Alexa device (to relay the WOL signal) for this to work. Dropped a true Alexa onto the network and has since worked 100%

Is SayBoot cloud dependent?

It is designed to work with Alexa which is itself cloud dependant…

Understood…

HASS.Agent can use a local MQTT broker, which is why I asked. If the internet is down, Alexa and SayBoot commands will not work from what you are describing, but HA can still control WOL and shut down the PC locally through HASS.Agent.

I’ll take a look at SayBoot, it’s an interesting avenue.

Very late response. I was focused on getting some other stuff to work in HA. I have 2 computers, One runs Kubuntu, which HA is installed onto Virtual Box. And the other one is newer that runs windows 11 pro. I found a setting in my router, that will allow to send a magic packet, to each computers IP address to do WOL. I was super excited about that.

I am not sure where in Linux to enable WOL. Or find it in the UEFI on my linux machine. The linux box I built 2-3 years before MS announced their stupid requirements for Windows 11. So that linux box cannot do windows 11. So I just run linux on it.

The windows 11 machine I bought a few months ago, so it is really brand new.

So you are still looking for a solution to turn your computers on and off through Home Assistant beyond the links you plugged in the OP?

If you simply want to turn your computer on, the simplest approach is to set the BIOS restore on power loss to power on, then it’s just a matter of turning on the power socket by whatever means you wish.

I have my computers set to turn on at a specific time, and if they lose power, like someone suggested. I originally made this post more to be informative, than anything and got lots of good feedback.

I was just sharing information in case others did not know, but I am behind the times apparently. Thank you everyone.