Eventghost Launch Webcore Piston


I have a weird issue and am hoping someone has seen this before. From all my research today, I haven’t been able to find anything similar. So I am migrating everything from ST to Hubitat (as many of us are), and am going to be using Webcore in Hubitat as well (as I had 100% of my ST setup in webcore).

I am also running Eventghost on my PC’s which control a few things in Webcore. Just to give some examples:
Monitor when PC is on or off by changing virtual switch when PC turns on or off.
Use virtual switch (same one as before) to turn PC on or off
Turn on desk lighting automatically upon PC boot, and off when PC is shutdown.
I also have a simple piston which just toggles lights when I hit certain buttons on my keyboard.

I guess a little background into how I did this is I have Eventghost setup to send an event to a webserver. I would then copy the Piston URL (external URL in Webcore) and use that as the web command URL.

If I wanted to send along a variable I could add a ?VAR=VARSTATUS after the end of the URL, and it would allow me to run the piston and pass along a piece of data too. Very useful as I can tell webcore when my PC is on / off just by manually executing the piston.

So here is where it all gets messed up. The ST URL ended in the Piston ID (:PISTON ID:). I have shortened some stuff from this URL (for security), but it shows the overall layout.

The Hubitat URL ends by sending a variable called access_token. This for some reason creates an issue when being sent from Eventghost which doesn’t allow it to run. Again, shortened some stuff so its different.


I am seeing this error in Eventghost.

I have also tried adding a “&” after the end of the URL (which would allow another variable to be added) which works well from a web browser, but not Eventghost.

Anyone have any thoughts? I have been playing around with this for hours and have had no luck. It would be a really big bummer if this quit working for me as I have quite a few pistons setup this way.

I know this isn’t quite a true webcore issue, but I was curious as anyone who may be currently migrating might see this issue and have solved it. Thanks.


I do not own a Hubitat, but I use EventGhost quite a bit…

Have you tested this URL from a normal web browser?


Yes, it works stock in the web browser, and if I were to add a “&” after it. For some reason I was thinking EG was adding a “/” to the end of the URL and when I tried it that way I would see an Oauth error.

So I tried it with a “&/” at the end and it would work in a web browser, but in EG it still wouldn’t work.


I am not trying to be nosy, but are there any symbols or punctuation in the censored URL?

For reference, in EventGhost, I use:
Add Action > EventGhost > Python Command > Python Statement:
import urllib; urllib.urlopen('https://example.com/api/token/abc123/smartapps/installations/def456/execute/:ghi789:?PcLocked=false&PcOff=false')


No, it is very similar to the ST one, but the access_token seems to be sent as a variable rather than included in the link. Besides the ? separating the variables at the end, and the & I added myself, there is no other symbols besides the /


I will play around with the format you use. I have been using the send command to webserver plugin which seemed to work really well.

Can I just copy and paste the statement you have above (and change my URL) into the Python Statement box directly? Or would there be anything else I have to setup?


That string above is 100% identical to all of my EventGhost commands to webCoRE…
(with a slight scramble for censorship, and the ending may each be a bit different… but the structure is spot on)

At the risk of stating the obvious:

  • Make sure Plugin: Webserver is in your Autostart folder
  • Everything is cAsesEnsiTive in the URL
  • That caSeseNsitiVe args must match exactly back in webCoRE as well


Is the 2 lines all part of the same command or is it 2 commands?

I tried it both ways and ended up getting this as a result from EG:


It is one long line.

Note: If you just added Webserver to the Autostart folder, you may have to save, close EG, and reopen the app to properly initialize.


Well I have Plugin: Webserver already there. Does anything within that need configured? I’ll reboot my PC and see if it helps

I have checked case and everything looks good. For this one I just need it to activate the piston, as I am using it to toggle a light. So no variables are being passed, aside from the access_token.

I’m no programmer so I am of quite limited knowledge from the HTML side of things, but could the access token be too long of a variable for EG to handle?


Sorry, I had a blonde moment.

The Webserver lets EG receive outside commands. it has nothing to do with outgoing requests, like urlopen

The other things I said above are true though.

I wonder, can you focus on just this one single command?
(temporarily ignoring all of your logic, can you just create a single (lone) Python command, and execute it via right click?)

Once the URL is working correctly, you should be able to bring it into your real macro.

The reason I am asking this is because some of the errors above look like from a different animal.


I’m sending data to a webcore piston but not in the format you’re trying to use. I may have ran into the same issue you’re encountering because of the HE access token. Send the data you want in a variable with the name as key and variable value as value.

Totally spaced that you’re going from EG to webcore.


So even running it from the test button within the python command window will cause it to fail out. Otherwise I have been selecting the task and hitting the run button, with still no luck.


I understand, but I’d prefer only seeing errors for the one single lone command


Could you copy what one of your commands would be? Be sure to hide your URL and access token though.

What are you using to send the command from EG?


I’m sending a command from node-red with json data. Same format of your piston URL except with the json payload.

Edit: image


Have you tried it this way?


Log $args.data


Got it to work! Tried a bunch of configurations, and this finally decided to cooperate.

Went back to the Send event to another webserver command and it decided to work.

This is the URL format I used that cooperated: Token

Not sure why, but switching out the public IP for my Hub’s IP worked really well.