Multiple Wake On Lan switches

Hello,
I´m quite new to hass.io and I´m glad about the examples listed with every component.

Now I´m fighting with some wake_on_lan stuff. I simply want to create 4 switches to wake-up 4 devices. This is how my configuration file look like:

switch:

  • platform: wake_on_lan
    mac_address: “macaddress”
    name: pc1
    host: pc1

switch:

  • platform: wake_on_lan
    mac_address: “macaddress”
    name: pc2
    host: pc2

switch:

  • platform: wake_on_lan
    mac_address: “macaddress”
    name: pc3
    host: pc3

switch:

  • platform: wake_on_lan
    mac_address: “macaddress”
    name: pc4
    host: pc4

Now, when reloading the config I only get the last switch in the config available in the GUI (pc4). Is the syntax wrong?

Thanks,
Philipp

See my config for an example on how to use multiple switches.

https://github.com/SilvrrGIT/HomeAssistant/blob/master/switches.yaml#L63

You may also want to read up on Yaml