Adding 2 Separate Wake On Lan computers

I’ve searched high and low, but I don’t see any reference to how I could do this

I have 2 separate computers I need to wake on LAN at different times. Is it possible to have them both in there?

This is my config, and it does not work

# Loads default set of integrations. Do not remove.
default_config:

# Text to speech
tts:
  - platform: google_translate

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


switch:
  - platform: wake_on_lan
    mac: 70:85:c2:3b:46:17
    name: "Office HTPC"
    
switch:
  - platform: wake_on_lan
    mac: 70:85:c2:3b:46:17
    name: "Living Room HTPC"

I tried removing the second “switch:” without any luck

(Ignore the duplicate MAC, just for testing)

Any ideas?

A few things:

  • use a single switch block in what looks to be your configuration.yaml file
  • try including the IP addresses of those machines
  • play with the broadcast_port. Common values for this are 7 or 9, but there may be others depending on your hardware
switch:
  - platform: wake_on_lan
    mac: 70:85:c2:3b:46:17
    name: "Office HTPC"
    host: <IP-ADDRESS-ONE>
    broadcast_address: 255.255.255.255 # default value
    broadcast_port: 9 # default value

  - platform: wake_on_lan
    mac: 70:85:c2:3b:46:17
    name: "Living Room HTPC"
    host: <IP-ADDRESS-TWO>
    broadcast_address: 255.255.255.255
    broadcast_port: 9

My WoL switches were hit-or-miss before I started including their IP addresses

They work completely fine for me, I just can’t figure out how to get a second switch, the second shows up all wonky

Let me try again from scratch. Thanks!