[WINDOWS TUTORIAL] PC On/Off (No Hardware Required)

Thanks for the heads up. I think you’re right about the network card taking a little bit to get back up. Good find! :slight_smile:

1 Like

HI
I have just set up everything its not working at least to pc off.
Im able to trigger pc shutdown in eg, but not with the virtual switch in st. I can see the log in eg on , off.
The commend pc on in st work but only if i have trigger from eg or manualy thru windows,pc off never work in st.
A also see webcore receive both command from st
Where do guy think i miss.

I also try to do another pc, this one dont receive any log in eg from st and when i trigger pc update on or off from that pc both switch turn on or off i gess i would have to replace the eg command in st but where do i replace the same command in eg
Thanks

Another question, do you have to do some configuration with curl or just install curl ,there no mention in the instruction
Thanks

Hey, all you have to do is install cURL as an admin. It simply allows EventGhost to tell SmartThings that your PC is turning off. Did you check and make sure your settings in EventGhost preferences are correct? It sounds like EventGhost might be closing when you exit. See step 1.

hi Nickd
Evenghost is not closing,step 1 is done correctly. I’m not shure if i have installed curl as a admin .Strange thing is that i can see the log in evenghost pc on pc off when i trigger the switch in st, for me ,i think the problme should be in eg or the pc itself.
I will make more testing soon and get back to you .
Thanks

1 Like

As I’ve just started with Smartthings and/or I have a problem with logic, I don’t understand how IFTTT/Webhooks is used. Do I need to create anything in IFTTT or it works just like that without a web request in Webhooks? If it works just like that, how does this happen? :slight_smile:

Later Edit: I’m slow, I got it in the end :slight_smile:

All WebCoRE is doing with the “IFTTT” action and trigger is using HTTP GET and HTTP POST to receive and send signals across the web. Nothing is required in IFTTT and it’s just your computer sending signals to the WebCoRE service.

Not sure what I am doing wrong, checked the firewall and almost everything maybe someone can help me. When I visit the https://graph-na02-useast1.api.smartthings.com/api/token I get the “Received event pc_off.” message.

When I check my piston log I see:
11/3/2017, 12:07:24 PM +580ms
+1ms ╔Received event [Home].ifttt = pc_off with a delay of 36ms
+121ms ╚Event processed successfully (121ms)

Log1

IT doesnt look like my Smartthings is talking to my Event ghost?

Did you properly set up the Send Events to Smartthings smartapp? The problem is definitely the communication through that smartapp. You should see live ST data like this. https://puu.sh/yf2QJ/d5ee1c619f.png (Make sure that you typed the correct IP and port in the ST SmartApp interface. Otherwise, shoot a message over at the Send Events to SmartThings thread.

Hi Nick,

Thanks for creating such a handy script. I think I have got it up and running but trying to understand if this is actually the script I am after. I can turn the PC off and on via my SmartThings app but if I am not mistaken it is not really turning the PC “off”, is that correct? I was originally thinking this actually turns the PC completely off but judging by how fast it comes back after I press “On” I am guessing that is not true. Is this sleep state the only option for someone looking to turn their PC off?

Basically my situation is that I have a HTPC that for the last 3 years I have run 24/7. Now that I am getting into SmartThings I decided I should try and save some hydro and turn it on and off as needed since I can automate it. I have unlimited bandwidth between 2am-8am so I try and take advantage of that. I am going to schedule the PC to turn off at night with our “Night” routine and then turn on in the middle of the night for a few hours to do some downloading before turning off again until a time when we turn it on to watch stuff. It seems I can do that with your script (correct?) just that the PC won’t actually shut down?

Well, if you want to shut down the computer rather than put it to sleep, simply modify the EventGhost macro. I went with sleep because many motherboards ignore Wake on LAN calls when shut down, but accept them when in sleep mode. You can easily change this, just make sure to test. Just keep in mind that sleep mode is pretty much off energy wise and applications wont run in sleep mode.

Thanks for the clarification. I’ll be honest I wasn’t totally familiar with sleep and what it meant for energy consumption. It seems it will meet my needs exactly which I’m happy about. It’s great to use SmartThings to do yet another energy efficient thing for the house. Great script and work!

1 Like

Hi agenovese820, i was having the exact same issues and non of the fixes suggested on this page worked for me either. I changed the port on the plugin to 8080 and that fix it for me. You’ll also have to set the port to 8080 on the Event Ghost app for obvious reasons. Hope this helps

1 Like

Hello Team,

I have been working on this tutorial for most of the day with some great success, but I have come to a stumbling block that may be simple to fix.

  1. When the computer is on, I execute the SmartThings app to turn off the computer, nothing happens.
    *** I can see the command propagate to EventGhost on my computer, so I am getting confused why the computer will not sleep or shutdown.

  2. When I manually run the command in EventGhost “PC shutdown” (not PC Update to Off), the computer will sleep. Now at this point, when I issue the ‘ON’ command for my computer from the SmartThings app, the computer wakes up to the login screen.

I am looking for some direction or suggestions for getting my computer to shutdown from the SmartThings app. I am very close and have tired many things without success.

Thanks in advance!

Ward

Does it make any attempt to shut down? Sometimes you need to enable Force Close Programs in EventGhost setup. Also, try using the other actions in EventGhost (Action -> System -> Power Management -> Turn Off, Stand By, etc)

Hello Nickd, When I added a Stand By action in the PC Update to Off Macro, the computer did take some action.

Thanks much!

This is pretty sweet. I’m aiming to shut down my whole living room at night when I tell Alexa goodnight.

I had this briefly working after I changed the port to 8080. Now it doesn’t work anymore. Events are still coming through to EventGhost, but nothing happens beyond that. Not sure what to do, especially since it seems to have stopped without me actually changing anything.

Strange. Have you verified all of your settings according to the guide? Was it after a specific update? Is WebCoRE up to date in the developer environment?

It was actually only working for a few minutes. I turned it off and on a few times in a row to check it out, then it stopped working. Restarted my computer, still didn’t work. Went back through the instructions a few times to make sure. My Webcore is up to date.

Here’s another solution that has been rock solid for me since day 1…A little over a year. I use a different approach with a program that’s checks my LAN for active PC.

That rest is similar.