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

Ok, so it looks like WebCoRE is doing the wake up https://prnt.sc/qpb94l
I would look in that section and make sure MAC address is correct.
Also, make sure SmartThings is on the same network as your PC that you’re trying to wake.
You can also test it by downloading app on your phone putting in MAC address of the PC and waking it up. If that works then SmartThings should be able to do the same.

It’s got to be an issue on Windows end for sure. I downloaded an app to my iPhone called “Wake Me Up”. I put in the MAC, and IP and it defaults to port 9. When I hit the wake up button the app says “Success”, however the PC did not wake up. I then changed the port to 7 as recomended by the app. I had the same result. The last port it recomended was “0” so I tried that and this time instead of success I got “Error Occurred - Unable to send the request. Please make sure you are connected to the network and the IP address is correct”.

So to me the app is seeing the connection properly on the 2 ports but the PC is not responding. I have no idea which settings to look in to further to fix this though. I am stumped but really hope to find the fix.

Well I have no answer as to how I fixed it but I did. I followed MANY different Windows 10 WOL related guides, changed a ton of settings in the registry, windows, devices, BIOS, etc and finally she works again. I don’t know what the fix was but I am relieved the last 2 hours of my Friday night weren’t a complete waste of time!

I’m glad you were able to get to work. For me in the past both devices had to be on the same network and of course WOL on the network card had to be enabled.

I set the webcore, ST virtual button and Eventghost.
When I push the virtual button, any log is recorded on Eventghost.
What did I screw up?TT
the iptime AP can cause trouble?
I can use WOL function with iptime APPS.

Hi all, I assume I won’t get any help since no one has been on this thread in a year… but I’ll throw it out there: I have no idea what to do in EventGhost when you mention “move the tree”. If you’re referring to the file in the post, I don’t have access to it. In fact, I don’t think any of the original links work anymore.

Can someone point me in the right direction?

The Event Ghost Smart app is a groove app. Groove is be phased and will probably stop working in the not to distant future.

You could probably do something similar to this with a smart plug and the new Edge Driver Web Requestor, interacting with EventGhost locally with Get Requests, someone clever will hopefully write a tutorial one day.

@TAustin
I am trying to use your Web Requester to create an event in “EventGhost”, but I don’t really know what I am doing. I previously had it set up using a Groovy Smart App which will be going away. I used it to put my computer to sleep when there was no motion in my office for x minutes.

I tried using the following post which probably not complete “Post:http://192.168.1.153:80/C:\Program%20Files%20(x86)\EventGhost\eventghost.exe

When I run this I get the following error from EventGhost “Webserver: Exception on handle_one_request: int() argument must be a string or a number, not ‘NoneType’”

Do you have any idea what I am doing wrong in my post?

Maybe you just typed it wrong in here, but your IP address has a ‘/‘ where a ‘.’ should be.

That was only a typo in this message, so that was not the problem.

Darn! Would have been an easy one! :smirk:

Let me try to reproduce this. Away at the moment but back in a couple days. Will get back to you.

Thanks. No rush, I am also out of town for a few days.

1 Like

I configured a web request with the same URL as you provided, and it seems to be getting sent OK, so I’m not seeing anything wrong with the string itself. So it does appear to be a problem with what EventGhost is expecting.

When you had this working with a Groovy SmartApp, is this the exact same URL string that you had working there?

Here is one thing to try: replace all the ‘\’ (backslash) characters with ‘%5C’ (similarly to replacing spaces with %20)

POST:http://192.168.1.153/C:%5CProgram%20Files%20(x86)%5CEventGhost%5Ceventghost.exe
1 Like

I reinstalled the EventGhost smartapp which I deleted last year when they said Groovy would be shut down soon, so I could see the events sent.

The smart app sends the following Event to EventGhost: HTTP.ST.EGLaptop.switch.on . EGLaptop is the name of the virtual switch I created to use with that smart app.

image

Also the %5C and %20 characters that you suggested disappear in the web request after you run one request.

I don’t really understand what exactly is being transmitted. That string is getting translated to an HTTP request that actually gets sent and recognized by the EventGhost app.

Do you have any documentation of the API that EventGhost supports? That would tell us exactly what the HTTP request format needs to be.

All I have is the smart app code:

/**

  • Send Events to EventGhost
  • Send SmartThings events to EventGhost
  • SmartThings/Send-Events-to-EventGhost.groovy at master · aderusha/SmartThings · GitHub
  • Copyright 2015 aderusha
  • Version 1.0.0 - 2015-09-13 - Initial release
  • Version 1.1.0 - 2015-09-15 - Changed handling of binary(ish) vs non-binary values to allow sending
  •                           value data to EG to be handled via Python and eg.event.payload[]
    
  • Version 1.2.0 - 2016-04-18 - Added support for individual button values
  • This SmartApp will send selected events to an EventGhost server running the Webserver plugin.
  • EventGhost is a Windows application used for event automation, find out more here: http://www.eventghost.org/
  • How to setup the EventGhost Webserver plugin: http://www.eventghost.org/mediawiki/index.php?title=Webserver
  • TODO:
    • Currently doesn’t support user authentication or SSL. EG Webserver authentication must be disabled by leaving
  • the username/password field in the plugin configuration blank
    • Figure out how to monitor Sonos “musicPlayer” events
    • Add additional capabilities to monitor
  • ISSUES:
    • “Color” values are not being received by EG, presumably due to the “#” character being mishandled somehow
  • Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

*/

// button handling is kinda working but the handler is disabled. getting different responses from minimote vs scene
// controller, should sort that out before tearing down the current minimote configs

definition(
name: “Send Events to EventGhost”,
namespace: “aderusha”,
author: “aderusha”,
description: “Send SmartThings events to EventGhost”,
category: “Convenience”,
iconUrl: “https://s3.amazonaws.com/aderusha/SmartThings/EventGhost_logo.png”,
iconX2Url: “https://s3.amazonaws.com/aderusha/SmartThings/EventGhost_logo@2x.png
)

preferences {
section(“EventGhost server address and port”){
input “egServer”, “text”, title: “Server”, description: “EventGhost Web Server IP”, required: true
input “egPort”, “number”, title: “Port”, description: “EventGhost Web Server Port”, required: true, defaultValue: 80
}
section(“EventGhost Command prefix”){
input “egPrefix”, “text”, title: “Command prefix”, required: false, defaultValue: “ST”
}
section(“Select events to be sent to EventGhost”){
input “mySwitch”, “capability.switch”, title: “Switches”, required: false, multiple: true
input “myDimmer”, “capability.switchLevel”, title: “Dimmers”, required: false, multiple: true
input “myColorControl”, “capability.colorControl”, title: “Color Controls”, required: false, multiple: true
input “myButton”, “capability.button”, title: “Buttons”, required: false, multiple: true
input “myMomentaryContact”, “capability.momentary”, title: “Momentary Contacts”, required: false, multiple: true
input “myMotion”, “capability.motionSensor”, title: “Motion Sensors”, required: false, multiple: true
input “myContact”, “capability.contactSensor”, title: “Contact Sensors”, required: false, multiple: true
input “myLock”, “capability.lock”, title: “Locks”, required: false, multiple: true
input “myThermostat”, “capability.thermostat”, title: “Thermostats”, required: false, multiple: true
input “myTemperature”, “capability.temperatureMeasurement”, title: “Temperature Sensors”, required: false, multiple: true
input “myBrightness”, “capability.illuminanceMeasurement”, title: “Light Sensors”, required: false, multiple: true
input “myHumidty”, “capability.relativeHumidityMeasurement”, title: “Humidty Sensors”, required: false, multiple: true
input “myEnergy”, “capability.energyMeter”, title: “Energy Sensors”, required: false, multiple: true
input “myPower”, “capability.powerMeter”, title: “Power Sensors”, required: false, multiple: true
input “myAcceleration”, “capability.accelerationSensor”, title: “Acceleration Sensors”, required: false, multiple: true
input “myPresence”, “capability.presenceSensor”, title: “Presence Sensors”, required: false, multiple: true
input “mySmoke”, “capability.smokeDetector”, title: “Smoke Sensors”, required: false, multiple: true
input “myWater”, “capability.waterSensor”, title: “Water Sensors”, required: false, multiple: true
input “myCO”, “capability.carbonMonoxideDetector”, title: “Carbon Monoxide Detectors”, required: false, multiple: true
}
}

def installed() {
log.debug “Installed with settings: ${settings}”
subscribeToEvents()
}

def updated() {
log.debug “Updated with settings: ${settings}”
unsubscribe()
subscribeToEvents()
}

def subscribeToEvents() {
subscribe(mySwitch, “switch”, eventHandlerBinary)
subscribe(myDimmer, “level”, eventHandlerValue)
subscribe(myColorControl, “color”, eventHandlerValue)
subscribe(myButton, “button”, eventHandlerButton)
subscribe(myMomentaryContact, “momentary”, eventHandlerBinary)
subscribe(myMotion, “motion”, eventHandlerBinary)
subscribe(myContact, “contact”, eventHandlerBinary)
subscribe(myLock, “lock”, eventHandlerBinary)
subscribe(myThermostat, “thermostat.thermostatMode”, eventHandlerBinary)
subscribe(myThermostat, “thermostat.thermostatFanMode”, eventHandlerBinary)
subscribe(myThermostat, “thermostat.thermostatOperatingState”, eventHandlerBinary)
subscribe(myThermostat, “thermostat.temperature”, eventHandlerValue)
subscribe(myThermostat, “thermostat.heatingSetpoint”, eventHandlerValue)
subscribe(myThermostat, “thermostat.coolingSetpoint”, eventHandlerValue)
subscribe(myThermostat, “thermostat.thermostatSetpoint”, eventHandlerValue)
subscribe(myTemperature, “temperature”, eventHandlerValue)
subscribe(myBrightness, “illuminance”, eventHandlerValue)
subscribe(myHumidty, “humidity”, eventHandlerValue)
subscribe(myEnergy, “energy”, eventHandlerValue)
subscribe(myPower, “power”, eventHandlerValue)
subscribe(myAcceleration, “acceleration”, eventHandlerBinary)
subscribe(myPresence, “presence”, eventHandlerBinary)
subscribe(mySmoke, “smoke”, eventHandlerBinary)
subscribe(myWater, “water”, eventHandlerBinary)
subscribe(myCO, “carbonMonoxide”, eventHandlerBinary)
}

def eventHandlerBinary(evt) {
def egHost = “${settings.egServer}:${settings.egPort}”
def egRawCommand = “${settings.egPrefix}.${evt.displayName}.${evt.name}.${evt.value}”
def egRestCommand = java.net.URLEncoder.encode(egRawCommand)
log.debug “processed binary event ${evt.name} from device ${evt.displayName} with value ${evt.value} and data ${evt.data}”
log.debug “egRestCommand: $egRestCommand”
sendHubCommand(new physicalgraph.device.HubAction(""“GET /?$egRestCommand HTTP/1.1\r\nHOST: $egHost\r\n\r\n”"", physicalgraph.device.Protocol.LAN))
}

def eventHandlerValue(evt) {
def egHost = “${settings.egServer}:${settings.egPort}”
def egRawCommand = “${settings.egPrefix}.${evt.displayName}.${evt.name}”
def egRestCommand = java.net.URLEncoder.encode(egRawCommand)
def egRestValue = java.net.URLEncoder.encode("${evt.value}")
def egRestCommandValue = “$egRestCommand&$egRestValue”
log.debug “processed data event ${evt.name} from device ${evt.displayName} with value ${evt.value} and data ${evt.data}”
log.debug “egRestCommand: $egRestCommandValue”
sendHubCommand(new physicalgraph.device.HubAction(""“GET /?$egRestCommandValue HTTP/1.1\r\nHOST: $egHost\r\n\r\n”"", physicalgraph.device.Protocol.LAN))
}

def eventHandlerButton(evt) {
def buttonNumber = evt.jsonData.buttonNumber
def egHost = “${settings.egServer}:${settings.egPort}”
def egRawCommand = “${settings.egPrefix}.${evt.displayName}.${evt.name}.$buttonNumber.${evt.value}”
def egRestCommand = java.net.URLEncoder.encode(egRawCommand)
log.debug “processed button event ${evt.name} from device ${evt.displayName} with value ${evt.value} and button $buttonNumber”
log.debug “egRestCommand: $egRestCommand , [${egRestCommand}]”
//sendHubCommand(new physicalgraph.device.HubAction(""“GET /?$egRestCommand HTTP/1.1\r\nHOST: $egHost\r\n\r\n”"", physicalgraph.device.Protocol.LAN))

sendHubCommand(new physicalgraph.device.HubAction(
[
    path: "/?$egRestCommand",
    method: "GET",
    HOST: "${egHost}",
    headers: [
        "Host":"$egHost",
        "Accept":"application/json"
    ]        
],
null,
null
))

}

Sorry, can you please update the download link for the EventGhost Tree Template? Thank you in advance

Now that Groovy SmartApps have been shut down EventGhost will not work with SmartThings.