Wake On Lan - configuration for turn_off

I’ve got WOL working for numerous devices

Using Hass-agent I’ve got a script that will put a windows computer into hibernate mode. If I run this script manually it works. The last step of configuring it as the “off” component of the WOL switch is what I am struggling with. I have tried a few different approaches but none of them will trigger my hibernate script.

> switch:
>   - platform: wake_on_lan
>     mac: 10:......
>     name: KGW Desktop WOL
>     turn_off:
>       service: script.turn_on
>       data: {}
>       target:
>         entity_id: "script.computer_hibernate_kgw_office"

I’ve tried it without the quotes. I’ve also tried:

>     name: KGW Desktop WOL
>     turn_off:
>       service: script.turn_on script.computer_hibernate_kgw_office

or service.script.computer_hibernate_kgw_office

I figure this is a yaml issue - just not sure what I am missing here

Any thoughts?

Is the script on the HA side or a script you wrote and have added to HASS.agent as a command?

It’s a script in HA. It turns on a switch that HASS.agent provides via MQTT to make the windows computer hibernate.

Manually calling the script in HA works fine and the computer hibernates. Using WOL, I can turn it back on - I just can’t seem to configure WOL to call the HA hibernate script. When I look at the script in HA after I do the WOL turn_off - I can see it didn’t invoke my HA hibernate script.

OK - I’ve solved this.

In HA, when you edit the yaml configuration files you always need to do an HA restart. When you do this, you have the option to just reload all the yaml configuration files (sort of a “fast” restart). Normally this works when you have made changes to these files - but not always. I’ve had this before where changes to config.yaml (or similar) required a complete HA restart to take affect. And that’s what was required this time. Once I did a full restart of HA everything started working.

1 Like