We have moved at community.getvera.com

Author Topic: Guide for setting up a Siri Proxy server to control Vera  (Read 40286 times)

Offline MDoc

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +3/-3
Guide for setting up a Siri Proxy server to control Vera
« on: January 20, 2013, 02:05:04 am »
I've got a SiriProxy server running and controlling Vera scenes.  While it was fresh... I wanted to put together a guide for those who want to try to set up Siri on their IPhone 4S/5 to control Vera.

A couple of things first:
   1. I did this with my iPhone 5 (or 4S).  You do not have to Jailbreak your phone.  All that's required on the phone is to add a certificate (which can be easily removed) and set the DNS address in your Wi-Fi connection.
   2. I used an old (really old) laptop and it runs Linux Server fine.  You can probably use the GUI version? or Virtual Machine.  I did a fresh Install.
   3. Be patient? I wiped the computer and started over with a fresh copy of Linux several times before I got it running.  Hopefully this guide will help things go smooth.
   4. A BIG thanks for the folks at am3yrus.com for their script to install the Three Little Pigs Siri Proxy.   This automates the task of performing the install.  If you?ve seen the procedure to do it manually, you know what I mean!
   5. I used Ubuntu Version 11.10 because I could not get the current version 12 to run on my old laptop.  I believe it should work with the current version

Install  Ubuntu  11.10
   1. Download Ubuntu 11.10 http://releases.ubuntu.com/11.10/ (pick version for your computer)
   2. Burn a CD, boot the computer you?re going to use using the CD and follow the install prompts.

Create a root password
   sudo passwd root
   <Enter password>
   sudo passwd -u root

Log into the Root
   su -

Install the Three Little Pigs Siri Proxy
   apt-get install -qq wget
   wget http://www.am3yrus.com/downloads/TTLPinstaller-1.10.sh
   chmod u+x TTLPinstaller-1.10.sh
   ./TTLPinstaller-1.10.sh

I used Static IP and Private Server.  All other parameters I kept the default

Install the Certificate on your iPhone
   1. Copy the ca.pem certificate from the Linus box to your PC.  It's located in the root/.siriproxy directory.  I use Winscp to access the files.
   2. E-mail the ca.pem file to yourself so you can open it on your iPhone.
   3. On the phone, select the ca.pem file and when the certificate box opens, install it.  It will say it's not trusted. Do it anyway.

Set DNS in the Wi-Fi Settings
Go to the Wi-Fi settings on your phone and select your current Wi-Fi account.  Change the DNS to the Static IP address of your server.

Forward 443 and 53
Go into your router and port forward ports 443 and 53 to the Static IP of the server

Create a server startup script
I had to stop and start the server DNS every time I powered up.  So here is a script that will automate the process and start the server.

   nano StartServer.sh

<enter the following>

   sudo /etc/init.d/dnsmasq stop
   sudo killall named
   sudo /etc/init.d/dnsmasq start
   cd ~/The-Three-Little-Pigs-Siri-Proxy && ./siriproxy-restarter

<press Ctrl O> and accept saving the file as StartServer.sh
<press Ctrl X> to exit the editor

Chmod +x StartServer.sh

Start the server
   Sh StartServer.sh

Hopefully,  the server will start without error.  Go to your iPhone and activate Siri and say "Test Siri Proxy".  If Siri response with, Siri Proxy is up and running. YOU DID IT!

To Control Vera  
Thanks to Autotronto, I had an example for modifying the siriproxy-example Ruby file to control Vera THANKS!

Follow his code:
http://forum.micasaverde.com/index.php/topic,8199.msg97472.html#msg97472

After editing the code you have to compile it.
   cd The-Little-Pigs-Siri-Proxy/plugins
   siriproxy update . <note the period>

Then start the server and see if you can control your Vera

Notes:
Watch the screen when you activate Siri. You should see a bunch of text when you press the button to activate Siri.  If not, Your DNS is not working. Search the web for dnsmasq for debugging.

If you are not talking with Vera, Ping Vera from the sever and verify you are seeing it:
Ping xxx.xxx.xxx.xxx <Vera IP>

If you get the server running and want to learn more about Ruby.  Great Site:
http://www.ruby-lang.org/en/documentation/

The next step is to create a plug-in. I know some of you are far ahead of me.. so I hope you'll share when you get it done.

« Last Edit: January 20, 2013, 10:41:47 pm by MDoc »

Offline MDoc

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +3/-3
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #1 on: January 21, 2013, 09:12:51 pm »
I was planning on waiting a little while to see if anyone comes up with a Plugin for a SiriProxy Server to control Vera... But as I think about it... since everyones needs are so vaired... I was just wondering if it makes more sense to write my own.  Any thoughts?

Offline itchyballs

  • Sr. Newbie
  • *
  • Posts: 40
  • Karma: +0/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #2 on: February 01, 2013, 04:59:34 pm »
I am very interested in this. A rasberry PI would be perfect for this project.

http://www.youtube.com/watch?v=PXmCiaRc9XU


THanks.

Offline racarter

  • Hero Member
  • *****
  • Posts: 519
  • Karma: +12/-4
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #3 on: February 01, 2013, 05:23:12 pm »
I have a Siri proxy server running on a Raspberry Pi which simply sends URLs to Vera to run scenes or control devices.  It works very well, so I'm not sure what advantages a dedicated plug-in would have.
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline MDoc

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +3/-3
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #4 on: February 01, 2013, 11:39:47 pm »
Yeah... Kinda finding the same thing.  I've been able to do everything I need by just modifying the siriproxy_example.rb file.

Offline spudjr

  • Full Member
  • ***
  • Posts: 133
  • Karma: +2/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #5 on: March 04, 2013, 08:29:26 pm »
MDoc
Looks like great directions here. Couple of questions. With the IPhone DNS set know to the proxy box, will the proxy box then forward DNS requests to the internet for non Siri translations.
Why are you forwarding Ports 443, and 53. Is this not all local to the one local network and the router does not come into play?
See discussions of "SPIRE" on other forums. Needed to keep keys valid with Apple. I see this does not come into play here. Any idea what they are talking about.
The script to start the DNS server. Does this script get run automatically from the init.d folder by default
Looking forward to setting up a Linux box again and giving this a try or using VM for it.

Thanks

Offline MDoc

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +3/-3
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #6 on: March 05, 2013, 12:00:07 am »
@spudjr

Yes,  once the Proxy Server searches for your Ruby Listen strings, if there are no matches, then the server passes the request to the Apple server the normal Siri processing.  The Siri response is then passed to your phone.

Ports 443 and 53 are used by the Proxy Server I believe to pass control over to the Apple Server... Someone who knows more about the technical workings of the proxy server may be able to chime in here.

Spire is used when a jailbroken "Non-Siri" iPhone (iPhone 4) is using the proxy server to give that device Siri capability.  As long as you use a Siri compatible phone to access the server every 24 hours (settable during setup) then the keys are reset and the non Siri phones will have Siri capability.  I am using only an Ipnone 5.

No... the script to I show is simply like a DOS batch file and is run manually so you don't have to key the commands each time you power up.  You could run it automatically on power up though.

Offline FireBird

  • Jr. Member
  • **
  • Posts: 94
  • Karma: +2/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #7 on: March 05, 2013, 06:17:01 pm »
I curious about this.... with Siri proxy setup with the Vera. Would I just tell Siri "Living Room Lights on" or "Garage Door Open". What commands will Siri accept?

Thanks you

Offline racarter

  • Hero Member
  • *****
  • Posts: 519
  • Karma: +12/-4
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #8 on: March 05, 2013, 07:32:10 pm »
Siri Proxy will accept anything you put into the siriproxy_example.rb file.  If it's not in there, the request gets passed to Siri's servers to be dealt with in the normal way.
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline spudjr

  • Full Member
  • ***
  • Posts: 133
  • Karma: +2/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #9 on: March 05, 2013, 10:02:53 pm »
Just an update. It appears the auto install script in no longer available from Three Little Pigs. They have fairly good directions for a manual install. Gave it a try and all worked fine until "rake install" section. figuring out the error will be for another night.

Offline Rusty2192

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #10 on: March 20, 2013, 08:45:31 pm »
Has anyone gotten this to work lately?  I have tried probably close to 10 times with several versions of Ubuntu, Xubuntu, desktop and server, TTLP, regular SiriProxy Server, etc. etc.

I just cannot seem to get it to work.  It doesn't help that I don't really know what I'm doing, but I am great at following directions  ;)

Offline MDoc

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +3/-3
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #11 on: March 20, 2013, 10:12:08 pm »
I just cannot seem to get it to work.  It doesn't help that I don't really know what I'm doing, but I am great at following directions  ;)

Are you getting an error? Couple of things to make sure...Did you install the Certificate and enter proxy server IP address on your iPhone?  What iPhone are you using...4, 4S,5?

Offline knewmania

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #12 on: March 21, 2013, 09:57:49 am »
Has anyone gotten this to work lately? 

I tackled this project last week. I have it running on a Raspberry Pi. It certainly wasn't easy, but eventually I got it working. I have very little Unix experience, so that was my biggest hurdle.

Of the many set of instructions I found the following to be the most accurate (for the Raspberry Pi install).

http://www.hometoys.com/emagazine.php?art_id=2090
Vera 2. UI 1.5.622 / Vera 3. UI 1.7.760

Offline Rusty2192

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #13 on: March 21, 2013, 11:05:13 pm »
I just cannot seem to get it to work.  It doesn't help that I don't really know what I'm doing, but I am great at following directions  ;)

Are you getting an error? Couple of things to make sure...Did you install the Certificate and enter proxy server IP address on your iPhone?  What iPhone are you using...4, 4S,5?

I finally got it working tonight on a VM of Ubuntu Server 12.10 using the step by step install of the Three Little Pigs.  This is so awesome.  Now I just need to get it working on my old desktop server instead of the VM on my laptop.
« Last Edit: March 21, 2013, 11:07:26 pm by Rusty2192 »

Offline cubs2b23

  • Full Member
  • ***
  • Posts: 102
  • Karma: +2/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #14 on: March 22, 2013, 11:06:38 am »
I've used this SiriProxy build for the raspberry pi for a couple different installs

http://sourceforge.net/projects/siriproxyrpi/