Author Topic: My deployment of Voxcommando  (Read 13710 times)

0 Members and 1 Guest are viewing this topic.

rebelmaveric19

  • $upporter
  • Jr. Member
  • *****
  • Posts: 41
  • Karma: 2
    • View Profile
My deployment of Voxcommando
« on: April 27, 2014, 12:07:04 AM »
I recently started integrating voxcommando into my network and wanted to let you all know about some stuff I have figured out.

I run voxcommando on a win7 virtual machine that is running on top of my WHS 2011 box in virtualbox. Right off the bat I made skype as my primary means of talking to "Jarvis" (laugh later). I am not really using Jarvis to do stuff like htpc commands (later maybe if mics get better) but more for home automation commands. My "alarm" system is currently 6 ip cameras that are recording in a program called Blue Iris. Blue iris sends a tcp command to voxcommando through vox's webserver and in turn writes a xml payload as the reason why he called (motion detect in the living room) and then calls me and reads the payload to me. I also use vox to activate and deactivate blue iris alerts by my phone on and off the wifi (always looking for my phone's static ip address). I use pstools batch files to make xml payload files of running processes on all the computers (Jarvis is Blue Iris running on the server) and can launch,kill and restart any process too. My main goal right now is making Jarvis "smart" by everytime he does something, he rights a payload xml to "know" what he is doing at all times and ALOT of if and then statements. I have no formal computer training and trying to create logic in Jarvis is the single hardest thing for me to create. Some day I want Jarvis to be able to fix things for me (if he sees the living room receiver come on but cant ping the living room htpc, wake it up incase eventghost didnt do it) so the WAF for all my htpc's goes way up and she dosent call me and I have to walk her over the phone while I am at work. I just wrote this to see if any of you would like to know how am using it with Blue iris and when I was google searching for how to get running processes on a remote computer I couldn't find anything. So if you are interested just ask and help you as much as I can.

James thank you very much for what you have built and it is an amazing piece of software.

rebelmaveric19

  • $upporter
  • Jr. Member
  • *****
  • Posts: 41
  • Karma: 2
    • View Profile
Re: My deployment of Voxcommando
« Reply #1 on: May 03, 2014, 12:29:28 PM »
To add to this I recently started using tasker on my android S4 with autovoice plugin. I set autovoice to run in continuous mode and listen for my payload command "Jarvis" and then whatever I say after and tasker sends a http command with all the payloads....example "Jarvis are you there" and tasker sends a http command as http://ip:port/api/vc.tellvox&&%avcomm.........where %avcomm is the phrase that I said. I can get this to successfully work without my screen on and even touching my phone (about 90% accuracy). Now the question is how can I send a payload of the tts.speak that VC says to my phone and somehow my phone interpret the payload into a tts speech command. That is the missing piece of the puzzle. Anyone smarter than me mind helping me out?

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: My deployment of Voxcommando
« Reply #2 on: May 03, 2014, 01:27:41 PM »
If I understand you correct, you use your S4 as mic with tasker. You can test VoxWav (which is available for free in the playstore), and the pro version has also a always "Mic ON" function. Here are more information about voxwav: [url][http://voxwav.wikispaces.com/VoxWav+Home/url]
***********  get excited and make things  **********

rebelmaveric19

  • $upporter
  • Jr. Member
  • *****
  • Posts: 41
  • Karma: 2
    • View Profile
Re:
« Reply #3 on: May 03, 2014, 11:53:31 PM »
Yea I understand what VoxWav can do but I can do sooooo much more with tasker. Call me crazy too but using tasker with autovoice also has less unrecognized commands. I want my phone to be the "voice" of my voxcommando install. I am trying to send all tts.speak commands back to my phone as a payload so my S4 is my "central" mic. Like I said I can send payloads to VC but trying to figure out a way to receive payloads is my problem. Thanks

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re:
« Reply #4 on: May 04, 2014, 09:44:00 AM »
Call me crazy too but using tasker with autovoice also has less unrecognized commands.

Crazy isn't the word I'd use, but it *is* surprising, and suggests that maybe VoxWav wasn't set up properly or something when you tried to use it.

wrt you other questions, it sounds like you need people who understand how Tasker works. The question mark here isn't how VC works, but how Tasker works. If you can find out via the Tasker documentation or forums how Tasker can listen for a message, we can then probably tell you how to send it from VC.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

rebelmaveric19

  • $upporter
  • Jr. Member
  • *****
  • Posts: 41
  • Karma: 2
    • View Profile
Re: My deployment of Voxcommando
« Reply #5 on: May 04, 2014, 11:14:33 AM »
The people that make AutoVoice have a plugin for tasker called autoremote that I can use as a webserver on the phone to receive payloads and it works outside of lan. Once I figure out how to get all my variables right I will be able to use VC from anywhere in the world without even touching my phone.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: My deployment of Voxcommando
« Reply #6 on: May 04, 2014, 11:29:41 AM »
Great. That's one of the main ideas behind VC -- that users can combine it with many other pieces of software and hardware to customize things according to whatever suits their needs, limited only by personal creativity and capacity.

Hopefully you can let other users here know how to actually do it once you've figured it out.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: My deployment of Voxcommando
« Reply #7 on: May 04, 2014, 01:43:12 PM »
It would be nice to figure out how to send information to tasker using autoremote,

However, if all you want to do is enable your phone as a TTS device then you can do it using VoxWav pro.  It should still receive TTS messages and speak even if running in the background.

The problem you will face when using autoremote is that you will need to create special actions for each command that you want to send TTS to your phone.  There is no way to "redirect" the existing TTS actions to a new action.
« Last Edit: May 04, 2014, 01:59:30 PM by jitterjames »

rebelmaveric19

  • $upporter
  • Jr. Member
  • *****
  • Posts: 41
  • Karma: 2
    • View Profile
Re: My deployment of Voxcommando
« Reply #8 on: May 04, 2014, 02:36:50 PM »
You can use autoremote to send events to tasker through your personal webpage you get when you buy autoremote in the play store.
I came back to ask if there was a internal variable in VC that is whatever was spoken BY VC last. Is there anyway I could somehow make a variable. My existing tts commands are random (because its nice not to hear the same thing over and over). I could replace my responses with XML's and chose random and use {LastResult} that way but is there an easier way?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: My deployment of Voxcommando
« Reply #9 on: May 04, 2014, 02:50:56 PM »
No there is no such variable.

Is autoremote able to listen to UDP messages as well as http?  If it is then there is a very easy solution.

Quote
I could replace my responses with XML's and chose random and use {LastResult} that way but is there an easier way?
I don't understand what you are saying here.

One option you have is to replace all your TTS actions with some other action like a python call that could do both the local TTS and send the TTS message to autoremote.  It could also select items randomly for you.  This would not be too difficult, but you would need to edit all your TTS actions to convert them.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: My deployment of Voxcommando
« Reply #10 on: May 04, 2014, 03:27:42 PM »
This would not be too difficult, but you would need to edit all your TTS actions to convert them.

that is exactly why I do not engage TTS.speak directly... rather I built a macro called feedback and I pass the text as payload ... the feedback will speak, osd.show and soon VFD ... one place to control it all ... or it would be a nightmare
When Voice command gets tough, use hand gestures

rebelmaveric19

  • $upporter
  • Jr. Member
  • *****
  • Posts: 41
  • Karma: 2
    • View Profile
Re: My deployment of Voxcommando
« Reply #11 on: May 04, 2014, 10:07:20 PM »
Is autoremote able to listen to UDP messages as well as http?  If it is then there is a very easy solution.
No. Autoremote works by receiving "messages" in http format like this "ip/apikey/jarvistalk=:=%arcomm", It is just looking for the message to say jarvistalk and issues an action (in my case tts) and says/does what ever %arcomm is.

I don't understand what you are saying here.
Make and payloadxml that is named "Jarvis is Here" and put random phrases for responses (i am here/online and ready/etc) and use payloadxml.getrandomphrase and then i could use {LastResult} as a tts/last spoken payload.....Nevermind its a stupid idea....(lot of work/time).

One option you have is to replace all your TTS actions with some other action like a python call that could do both the local TTS and send the TTS message to autoremote.  It could also select items randomly for you.  This would not be too difficult, but you would need to edit all your TTS actions to convert them.
I am smart enough to use plugins and programs that other people write and suit them for my needs (sometimes need help) but not smart enough to write my own code.....I know python is about the easiest language to learn but I tried and got frustrated severely......I learn by examples and I know there is alot of examples out there but here is how I learn them, I ask you to do something simple and write it in code and I will try to decipher it and make sense in relating it to something I do know and 99% of the time you never have to teach me again.....but would love to learn how to write a script to make it easier on me

that is exactly why I do not engage TTS.speak directly... rather I built a macro called feedback and I pass the text as payload ... the feedback will speak, osd.show and soon VFD ... one place to control it all ... or it would be a nightmare
This makes alot of sense but you cant select random phrases right because its just whats in the text variable correct? and what is VFD?

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: My deployment of Voxcommando
« Reply #12 on: May 05, 2014, 12:01:47 AM »
In fact yes you can have random phrases ...  I pass 2 payloads, one is either a specific phrase or a value, the second is the method ... If method one look for a random phrase from XML file with value passed...

VFD = http://en.wikipedia.org/wiki/Vacuum_fluorescent_display
When Voice command gets tough, use hand gestures

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: My deployment of Voxcommando
« Reply #13 on: May 05, 2014, 09:24:54 AM »
I ask you to do something simple and write it in code

It's difficult for a 'teacher' to determine what is simple from the learner's point of view, but still enough so that the learner doesn't come back again 5 minutes later asking for another example, since that ends up being a full-time voluntary job in which we are writing custom configurations for every user, and it's not clear that the lessons are being applied more broadly.

Here are several solutions that should allow you to generate random TTS, OSD and Autoremote messages. Hopefully these examples will be helpful to VC users in general.

I was not able to test the Autoremote line. You'll have to test that yourself and maybe debug a bit if I screwed something up there (quick morning effort -- there may be typos or I may have overlooked something in the Python version).

VC Only Method:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.3.2-->
<commandGroup open="True" name="VC only tts tests" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="261" name="tts to multiple locations 01" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>myTTS</param>
        <param>hello|greetings|hi there</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>test random feedback</phrase>
  </command>
  <command id="271" name="doMyTTS" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>([^|]+)</param>
        <param>--</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetLastResult</cmdType>
      <params>
        <param>{Match.Rnd}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>http://autoremotejoaomgcd.appspot.com/sendmessage?key={M:maveric.autoremoteKey}&amp;message=jarvistalk=:={LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>myTTS</event>
  </command>
</commandGroup>

Per our earlier discussion, the {M:maveric.autoremoteKey} is a variable that refers to a map table in VC where you've stored your API key for Autoremote. The name of the map variable will depend on what you've named your map and what you've named the API key variable. http://voxcommando.com/mediawiki/index.php?title=Maps
« Last Edit: November 27, 2015, 09:25:59 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: My deployment of Voxcommando
« Reply #14 on: May 05, 2014, 09:31:31 AM »
Python version as follows. You need to enable the Python plugin in VoxCommando for this to work.

VC commands group:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.3.2-->
<commandGroup open="True" name="python random" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1151" name="load python script" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>PY.ExecFile</cmdType>
      <params>
        <param>PY\randomMsg.py</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>VC.Loaded</event>
  </command>
  <command id="1152" name="test tts message" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.SetLastResult</cmdType>
      <params>
        <param>My name is Simon|Hello there|4|5|6|7|8</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PY.ExecString</cmdType>
      <params>
        <param>randomMsg("{LastResult}")</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
</commandGroup>

Python script (randomMsg.py) attached. It needs to go in the PY folder of your VC directory (or you need to change the file path in the VC command).

The lines that start with '#' are not code, but comments to the reader.

Pasted here for other users who may be interested in the code:
Code: [Select]
import urllib
import random

def randomMsg(tts):
    mavericAPIkey= "Enter your API KEY here in quotes (in quotes defines it as a string in Python)"
    ttsList=tts.split("|")
    myMsg=random.choice(ttsList)
    vc.callAction("TTS.Speak",myMsg, None)
    vc.callAction("OSD.ShowText",myMsg, None)
    #if you want to use VC, uncomment (remove #) the following line:
    #vc.callAction("Scrape","http://autoremotejoaomgcd.appspot.com/sendmessage?key="+mavericAPIkey+"&message=jarvistalk=:="+myMsg,None)
    #the line below calls the URL directly from python. You'll need to test this.
    urllib.urlopen("http://autoremotejoaomgcd.appspot.com/sendmessage?key="+mavericAPIkey+"&message=jarvistalk=:="+myMsg)
« Last Edit: May 21, 2014, 03:06:59 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)