VoxCommando
Help and Support (Using VoxCommando) => EventGhost => Topic started by: RichPyke 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.
-
Your current vc code:
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
EvenGhost.Send Energy
then in your eventGhost macro send an event back to voxCommando
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1572">
<Macro Name="Broadcaster: Broadcast: event" Expanded="True">
<Action>
BroadcastListener.Broadcast(u'event', u'announcepower&&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}
-
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.
-
:)