Siri controlling Plex



Thanks for the quick reply. I use a myPlex account, thats all...


EDIT: Ignore me, I shouldn't work on this stuff at 2am :) Stupid mistake...



Do you have the plex player running on the same machine?


Yes, the issue was that I have a different external port for for Plex and I was using that port :) All working now.

Great plugin by the way!

edit*



i went to a os x implementation and got further, so i deleted this question as it no longer applies.

edit*



i went to a os x implementation and got further, so i deleted this question as it no longer applies.

I ended up re-doing my siriproxy server in Mac OS X so i wouldn’t have to burden my server with running a VM.



I’ve gotten it up, and gotten further than before, i installed it and it doesn’t crash my siriproxy server, until i ask it to play something. I thought the errors might have something to do with the fact that the plex server was on the same mac, so i tried a loopback (127.0.0.1) and it’s ip 10.0.1.31. Here’s my terminal output:



Again, any help would be appriciated.





j2serve:SiriProxy administrator$ rvmsudo siriproxy server

Starting SiriProxy on port 443…

Create server for iPhone connection

start conn #<SiriProxy::Connection::iphone:0x007febf19deb28 @signature=3, @processed_headers=false, @output_buffer="", @input_buffer="", @unzipped_input="", @unzipped_output="", @unzip_stream=#Zlib::Inflate:0x007febf19de9c0, @zip_stream=#Zlib::Deflate:0x007febf19de998, @consumed_ace=false, @name=“iPhone”, @ssled=false>

[Info - Plugin Manager] Plugins laoded: [#<SiriProxy::Plugin::Example:0x007febf1af2938 @manager=#<SiriProxy::PluginManager:0x007febf19de2e0 @plugins=[…]>>, #<SiriProxy::Plugin::plex:0x007febf1caccb0 @host=“127.0.0.1”, @port=32400, @tv_index=nil, @plex_library=#<PlexLibrary:0x007febf1cacc10 @host=“127.0.0.1”, @port=32400, @tv_index=nil>, @manager=#<SiriProxy::PluginManager:0x007febf19de2e0 @plugins=[…]>>]

[Info - iPhone] Received Object: LoadAssistant

[Info - iPhone] Received Object: StartSpeechRequest



[Info - iPhone] Received Object: FinishSpeech

[Info - Guzzoni] Received Object: SpeechRecognized

[Info - Plugin Manager] Processing ‘Play family guy season two episode two ’

[Info - Plugin Manager] Processing plugin #SiriProxy::Plugin::Example:0x007febf1af2938

[Info - Plugin Manager] Processing plugin #SiriProxy::Plugin::Plex:0x007febf1caccb0

[Info - Plugin Manager] Matches (?i-mx:(play|playing)(.+))

[Info - Plugin Manager] Applicable states:

[Info - Plugin Manager] Current state:

[Info - Plugin Manager] Matches, executing block

/Users/administrator/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/open-uri.rb:346:in open_http': 500 Internal Server Error (OpenURI::HTTPError)<br /> from /Users/administrator/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/open-uri.rb:775:in buffer_open’

from /Users/administrator/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/open-uri.rb:203:in block in open_loop'<br /> from /Users/administrator/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/open-uri.rb:201:in catch’

from /Users/administrator/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/open-uri.rb:201:in open_loop'<br /> from /Users/administrator/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/open-uri.rb:146:in open_uri’

from /Users/administrator/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/open-uri.rb:677:in open'<br /> from /Users/administrator/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/open-uri.rb:33:in open’

from /Users/administrator/.rvm/gems/ruby-1.9.3-p0/bundler/gems/SiriProxy-Plex-0d4d27169f2e/lib/plex_library.rb:21:in xml_doc_for_path'<br /> from /Users/administrator/.rvm/gems/ruby-1.9.3-p0/bundler/gems/SiriProxy-Plex-0d4d27169f2e/lib/plex_library.rb:26:in all_shows’

from /Users/administrator/.rvm/gems/ruby-1.9.3-p0/bundler/gems/SiriProxy-Plex-0d4d27169f2e/lib/plex_library.rb:106:in find_show'<br /> from /Users/administrator/.rvm/gems/ruby-1.9.3-p0/bundler/gems/SiriProxy-Plex-0d4d27169f2e/lib/siriproxy-plex.rb:64:in block in class:Plex

from /Users/administrator/.rvm/gems/ruby-1.9.3-p0/bundler/gems/cora-15d199d3af0b/lib/cora/plugin.rb:41:in instance_exec'<br /> from /Users/administrator/.rvm/gems/ruby-1.9.3-p0/bundler/gems/cora-15d199d3af0b/lib/cora/plugin.rb:41:in block (2 levels) in process’

zlib(finalizer): the stream was freed prematurely.

zlib(finalizer): the stream was freed prematurely.

j2serve:SiriProxy administrator$

I also got bitten by the prospect of controlling PLEX w/Siri, but I too am running into a problem.





mac@Monstroso:~/.siriproxy$ rvmsudo ./bin/siriproxy server

[sudo] password for mac:

Starting SiriProxy on port 443…

Create server for iPhone connection

start conn #<SiriProxy::Connection::iphone:0x0000000192ea68 @signature=3, @processed_headers=false, @output_buffer="", @input_buffer="", @unzipped_input="", @unzipped_output="", @unzip_stream=#Zlib::Inflate:0x0000000192e680, @zip_stream=#Zlib::Deflate:0x0000000192e590, @consumed_ace=false, @name=“iPhone”, @ssled=false>

/home/mac/.rvm/gems/ruby-1.9.3-p0/bundler/gems/SiriProxy-Plex-0d4d27169f2e/lib/plex_library.rb:1:in require': cannot load such file -- CGI (LoadError)<br /> from /home/mac/.rvm/gems/ruby-1.9.3-p0/bundler/gems/SiriProxy-Plex-0d4d27169f2e/lib/plex_library.rb:1:in <top (required)>’

from /home/mac/.rvm/gems/ruby-1.9.3-p0/bundler/gems/SiriProxy-Plex-0d4d27169f2e/lib/siriproxy-plex.rb:24:in require'<br /> from /home/mac/.rvm/gems/ruby-1.9.3-p0/bundler/gems/SiriProxy-Plex-0d4d27169f2e/lib/siriproxy-plex.rb:24:in <top (required)>’

from /home/mac/.siriproxy/lib/siriproxy/plugin_manager.rb:22:in require'<br /> from /home/mac/.siriproxy/lib/siriproxy/plugin_manager.rb:22:in block in load_plugins’

from /home/mac/.siriproxy/lib/siriproxy/plugin_manager.rb:14:in each'<br /> from /home/mac/.siriproxy/lib/siriproxy/plugin_manager.rb:14:in load_plugins’

from /home/mac/.siriproxy/lib/siriproxy/plugin_manager.rb:8:in initialize'<br /> from /home/mac/.siriproxy/lib/siriproxy.rb:21:in new’

from /home/mac/.siriproxy/lib/siriproxy.rb:21:in block (2 levels) in initialize'<br /> from /home/mac/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:1432:in call’

from /home/mac/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:1432:in event_callback'<br /> from /home/mac/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in run_machine’

from /home/mac/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in run'<br /> from /home/mac/.siriproxy/lib/siriproxy.rb:16:in initialize’

from /home/mac/.siriproxy/lib/siriproxy/command_line.rb:96:in new'<br /> from /home/mac/.siriproxy/lib/siriproxy/command_line.rb:96:in start_server’

from /home/mac/.siriproxy/lib/siriproxy/command_line.rb:85:in run_server'<br /> from /home/mac/.siriproxy/lib/siriproxy/command_line.rb:37:in initialize’

from ./bin/siriproxy:6:in new'<br /> from ./bin/siriproxy:6:in



Here’s my config.yml entries:



port: 443

log_level: 1

plugins:

# NOTE: run bundle after changing plugin configurations to update required gems



- name: ‘Plex’

git: ‘git://github.com/hjaltij/SiriProxy-Plex.git’

plex_host: ‘192.168.1.3’

plex_port: ‘32400’

plex_tv_index: ‘2’



- name: ‘Example’

path: ‘./plugins/siriproxy-example’

just a side note to my post above, if i change plex_tv_index: ‘2’ to 1 or 3, it doesn’t crash, but can’t find any episodes.

siriproxy-plex just updated with onDeck support. http://www.youtube.com/watch?v=yA_VjVfy8yY

The GitHub source has been updated.



Check config.yml closely as now it contains a variable for you TV index number.

Ok, I got mine working. My original error was caused from the fact that I was missing some of the required gems, and I ran into the 404 Error that was resolved by setting the TV ID setting in config.ply to “key” value found by browsing to http://192.168.1.3:32400/library/sections (your IP & port will vary).



Now, if this can be used to control a ‘channel’ plugin in plex we should be able to build a plugin that groups shows based off the ‘studio’ key. This way we could essentially tell Siri to “change channel to Cartoon Network” and it would start playing shows (maybe in a random order) to give that ‘TV Feel’.

@Hjaltij,



Thanks for “plex_tv_index”, is it able to support multiple (more than one) TV section?



Also, is there a read me with a summary of commands currently available in Siriproxy-plex ?





Regs

D.




Great news! But i'm struggling to get this to work.



I've updated the plex plugin for siri *bundle update siriproxy-plex* and checked that my config.yml file in the bundle folder has been updated. After that I've run bundle install followed by rvmsudo siriproxy server. Is there anything else I have to do?

I updated this morning and on deck works for me, only trouble is, it had pages for shows to read out :slight_smile:



The only thing I can suggest is try a “siriproxy update” just to make sure all components are up-to-date

Multiple TV index’s are not supported at the moment. This is one on my list to work on but not my highest priority. I’m really jonesing to get myPlex working as that is what I use the most to get to my content from a distance.



Please add feature requests in the github repository so we can track them.








Well, that was easy. thanks for your help, siriproxy update was all i needed

Sorry didn’t answer the second question.



I’ll put together a readme this week. “list of commands” is something we are def going to need. I’m starting to get conflicting commands between various siriproxy plugins I’m using. I’m not sure how to address this but it seems adding a “commands supported” to all siriproxy readme’s would be a start.


I have run ‘siriproxy update’, ‘siriproxy bundle’ and made the changes to config.yml.



“What’s On Deck” still isn’t being recognised. ‘siriproxy update’ grabs the latest code right?



[Info - Plugin Manager] Processing 'What’s on deck ’

[Info - Plugin Manager] Processing plugin #SiriProxy::Plugin::Example:0x007f8a219da500

[Info - Plugin Manager] Processing plugin #SiriProxy::Plugin::Plex:0x007f8a21a6c888

[Info - Plugin Manager] Processing plugin #SiriProxy::Plugin::SiriIMDB:0x007f8a21a02a78

[Info - Plugin Manager] Processing plugin #SiriProxy::Plugin::AppController:0x007f8a21a34c08

[Info - Plugin Manager] No matches for 'What’s on deck ’

Try the following:


  1. comment out plex lines in ~/.siriproxy/config.yml
  2. siriproxy bundle
  3. cd ~/.rvm/gems/ruby-1.9.3-p0/bundler/gems (if you’re on OSX Lion this should be your ruby version)
  4. rm -rf SiriProxy-Plex*
  5. remove comments from plex lines in ~/.siriproxy/config.yml
  6. siriproxy bundle



    This should ensure that you get the latest siriproxy-plex plugin.






I like this idea. It would be easy to make siri start playing a "channel" in plex, but plex would have to implement, keep track of, and manage the "play next" functionality. Very cool idea though. This is exactly why I still use hulu, gotta have that mindless background noise without having to select the next show all the time.



thanks for this, combined with his new read me i was able to figure it out finally. (my index is 5!)

Wondering if there is any planned support for controlling external players, streaming from separate media servers? Is that even possible?