How about:
Turn on Kitchen PC
Turn off Bedroom PC
Mouse is Active
Turn on Kodi
Even Works with Alexa or Hey Google!!
This Tutorial will not only show you how to make your PC a totally controllable Switch in ST, but also use Virtual Switches as a Motion device or to Execute Programs which can all be used for Home Automation! After setup, your PC status will be in perfect sync with the Virtual Switch no matter if you turn on/off the PC manually or through SmartThings.
It might seem like a lot but you can have this up and running fairly quickly especially if you are already familiar with installing custom apps. Itâs up to you how far you want to go down the rabbit hole!
Tools used: Send Events to Event Ghost (App), Host Pinger (App), EventGhost (Free Windows Program), CoRE or webCoRE (App) and Alexa Cloud Interface App (App) (Links are provided in Tutorial)
Steps 1-5 is all you need for on/off operation. (Shouldnât take more than a couple of hours to get it up and running)
Steps 6-9 will take a little more time and if you are not computer savvy then steps 6-9 may be a little confusing. However, I will be here to answer any questions.
Every step is not fully âdetailedâ. You may have to leave this page to get a couple of things installed and figured out on your own before you can proceed to the next step. I have provided more detailed Screen Shots and Examples below in Post #2 in case you get stucked.
As far as I know, no other easy way to do this so if you find an easier way, be sure to drop a note.
Ok, here we go!
Warning! For complete integration, an always on PC or Linux Box to run the Host Pinger Sever is needed. However, you can still turn on or off your PC without Host Pinger. Host Pinger is only used to keep the Virtual Switch(s) in Sync and again, is highly recommended.
A Raspberry PI 3 is perfect for this task!
At the end, you will be able to easily monitor if PCs are on/off, turn them on/off (manually or via ST and the switch stays in sync), monitor if there has been activity on the PC, create macros for things (Virtual Switches) like, Alexa, open up Google Chrome or, Alexa, start Kodi, or Alexa, turn off Bedroom PC! Coupled with CoRE or webCoRE, I have complete control over my PC and you will too!
Second Warning! This tutorial is PC driven (Sorry Mac Users) and relies heavily on EventGhost (Free) which is a super easy PC tool. It will serve as the means to turn Off your PC. (Can also put it to sleep or hibernate.) Basic beginner info about Event Ghost can be found here:
http://www.eventghost.net/mediawiki/index.php/Main_Page
** Quick Setup for on/off PC control via SmartThings:** See Post #2 for detail instructions with Screenshots
-
Install Event Ghost on the PC you want to control. Event Ghost is one of the main ingredients and it is super easy to learn. I used this initially to just turn âoffâ my PC from SmartThings but there is so much more you can do with it!
-
If you do not know how to install custom code, then please see this FAQ:
[OBSOLETE] FAQ: An Overview of Using Custom Code in SmartThings (SmartThings Classic, Groovy Code)
Install the custom app "Send Events to Event Ghost in the IDE.
-
Create a Virtual Switch (VS) to turn âoffâ PC using Send Events to EventGhost App. (You could also create the VS with Host Pinger) In the Send Events to EventGhost App, make sure this switch is selected so it will show up on the EventGhost activity screen.
FAQ: Creating a virtual Groovy Device [OBSOLETE] -
Using the same VS, Use CoRE or webCoRE and the Wake on Lan (WOL) feature to turn â'onâ PC (just point to mac address)
-
Install Host Pinger to sync on/off status of Computer with VS. (CoRE rule example listed below) Basically Host Pinger will dictate the status of the switch. If the Ping is Live, the switch will be On, If the Ping is dead, the switch will turn off.
[OBSOLETE] Host Pinger (IP based Online State / Presence)
(More Advance setup below)
Quick Setup for using Event Ghost to monitor PC Activity: See Post #2 for detail instructions with Screenshots
- Learn how to use Event Ghost to send âPC Eventsâ to SmartThings. (However, we donât need all of this just the Python Script and you need to create the index.html webpage)
Here are better instructions
-
Create a Virtual Smart Switch that will be used to update computer mouse activity.
-
Install Cloud Interface Smart App from Ask Alexa Setup to get the âEnd Pointsâ of the VS. (So Cool!)
http://thingsthataresmart.wiki/index.php?title=Alexa_Helper#Cloud_Interface_Smart_App_Setup -
Finally configure a Macro and Python Script in Event Ghost to send SmartThings the PC Activity Status
import urllib; urllib.urlopen(âhttp://some smartthings addressâ)
This is better explained with the screen shots in Post #2 below with the label Step 9-Setup with Screen Shots for Mouse Activity in Event Ghost:.
- Like this Post and spread the word or come back to this post and update me if there is a better solution!
I hope this helps someone. Let me know if you need further information on my setup.
Thanks.