plamoni / SiriProxy

A (tampering) proxy server for Apple's Siri
GNU General Public License v3.0
2.12k stars 343 forks source link

custom plugin #540

Closed karlbarre closed 11 years ago

karlbarre commented 11 years ago

Hi, I'm trying to control mt x10 device via a siriproxy and i would need your help to figure the little I have left

im trying to write a new command in the siriproxy-exemple.rb file but I can't make it work

I would need to introduce a command like

./x10cmd rf a5 on

in the scrip

trying

listen_for /turn the bedroom light on/i do ./x10cmd rf a5 on, say "I turn your bedroom light on" end

you have an idea on how could it execute the line that I want ?

thx

elvisimprsntr commented 11 years ago

First, this issues tracker is for problems with siriproxy itself, not an open forum to ask how to questions. That is best served on other forums.

Regardless

  1. I would not recommend adding to the example plugin. I would start with a basic shell. Although written for the Raspberry Pi, my RPi plugin provides the basic structure and files for you to start from. https://github.com/elvisimprsntr/siriproxy-rpi You can fork or clone the repo and make changes as you like.
  2. For X10 control, I would perhaps look for another X10 siriproxy plugin.
  3. I am not familiar with the X10 API you are trying to use, but It looks like to you trying to execute shell commands. If so the syntax is not correct. Perhaps something like this.
listen_for /turn the bedroom light on/i do
`sh x10cmd rf a5 on`
say "I turn your bedroom light on"
request_completed
end

You may have to explicitly define the entire path to x10cmd

elvisimprsntr commented 11 years ago

Not sure what X10 controller you are using but this one sounds interesting. There is a ruby gem for it to make it easier to interface with. http://x10-cm17a.rubyforge.org/