Wake on Lan

Me too, tied it in with opening a roller blind, setting the lights to a specific scene and turning on my monitor (TV).

wol seems to have stopped working from my hub. it just suddenly stopped working other devices like my router can do wol but not my hubitat.

Just tested it and it still works for me. I haven't updated my hub firmware in a while though. What version of HE firmware are you on?

Updated my firmware to the latest version and it still worked fine. Verify the MAC address is entered correctly. Also check the logs for any clues.

1 Like

Mac Is correct , debug log says it's send the magic packet. But nothing.

dev:1422021-03-26 11:03:35.243 pm infoBattlestation was turned off

app:1252021-03-26 11:03:33.780 pm debugSending Magic Packet to: 7085C2A4DA67

app:1252021-03-26 11:03:33.778 pm debugBattlestation activated

app:1252021-03-26 11:03:33.768 pm debugSending Magic Packet to: 7085C2A4DA67

app:1252021-03-26 11:03:33.764 pm debugBattlestation activated

app:1252021-03-26 11:03:33.734 pm debugSending Magic Packet to: 7085C2A4DA67

app:1252021-03-26 11:03:33.726 pm debugBattlestation activated

Seems like a network issue of some sort. Anything special on your end? Vlans etc?


I don't have any vlans, I check network settings on my hub they looked correct. I reset my hub network settings got the same information but now it works... Bit weird but thank you for the help.

1 Like

Hi @stephack,
Thanks for the code, your App works perfectly for me!

However, I'm trying to build it into a custom driver, and I really can't figure out what I'm doing wrong. As mentioned, it works flawlessly when I use the Boot Me Up Scottie/Child drivers, but when I copy+paste it into my driver, it doesn't.

I'm new to coding with Hubitat, but the driver code is as follows. There is a bunch of other stuff in there as well, but I guess the important bit is the on() and createWOL() functions. Including the rest in case I'm missing something.

metadata {
    definition (name: "PC Controller", namespace: "manke", author: "Andreas") {
        capability "Switch"
        capability "Momentary"

    preferences {

        input(name:"myMac", type: "text", required: true, title: "MAC of workstation")
        //input "myMac", "text", required: true, title: "MAC of workstation"
        input(name: "EventGhostIP", type: "string", title:"Local IP Address", description: "", required: true, displayDuringSetup: true)
        input(name: "devicePort", type: "string", title:"Event Ghost Server Port", description: "", required: false, displayDuringSetup: true)
        input(name: "offCommand", type: "string", title:"Event Ghost off command", description: "Specify off command for Event Ghost", required: false, displayDuringSetup: true)
        input(name: "testCommand", type: "string", title:"Event Ghost test command", description: "Specify test command for Event Ghost when using push button", required: false, displayDuringSetup: true)
        input(name: "PetName", type: "string", title:"Pet Name", description: "You may assign a pet name", defaultValue: "69", required: false, displayDuringSetup: true)
        //input(name: "devicePath", type: "string", title:"URL Path", description: "Rest of the URL, include forward slash.", displayDuringSetup: true)
        input(name: "EnumFIeld", type: "enum", title: "Choose a value", options: ["This","THoSe","THAT"], defaultValue: "This", required: false, displayDuringSetup: true)
        //input(name: "deviceContent", type: "enum", title: "Content-Type", options: getCtype(), defaultValue: "application/x-www-form-urlencoded", required: true, displayDuringSetup: true)
        //input(name: "deviceBody", type: "string", title:"Body", description: "Body of message", displayDuringSetup: true)

def parse(String description) {

def getCtype() {
    def cType = []
    cType = ["application/x-www-form-urlencoded","application/json"]

def push() {
    //Send Event Ghost test command
    //sendEvent(name: "switch", value: "on", isStateChange: true)
    //runIn(1, toggleOff)
    //sendEvent(name: "switch", value: "off", isStateChange: true)

def toggleOff() {
    sendEvent(name: "switch", value: "off", isStateChange: true)

def on() {
    sendEvent(name: "switch", value: "on", isStateChange: true)

def off() {
    sendEvent(name: "switch", value: "off", isStateChange: true)

def sendEventghostCommand(String eventGhostCommand) {
    def localDevicePort = (devicePort==null) ? "80" : devicePort
    def path = EventGhostIP + "/?" + eventGhostCommand
    def body = ""
    //if(deviceBody) body = deviceBody
    def deviceMethod = "GET"
    def deviceContent = "application/json"
    def headers = [:] 
    headers.put("HOST", "${EventGhostIP}:${localDevicePort}")
    headers.put("Content-Type", deviceContent)

    try {
        def hubAction = new hubitat.device.HubAction(
            method: deviceMethod,
            path: path,
            body: body,
            headers: headers
        log.debug hubAction
        return hubAction
    catch (Exception e) {
        log.debug "sendEventghostCommand hit exception ${e} on ${hubAction}"

//Send Wake on LAN package to PC
def createWOL() {
	def newMac = myMac.replaceAll(":","").replaceAll("-","")
    /*if(logEnable)*/ log.debug "Sending Magic Packet to: $newMac"
    def result = new hubitat.device.HubAction (
       	"wake on lan $newMac",
    return result

Debug output for both the device and the app seems identical

[dev:140]( 09:19:35.113 [debug]( Magic Packet to: 382C4A6DE77E

[app:262]( 09:05:14.026 [debug]( Magic Packet to: 382C4A6DE77E

I'm kinda hitting a wall here, I hope you have some tip that can help me move forward.
Thanks for reading, and for the app anyway! I'll use it as a fallback if I cant get this to work :slight_smile:

Try replacing this line
return result


1 Like

That works, thanks so much!
Do you know if anyone made a kinda tutorial/introduction for programming the Hubitat? Or Is it just inferring from code examples? I'm not super familiar with this syntax either, is it JavaScript-esque?

It’s the Groovy language, a flavor of the Java family. You can Google for tutorials.

Hubitat developer documentation is here:


The Documentation link is at the top of every forum page, Hubitat device driver and app programming is similar to the classic SmartThings model. That documentation is here:


Welcome to the Hubitat community!

1 Like

I'm new to Hubitat but I've been trying to use this app. I've successfully installed it but my only options for switches are my Sengle bulbs. I'm wanting to use my Phillips Motion Sensor. Is there a reason that's not showing up as an option?

The switch is what you will "turn on" to send the WOL command to your pc. The intent is that you will create a virtual switch (called My Pc for example). You could then manually flip that switch to wake your pc, or include it in an automation. So in your case you would create an automation that turns on the "My Pc" virtual switch when there is motion detected on your Philips motions sensor.

To create a virtual switch, go to Devices -> Add Virtual Device. Choose Virtual Switch as the type and give it an appropriate name. I would recommend you also open the device page of the newly created switch and set AutoOff to 1s or 500ms. This will essentially make it a momentary switch that you can use over and over again...you only want to turn on the switch...since turning off wouldn't accomplish anything.



I recently got a Hubitat which I had given a fixed IP address to. When trying to set this up to wake a couple of network devices, it failed every time.

Deleting the apps and switch, setting the Hubitat back to DHCP and setting WOL up again caused it to work. Setting the Hubitat to static with the assigned IP caused it to fail again.

Could something odd in the way Hubitat have implemented either WOL or Static IP explain this behaviour?

Are both the hub and the devices you are trying to WOL on the same network/Vlan?
Are you also sure you are setting up the static configs properly ie IP/Subnet/Gateway. If any of these are not configured correctly then you can have issues.

In any case I usually recommend leaving the hub as DHCP and setting up an IP Reservation. That way the hub always gets the same ip address (essentially static) and also automatically gets all the correctly configs for subnet/getway/etc.




Same VLAN and no issue pinging the Hubitat from the device. All of the Hubitat network settings were left exactly as the DHCP left them, so literally just switching to the Hubitat assigning the IP address caused failure. It is odd, because the built in ONKYO driver, which also needs to talk to the local network, was fine whether the Hub IP address was DHCP assigned or static

I have now reserved the IP and that should mean it stays working.

I was hunting around the web ui of my Hubitat to find a way to set a static ip to it....gave up and decided to search the forum. Apparently it's only an option for the C5 and above and I have a C3 and a C4. Glad to hear you got it working anyway.

I had issues too so I created my own app. you can download it from here:

@stephack perhaps it's self-evident or mentioned later in this thread, but the classic means by which plug-ins like WOLPlusPing (over on the Vera platform) kept track of the target network device's power status was simply to ping its IP address every minute or so. Helps if you assign static IP addresses, but not hard to do for this purpose.

When the PC turns off, the virtual switch assigned to by WOLPlusPing turns off the corresponding virtual switch, which in turn the hub can automate from. Sorry if I'm stating the obvious, but I noticed other members wondering how that would work.

I "sort of" mention this here:

The way you describe it, is pretty much the way I do this in Home Assistant. Since it would require yet another HE app (or a complete rewrite of my existing app) it would be a nogo for me. As I mentioned, I only keep my Hubitat going to support minor updates to my existing app/drivers. I do not actively develop for HE anymore.

If there is already a device monitoring app/driver out there, it could be used in coordination with my Boot Me Up Scottie app...or...if the dev is still active in HE, they could easily add WOL to their app. My code is available for anyone to inspect...its a Very simple app.


Download the Hubitat app