Newly documented Wake on Lan (WOL) functionality (2016)

project_power

#1

We’ve updated our developer documentation with steps to wake up a networked device via WOL.

http://docs.smartthings.com/en/latest/cloud-and-lan-connected-device-types-developers-guide/building-lan-connected-device-types/building-the-device-type.html#wake-on-lan-wol

def myWOLCommand() {
    def result = new physicalgraph.device.HubAction (
        "wake on lan <your mac address w/o ':'>",
        physicalgraph.device.Protocol.LAN,
        null,
        [secureCode: "111122223333"]
    )
    return result
}

Wake On Lan for v2 hub
Need Help Improving Computer ON/OFF Control
Need help writing a WOL integration that gets triggered as a switch
Is there a way to switch PC ON Wake On LAN using Smarthub?
[Release] Host Pinger (IP based Online State / Presence)
Trying to enable WOL, but stuck at first step - enabling github
Help with an Idea (remotely restart a PC)
(Bobby) #2

@ady624 can CoRE integrate?


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #3

Ideally, maybe, this should also be a Capability?

Dunno…


( I hate Mondays) #4

Just saw this, sure. MAC and secret as parameters…


(Kevin) #5

Has anyone been able to get this to work?

Is there another command that let’s you turn off the computer or at least put it to sleep?


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #6

I recommend EventGhost. … There are a few Topics open on this in the Forum.


(J.E.) #7

I played around with this method a bit and was able to get to it work with a PC wired directly to my primary router. However, I needed to wake/suspend a laptop over wifi, and was unable to get the wake to work with this method.

My final solution ended up being quite a bit more complicated…I believe this built-in method would be an easy solution for a simple WOL request to a PC physically wired to your LAN.

What I ended up with (Youtube link): smartthings, wol, and suspend


(Kevin) #8

Thank you for pointing me towards EventGhost, it works great for putting the computer to sleep or shutting it down, but I’m still trying to find a way to wake it up after putting it to sleep.

The WOL command doesn’t do anything or display any errors, but my main concern is that my hub stops responding if I execute that command more than a few times.

When that happens, the only way I can get it to start working again is to reboot it by pulling the power cable and batteries.

This happened twice last night and once today while testing it and twice the last time I tried testing it which was about a month ago.

I didn’t have any problems with my hub during the month in between the tests so it’s definitely related to this command or hub actions in general.

I’m not necessarily looking for help getting WOL to work because it’s probably a windows or bios setting, but I would like to know why it keeps messing up the hub.

Does anyone have any ideas? @Tyler @jody.albritton


(Derek) #9

Sorry I’m new to all this and was curious how you were able to get your WOL to work with the physically wired computer. I looked through the documentation a bit but I’m not very familiar with Groovy or making apps or device handlers.

Any information you could give me would be great.

Thanks


(Kevin) #10

I’m pretty sure the SmartApp CoRE has this feature built in so that all you have to do is enter your mac address.

I wasn’t able to get WOL to work with my computer that’s wired so I came up with a different solution.

I used the free software EventGhost to create macros that perform actions like changing the volume, opening various applications and shutting down the computer.

I then changed the bios settings on my computer so that when power is restored the computer automatically turns on.

I have my computer plugged into a z-wave switch (Aeon Labs DSC06106-ZWUS - Z-Wave Smart Energy Switch) and I extended the generic device handler for it.

The on command turns on the switch causing the computer to start.

The off command uses EventGhost to safely shut down the computer and then once the power drops to 0 it shuts the switch off.

I added the Music Player capability so that the device handler can be used to Pause/Unpause shows on Hulu/Netflix and adjust the volume.

This device handler allows me to use my Amazon Echo with the Ask Alexa SmartApp to perform all those actions through voice commands.

I hadn’t planned on posting the code for this device handler, but I’ve added it to my GItHub SmartThings repository as “Generic Computer” in case anyone’s interested.

My TV doesn’t turn on automatically when given power so I had to create an IR transmitter using Arduino and the ThingShield to turn my tv and receiver on and off, but that’s a whole other project.


#11

Hi - are there any instructions on where this is on CoRE. I am new to it - but have it published to my smartapps - but cannot find any settings/capabilities etc for WOL?


( I hate Mondays) #12

It is a task. On the action side of things, add an action controlling either the location or one or more devices, then add a task and scroll down to find Wake on LAN in the list.


#13

Many thanks! Found it and working like a charm!

Don’t suppose you know if a similar way to send a Shut Down command via ST and/or CoRE?

Ideally I want to set up a Momentary switch that can send a command to shutdown the PC.


( I hate Mondays) #14

SoL is not as standardized as WoL (which is implemented at a low motherboard level), but you will find several apps that can run on your computer (OS dependant) that accept http requests which CoRE can make. Search the forum for sleep on lan…


(Kevin) #15

I use the Windows application EventGhost for this purpose, but I’ve modified an energy monitoring switch DTH to ensure that it doesn’t turn off the power when the computer is still on.

The off command sends the shut down command to EventGhost and then waits until the power drops to 0 before turning the actual switch off.

The motherboard is set to turn on the computer when power is restored so turning the switch back on turns the computer on.


(Ron Talley) #16

Can Event Ghost run on a Pi 3? Is there something that can run on Pi 3 to tell the computers on my network to shutdown or goto sleep?

I’m trying to save every last penny I can as far as energy goes. However, it will takes years to recoup what I’ve spent trying to save!


(Micah Madru) #17

I have wake on lan currently working through a RP module, but I was hoping to get this to work. I set it all up with my
IP. 172.30.42.3 Port 9 and the MAC without any colons and it doesn’t do anything. I have it on with a packet sniffer that monitors for WOL packets and it doesn’t see anything.

Is there something I’m missing?


(Nate House) #18

If your device supports ipmi, could probably make something that can bridge to that for power control


#19

@apottere posted this link in another thread, but I wanted to add it to this one. This is a project report at reddit from someone who is using the WOL SmartThings feature combined with google home so they can turn the computer on and off by their voice. :sunglasses:


(Eddy) #20

I have a similar setup.
Works wonders, except that lately pc being waking up by itself.

For those who plan to do this on win 10, there is a couple of task out there that would automatically wake up your pc for no reason.

Best way to look for the trigger is by browsing the event log in windows and reviewing all scheduled tasks