I'm just getting into EventGhost and I'm super confused.

If you have a question or need help, this is the place to be.
Post Reply
User avatar
superluig164
Posts: 1
Joined: Mon Sep 09, 2019 5:17 pm
Contact:

I'm just getting into EventGhost and I'm super confused.

Post by superluig164 » Mon Sep 09, 2019 5:24 pm

Hey guys, I just joined the forum for this lol.
I downloaded and installed EventGhost today and I'm like, insanely confused. I am very well-versed with computers (though not with programming, but I'm getting there) and I know my way around technology and stuff but I've got to say, the documentation for EventGhost doesn't give me much to go off of at all, so here I am.
I'm coming from Tasker on Android and I was looking for similar functionality on Windows. EventGhost looks like exactly what I need, but just downloading it and trying to get into it isn't working out. To start, I just want to simply make something that toggles the mute switch at certain times of day, and since this is a laptop, I want to ensure that mute is in a certain state at certain times. (for example if the time has passed and I started up my laptop late)

Can anyone help me out?
Thanks

jonib
Plugin Developer
Posts: 1318
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: I'm just getting into EventGhost and I'm super confused.

Post by jonib » Mon Sep 09, 2019 7:09 pm

superluig164 wrote:
Mon Sep 09, 2019 5:24 pm
Can anyone help me out?
Start with "Short Manual" if you have not read it yet.
Then read/search the forum for anything you don't get/understand.
Last is to ask for as specific help as possible on the forum.

Of course the documentation could be much better and more complete, unfortunately the documentation seems to always get the least love.

There is builtin actions to toggle mute, and there are several ways to schedule actions via delayed, a timer or scheduled events. extra actions are added from plugins either builtin or externally downloaded. like SchedulGhost.

Check out Core audio plugin and Audioendpoint for more audio functionality.

Unfortunately there was a problem with the hosting of the site and forum that resulted in many of the downloads don't work, if you are interested in a plugin ask in the plugins support thread if it can be uploaded again.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

jachin99
Experienced User
Posts: 601
Joined: Sat Feb 13, 2016 8:39 pm

Re: I'm just getting into EventGhost and I'm super confused.

Post by jachin99 » Wed Sep 11, 2019 3:55 pm

When I first started using EG, I was extremely confused as well but once you understand how simple it is, you won't believe you were ever confused by it. The first thing I would do as jonib suggested is to figure out what plugins you need to add to EG to get your desired functionality. If you really aren't too picky then scheduleghost would probably be a good choice. So I guess step one would be adding the capabilities you need to eventghost in order to perform your desired task. In this case you need to toggle the mute on your PC at certain times of the day. Toggling mute is built into the current plugins that ship with EG so no additions are needed there. Toggling the mute at a certain time of day however does require eventghost to know what the current time is, and the time of day you would like your action to be performed. For the latter, you will need a plugin that gives EG this capability in the form of schedule ghost.

Once you have the capabilities you need, then it is a matter of getting the events you want to show in the log. So now you will need to make sure schedule ghost is configured properly, and fires events into your log for the specific time of day that you want EG to toggle your mute. When you have the "Time Event" configured correctly, and it shows in your log you will have to create a new macro (Which is a combination of an event - in your case a certain time of day, and an action - toggling mute). To create a new macro, click on the gear icon, and the add an action dialog box should pop up. Actions are grouped into categories in the add action dialog, and you can click the + box to expand these groups in order to look for specific actions. I'm not sure how toggle mute is grouped but looking around some you should be able to find it. Once you find toggle mute just click on it, and macro should be added to your main tree on the right. You have now configured eventghost to perform your desired action but it still has no idea when it should do so.

This is where the event, or time of day for you, comes into play. Once your desired event fires it should show on the left side of the screen in your log. You then grab the event with your mouse, and drag it over your newly created macro. Don't forget to save your tree after you have everything configured. I believe that by default it will save to your documents. If everything goes well eventghost should toggle your mute on its own every day at the time you specified. To test your new macro you can also right click it, and select execute item from the dialog box. I asked for someone to upload the scheduleghost plugin for you because it was lost in a site outtage, and I'm linking a youtube video about how to use eventghost as well. https://www.youtube.com/watch?v=xnMzu1h1gxc Once the scheduleghost plugin is added, and you get a chance to try everything out let me know how it goes. I can also try to write better instructions.

dan Edens
Posts: 46
Joined: Mon Sep 24, 2018 7:57 pm

Re: I'm just getting into EventGhost and I'm super confused.

Post by dan Edens » Wed Sep 11, 2019 5:41 pm

jachin99 wrote:
Wed Sep 11, 2019 3:55 pm
When I first started using EG, I was extremely confused as well but once you understand how simple it is, you won't believe you were ever confused by it. The first thing I would do as jonib suggested is to figure out what plugins you need to add to EG to get your desired functionality. If you really aren't too picky then scheduleghost would probably be a good choice. So I guess step one would be adding the capabilities you need to eventghost in order to perform your desired task. In this case you need to toggle the mute on your PC at certain times of the day. Toggling mute is built into the current plugins that ship with EG so no additions are needed there. Toggling the mute at a certain time of day however does require eventghost to know what the current time is, and the time of day you would like your action to be performed. For the latter, you will need a plugin that gives EG this capability in the form of schedule ghost.

Once you have the capabilities you need, then it is a matter of getting the events you want to show in the log. So now you will need to make sure schedule ghost is configured properly, and fires events into your log for the specific time of day that you want EG to toggle your mute. When you have the "Time Event" configured correctly, and it shows in your log you will have to create a new macro (Which is a combination of an event - in your case a certain time of day, and an action - toggling mute). To create a new macro, click on the gear icon, and the add an action dialog box should pop up. Actions are grouped into categories in the add action dialog, and you can click the + box to expand these groups in order to look for specific actions. I'm not sure how toggle mute is grouped but looking around some you should be able to find it. Once you find toggle mute just click on it, and macro should be added to your main tree on the right. You have now configured eventghost to perform your desired action but it still has no idea when it should do so.

This is where the event, or time of day for you, comes into play. Once your desired event fires it should show on the left side of the screen in your log. You then grab the event with your mouse, and drag it over your newly created macro. Don't forget to save your tree after you have everything configured. I believe that by default it will save to your documents. If everything goes well eventghost should toggle your mute on its own every day at the time you specified. To test your new macro you can also right click it, and select execute item from the dialog box. I asked for someone to upload the scheduleghost plugin for you because it was lost in a site outtage, and I'm linking a youtube video about how to use eventghost as well. https://www.youtube.com/watch?v=xnMzu1h1gxc Once the scheduleghost plugin is added, and you get a chance to try everything out let me know how it goes. I can also try to write better instructions.

What really kicked off my learning curve with EG was keeping Pycharm open behind it and playing with it internally. Watch what you do with Git
forsure, but being able to see what is happening when something went wrong was a huge deal.
2019-09-11 12_38_14-EventGhost WIP - general ai 35.png
I haven't done anything major, a few custom menu options and a dark theme, but man do the possibilities seem endless!
:D

User avatar
kgschlosser
Site Admin
Posts: 4807
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: I'm just getting into EventGhost and I'm super confused.

Post by kgschlosser » Thu Sep 12, 2019 5:43 am

OK i want to chime in on this as well...


Remove any thoughts you have about Tasker.. as this is going to make things difficult for you. I first need you to understand what EventGhost is and does.

EventGhost is not what you think it is. EventGhost by it's self really does nothing out of the box. It's the plugins that give EventGhost functionality. This is the best description I can come up with for what EventGhost is and does. "It is a translator, It provides a common API (Application Programming Interface) that allows devices and or software to be able to communicate with each other when they are not designed to do so. You always need to keep that in your mind when working with EventGhost.

You are also going to need to know some vocabulary. This is going to help you a bunch when searching the forums or asking questions.
Tree, Config Tree = On the right hand side of EG (EventGhost) is your tree.
Log = on the left hand side with the alternating colored bars.
Plugin = an extension to EventGhost. there are 4 plugins that come "pre installed" These 4 are Mouse, Window EventGhost and System
Installed Plugin = an installed plugin is one that is not one of the 4 "core" plugins and you will be able to see the plugin in the "Autostart group" in your tree
Event = you will see events appear in your log. they are going to have a lightning bolt for an icon. Events get "triggered" by plugins, they are the mechanism that is used to send notification to EG that the device or software has done something that you may want to react upon. An event is broken into several pieces.

When you see an event in your log this is how it is broken down.

Code: Select all

Some.Event "additional data"
everything before the first "." (dot) is called the prefix this is the identifier for what caused the event to take place. this is typically the plugin name
everything after the first "." up to the first space or special character (ideally) is called the suffix. the suffix is typically what has taken place.
depending on who write the plugin the suffix can contain multiple "."s this is typically done to further break apart the event. As an example. Say you have a zwave lighting controller. and it produces an event like this.

Code: Select all

ZWave.LivingRoom.OverheadLight.On
so the event is broken into components like this
{plugin}.{location}.{device}.{state}

another example is an AVR

Code: Select all

AVR.Zone1.Volume.50
{plugin}.{location}.{identifier}.{state}

We try to provide as much as we can in the event. but sometimes there is simply to much data to try and relay through the use of the first 2 components of an event. This is what the last section is for. The last section is called the payload, It is going to start with one of the below listed character(s)
u'
u"
'
"
[
{
<
(

payload data is usually handled by using the "Python Script" action. This action allows you to run python scripts. There are some special use cases where you are able to use the payload data directly in action that is not a Python Script action.


These are the items that can appear in your tree
Folder = Just a container for organization
Plugin = The only place you will see a plugin is in the Autostart group(macro)
Event = You place these in a macro. This is what "runs" the macro
Action = These you place in a macro as well. this is what gets run.
Macro = a container to house the actions that you want to run along with an event or events that cause the macro to run

AutoStart = This is a macro. This is the only macro that is always there. this macro gets run when EventGhost starts up. This is the reason why you see the plugins that are installed listed in there. It starts the plugins


This is what I want you to do so you can get a better understanding. The learn by doing is always how I like to learn. so lets start off with something basic.

You mentioned the volume specifically the mute... Here is what I want you to do.

if you right click on the computer icon at the top of your tree a menu is going to appear. click on "Add Folder" in the menu.. This is going to create a folder in your tree. you can optionally name it if you like.

Now right click on that new folder. you will that menu again. now click on "Add Macro". This is going to open up the Add Action Dialog. On the left you will see a list of all of your installed plugins (including the 4 core plugins) next to each plugin is a "+" if you click on the plus next to one of them it is going to list the available actions for that plugin. An action is the mechanism used to tell a device or software what to do.

I want you to click on the + next to the EventGhost plugin. Now I want you to select the Show OSD action and then click on the OK button on the lower right. The Add Action Dialog will close and now another dialog is going to open. If an action has settings that you can make it is going to provide you the controls to make those setting changes. This is called the Action Config Dialog or Action Item Setting. Here you are given a whole bunch of things you can set.. In the "Text to display" I want you to key in "MUTE ON" change the Alignment to Screen Center, now click on the Text Font button and change the size to 72 and click the ok button. now click on the Text Color button and change the color to bright green, you have to watch here when you click on the color green you will also have to slide the bar on the right down to the middle then click on the Ok button.

You have just created your first macro..HOORAY!!! But.... one problem.. this macro is never going to do anything. we need to tell it when we want it to run. and we do that by adding an event. we are going to do this the easy way. I want you to mute the sound on your computer. when you do this you will see an event appear in your log. I want you to click and drag that event into your new macro.. Now we just added a way to run that new macro.

once you have done that go back and unmute your audio and then mute it again.. now watch your screen when you do this.

EventGhost is really that simple to use. I know that the lack of buttons and and crazy settings is what throws people for a loop. When I first looked at EventGhost i was a we bit taken by the lack of controls. and how simple the interface was.. I actually abandoned it because I could not figure it out either.. Because my brain simply could not process the simplicity of it. It wasn't until several years later that I was introduced to EventGhost again. But this time I had someone to explain it to me.

The real power of EventGhost will become apparent once you dive into the Python Script action.. This is where the real magic happens.

Me and many other uses on the forum are always willing to lend a hand. So ask any questions you want. I personally do not like to simply hand an answer to someone. On occasion I do But not without a very detailed step by step of what is happening and why. I much prefer to give tips or pointers and let the user provide the answer they are looking for.

If you continue to use EventGhost Trust me when I say this is not the first book you will see from me. But they are almost always outlined like this.

There are a bunch of plugins that come pre packaged with EventGhost. These plugins are not "installed" to install a plugin you need to right click on your tree and click on "Add Plugin" and then it is going to show you a list of plugins that are available for you to add to your tree. You are going to want to use the SchedulGhost plugin to accomplish your goal. TIP right click on the ShowSchedule action in your tree and click on execute.

ScheduleGhost is only going to take care of you muting and unmuting while the computer is running. If you start the computer during a mute or unmute time we are going to have to do a little bit of python script magic.

I am just giving this to you because it is a more complex thing and would be a tough nut to crack your first time out.

This is going to mute or unmute the audio when EG starts up (when you login to the computer) You will need to have the start EG when user logs in checked in options. you are going to need to create a Python script action in your Autostart group and in that script paste the code below.

I have commented the script so read everything that is after the "#"s this is going to tell you hat is going on. and what you will need to change.
YOU MUST KEEP THE INDENT LEVELS WHERE THEY ARE!!! this is how python knows where code is supposed to get run. so make sure the indent (4 spaces) is proper when making any changes!

Code: Select all

MUTE_TIMES = [
    # You are going to need to modify/add to this list of times.
    # Each entry is a start time and a stop time
    #        START                    STOP
    # [[hour, minute, second], [hour, minute, second]]
    # The time between the start and stop the audio should be muted.
    # if the time does not fall into any of the scheduled mute times 
    # the audio will be unmuted
    [[22, 15, 15], [22, 20, 0]],
    [[8, 0, 0], [9, 0, 0]]
    
]

# python has a nice module that handles times and dates
# this module makes it nice and easy to do comparisons
import datetime

# we get the current date and time. 
# resolution is down to the microsecond. 
# For what we need we are only going to use seconds.
date_time = datetime.datetime.now()

# we are going to iterate over the schedule times you provided above
# iterate means to go through each entry.
for start_time, stop_time in MUTE_TIMES:
    # here we take those entries and turn them into times that we can compare 
    start_time = datetime.datetime(date_time.year, date_time.month, date_time.day, *start_time)
    stop_time = datetime.datetime(date_time.year, date_time.month, date_time.day, *stop_time)
    
    # this is where we want to see if the start time is lower then the current 
    # and also lower then the stop. if it is then mute the sound.
    if start_time < date_time < stop_time:
        eg.plugins.System.MuteOn(u'Primary Sound Driver')
        # we want to stop the iteration. by stopping the iteration 
        # the "else" below never gets run.
        break
else:
    # if the iteration completes that means that the current time 
    # is not between the start and stop times so we want to unmute the audio
    eg.plugins.System.MuteOff(u'Primary Sound Driver')
If you like the work I have been doing then feel free to Image

Post Reply