How to control Multiple devices throw wake on lan

Thanks to Burningstone. I’ve got the right configuration.Here is the control Multiple devices throw wake on lan configuration.yaml.

switch:
  - platform: wake_on_lan
    mac_address: "4C-CC-6A-7F-5B-04"
    name: "yourdevicename"
    host: your ipaddress
  - platform: wake_on_lan
    mac_address: "4C-ED-FB-BB-DF-CB"
    name: "yourdevicename"
    host: your ipaddress
3 Likes

please format your code

then we love to help you

Did you add

wake_on_lan:

to your configuration.yaml?

Also name1, name2, mac_address1,mac_address2 etc. will not work. The configuration looks for name and mac_address without the number afterwards. You need to separate it into 2 switches. Did you configure the hosts to be able to be woken up by LAN, does wake on LAN work when you send a magic packet from another device?

# PopeyesLaptop turn on    
switch:
  - platform: wake_on_lan
    mac_address: "4C-CC-6A-7F-5B-04"
    name: "PopeyesLaptop"
    host: 192.168.1.155
    
# Popeyesdesktop turn on
switch:
  - platform: wake_on_lan
    mac_address: "4C-ED-FB-BB-DF-CB"
    name: "Popeyesdesktop"
    host: 192.168.1.91    

Here is format code. My Homeassistant only recognized the laptop switch.

Yes.I added wake on lan to my configuration.yaml
And the laptop switch can control my laptop. The desktop doesn’t show on the homeassistant. The wake on lan platform only control one device. I want to control two devices.

Screenshots don’t make it easy for people to answer you. Please read point 11 here: How to help us help you - or How to ask a good question

Sorry for that. I’ve post the code.

1 Like

Try like this:

switch:
  - platform: wake_on_lan
    mac_address: "4C-CC-6A-7F-5B-04"
    name: "PopeyesLaptop"
    host: 192.168.1.155
  - platform: wake_on_lan
    mac_address: "4C-ED-FB-BB-DF-CB"
    name: "Popeyesdesktop"
    host: 192.168.1.91
2 Likes

Thanks a lot! It’s working!!!

Seems like latest wake on lan needs “mac” not “mac_address” and the docs example doesn’t reflect this. But I’m a major amateur so I don’t want to edit the documentation page and screw something up.

1 Like

Agreed. Tested with mac: instead of mac_address: and it works as a switch.

I have the problem that the Family NUC is not waking up properly. The Workstation is functional.

When I WOL them thorugh my MAC both work. But with the script in config … only Workstations works?

  # WOL - Workstation
  - platform: wake_on_lan
    mac: "04-92-***"
    host: 192.*** *(ip of host system)*
    broadcast_address: 192.*** *(ip of host system)*
    broadcast_port: 9
    name: "Workstation"
    turn_off:
      service: script.workstation_shutdown

  # WOL - Family NUC
  - platform: wake_on_lan
    mac: "88-AE-***"
    host: 192.*** *(ip of host system)*
    broadcast_address: 192.*** *(ip of host system)*
    broadcast_port: 9
    name: "Family Nuc"
    turn_off:
      service: script.nuc_shutdown