Hi All,
I have a mqtt service running on a laptop of mine. I have setup a standard mqtt block in Home Assistant to pub/sub to it. This works flawlessly.
What I want todo is add a wake_on_lan switch to turn off and on my laptop (turning it off over mqtt) I’m having some trouble following the WOL Switch documentation in regard to the turn_off option.
This is what I have so far, and would like some helpful direction as i’m not sure how to format the turn_off action for mqtt:
switch:
- platform: wake_on_lan
name: "Computer WOL"
mac_address: "00-11-22-33-44-55"
turn_off:
service: mqtt.publish
data_template:
topic: "home/computer/switch/set"
payload: "OFF"
Is this structure setup right?
fyi: the home/computer/switch/set OFF performs a “pmset sleepnow” on the laptop. I have tested this and it works great outside of the WOL context.
Thanks!