WebCore and EventGhost


#26

I was going to run once a day


#27

You can edit the piston, and then:

  • Click on “Add a new statement”…
  • Then “Add a timer”
  • Every Value = 1 day
  • At this time Value is in military time (18:00:00.00 is 6pm)
  • Then click on the button “Add a statement”
  • Then click on Cancel

You will be left with this at the bottom of your code:
temp

Then make sure the 4th button up top is blue:
temp

Then you can drag your original code to the proper place.


To drag and drop code, click in the yellow section to highlight the entire WITH command

and then drag the blue arrow and carefully drop it inside the new timer which I have highlighted below:

temp


#28

Your final code will look something like this:


#29

Got it
Thank you


#30

Oh, this is awesome. Now I can tell when my son is on his computer after his bedtime and put it to sleep, lol. Now I have to figure out how to send notifications for that. I guess when computer is ON after a certain time?


#31

I still use webCoRE for all my logic… In that case, you could have one command sent when his PC is turned on, and another when he shuts down. Let webCoRE keep track by way of a variable, and then at your designated time, simply check to see the state of the variable. This is much easier coding than if you want to send a query to his machine, wait for a response, and then do something.


Sample code to get you started:

sample


The main code back to webCoRE are the lines starting with “WC - PC is currently”
(Both are found by right clicking > Add action > EventGhost > Python Command)

WC - PC is currently (turned ON)
import urllib; urllib.urlopen('https://api.smartthings.com/api/token/123abc/smartapps/installations/456def/execute/:789ghi:?PcLocked=false&PcOff=false')


WC - PC is currently (turned OFF)
import urllib; urllib.urlopen('https://api.smartthings.com/api/token/123abc/smartapps/installations/456def/execute/:789ghi:?PcLocked=true&PcOff=true')


They both point to the same piston, but use different arguments, so different portions of the piston run depending on the circumstances.

Side Note:
You may want to hide the EG icon in his tray, because if he manually exits the app, it will send the OFF command to webCoRE (thereby defeating your monitoring)


#32

Interesting sound effects. :wink: If I used sound effects, would they play on his computer, or on mine? (Just curious)

Is this for ActionTiles?

In a piston, right? (For now, I’m just taking a quick glance at my ST app…although I haven’t set up the PING program yet.


#33

It plays on the machine with EventGhost that is taking action… Although nothing is stopping you from having one machine talk to the other. Just add another line of code to send a command directly from his PC to yours.


Those tiles are on my webCoRE Dashboard:

temp


Yes, the same piston can monitor the PC-ON command as well as the PC-OFF command, and set a variable at that time. If you use a global variable, then you can have another piston running at specific times, and use the global variable as a condition.


#34

Could you give me an example, please?

Wait, what? You mean on this screen?


#35

I am booked for a week or so, but basically it is the same URL as the examples I have already linked to. (but instead of webCoRE to EventGhost, that URL is used in EG to EG.


Yup! :sunglasses:


In a nutshell, once EventGhost can talk to webCoRE and visa versa, then anything in one environment can do anything in the other.

(Pro tip: Throw in Tasker as well, and then your phone, PC, SmartHome etc will all be linked)


#36

@WCmore

Hey, Eventghost is working great, but I noticed something in my Devices when I was adding my son’s RP. Our PCs show different settings.

Should they both be virtual, or simulated switches? I notice his Status and Execution are different. Should I change one or the other?


#37

Personally, I use Simulated Switches instead of virtual switches.

No matter which you choose, I would keep them the same to make future coding easier.


#38

I just thought it was weird that his computer shows as Active/Local, even though I’m accessing his through the network, but my computer is coming up as Online/Cloud, even though I’m running it on my 'puter as I type, lol.


#39

I suspect this is just one of the differences between virtual and simulated switches. I find SimSwitches much more useful and reliable, but your mileage may vary.


Just to clarify, everything in your last post is related to the imaginary switches. (ST cannot see your PC)
IE: “his virtual switch shows as Active/Local, … but your simulated switch is coming up as Online/Cloud”


Personally, I use EventGhost to send a command to SmartThings which flips my Simulated Switch and sets a variable.

I can then look at my SimSwitch and know if my PC is on or off, but it is not a ‘live’ connection. I have to program the on/off command to be sent.


#40

Oh, I’m doing that as well…I’m just not sure how I got them configured differently. I tried to recreate my steps as carefully as possible.

What would be the biggest difference between a virtual and simulated switch?


#41

You should be able to change the virtual into simulated by using the IDE and editing the device handler. One click and it’s done

temp


#42

Never had an issue with SimSwitches, but I hear of issues with virtual switches all the time


#43

OK, all fixed. That said, Both PC simulated switches show OFF. Do I need to program something in GE or Webcore to have them show ON when the PCs are on? They work fine otherwise.

Oh, here’s a question. Sometimes my son gets kinda loud when he’s playing with his online friends. I’d love to be able to send him a spoken message or MP3 recording over his computer (and presumably into his headphones) telling him he’s too loud, lol. How might I go about doing that?

Ok…another question (SORRY!!!). I have Eventghost running on his computer…is there a way to access his EG from my computer (Without interrupting his game), or do I have to wait until he’s done so I can make changes on his EG?


#44

You need EventGhost to send a “PcOn” command when the desktop loads, and a “PcOff” command when it exits.


You could send a command to his EventGhost to play a MP3 file, but one word of warning: You would likely only be able to do this once, and he would find and disable EventGhost. (thereby defeating your original piston forever)

Perhaps a ‘better’ alternative is to have webCoRE flash one of his lights (or a certain color) to remind him to quiet down. That is less intrusive, and he’d have no reason to uninstall an app on his PC


Likely not or you would know about it. (it doesn’t come with default Windows) Most desktop sharing apps show the same images on both screens


#45

Well, he doesn’t know what eventghost is, and if he DID delete it, he’d lose computer privileges. He got in trouble when he unplugged his Alexa when my bedtime reminder was nagging him. And it’s not like he can’t manually turn off his lights, lol