Author Topic: VC & EG help  (Read 3296 times)

0 Members and 1 Guest are viewing this topic.

RichPyke

  • $upporter
  • Jr. Member
  • *****
  • Posts: 6
  • Karma: 0
    • View Profile
VC & EG help
« on: September 16, 2012, 12:32:10 PM »
Hi,

I've been using VC for a while now and haven't had too many issues, none I couldn't sort out... until now.

Basically, I have my energy meter which sends the signal to my RFXCOM, Eventghost picks this up and stores the data as eg.power, eg.voltage etc.

I have a VC command "how much electric am I using", which VC responds to by sending a broadcast to EG called "power". EG picks this up and runs the macro i.e. gets the eg.power variable.

How can I get a payload for the TTS.SpeakSync from EG to VC?

I can get this to happen by EG sending the Broadcast: TTS.SpeakSync and the variable, which does make it say the details but I'd prefer to have VC's TTS.SpeakSync command and the payload {eg.power} as it is surrounded by soft mutes, soft unmutes, vox off and vox standby commands (to stop vox speaking to itself and basically getting stuck in loops of commanding itself).

The VC command is;
VC.Off
XBMC.SoftMute 70
EvenGhost.Send Energy
TTS.SpeakSync {eg.Power}    <-- This is the bit I'm struggling with, is it {1}, {match.1}, {lastresult}???
XBMC.SoftUnMute
VC.Standby

Or (as I wrote this I thought of this and I'll try in a second, although a bit of a clunky way to do it) will I have to have EG broadcast the VC.Off, XBMC.SoftMute, TSS.SpeakSync, XBMC.SoftUnMute & VC.Standby commands?

Any help would be appreciated.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC & EG help
« Reply #1 on: September 16, 2012, 12:41:59 PM »
Your current vc code:
Code: [Select]
VC.Off

XBMC.SoftMute 70
EvenGhost.Send Energy
TTS.SpeakSync {eg.Power}    <-- This is the bit I'm struggling with, is it {1}, {match.1}, {lastresult}???
XBMC.SoftUnMute
VC.Standby

The problem is that the EvenGhost.Send command does not wait for any kind of response.  It is a one way broadcast.

I think the best thing to do is to replace all your code with just
Code: [Select]
EvenGhost.Send Energy

then in your eventGhost macro send an event back to voxCommando
Code: [Select]
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1572">
    <Macro Name="Broadcaster: Broadcast: event" Expanded="True">
        <Action>
            BroadcastListener.Broadcast(u'event', u'announcepower&amp;&amp;75', 33000)
        </Action>
    </Macro>
</EventGhost>
In my example macro I am just sending back 75 but you can replace this with {eg.power} etc.

Then you can have a command in VC triggered by this event and use the payload {1}
« Last Edit: September 16, 2012, 12:44:06 PM by jitterjames »

RichPyke

  • $upporter
  • Jr. Member
  • *****
  • Posts: 6
  • Karma: 0
    • View Profile
Re: VC & EG help
« Reply #2 on: September 16, 2012, 01:45:33 PM »
Perfect. I hadn't noticed that you could have VC perform actions from events rather than voice... The one place I didn't even think to look.

That'll help me out a lot and make some other actions a bit cleaner too.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: VC & EG help
« Reply #3 on: September 16, 2012, 02:28:10 PM »
  :)