We have moved at community.getvera.com

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

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #30 on: May 05, 2013, 02:57:37 am »
Hi wseverino

Parker - I use the /home/pi/SiriProxy/plugins/siriproxy-example/lib/siriproxy-example.rb

Is there more than one of these files? I would have thought we all used the same ? - So which one should be used (I don't seem to have anything in /home/?) 

Also was that your entire siriproxy-example file you posted or just an extract?

-------------------------------------

Hi @Spudjr

Thanks for those examples, I'll give them a try.

-------------------------------------

So far nothing that I've added, even the simplest of commands into the siriproxy-example have been returned to me, which is very strange.  ??? - yet I can see the commands being processed by the Pi and 'test siriproxy' returns correctly.

I'm using DNSMASQ, which seems to be taking up port 52, and I've been reading contradicting information about the value of having it running :(

Is everyone running siri proxy  on a PI ? Do they find long pauses occurring after certain requests are made ?

Do you think there is scope to make a  dedicated Micasaverde Vera file? One where only minor customisation is required, e.g by updating/managing a device number and naming table?
« Last Edit: May 05, 2013, 03:57:27 am by parkerc »

Offline MDoc

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +3/-3
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #31 on: May 05, 2013, 09:39:08 am »
So far nothing that I've added, even the simplest of commands into the siriproxy-example have been returned to me, which is very strange.

When you compile,  are you putting a period after the update command?  I'm not using a Pi but I had the same problem until I put the period aver the updat command.   Should be "Update ."


Offline spudjr

  • Full Member
  • ***
  • Posts: 133
  • Karma: +2/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #32 on: May 05, 2013, 10:53:07 am »
parkerc

Using the pi here and no problems. You may be using the wrong siriproxy-example.rb file. I,m running as root and use the siriproxy-example.rb file in

/usr/local/rvm/gems/ruby-2.0.0-p0/gems/siriproxy-0.5.3/plugins/siriproxy-example/lib/siriproxy-example.rb

Set up a symbolic link much easier than all that typing  :)
Anytime I just update the siriproxy-example.rb file I just need to restart the server. If you add gems or plugins then that is a different matter. Hope this helps

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #33 on: May 05, 2013, 02:50:40 pm »
You may be using the wrong siriproxy-example.rb file. I,m running as root and use the siriproxy-example.rb file in

/usr/local/rvm/gems/ruby-2.0.0-p0/gems/siriproxy-0.5.3/plugins/siriproxy-example/lib/siriproxy-example.rb

Set up a symbolic link much easier than all that typing  :)

Hi Spudjr, that the one I'm using, so it's good to hear you are using the same one.

I'm a novice on Linux, how do I do a symbolic link?

Anytime I just update the siriproxy-example.rb file I just need to restart the server.

Now that is something I have not tried, I assumed the siriproxy-example file was addressed a-fresh each time, and the server runs throughout.. I'll give it a go.

Offline spudjr

  • Full Member
  • ***
  • Posts: 133
  • Karma: +2/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #34 on: May 05, 2013, 03:07:25 pm »
Symbolic link

ln -s [TARGET DIRECTORY OR FILE] ./[SHORTCUT]

You could also use something link WinSCP to connect to the Pi and then save the location of the .rb file as a favorite within WinSCP

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #35 on: May 05, 2013, 03:28:19 pm »
Thanks @Spudjr

I have the Pi and siriproxy-example now linked to my Textastic app on the iPad, so I have a very quick way to update the file.

A restart helped Siri to see the new entries in the Siriproxy file, however my progress has led me to this error.

Quote
[Info - Plugin Manager] Processing 'What is Ben's room temperature '
[Info - Plugin Manager] Processing plugin Example
[Info - Plugin Manager] Matches (?i-mx:What is Ben's room temperature)
[Info - Plugin Manager] Applicable states:
[Info - Plugin Manager] Current state:
[Info - Plugin Manager] Matches, executing block
[Info - Plugin Manager] Plugin Crashed: No such file or directory - http://192.168.1.234:3480/data_request?id=lu_variableget&DeviceNum=42&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature

Any ideas?

Offline spudjr

  • Full Member
  • ***
  • Posts: 133
  • Karma: +2/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #36 on: May 05, 2013, 03:43:21 pm »
Try to work from this that jumper 4000 posted and I just modified to suit my words. Note the port number I'm using

listen_for /\b(What is|give me)(?: the)? living room temperature?/i do |state|
  ltemp = open("http://192.168.100.53:49451/data_request?id=lu_variableget&DeviceNum=23&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature")
    say "The living Room temperature is #{ltemp.read} degrees."
    request_completed
  end

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #37 on: May 05, 2013, 03:56:26 pm »
Try to work from this that jumper 4000 posted and I just modified to suit my words. Note the port number I'm using

listen_for /\b(What is|give me)(?: the)? living room temperature?/i do |state|
  ltemp = open("http://192.168.100.53:49451/data_request?id=lu_variableget&DeviceNum=23&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature")
    say "The living Room temperature is #{ltemp.read} degrees."
    request_completed
  end

That's actually where I started, and I've tried to tailor it in a number of ways, but the result is sadly the same. Siri tells me the plugin has crashed.

Quote
[Info - Plugin Manager] Processing 'What is the living room temperature '
[Info - Plugin Manager] Processing plugin Example
[Info - Plugin Manager] Matches (?i-mx:\b(What is|give me)(?: the)? living room temperature?)
[Info - Plugin Manager] Applicable states:
[Info - Plugin Manager] Current state:
[Info - Plugin Manager] Matches, executing block
[Info - Plugin Manager] Plugin Crashed: No such file or directory - http://192.168.1.234:49451/data_request?id=lu_variableget&DeviceNum=42&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #38 on: May 06, 2013, 02:20:32 am »
I tried seeking advice from the GitHub (https://github.com/plamoni/SiriProxy/issues/520) but with no real success other than being reminded about Google, which I'd already exhausted so that was not exactly a positive support experience, however @Elvisimprsntr did suggest

https://github.com/kreynolds/ruby-mios

Which made me wonder if the SiriProxy calls to Vera could be better run with that ?

Sadly I'm out of my knowledge zone now, (and sadly still do not have a working integration between Siriproxy and Vera ) however I wanted to put the ruby-mios link out there for discussion.

Just to confirm I can get siriproxy to say other things, but for for the life of me I can't get it to communicate with Vera..
« Last Edit: May 06, 2013, 02:34:50 am by parkerc »

Offline spudjr

  • Full Member
  • ***
  • Posts: 133
  • Karma: +2/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #39 on: May 06, 2013, 09:08:16 am »
One last shot here. When you say none of your commands works with Vera do you have

require 'open-uri'


at the begining of your .rb file

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #40 on: May 06, 2013, 10:01:28 am »
That's it !!!!!!  - Thanks so much @spudjr

I did not see that listed as required. Where was it ? Althought saying that I can see it in @wserverino's example now I look at it again.

Speaking of @wserverino's example file, he mentions in it.
Quote
Remember to add this plugin to the "config.yml" file!

What is meant by that? I can see the config file, but I'm not sure where to put it.

Also, I execute siriproxy on my iPad, via a SSH application but if i move away from it, it stops working and I have to to back, reconnect and then start siriproxy again? Any idea how I can always make this run?  What do others do ?

Thanks again..
« Last Edit: May 06, 2013, 10:22:35 am by parkerc »

Offline wseverino

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 854
  • Karma: +0/-0
  • Da Man, Da Myth, Da Legend - in his own mind!
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #41 on: May 06, 2013, 12:06:56 pm »
Parker - The config.yml comment should have been deleted when I posted the code. I was initially going to create a separate plugin for it but I decided to paste it into the siriproxy-example.

My ZWave Network: Too friggin big to list.....

Offline spudjr

  • Full Member
  • ***
  • Posts: 133
  • Karma: +2/-0
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #42 on: May 06, 2013, 12:32:57 pm »
parkerc

Glad you got it working :)
I no longer have it set up on my pi as I am using it for another purpose. Playing with automation on a Android device
Saying that a useful utility you may want to install on your pi is tmux

apt-get install tmux


It will allow you to open up another terminal window and then start siri server. You then can go back to your orginal window logout of your SSH session and leave siri running in the background

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #43 on: May 06, 2013, 04:47:57 pm »
Parker - The config.yml comment should have been deleted when I posted the code. I was initially going to create a separate plugin for it but I decided to paste it into the siriproxy-example.

Thanks @wseverino, the example you've posted looks really good, I'm customising it now to see how it works with my set up.

You certainly have the makings of a 'generic' siriproxy-example for Vera  If you evolve it, will you be up for sharing the subsequent versions?
« Last Edit: May 06, 2013, 04:52:36 pm by parkerc »

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: Guide for setting up a Siri Proxy server to control Vera
« Reply #44 on: May 06, 2013, 05:39:59 pm »
@wserverino

If you have time, I've customised the plugin you created, but any dynamic command I run causes the plugin to crash. Stating "no implicit conversion of nil into String"

[Info - iPhone] Received Object: FinishSpeech
[Info - Guzzoni] Received Object: SpeechRecognized
[Info - Plugin Manager] Processing 'On living room light '
[Info - Plugin Manager] Processing plugin Example
[Info - Plugin Manager] Matches (?i-mx:(on|off).*(living room light|main bedroom light|left conservatory lamp|right conservatory lamp|bonus room overhead| bonus TV|foyer chandolier|foyer lamp|front porch|garage overhead|garage spot light|breakfast nook|bar lights|kitchen overhead|under cabinet|laundry room|downstairs hallway|master bath sconce|master bath overhead|Alexandra|Bill|master overhead|Nicholas overhead|Sophie overhead|Sophie lamp|Sophie closet|upstairs hallway|stairwell|updstairs hall lamp))
[Info - Plugin Manager] Applicable states:
[Info - Plugin Manager] Current state:
[Info - Plugin Manager] Matches, executing block
[Info - Plugin Manager] Plugin Crashed: no implicit conversion of nil into String