Switch creation / Wake on LAN

You have quotations for both name and mac address and the host is commented out - this is wrong.

Here is what I have in mine and it works:

  1. switch.yaml
- platform: wake_on_lan
  mac: 00:11:22:33:44:55
  name: server
  host: 192.168.1.X
  turn_off:
    service: shell_command.turn_off_server
  1. configuration.yaml
## wol ##

wake_on_lan:

shell_command:
  turn_off_server: "ssh -p 59622 [email protected] 'sudo systemctl start systemd-suspend'"

and add this to point your configuration.yaml to the switch.yaml file

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

## New entries

switch: !include switch.yaml

That pretty much it and ensure you follow the WOL guide for the rest as previously posted above by @krskrab:

Good luck and hope this helps

Note: I am using fedora for my server with NVIDIA card so my command to suspend differs from the WOL guide in HA

3 Likes