Switch for WOL or Command_Line not showing

Spent about 2 weeks playing with this and I can’t seem top get it to work. I can’t seem the switch displayed on any page.

Here is what I followed.

Mimic’s the example here - https://github.com/GreenTurtwig/personal-home-automation/tree/master/Home%20Assistant

Within switches.yaml called in configuration
platform: wake_on_lan
mac_address: “XX-XX-XX-XX-XX”
name: “wol”
host: “10.0.1.13”

In groups.yaml I call this.

System:
    - sensor.cpu
    - sensor.cpu_use
    - sensor.ram_use
    - sensor.ram_free
    - sensor.since_last_boot
    - switch.wol

ground_control:
    name: Control
    view: yes
    entities:
      - group.speedtest
      - group.system

Nothing shows up for switch.wol like the example posted above. I’m at a loss. Another switch I’m trying is command line.

#- platform: command_line
#switches:
# pc_power:
#     oncmd: 'sudo wakeonlan XX-XX-XX-XX-XX'
#     offcmd: 'sudo net rpc shutdown -f -t 0 -I 10.0.1.13 -U  [email protected]%USERPASSWORD'

This follows the example of: https://github.com/brusc/Home-Assistant-Configuration

Again the switch does not show up.

I hope you just commented out the switch in the last example for testing purposes and forgot when you posted it here. Otherwise, that would be the problem - your switch is not loading becuase it’s commented out with the “#”.

Not trying to be a wiseguy, but sometimes we all miss the obvious stuff when we’re deep into a problem.

Ha thanks! Yea - I commented that one out to test the first switch independently as well. Not sure what I’m doing wrong as I’m mimicing both examples (at least I think).

Wait; do you actually see a switch entity called “switch.wol” when you browse the entity list in the states panel?

Or do you see one called “switch.pc_power”? I think you have the wrong name in the System: group.

I do not see switch.wol in states panel at all nor switch.pc_power

previously I had both added in to group.yaml when I was testing.

It may be your syntax. Take a look at the example in the command line component:

switch:
  platform: command_line
  switches:
    kitchen_light:
      oncmd: switch_command on kitchen
      offcmd: switch_command off kitchen
      statecmd: query_command kitchen
      value_template: '{{ value == "online" }}'

Hi there,

I am facing the same issue with 0.26.1 (didn’t try before). The entity is just not appearing. @Dracoy did you ever solve this or just let it go?

My syntax is pretty much what it is for any other component thats working fine. I tried stuff like that:

`# Wake on lan für Server
switch:
platform: wake_on_lan
mac_address: “00-23-XX-XX-XX-XX”
name: “Plex Server”
host: “192.168.0.5”

Example configuration.yml entry

switch2:
platform: wake_on_lan
mac_address: “00-01-02-03-04-05”
name: “WOL”
host: “192.168.1.1”`

Thanks
Chris

EDIT: I took @rpitera’ssuggestion to work, and it shows now. I don’t understand it, as both variantes should be working fine.

Here’s my working code for any1 interested:

`switch:

  • platform: wake_on_lan
    mac_address: “00:23:54:AA:06:97”
    name: “Plex Server wecken”
    host: “192.168.0.5”`

I am right in thinking that the wol switch just sends a magic packet every few seconds to the specified devices? If so, then how will it ever go to sleep?

I have it set up pointing to my pc but my PC now never goes to sleep. It’s power settings are set to sleep the machine after 15 mins.