We have moved at community.getvera.com

Author Topic: Raspberry Pi and voicecommand to control your Vera with voice  (Read 7897 times)

Offline bdk0172

  • Newbie
  • *
  • Posts: 11
  • Karma: +2/-1
Raspberry Pi and voicecommand to control your Vera with voice
« on: February 09, 2014, 01:07:04 am »
Got my Raspberry Pi delivered yesterday and already have it set up to control my VeraLite using voice commands.  To begin with, if you want to do this, make sure you have at least an 8gb SD card, 4gb will not be enough to copy Noob to and install Raspbian. 

Let me preface this with a couple of items.  If you're running your Pi through HDMI directly to a TV, you're probably fine.  I started with the HDMI connected to a receiver sending video to projector and having the receiver handle the audio and the text to speech from voicecommand would only kick in after the 4th or 5th word.  If you're running things through a receiver, then I highly recommend plugging computer speakers into the analog port and using that.  In order to do so, you'll need to run the following command:

sudo amixer cset numid=3 1
The "1" tells it headphone/analog, or you can set it to 0 for "auto" or 2 for "hdmi".

Once you have your Pi and SD card, go here:  http://www.raspberrypi.org/downloads
You can try downloading the Noobs image, but when I did something was corrupt, once I grabbed it from the torrent, everything was fine.
Format your SD card according to the instructions from that page and then copy the unzipped Noobs image to it.
Put the SD card into your Pi and start it up.  It will ask you what OS's you want to install.  For this tutorial all you need is Raspbian.
It will take a while, but when done you'll be presented with options.  I don't remember what they all are, but I do remember telling it to boot up into Terminal and not GUI.  You'll want Terminal in order to install the next items.
Your Pi will reboot again I believe after setting the options.
Once done, follow the instructions here http://stevenhickson.blogspot.com/2013/06/installing-and-updating-piauisuite-and.html to install voicecommand. 
There are numerous things you can install during his setup, do what you want.
The very last item to install is voicecommand, you definitely want that. 
After installing it, it will ask if you want to set it up, you probably want to say yes, or you can just run "voicecommand -s" from terminal at any time after the fact.
If you get an error during install/setup about libboost.regex, you'll need to run the following command:  "sudo apt-get install libboost-regex1.49-dev"

Once everything's set up, you'll need to edit the config file to recognize and run commands by running "voicecommand -e"
You can set up all kinds of things here, but if you're just worried about VeraLite, you need to check out this page:  http://wiki.micasaverde.com/index.php/Luup_Requests#user_data

There's a lot of info here that should be easy enough to figure out, but these are the http requests you want to send. 

So now that you're in the the edit config, here are the important parts.  You set up a command on the left side by telling it what you want to say.  Say you want to set up a scene for "watch tv" to turn off all of the lights.  Your line in the edit config would be "watch tv==".  "watch tv" is the voice command you want it to listen for.  After the "==" you would type in "curl" with a space after followed by the http url that will run your command from http://wiki.micasaverde.com/index.php/Luup_Requests#user_data.

One thing to remember is to wrap your http string in double quotes. For some reason the ampersands in the string cause it to break.  So you line in the config would be:  curl "http://..."

Offline jimpapa

  • Sr. Member
  • ****
  • Posts: 454
  • Karma: +28/-1
Re: Raspberry Pi and voicecommand to control your Vera with voice
« Reply #1 on: February 09, 2014, 11:28:39 am »
Nice write up!

I was not interested in doing this until reading the post...

Hardware wise.. Just get a pi. Any other shields etc ?


Offline bdk0172

  • Newbie
  • *
  • Posts: 11
  • Karma: +2/-1
Re: Raspberry Pi and voicecommand to control your Vera with voice
« Reply #2 on: February 09, 2014, 06:03:50 pm »
I just got a starter kit from a seller on Amazon.  Wish I would've known that a 4gb SD card wasn't going to be big enough, but oh well.  You definitely want a case for it.  Some of the other items you might already have lying around and this seller has all kinds of different packages so just get what you need.

http://www.amazon.com/gp/product/B00GGM0Y66/ref=oh_details_o00_s00_i00?ie=UTF8&psc=1

Offline jimpapa

  • Sr. Member
  • ****
  • Posts: 454
  • Karma: +28/-1
Re: Raspberry Pi and voicecommand to control your Vera with voice
« Reply #3 on: February 10, 2014, 11:09:47 am »
I just got a starter kit from a seller on Amazon.  Wish I would've known that a 4gb SD card wasn't going to be big enough, but oh well.  You definitely want a case for it.  Some of the other items you might already have lying around and this seller has all kinds of different packages so just get what you need.

http://www.amazon.com/gp/product/B00GGM0Y66/ref=oh_details_o00_s00_i00?ie=UTF8&psc=1

Ok, thanks for the link!


Offline bucko

  • Hero Member
  • *****
  • Posts: 659
  • Karma: +27/-9
Re: Raspberry Pi and voicecommand to control your Vera with voice
« Reply #4 on: February 10, 2014, 06:46:55 pm »
Can you give some more information about your setup? For instance, what is the hardware am I talking into? iPhone. iPad. hidden mics?

In other words, what are the physical aspects of this install?


Thanks
Vera 3, 40+ Fibaro relays & dimmers, IPUX cams, Elk M1 Gold, M1XEP, M1SP, XVOR, M1RB, Elk124, Monoprice HDMI matrix & 6 zone amp, Denon AVR, Panasonic A8000, BI DV,On Controls

Offline bdk0172

  • Newbie
  • *
  • Posts: 11
  • Karma: +2/-1
Re: Raspberry Pi and voicecommand to control your Vera with voice
« Reply #5 on: February 11, 2014, 03:57:09 pm »
I'm using a Logitech webcam for the mic.  I finally got around to uploading a video to youtube that shows a little of the hardware and the whole thing in action.

http://www.youtube.com/watch?v=0vuaxNcFOjs&feature=youtu.be

Offline ShawnInFL

  • Full Member
  • ***
  • Posts: 199
  • Karma: +6/-0
Re: Raspberry Pi and voicecommand to control your Vera with voice
« Reply #6 on: March 21, 2014, 01:45:49 am »
I've got the fever for a feature like this...

So, how have you liked it so far?
Reliability/accuracy?
Change/modify voice feedback?

Have you considered multi mic and if so, what approach.
Would be awesome to have the ability to cruise the house with multi mic's.

Thanks for post and video...!!

Offline peterluc8080

  • Full Member
  • ***
  • Posts: 124
  • Karma: +4/-2
Re: Raspberry Pi and voicecommand to control your Vera with voice
« Reply #7 on: April 10, 2014, 08:58:04 pm »
I wanted something like that! Thanks for the guide. Will try it this week-end.

Envoy? de mon Z30 en utilisant Tapatalk


Offline boojew

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +0/-0
Raspberry Pi and voicecommand to control your Vera with voice
« Reply #8 on: April 11, 2014, 09:36:07 pm »
Interesting. I was thinking about using Jasper (jasperproject.github.io) for this. Wonder if either has a distinct advantage.

Edit: thinking more about it, the area I wanted this for, I also wanted a tablet for control. Might just use Utter on an android tablet
« Last Edit: April 13, 2014, 10:58:33 am by boojew »

Offline krmccreight

  • Newbie
  • *
  • Posts: 9
  • Karma: +2/-0
Re: Raspberry Pi and voicecommand to control your Vera with voice
« Reply #9 on: November 28, 2014, 04:59:19 pm »
So I place my command into the voice command file as attached below.  But when I speak the command it is not recognized.  What am I doing wrong.  Everything seems to be correct.  The pi even answerers me yes sir and acknowledges the voice command.

turn on kitchen light==curl "http://192.168.0.103:3480/data_request?id=action&output_format=xml&DeviceNum=3&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1"

This is just a part of a testing phase but frustrating.  I know the command works because it works in the browser.  Is there something that has to happen before the curl command i.e. does it have to open a browser first?  Any help would be appreciated.

Offline jeff3lo

  • Full Member
  • ***
  • Posts: 114
  • Karma: +1/-0
Re: Raspberry Pi and voicecommand to control your Vera with voice
« Reply #10 on: December 09, 2014, 01:00:26 am »
Will this voice command work on XBMC Gotham?  Or does it have to run on Raspbian?

Thank you.