Author Topic: EG and VC, a little novice help  (Read 6054 times)

0 Members and 1 Guest are viewing this topic.

deathtech

  • Jr. Member
  • **
  • Posts: 20
  • Karma: 1
    • View Profile
EG and VC, a little novice help
« on: March 03, 2014, 12:48:33 PM »
I posted this on the EG forum but i think i would get a better response here as its VC that i'm using with EG. Also no one has responded there either :/

Here is my situation, and i could be going by this all wrong, but here is what i know now.


I'm rather new to all of this, but have some very basic programming knowledge. I'm having a hard time getting EG to do what I need it to do.

Its for my Onkyo receiver. i can get it to send out a QSTN to my receiver and get a response back just fine. What i need it to do now is send this response back to VC within the broadcast to VC.

I have it working but its a very sub-par way of doing it i'm sure. Right now depending on the response back: example: OnkyoISCP.SLI00 i make another macro that broadcast this is for source TV/CD (via a payload: eg.AVR_Source&&CD) and send it to voxcommando. read CD as the pay load and then i use it to do what i need.

now, i've done this with all sources, this is not ideal, if i can just make a single macro in Event Ghost that says whatever the result is returned via the first QSTN from my receiver's event, add this to the broadcaster payload, such as that would be a variable that would always change depending on my source it returns. Such as: eg.AVR_Source&&{QSTN_answer} This way i dont need to manually add macro's for each source returned. Also this will teach me more on how to use this program and i can use this for other tasks later on.

I have tried this: eg.AVR_Source&&{eg.result} hoping the response back from the event in EG would populate the result, but it doesnt work this way apparently :) as i get None everytime.

I hope this makes sense, any help would be appreciated!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: EG and VC, a little novice help
« Reply #1 on: March 03, 2014, 12:59:43 PM »
Please copy / paste whatever EG macros you are currently using  (that relate to what you are describing here) into a code block on this forum so that I can see what you have done so far, and I will see if I can find the problem.

deathtech

  • Jr. Member
  • **
  • Posts: 20
  • Karma: 1
    • View Profile
Re: EG and VC, a little novice help
« Reply #2 on: March 03, 2014, 01:14:45 PM »
As you can see i have setup checks for power and source individually, based on the QSTN event. I am assuming there is a better way of doing this, by capturing the data that was returned via the initial power check or source check in the QSTN event, then populating the payload of the broadcast with that data. Instead of making all of those source checks and power checks etc. I could have a single broadcast with a dynamic payload.

So not really a problem as much as it is a, how should i go about doing this or can i, or how would you?



Code: [Select]
   <Plugin Identifier="OnkyoISCP" Guid="{5B3B8AEB-08D7-4FD0-8BEE-8FE50C231E09}" File="OnkyoISCP">
            gAJYDQAAADE5Mi4xNjguMS4xMjhxAE3g6lgBAAAAMXEBh3ECLg==
        </Plugin>
        <Plugin Identifier="BroadcastListener" Guid="{5E8DA56B-24AC-4092-9521-169343C5171C}" File="Broadcaster">
            gAIoWAkAAABCcm9hZGNhc3RxAFgPAAAAMjU1LjI1NS4yNTUuMjU1cQFNNYKIWAIAAAAmJnECVQ0xOTIuMTY4LjEuMTIzcQN0cQQu
        </Plugin>
        <Plugin Identifier="FileOperations" Guid="{50D933C5-F93B-4A8A-A6CE-95A40F906036}" File="FileOperations">
            gAIpLg==
        </Plugin>
    </Autostart>
    <Folder Name="Onkyo Source Check" Expanded="True">
        <Macro Name="Onkyo Check Source" Expanded="True">
            <Event Name="Broadcast.Get_Source" />
            <Action>
                OnkyoISCP.SendCommand(u'SLIQSTN')
            </Action>
        </Macro>
    </Folder>
    <Folder Name="Check AVR PWR" Expanded="True">
        <Macro Name="Onkyo Check PWR" Expanded="True">
            <Event Name="Broadcast.AVR_PWR_Status" />
            <Action>
                OnkyoISCP.SendCommand(u'PWRQSTN')
            </Action>
        </Macro>
    </Folder>
    <Folder Name="Onkyo PWR Status On Broadcast" Expanded="True">
        <Macro Name="Onkyo PWR Status" Expanded="True">
            <Event Name="OnkyoISCP.PWR01" />
            <Action>
                BroadcastListener.Broadcast(u'event', u'eg.AVR_PWR&amp;&amp;PWR_on', 33000)
            </Action>
        </Macro>
        <Folder Name="Onkyo PWR Status Off Broadcast" Expanded="True">
            <Macro Name="Onkyo PWR Status" Expanded="True">
                <Event Name="OnkyoISCP.PWR00" />
                <Action>
                    BroadcastListener.Broadcast(u'event', u'eg.AVR_PWR&amp;&amp;PWR_off', 33000)
                </Action>
            </Macro>
        </Folder>
    </Folder>
    <Folder Name="Onkyo Game Broadcast">
        <Macro Name="Onkyo Check Source Game Broadcast" Expanded="True">
            <Event Name="OnkyoISCP.SLI02" />
            <Action>
                BroadcastListener.Broadcast(u'event', u'eg.AVR_Source&amp;&amp;Game', 33000)
            </Action>
        </Macro>
    </Folder>
    <Folder Name="Onkyo CD Broadcast" Expanded="True">
        <Macro Name="Onkyo Check Source CD Broadcast" Expanded="True">
            <Event Name="OnkyoISCP.SLI23" />
            <Action>
                BroadcastListener.Broadcast(u'event', u'eg.AVR_Source&amp;&amp;CD', 33000)
            </Action>
        </Macro>
        <Folder Name="Onkyo WD Broadcast" Expanded="True">
            <Macro Name="Onkyo Check Source WD Broadcast" Expanded="True">
                <Event Name="OnkyoISCP.SLI00" />
                <Action>
                    BroadcastListener.Broadcast(u'event', u'eg.AVR_Source&amp;&amp;WD', 33000)
                </Action>
            </Macro>
        </Folder>
    </Folder>
    <Folder Name="Onkyo BD/DVD Source Check" Expanded="True">
        <Macro Name="Onkyo Check Source BD/DVD Broadcast" Expanded="True">
            <Event Name="OnkyoISCP.SLI10" />
            <Action>
                BroadcastListener.Broadcast(u'event', u'eg.AVR_Source&amp;&amp;BD', 33000)
            </Action>
        </Macro>
    </Folder>
</EventGhost>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: EG and VC, a little novice help
« Reply #3 on: March 03, 2014, 02:18:58 PM »
You made a mistake when copying and pasting your code.  The xml should start with

Code: [Select]
<?xml version="1.0" encoding="UTF-8" ?>

Anyway, it doesn't matter since I was able to edit it, but in case someone else is wondering why they can't copy and paste this code back into EventGhost, that is why.
« Last Edit: March 03, 2014, 02:48:29 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: EG and VC, a little novice help
« Reply #4 on: March 03, 2014, 03:02:39 PM »
This should get you headed in the right direction.

In case you missed it, this is a crucial (must read it all several times) page to read for the type of stuff you are doing: http://www.eventghost.org/docs/scripting.html

Code: [Select]
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1600">
    <Folder Name="ONkyo ISCP Qstns" Expanded="True">
        <Macro Name="Onkyo ISCP: SendCommand: SLIQSTN" Expanded="True">
            <Action>
                OnkyoISCP.SendCommand(u'SLIQSTN')
            </Action>
            <Action>
                OnkyoISCP.SendCommand(u'PWRQSTN')
            </Action>
        </Macro>
        <Macro Name="Broadcaster: Broadcast: Onkyo{eg.event}" Expanded="True">
            <Event Name="OnkyoISCP.SLI" />
            <Event Name="OnkyoISCP.PWR" />
            <Action>
                BroadcastListener.Broadcast(u'event&amp;&amp;Onkyo.{eg.event.suffix}', u'{eg.event.payload}', 33000)
            </Action>
        </Macro>
    </Folder>
</EventGhost>

deathtech

  • Jr. Member
  • **
  • Posts: 20
  • Karma: 1
    • View Profile
Re: EG and VC, a little novice help
« Reply #5 on: March 03, 2014, 03:34:15 PM »
wow, that's awesome it actually works like i was wanting. This will streamline a lot of things for me now. and i kinda of understand what occurred here lol

i have to wrap my head around why it actually worked the way you made it, but its a good start to analyze and start as you said.

Thanks again James!

you guys rock.



jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: EG and VC, a little novice help
« Reply #6 on: March 03, 2014, 05:14:14 PM »