Wake on LAN shutdown

Hi,

I’ve seen the 0.33 release has added support to the WoL switch for shutdown through script, which is something I’ve been waiting for since I discovered Home Assistant. The component page has been updated, and makes reference to defining an action to run in order to trigger the shutdown.

Release notes also state:

The turn_off variable is there to help you call a script when you have figured out how to remotely turn off your computer.

The command line needed to execute the remote shutdown is as follows:

net rpc shutdown -f -I <ip address> -U <username>%<password>

The command is working by executing through PuTTY, just not when I try to integrate it into HA. I tried defining a shell_command which didn’t appear in my list of entities, and I tried just getting it working as a command switch separate to the WoL switch, but couldn’t get it to work there either.

Now I’m pretty new to Home Assistant, so I’m not massively up to speed on all the ins and outs of the platform yet, thought I have been reading as much as I can. Can anybody point me in the right direction to get this working?

Thanks,
Matt

Here is what I have working with the new option:

  - platform: wake_on_lan
    mac_address: "01:10::01:10:01"
    host: 192.168.1.5
    turn_off:
      service: shell_command.htpc

create a shell command with your netrpc command above and it should work.

Aha! Thank you. The service parameter is all it seems I was missing, it’s working fine now. I did expect, once I got it working, that the shell_command entry would appear in the entities list like everything else, but this appears not to be the case.

Thanks,
Matt