[NEEDS UPDATING] Computer Power with Wake On LAN

I’ve been wanting to control my PC power from SmartThings for a few days, and after searching and searching with no luck. I finally got around on to playing with Groovy. I figured I’m not the only one who would like this. So here you go a fully working WOL and eventghost SmartApp.

You will need a simulated switch, a PC that is WOL capable, and EventGhost with webserver and shutdown trigger.

https://github.com/freethewhat/mySmartThings/blob/master/smartapps/freethewhat/computer-power-control-with-wake-on-lan.src/computer-power-control-with-wake-on-lan.groovy

8 Likes

I’ve been trying to get this to work, and I cant

I have WOL working from the web (ports 7 & 9 opened from the web through to an address that is reserved on my DHCP server) and have it working internally where I send it to the broadcast range of the network (10.x.x.255) and from my router it works, and from my mobile android device it works… But I cant get this to work.

I have even changed the line of code from “wake on lan $macaddress”, to “wake on xxxxxxxxxxxx”, and put the actual Mac address in the code (ruling out any variable passing line 93) and it still doesn’t work.

I just cant get this new WOL functionality in SmartThings to work on my network :frowning:

Figured it out. I used a Magic Packet snifer and found that even if you didn’t put a secure-on password in, the WOL command would be broadcast with 12 0’s at the end of the WOL packet, which my machines were ignoring.

If you put a secure password in as 123456789123 then all works.

I did a tutorial on this a while back.

hi, where you put the password? Only in the smart app or where else?

Hey, In the App, I believe there is a section for “secureon” password. Must admit, I didn’t stay with this app very long, as it only woke and shutdown the PC. It didn’t remain in sync with the PC (so If I turned on the PC by the button, it didn’t update in the App) I moved to sumitkgarg : WOL Switch.

Ok, thanks… I will search for that app instead. Im new on this. Thanks!

It’s great having a little Pi to serve other things that connect to SmartThings. The sync is easily fixed with Host Pinger which my Pi host. I even use the PC as a motion sensor! It is explained in my tutorial:

im sorry for asking this im super newbie i cant find enough info to make this work, i manage to add your code to create a smartthing app and i can see it on my phone, also manage to create a virtual switch and also i can see it on my phone, my pc is configured to wol but cant understand how to make an eventghost webserver and shutdown trigger and use everthing together to power control my pc, please help!!!

Did you fix this?