[OBSOLETE] Send Events to EventGhost

My hub froze every time I tried getting WOL to work which is why I decided to wake up the computer by restoring power to it. I’ve found that sending multiple commands to EventGhost will also freeze the hub so I basically just use it to turn my computer off.

You should be able to use the device handler I posted as a virtual device, but I’ve never tested it.

OK. I figured that is what I would do. I installed it and will try to set it up. I’ll let you know how it goes.

Thanks for the reply! I FINALLY got it working. I was able to set up the smart app, see it under “My Smart Apps”, add the switch I created for my EventGhost powered PC, and then view the URLs after enabling OAuth. However, after executing the 2 line python script with the app-supplied URL, it wouldn’t work. It turns out the URL of my developer account is NOT graph.api.smartthings.com, but rather graph-na02-useast1.api.smartthings.com. Changing this fixed everything!

Okay, now that I’ve got it working…

Is there a way to just simply update the power state in SmartThings without actually triggering that state? To give you some background, I have Eventghost powering my HTPC which runs all my media and cable. I usually use a remote to power on/off the HTPC which is all run through EG. I recently added a virtual switch in ST so that I can control the HTPC power by telling the Amazon Echo “Alexa, turn on the TV.” This works great, as long as the power state between ST and EG are in sync. The problem was that I would use my remote to turn off the power, but ST wasn’t being updated and would still see it as ON. So, when I would say “Alexa, turn on the TV,” the command would be ignored by ST because it was already ON.

That was the problem. Now I have the python script updating ST whenever the HTPC turns on or off. So the above problem was kind of solved. The only lingering issue is that when EG runs the python script to update ST, ST then updates the power state which in turn sends an event to EG and runs the same script redundantly. Fortunately, this hasn’t caused any issues because I set up EG with checks to not run the on/off script when it’s already on/off. Regardless, I don’t necessarily want these redundant events attempting to run the macros again. Any thoughts on how I could just update ST without it sending an event to EG?

Sorry if I’m talking in circles or if any of this is confusing. You’ve been a HUGE help!!!

Thanks,
Brian

Modify your Virtual Switch to add an extra ad hoc Command “silentOn()” or whatever you want to call it.

I believe you can then have it’s methods code check the current Switch State and, if already on, set the Attribute State with “isStateChange = false”, thus avoiding triggering an Event.

I’m sorry, I’m a bit new to all of this. How would I do that? I went into the settings of the virtual switch, and I didn’t see anything where I could add commands.

Host Pinger is good for syncing your PC status. It simply pings the IP address and if the PC is on then it turns on the Virtual Switch and visa-versa.

Works great for me and I have it running on an always on Pi3.

2 Likes

A little late, but have EventGhost call an IFTTT maker action. Then make the action do what you want. Additionally, it can call a maker action to CoRE.

I installed EventGhost on PC, set action to open NotePad when ST detects motion. Worked perfect. Now I want to change Notepad just to wake up my display - using this for ActionTiles @tgauchat which is awesome. Going to have a touchscreen PC setup as my ActionTiles display.

3 Likes

great idea! Great alternative than to use a wall mounted display

1 Like

Hi, I was just wondering if someone could help me out a bit figuring out how to make Smartthings send events from my multipurpose sensor to Eventghost. I’ve already set up the Webserver plugin and set it up so that when I go to IPADDRESS/?ST.Multipurpose+Sensor.contact.closed it triggers the “play” key on my keyboard. I’ve also added the Eventghost smartapp to my phone and added my multipurpose sensor to it, as well as configuring the smartapp with my IP, my port and the command prefeix set to ST. But when I open or close the sensor, nothing gets sent to eventghost on my PC. I wanted to set it up so that when the sensor is closed, it would trigger the “play” key on my PC’s keyboard but I must be missing a step to get the smartapp to communicate with the webserver. Could anyone offer some insight as to what I’m missing? Thanks!

Sorry to double post but I’ve finally figured it out! It turns out my problem was that I had a username and password set up in Webserver. It seems that was preventing the Smartapp from communicating with the PC because as soon as I removed the username and password, it started working! Thanks for all the instructions on this post! Now to figure out how to configure it to only run between certain times of the day and only once per day!

1 Like

@luma
Is there a simple tutorial that shows how to setup EventGhost from start to finish?
Just a simple guide to install the SmartApp and application on PC.
Then a detailed guide on how to do something simple to get started.
Ex: If Kitchen Lights turn on, open a Chrome browser or Notepad that says “Hello World”.

I am finding bits and pieces of what EventGhost can do but I have no idea how join it all together.
So far I installed EventGhost on my PC and installed the SmartApp.
Wasn’t able to link the Github to aderusha - SmartThings - master
I had to manually paste in the code which was weird.

But now I think I need to setup a plugin?
Tried following the link below but got lost. Is there a detailed step by step anywhere?

http://www.eventghost.net/mediawiki/index.php?title=Webserver

Having a hard time linking to EventGhost repository, what I am doing wrong?
Below is a link to the Gibhub:

I am going to Settings > Add new repository > aderusha (owner) > SmartThings (name) > master (Branch)
Then when I go to Update from Repo, nothing is there.
I’ve done this before, IO have a few SmartApps linked such as webCoRE.

Not sure what the repository is needed for??? Are you talking Eventghost or the ST Smartapp that communicates with Eventghost? Either way, know of no reason one needs a repository. So…

First things first:
Eventghost the PC application (nothing to do with ST at this point)

  • You have it installed and running?
  • You have downloaded and installed the EG plugin Webserver? (Its been a long time since I installed this and it may very well be the plugin came with the main EG application. If not you will have to search for EG webserver plugin)
  • You have set the Webserver plugin preferences? (On the top rightside of the main EG window, Double click Autostart/Plugin: Webserver and fill in at least the port number [88 is default] and HTML Document root) BTW: complete documentation can be found by clicking on the “here” link found on the top right side of this webserver preference window.
  • You have tested EG AND the plugin by sending it a message via any web browser? (i.e. In the addressbar of any web browser, enter http://theIP-of-the-PC-Running-EG:portnumber/?This.is.a.test. In my environment this example would look like: 192.168.1.231:88/?This.is.a.test) Executing this test will trigger an event in EG containing, 1) a lightning bolt 2) time of the event 3) the event. (in this case This.is.a.test)

If it works, install the EG ST Smartapp. Look like you already have the code.
Once installed using the Smarthings mobile app open up the EG smartapp and set the preferences. The IP is that of the PC on which you installed EG. The port is the number you specified above when setting up the plugin.
Only thing left to do is the specific which events you you want to send to EG. Again, this is setup in the ST Smartapp preferences

Now comes the fun part. If everything is setup and a ST event occurs EG app will hear about it. You now have to setup on the rightside of the EG window, an EG macro. We’ll call it Door Open. On the left EG window pane click and drag the event (LOOK FOR LIGHTNING BOLT) received from ST onto the macro you just created.
Right click this macro and select “Add Action” . In your post example you used Chrome or Notepad. To do this the Add action optoion would be “System/Start Application”. Once selected fill out the form that appears and voila…

What you now have is
A macro called Door Open, underneath it an event sent from ST Smartapp, underneath it the action to perform when this event occurs.

I’ll leave it at that for now and see if you can follow what I wrote above. Let me know

2 Likes

@cdikland

Thanks, that guided me a little further.
Installed the Web Server, my test was successful. Created a folder called SmartThings, added an action to open an image when Contact is open. Setup the SmartApp, EventGhost is receiving the activity now and executed the command.
The only problem I see so far is the reliability of the response from SmartThings. It could take a few minutes to respond to an open sensor or not read the open/close at all sometimes.
Or when it is OPEN, it will read CLOSED. Weird.

Also, what goes in the HTML root folder for the Webserver plugin, what is that for?
And do I need a login/pw for the webserver plugin? I found that ST won’t talk to it if I have one.

When you say “a few minutes to respond” do you mean the event in EG takes a few minutes to appear in the EG Left Panel or do you mean Smartthing App does not update the sensor when the door is opened hence no event gets sent to EG for a long time?? If its the latter than you have a ST problem and need to talk to support. As for events being sent and received by EG response time on my side is immediate. In otherwords, a door opens, ST app updates and sends the event to EG. At the blink of an eye the event is received by EG. If this isnt happening for you what happens time wise when you send an event to EG via a web browser. i.e 192.168.1.222:88/?AnEGEvent

SmartThings is fine.
It is the feedback on the EventGhost from ST that is the problem.

I did your web browser test and it works fine. Events happening on the computer are instant and EG is not missing anyone.
I just tested it with a ST switch now, sometimes it is instantaneous, other times it does not register or it will be the incorrect value (ON/OFF) - same as the contact sensor.

Most of the time, if turn my lights ON, wait 10 seconds, turn them OFF, EG won’t register it.
Wait 30 seconds, turn them back ON, EG registers the lights as turning OFF. It gets out of sync while also missing events.

Tried changing my port #, same issue.

Update
Now I just opened my sensor, and EG registered the correct value of lights while missing the contact event.
So my contact was triggering my light event as on/off for a few minutes. So weird.

I also did your test again and only did it once. But it registers 4 times and once randonly 35s later? Is that normal?
image

Not normal. Weird indeed.
Can you check what version of EG you have running?? (About Eventghost/System information)
What windows OS are you running under?? Win7? Win 10??

As for your earlier question “what goes in the HTML root folder for the Webserver plugin” I never use it. You could place a HTML web page there. That page would be accessible via browser url such as 192.168.1.231:88/mywebpage.htm.l In fact, if you want to call EG remotely (i.e. http://myegwebser.org:8888/?my.event) , I would create a blank file called index.html and place it in that folder. Without it the folder would be exposed remotely and could be accessed via http://myegwebser.org:8888.

I do not use a username and password in my setup. The webserver help page explains why and when you would use this. I cant recall the details

Using EventGhost 0.4.1.r1722.
Windows 10 v1703.

It goes the other way too. If I turn on a light, it will open a sensor. Not sure what’s going on…
This would be awesome if it actually worked correctly for me!

I just tried it with a completely different computer running Win7 with the same exact problems.

dang… same version I am using. I had it running under Win 10 for several years and recently moved it to Win 7. Havent noticed any differences. I am at a loss.

1 Like

I reinstalled the SmartApp, no luck.
I also removed the sensor I was using to test and linked a single light I have not used yet. Turned on the light and it registered the sensor (no longer linked to EG) as open lol.
Then a few minutes later, I turned the same light off, which made EG say a different light (no longer linked to EG) as on.

Man this is so disappointing. Is there someone I could reach out to for troubleshooting?