(Tutorial) PC on/off and Activity Monitor with SmartThings

Host Pinger

Send Events to EventGhost

Recent Activity for Virtual Switch

ok so i have opened my ports 8087 ( i was using the others) and i have added what you can see in the screen shot. It seems to show the SM eventghost app sending updates to Eventghost on the PC however it doesn’t shutdown.

The only thing i can think i have missed is the Macro and Python Script in Event Ghost to send SmartThings the PC Activity Status im not sure which URL this is in reference to the switch in IDE or just the IDE home screen?


You are jumping ahead with the Macro and Python Script Stuff
 This is related to the PC Activity Virtual Switch. (Advanced steps 6-9)

You are still on step 4-5
Post #2

Your HTTP.Shutdown.Server.switch.off on the left side does not match the right side. You must have tried typing it in or something
There is no URL
You literally just click and drag the event on the left on top of the Forced.Shut Down action on the right.

1 Like

ok i see what you mean , i have copied the HTTP.Shutdown.Server.switch.off over . which value does the Eventghost command prefix relate to?

Steps 1-5 is all you really need. Afterwards, you should beable to turn on and turn off the PC and use Host Pinger to keep the switch in sync


Steps 6-9 is more advanced and not necessary but is cool if you want to use your mouse activity as a sort of motion sensor


The Python script is used to send events to ST using the end point (cloud interface app) URL. Post #2 has detailed instructions on how to set this up but again this is not necessary.

Step 6-9 is for a totally different Virtual Switch and has no relation to steps 1-5.

thanks got this working in the end.

what i wasn’t understand if once i have setup event ghost turn the “switch” on and off and then look for the commands withing ghost and copy over

1 Like

Awesome! I am going to update tutorial one of these days to full step by step instructions. Glad you got it running.

@rontalley Hello, need a little assistance. Everything works perfect, but I am having one issue. I am testing my PC on and off switch. I have it set not to actually turn off the pc at the moment just for testing. When I turned the switch off I expected it would turn itself back on with host pinger, but it did not. However, when I closed host pinger on my pc and then re opened it. The pc switch on ST did turn back on. My question is what am I doing wrong, why does the switch only turn back on when I close and reopen host pinger on the pc?

Host Pinger really has nothing to do with turning on the PC. It’s only purpose is to keep the switch and actual PC status in sync. This is why it’s best for it to be always running on a dedicated server such as a little Pi3 or always on PC.

There are two methods for turning “on” the PC.

  1. Use webCoRE and Wake On Lan (WOL) command by finding your MAC address (easily found in your router device page).

Or

  1. Use a smart outlet to turn off/on the power to the PC. Most PC have a setting in the BIOS to say when Power is restored, then turn on.

I use a combination of both with all of my PCs. The ones that can receive a WOL command, typically these are hard wired on the network (cat5 cable). The ones that are not (usually connected via WiFi), I use a smart outlet.

Again, Host Pinger’s only job in this setup is to monitor the network and determine if the PC is awake(on) or sleep(off/hibernating/etc.)

Hope this helps.

Sorry I don’t think we are on the same page. I am just trying to keep the switch in sync. If I turn off the switch to test and the pc stays on. That now means the switch is out of sync the pc is on but now the switch shows off. So host pinger is supposed to turn the witch back on becasue the pc is on. But the only way I can get host pinger to do that is to close it out on the pc and then reopen it. Then you can switch that the switch is sent an on command from ghost pinger. Why does it only work when I turn off host pinger and then turn it back on?

Oh I see.

If you actually turn off the PC manually, then Host Pinger will see that the ping is dead and will send an Off command to ST. This is how it should work
You are tricking the system by sending an off command to the PC but the PC doesn’t turn off and there is no way that ST knows because according to Host Pinger nothing has changed
This would be easy to monitor if you had a power meter on the PC. If wattages drops below x watts then turn off. If wattage rises above x watts then turn on


Host Pinger monitors “changes”. If the ping is not answered, then it will send an off command and visa versa.

Whenever you “restart” Host Pinger, it reads the actual status of the PC and then sends a command to ST.

Again, the Ping HAS to change in order for Host Pinger to actually send a command to ST to sync the switch. No change. No command.

I see what you are saying.

Wait, I do have it on a plug with a power meter. So you are saying to get rid of of host pinger all together and use webcore piston to monitor the switch based on wattage?

Also, could I not use webore with the PC activity switch from the mouse actions. Something like if pc switch is off and pc activity is on, then turn the pc switch on?

1 Like

Yep. I will never buy another smart outlet that doesn’t monitor power. So darn useful!

Thinking about it now, I am going to update this tutorial to add what we just discussed here!

I regards to the PC activity, I use both. Active and Inactive from Event Ghost and webCoRE If PC is off Then turn off PC activity.

Thanks!

BTW, I am sure this integration has saved me tons of money as now there are no PCs that just stay on when not in use.

1 Like

So I can get rid of host pinger? What do you think about using the pc activity switch?

My PC is always on, LOL. This is all so I can control it when I need to.

Just a heads up. Eventghost has switched domains so you should update your link above. New location is:

www.eventghost.net

1 Like

Done! I still rely on this integration heavily so thanks for the heads up.

No problem, I’m looking into it to find a reliable way to wake my PC from sleep remotely. I had previously just power cycled my smart switch that monitors power usage and relied on the motherboard being set to “Turn on when AC Power is restored” but it’s a little clunky.

Hoping this is a little better.

EDIT: Guess all I need is webCore for WOL.

Yep. The waking is the easy part. The putting it to sleep or turning it off or running a program took some creative juices flowing.

1 Like

At least for now, I’m okay with normal Windows sleep rules and don’t need instant sleep/shutdown abilities. If that changes though, I’ll be sure to come back, definitely cool that you’ve liked SmartThings to Eventghost.

1 Like

I just read through this whole thread. Super useful and interesting. I have EventGhost installed and running and linked to my HousePanel API to query the status of things and to send commands to things. By using the HousePanel API it gives EG the power to do both a pull and a push this avoiding the use of the Webserver plugin and an extra ST app to push events. With that said I like the idea of also using the ST event push to EG for event driven actions on the PC so I plan to add this to my setup. If all you want is to know status then the HP api will do that without extra stuff. See the wiki for HP for details.

1 Like