The Vera Community forums have moved!

General => Remote Control => Topic started by: dlca1 on October 21, 2011, 12:32:10 am

Title: Linking Iphone/Siri to control Vera?
Post by: dlca1 on October 21, 2011, 12:32:10 am
I was thinking it would be fun to use Iphone/Siri voice-control to control my Vera. However, the API to Siri is limited to the built in functionalities.
http://cydiahelp.com/iphone-4s-siri-commands-all-in-one-post/


Anybody have ideas of how to enable this?

Idea 1: "Send message to Vera, turn on master lights"
Create some type of auto-reponder, that will respond to text messages and invoke a Vera command.

This is kind of round-about. any more clever ideas? If Idea 1 is the best option, are there are any existing projects to enable this?

thanks in advance

Title: Re: Linking Iphone/Siri to control Vera?
Post by: RedTechie on November 10, 2011, 09:02:07 pm
You could possibly make a bookmark to a HTTP API request, and then tell siri to go to that bookmark (if that works).

http://forum.micasaverde.com/index.php/topic,8334.msg53085.html
Title: Re: Linking Iphone/Siri to control Vera?
Post by: Chimpware on November 13, 2011, 07:57:52 am
Rumor is that later versions of Siri will enable 3rd party apps to use the interface, so SQ Remote + Siri could be awesome.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: dlca1 on November 14, 2011, 06:25:32 pm
Thanks for the link redlinkie

I just configured a new contact and called in Master.  In the URL-Home, I entered the url for toggling light on/off

Now, I can hold down the Siri button and say "master". It will pull up the master contact. I still have to "touch/click" the url and then my lights turn on/off.

Still not perfect, but progress and better than multiple clicks to open up ivera2 -> lights -> On/Off.

Looking forward to apple opening up siri API.  Then it would be really powerful.

Title: Re: Linking Iphone/Siri to control Vera?
Post by: wseverino on November 14, 2011, 07:44:26 pm
Looking forward to apple opening up siri API.  Then it would be really powerful.

Apple opening up is like a contradiction in terms!!! LOL
Title: Re: Linking Iphone/Siri to control Vera?
Post by: garrettwp on November 21, 2011, 03:55:26 am
http://www.engadget.com/2011/11/21/developer-creates-third-party-proxy-server-for-siri-controls-th/

- Garrett
Title: Linking Iphone/Siri to control Vera?
Post by: DaveL17 on November 21, 2011, 05:05:06 pm
http://www.engadget.com/2011/11/21/developer-creates-third-party-proxy-server-for-siri-controls-th/

- Garrett
I was just coming here to post news about this. Here's another source.

http://www.tuaw.com/2011/11/21/developer-builds-siri-proxy-server/

Title: Re: Linking Iphone/Siri to control Vera?
Post by: wseverino on November 30, 2011, 09:26:46 am
Ok now thats pretty Bitchin!!!! The big issue I see is its a crack so wide spread use is not there.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: dlca1 on December 02, 2011, 05:22:25 pm
Thanks for the link. Pretty cool. Folks have gotten siri-proxy to do all sorts of cool home automation.

I'm going to try this when I have time. Let me know if anybody else is trying this and would be happy to collaborate.

Title: Re: Linking Iphone/Siri to control Vera?
Post by: Richard on December 08, 2011, 10:33:59 pm
I installed siriproxy and had it call the http GET commands in the Vera.
I have it controlling my lights right now.

It was pretty easy to get going.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: strangely on December 09, 2011, 12:54:44 am
I installed siriproxy and had it call the http GET commands in the Vera.
I have it controlling my lights right now.

It was pretty easy to get going.
Video Video Video :)
Title: Re: Linking Iphone/Siri to control Vera?
Post by: Richard on December 11, 2011, 07:51:27 pm
I'm pretty sure my video will look like any of the other siriproxy videos, but in case people are interested, here is the video.

Siri controlling my vera2:

http://www.youtube.com/watch?v=cP6lR4Vx1XA&context=C2a961ADOEgsToPDskKT3lc_VPcjBqVCsWUfrjlC
 ;D

I only show it controlling devices in the video, but I have it controlling scenes too.

FWIW, I think this is a killer app for home automation.  I always have my phone in my pocket, and having a highly accurate voice recognition system always available in my house is great.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: strangely on December 11, 2011, 08:44:58 pm
@Richard, you should maybe post a bit of a howto for setup, it looks really good!

I guess I'll have to set this up when I get my 4S in January :)
Title: Re: Linking Iphone/Siri to control Vera?
Post by: Richard on December 11, 2011, 09:00:48 pm
If I get my siriproxy plugin code to a place where it is a little more generic (than what I currently have) I'll put it up on git if anyone else wants it.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: guessed on December 11, 2011, 09:24:13 pm
Thats very cool, thanks for posting that Richard.  I was reading through the stuff the other day, and it looks fairly simple to setup.  I'm glad that someone's blazing the trail with this stuff.

Can't wait until the "away from home" version of it is viable/simple (and secure) as well.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: rlmalisz on December 18, 2011, 09:13:01 pm
If I get my siriproxy plugin code to a place where it is a little more generic (than what I currently have) I'll put it up on git if anyone else wants it.

I, for one, would love to see it and play with it.  Even if it's not that generic!

--Richard (M)
Title: Re: Linking Iphone/Siri to control Vera?
Post by: DeltaNu1142 on December 19, 2011, 09:16:40 am
I can't wait to try this out...  I'm still using a 3G until I'm eligible for an upgrade in April...   :(
Title: Re: Linking Iphone/Siri to control Vera?
Post by: autotoronto on December 19, 2011, 03:26:09 pm
If someone would like to get SiriProxy operating on Vera itself, that would be progress.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: rlmalisz on December 19, 2011, 04:04:56 pm
If someone would like to get SiriProxy operating on Vera itself, that would be progress.

I doubt that there's enough space or compute power for all of the libraries that SiriProxy seems to be using on a V3, let alone a V2.  And then there's Ruby, and Gem, etc.  I have SiriProxy running in an Ubuntu 11.10 VM on my MacPro, and
I was literally installing packages for an hour before I could even get started.

--Richard
Title: Re: Linking Iphone/Siri to control Vera?
Post by: autotoronto on December 20, 2011, 11:42:54 am
For the very keen, here's the quickest (and dirtiest) way of doing it:

Install SiriProxy as per the various webpages, and make sure the machine on which it runs has reachability to your Vera.

Edit ~/SiriProxy/plugins/siriproxy-example/lib/siriproxy-example.rb and add at the top
Code: [Select]
require 'open-uri'

and then somewhere in the body (should be obvious where):
Code: [Select]
listen_for /Lights On/i do
    say "Let there be light"
    open('http://xxx.xxx.xxx.xxx:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=YYY')
    request_completed
  end

  listen_for /Lights Off/i do
    say "Darkness was over the surface of the deep."
    open('http://xxx.xxx.xxx.xxx:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=ZZZ')
    request_completed
  end

where xxx.xxx.xxx.xxx is the IP address of your Vera and YYY and ZZZ are the two scenes you want to run.


Obviously there are many better and more extensible ways of doing this, but if your only object is to impress your other half, this will do the trick in the minimum of time.

In respect of running SiriProxy on Vera - Pete Lamonica's code is the proof-of-concept that follows the proof-of-concept. I'm sure something could be written that's more appropriate to the Vera platform, not using Ruby.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: rlmalisz on December 20, 2011, 10:59:42 pm
I am getting there.  My config.yml lines just set a few URL components (and this could be done in the .rb file).  But I now am setting up a hash of my "house" rooms in the .rb initialize method...so adding more devices is as simple as adding another room there, or more devices to a room.  Currently, all it does is turn off/on lights and set levels for dimmers.  It shouldn't be hard to have a method that reports all the lights that are currently on, and individual light status.  Thermostat won't be hard, either.

But before my friends get over for Christmas dinner, I *have* to get the main garage door to open when Siri hears "open the pod bay doors, Hal".

When I get this stapled down a bit more, I'll let you all know.  And if I learn Ruby before I'm done, well, I guess that's okay.  First Python, and now this.  For some of this, it'd be a lot easier if I hadn't been writing Perl for 20 years.  I just keep writing it, even when it's now the language I am working in.

--Richard
Title: Re: Linking Iphone/Siri to control Vera?
Post by: strangely on December 20, 2011, 11:16:03 pm
I *have* to get the main garage door to open when Siri hears "open the pod bay doors, Hal".

That alone would be worth the price of a 4S :)
Title: Re: Linking Iphone/Siri to control Vera?
Post by: rlmalisz on December 22, 2011, 03:38:00 pm
Table-driven.  Still haven't added anything to do locks or garage doors, but have done implemented a table-walk that matches device numbers from Vera's "status" dump to the tables, and produces this as some of its output, only reporting on sensors that are tripped, locks that are unlocked, and lights/outlets that are switched on.  Of course, Siri is saying all this stuff as well.

--Richard
Title: Re: Linking Iphone/Siri to control Vera?
Post by: parkerc on August 27, 2012, 03:48:09 pm
Hi, I was just wondering how @rimalisz or any otherswere progressing with pairing Siri and Vera?
Is it a match made in silicon heaven? I'm looking for a some easy to follow instuctions for someone who is a newbie in this area.
Title: Linking Iphone/Siri to control Vera?
Post by: Gjones on January 07, 2013, 05:52:33 pm
Hi

I've spent the last few days getting siri proxy up and running to control lights and scenes. Did any have any luck returning status such as temperature?

Cheers
Title: Re: Linking Iphone/Siri to control Vera?
Post by: parkerc on January 07, 2013, 05:55:23 pm
Hi Gjones

Sorry to jump on you so soon after you've posted, but would you be able to share the set up and steps you took to get it working with Vera?
Title: Re: Linking Iphone/Siri to control Vera?
Post by: Gjones on January 08, 2013, 04:03:48 am
I've done very little different than reported by Rlmalisz and autotoronto earlier. The original siri proxy by plamoni on github appears to have some problems reported at the end of last year and is no longer being updated. I installed the Three Little Pigs siri proxy on a Ubuntu VM as this one is currently being supported.


Instructions and installer can be found at
https://github.com/jimmykane/The-Three-Little-Pigs-Siri-Proxy
http://www.am3yrus.com/

After up and running I modified the siriproxy-example.rb as described by autotoronto to send http commands to vera for devices and scenes. Once modified run 'siriproxy update .'   And the restart the proxy.

If I still find it useful when completed I may look at moving it to a raspberry pi.

Title: Re: Linking Iphone/Siri to control Vera?
Post by: Gjones on January 08, 2013, 04:07:48 am
Hi rlmalisz

Are you able to share an details on your advance config and status reporting?

Thanks
Title: Re: Linking Iphone/Siri to control Vera?
Post by: WB-AVL on February 13, 2013, 04:10:09 pm
I have everything running on the Raspberry PI.

The one problem I'm having is that my changes to the siriproxy-example.rb are not showing up when I restart siriproxy.

I have run "siriproxy update ." and have tried rebooting afterwards but none of my changes show up.

Any suggestions are greatly appreciated.

Thanks,

Will Byrum


I've done very little different than reported by Rlmalisz and autotoronto earlier. The original siri proxy by plamoni on github appears to have some problems reported at the end of last year and is no longer being updated. I installed the Three Little Pigs siri proxy on a Ubuntu VM as this one is currently being supported.


Instructions and installer can be found at
https://github.com/jimmykane/The-Three-Little-Pigs-Siri-Proxy
http://www.am3yrus.com/

After up and running I modified the siriproxy-example.rb as described by autotoronto to send http commands to vera for devices and scenes. Once modified run 'siriproxy update .'   And the restart the proxy.

If I still find it useful when completed I may look at moving it to a raspberry pi.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: Gjones on February 13, 2013, 04:35:55 pm
I started to see the same problem. ran 'rake install' again and updates to the siriproxy-example.rb started to work.

My normal process of stopping the server. running 'siriproxy bundle' and then 'siriproxy server' then started to work again.

hope this helps
Title: Re: Linking Iphone/Siri to control Vera?
Post by: WB-AVL on February 13, 2013, 05:11:38 pm
Thanks for the suggestion but I'm still not having luck. In my SiriProxy directory I ran "rake install", "siriproxy update .", "siriproxy bundle" then "siriproxy server"

Still no changes showing up. I will try a reboot for the heck of it. Any ideas?

Will Byrum
Title: Re: Linking Iphone/Siri to control Vera?
Post by: WB-AVL on February 20, 2013, 08:57:54 am
FYI:

I was able to get everything working by changing the siriproxy-example.rb file in the usr/rvm etc. etc. directory. Then I run "siriproxy bundle" after any change.

It works great!
Title: Re: Linking Iphone/Siri to control Vera?
Post by: MDoc on February 20, 2013, 01:35:06 pm
Just as reference I posted instuctions to set up a Proxy Server for those interested.   Probly should have posted here... My Bad

http://forum.micasaverde.com/index.php/topic,13324.msg99059.html#msg99059
Title: Re: Linking Iphone/Siri to control Vera?
Post by: cubs2b23 on February 26, 2013, 11:10:18 am
Does anyone have any other examples of how to interact with Siri?  I saw the example to run a Scene and I've used that successfully. But can we interact with individual devices instead of a scene? Is there a way to poll the status of a device for Siri to return?

Thanks
Title: Re: Linking Iphone/Siri to control Vera?
Post by: Gjones on February 26, 2013, 11:20:10 am
Hi

I've listed my commands for turning a device off, setting the DIM level and reporting the thermostat temperature. To return the status i used HTTParty. I didn't get time to work out how to load the HTTParty gem seperately so just enabled the default thermostat plugin in the /.siriproxy/config.yml file which installed it for me


#Turn Device off
listen_for /Living room light off/i do
    open('http://10.0.30.35:3480/data_request?id=lu_action&DeviceNum=35&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0')

#Set Dim Level
listen_for /Living room light ([0-9,]*[0-9])%/i do |dimlevel|
    say "Set Living room light to: #{dimlevel} percent."
     open("http://10.0.30.35:3480/data_request?id=lu_action&DeviceNum=35&action=SetLoadLevelTarget&serviceId=urn:upnp-org:serviceId:Dimming1&newLoadlevelTarget=#{dimlevel}")

listen_for /Hall temperature/i do
  halltemp = HTTParty.get("http://10.0.30.35:49451/data_request?id=lu_variableget&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&DeviceNum=14")

     
        say "Hall temperature #{halltemp} degrees."
     
Title: Re: Linking Iphone/Siri to control Vera?
Post by: cubs2b23 on February 26, 2013, 12:08:08 pm
Thanks Gjones - that will help me get started with on/off/dimmer.

Do we know if there is anyway to have siri pull up an image from a webcam that's connected to Vera?
Title: Re: Linking Iphone/Siri to control Vera?
Post by: cubs2b23 on February 26, 2013, 02:47:18 pm
Another question as I dig into this further: Has any one written a siriproxy plugin for vera?  I'm wondering if we can use the one done for the ISY-99i controller and modify it to use Vera commands instead. 

https://github.com/elvisimprsntr/siriproxy-isy99i (https://github.com/elvisimprsntr/siriproxy-isy99i)
Title: Re: Linking Iphone/Siri to control Vera?
Post by: spudjr on March 08, 2013, 01:44:55 pm
GJones
New to this stuff. Just want to clarify. The code you posted is in the siriproxy-example.rb file and NOT  the config.yml file or do I modify the config.yml?

Enable the default thermostat plugin, i gather that is get rid of # in line name: Thermostat, and change the host ip address line to the siri-proxy?

Thanks
Title: Re: Linking Iphone/Siri to control Vera?
Post by: Gjones on March 08, 2013, 04:32:31 pm
That's right the config.yml just needs the comments removing from the thermostat section, as it's not being used other than to load the httparty gem the IP can be left as it is.

the siriproxy-example.rb should have the vera commands added.

rlmalisz looks to have a far more elegant solution though on this post.
http://forum.micasaverde.com/index.php/topic,9070.msg104399.html#msg104399
Title: Re: Linking Iphone/Siri to control Vera?
Post by: spudjr on March 09, 2013, 11:50:08 am
GJones
Thanks for the reply. Making some progress :)
Having issues with dimmer control. changed the device number to that found under advanced, id of the GE dimmer. Needed to add scheme to the URN:  Still no go. guess I found a project for the evening.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: spudjr on March 15, 2013, 07:04:53 pm
Can anybody confirm if the CT-100 thermostat will work with Siri Proxy.
Uncommented the 3 lines in the config.yml file for the thermostat plugin. since the CT-100 is not ip enabled I set the ip address to the vera box. Ran siriproxy bundle and update.  If  ask for the thermostae status it just tells me it is off. Running command bundle show I see "siriproxy-thermostat 0.0.1 badb55d. Any ideas on the badb55d
Title: Re: Linking Iphone/Siri to control Vera?
Post by: knewmania on March 16, 2013, 10:41:14 am
Hi

I've listed my commands for turning a device off, setting the DIM level and reporting the thermostat temperature. To return the status i used HTTParty. I didn't get time to work out how to load the HTTParty gem seperately so just enabled the default thermostat plugin in the /.siriproxy/config.yml file which installed it for me


#Turn Device off
listen_for /Living room light off/i do
    open('http://10.0.30.35:3480/data_request?id=lu_action&DeviceNum=35&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0')

#Set Dim Level
listen_for /Living room light ([0-9,]*[0-9])%/i do |dimlevel|
    say "Set Living room light to: #{dimlevel} percent."
     open("http://10.0.30.35:3480/data_request?id=lu_action&DeviceNum=35&action=SetLoadLevelTarget&serviceId=urn:upnp-org:serviceId:Dimming1&newLoadlevelTarget=#{dimlevel}")

listen_for /Hall temperature/i do
  halltemp = HTTParty.get("http://10.0.30.35:49451/data_request?id=lu_variableget&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&DeviceNum=14")

     
        say "Hall temperature #{halltemp} degrees."
     

So I have been working on this project for a little while now and I finally have SiriProxy running on the Raspberry Pi. I am having problems with getting it to control my devices. I hope someone can assist me:

As an example I am trying to get SiriProxy to lock/unlock my Kwikset Deadbolt. Here is the code I have entered into the SiriProxy-example.rb file:

Code: [Select]
#Unlock Foyer Deadbolt
  listen_for /Unlock Deadbolt/i do
    open("http://192.168.0.5:3480/data_request?id=lu_action&output_format=xml&DeviceNum=4&serviceId=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget&newTargetValue=0")
 
  request_completed #always complete your request! Otherwise the phone will "spin" at the user!
  end

I get the following response from SiriProxy when I issue the Unlock Deadbolt command:

Code: [Select]
Plugin Crashed: No such file or directory - http://192.168.0.5:3480/data_request?id=lu_action&output_format=xml&DeviceNum=4&serviceId=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget&newTargetValue=0

I can enter that http string into a browser and the Deadbolt does unlock. Any ideas?


**EDIT. Disregard I figured it out.

 I was missing the require 'open-uri' at the beginning of the example file.
Title: Re: Linking Iphone/Siri to control Vera?
Post by: spudjr on March 17, 2013, 11:27:18 am
I want to use the example dim control code and use it for setting a thermostat. What variable is available other than "%" in the line

#Set Dim Level
listen_for /Living room light ([0-9,]*[0-9])%/i do |dimlevel|

Tried putting in a word instead of % and it did not like it