If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Flex TV: Google Assistant/Alexa + Plex Integration (with support for Sonarr, Couch, Sick, etc.)

1235766

Answers

  • FlippageFlippage Posts: 69Members, Plex Pass Plex Pass

    This is really coming along amazingly.

    One question in relation to:

    My intention as of right now is to package this as a self-contained version of XAMPP/LAMP/WAMP.

    How difficult is it going to be to set up on an existing XAMPP setup?

    I'm already running a webserver with all of my other apps, so I'd prefer not to have to setup a second instance, or to overwrite what I have.

    This is probably a bit early to be asking, but I figured I'd throw it out there. If you factor in that most people with Plex would probably have a webserver running already.

    Can't wait until this is ready to test with PMP :) - My excitement is palpable.

    Once again, amazing work mate. You're doing so much with this project, and meanwhile the PMP devs haven't done anything for the last few months. That may be why you're not getting a response from the PMP devs? They're supposedly releasing a new version of PMP.... One day.

    Might be easier to integrate with this, once the new version is released.

  • digitalhighdigitalhigh Posts: 300Members, Plex Pass Plex Pass

    @Flippage said:
    This is really coming along amazingly.

    One question in relation to:

    My intention as of right now is to package this as a self-contained version of XAMPP/LAMP/WAMP.

    How difficult is it going to be to set up on an existing XAMPP setup?

    I'm already running a webserver with all of my other apps, so I'd prefer not to have to setup a second instance, or to overwrite what I have.

    This is probably a bit early to be asking, but I figured I'd throw it out there. If you factor in that most people with Plex would probably have a webserver running already.

    Can't wait until this is ready to test with PMP :) - My excitement is palpable.

    Once again, amazing work mate. You're doing so much with this project, and meanwhile the PMP devs haven't done anything for the last few months. That may be why you're not getting a response from the PMP devs? They're supposedly releasing a new version of PMP.... One day.

    Might be easier to integrate with this, once the new version is released.

    Shouldn't be that difficult at all. You need CURL enabled. You need to suppress some warning messages, but those should be squashed on my end before release. It'll need a valid SSL certificate. And more than likely, I'm thinking my final implementation will need to be able to listen on a custom port, as I may wind up using the devices.xml endpoint directly on Plex in order to facilitate figuring out the IP address of the Phlex server. ;)

    Today, yesterday, I worked mainly on UI stuff and making the API.ai stuff smarter. There's now a button in Settings to allow deploying the API.ai config directly to their site in the event I update the code, etc. I have little "test" buttons set up to verify that Phlex can talk to Sonarr/CouchPotato/Plex/Etc. The login screen isn't just an ugly black voide.

    And for API.ai, I've now added the ability to detect multiple results for a search, and then ask you which one to play and respond by playing the title you stated, etc. It can now handle search requests directly, as well as most "play, stop, pause, skip, seek" commands. And, as I've mentioned, if you do not have a piece of media you requested to play, it'll ask if you want to download it...and then it'll download it.

    Behind all this is a lot of work to adhere to Google's requirements for conversation stuff. You have to queue the app to stop listening for requests after playing something or downloading something. You have to tell it to switch to a new intent when downloading or asking for results. It's a lot to learn in a short time.

    Still have to figure out how I handle the bit of linking up every individual Phlex server to a main one, which in turn handles the authorization between Google/Alexa and Phlex, and shuttles commands to the specific server. Fortunately, I can use a person's Plex username and password to authorize against Plex.tv, then pull the device list and find the public IP of the Phlex server, so I shouldn't have to personally cache any kind of information for anybody. I hope. I really don't want anybody's info, I just want this to work like an official app.

    So, that's what I'm working toward. Not just some hacky thing only master developers can install, but that anybody with the ability to install Plex can set up and use with minimal hassle.

    Anybody familiar with the process of google authorization...hit me up. That's next on my list to crack into - API # 6 or 7 to learn. :P

  • user654784user654784 Posts: 34Members ✭✭
    edited February 1

    but google assistant is coming very soon on shield, mibox and some others android tv and so don't need to have a google home anymore to use ok google. will it work with google assistant on the shield ?

  • digitalhighdigitalhigh Posts: 300Members, Plex Pass Plex Pass

    @user654784 said:
    but google assistant is coming very soon on shield, mibox and some others android tv and so don't need to have a google home anymore to use ok google. will it work with google assistant on the shield ?

    I can't say for certain, but if it's the exact same assistant, then I don't see why not. It works with the Assistant on my phone.

  • danjames92danjames92 Posts: 3,246Members, Plex Pass Plex Pass

    Can you just imagine:

    "Hey Alexa, I'm missing season 2 episode 5 of House, download it for me."

    the possibilities!

    Mac Mini (2.7GHz, Late 2012, Windows 10, Kodi DSPlayer) | SATV 16GB | Panasonic TX-P50GT50B | Yamaha RX-V675 | Q Acoustics 2010i (FL, FR, Left S, Right S), Q2000ci Center, Q2070si Sub

     

  • PhairmediaPhairmedia Posts: 229Members, Plex Pass Plex Pass

    @digitalhigh thanks for keeping us all updated on your progress :)
    will the first release come compatible with Alexa?

  • SCDemanettSCDemanett Posts: 11Members, Plex Pass Plex Pass

    This is progressing nicely awesome work @digitalhigh! I would like to suggest integration with SickRage which is a fork of SickBeard if possible. I of course could switch to Sonarr which I would like to check out anyway. Either way my primary use would be to tell it to play something from Plex, the downloads are just really nice additions. Rock 'n' roll!

  • digitalhighdigitalhigh Posts: 300Members, Plex Pass Plex Pass

    @danjames92 said:
    Can you just imagine:

    "Hey Alexa, I'm missing season 2 episode 5 of House, download it for me."

    the possibilities!

    Hmmm. That reminds me...I haven't actually set up "named episode" downloading yet, it just looks for series title. Maybe I should work on finishing out Sonarr stuff at some point in time today.

    @Main Plex said:
    @digitalhigh thanks for keeping us all updated on your progress :)
    will the first release come compatible with Alexa?

    I can't say for sure yet. I've been focusing on doing my homework for proper google Home integration first, as there's already somebody working on a proper Alexa skill for Plex in an official capacity. I think it really will depend on how different Google And Amazon's authentication systems are, and how complex it will be to add an account linking bit for Alexa like I'm working on with Google.

    Really, the only thing I'm using API.ai for is to strip the "I want to watch" and "Can you play's" off of my queries, the rest of the language parsing is all done manually by my code. :D

    @SCDemanett said:
    This is progressing nicely awesome work @digitalhigh! I would like to suggest integration with SickRage which is a fork of SickBeard if possible. I of course could switch to Sonarr which I would like to check out anyway. Either way my primary use would be to tell it to play something from Plex, the downloads are just really nice additions. Rock 'n' roll!

    SickRAGE. Check. Hopefully, as Sonarr is a fork of SB, they'll all use the same-ish API. That would be excellent.

    Also, started writing the "main server" component of this last night, today I intend on working out how to make it prompt to link to your Google/Plex account, then store a token to correlate all that data. Also posted on Stack Overflow, I should probably look and see if I got a reply there yet...my guess is somebody just ripping me a new one for not phrasing it correctly or posting it in the wrong section or something.

    Gotta love SO...

  • rossiniorrossinior Posts: 207Members, Plex Pass Plex Pass

    You just made it to my watchlist ;)

    Additional challenge for you: I am an Alexa user (and would require German language skill - which I would be willing to assist in translating).

    See my signature... my PMS is running locally on a QNAP NAS... a web server is already running on it... wouldn't that make a perfect place to put Phlex also to it? :)

    I really cannot wait see this being done.

    Of course, I would be willing to act as a BETA tester for Alexa development also... ;)

    Cheers.

    My plex settings:

    16TB QNAP PMS, 8 TB Buffalo Win2k12 PMS - 3x FireTV(2nd gen), 1x Android tablet, 1x Samsung S6 (Music, Movie, TV show libraries)

    My "small" feature wishes:
    -* multiple parallel filters using an advanced mechanism (AND/OR/NOT) combine different categories when using filters
    -* better collection (not only as a meta tag, movie grouping, searchable)
    -* user defined meta tags which can be assigned to standard tags but which do not get lost when updating the data (example) [I want to add "James Bond" to all James Bond movie titles without marking the titles as not changable; I would add information on different versions (Uncut, Extended, DC) of a movie to the movie title, I would like to add the role of a character, I want to add a user defined collection name without marking the standard field as not changable]
    -* flag to limit my search to the actual library which I am in when doing a search
    -* German plex skill for Alexa

  • PhairmediaPhairmedia Posts: 229Members, Plex Pass Plex Pass
    edited February 1

    @rossinior said:
    Of course, I would be willing to act as a BETA tester for Alexa development also... ;)

    I'd second this
    I have my own domain secure with a signed ssl
    All linked to idashboard so I can access htpc manager|omni|sonarr|couchpotato|mylar

    Windows 10

  • digitalhighdigitalhigh Posts: 300Members, Plex Pass Plex Pass

    @Main Plex said:

    @rossinior said:
    Of course, I would be willing to act as a BETA tester for Alexa development also... ;)

    I'd second this
    I have my own domain secure with a signed ssl
    All linked to idashboard so I can access htpc manager|omni|sonarr|couchpotato|mylar

    Windows 10

    iDashBoard?!?!?!

    Oh no, you need to be using Muximux. I hear one of the developers is a real standup guy. ;)

  • FlippageFlippage Posts: 69Members, Plex Pass Plex Pass

    This might be of interest to you @digitalhigh
    https://play.google.com/store/apps/details?id=com.atomjack.vcfp

    Seems you can use Tasker on android to link this to your Google Home.

    You have some competition ;)

    I don't have Android though, and his app doesn't support PMP either, so it's no use to me. Thought other people might be interested though. Competition is healthy. I'd still prefer to run this at the server level though, rather than relying on a phone app.

  • XmemphistoXXmemphistoX Posts: 23Members, Plex Pass Plex Pass

    Really hope this wont be too difficult to implement. I'm familiar with xampp and can create a ssl certificate but I hope that is enough.

  • digitalhighdigitalhigh Posts: 300Members, Plex Pass Plex Pass

    @XmemphistoX said:
    Really hope this wont be too difficult to implement. I'm familiar with xampp and can create a ssl certificate but I hope that is enough.

    As of right now, the SSL requirement will probably be going away.

    Today I'm working on "the main server" of Phlex, and integrating registration and google linking. It's fun...trust me.

    So far, I've got the "big boy" server set up and an SSL cert created for that.

    I have the "phlex client" application auto-registering it's IP address and the user's API token with the main server.

    I have API.ai pointed at the main server, and set up to require Google "account linking". This mostly works. You get a neat little card in the Google Home app that tells you to link your account. Click the card, it takes you to the main server, where you're then prompted to allow google to view your basic info. This redirects you to another page on the server where you need to re-enter your API key. Once you enter a valid API key, the Google token gets stored with your server IP and Phlex key.

    And for the moment, this is where I'm stuck. I can save all the data and associate the Google Token with Phlex key and IP. But, I'm fighting with Google to return the proper confirmation message to let them know that I have a key and that the account is linked.

    Once I sort that bit out, then I still have to write the mechanism that will take requests from API.ai, associate them with the user's Google Token, and then shuttle the request off to their individual server. But that part should be pretty easy.

    Similarly, I should be able to write a very very similar mechanism that utilizes Alexa's authorization system instead of Google, so I just need to look up a person's respective token in order to know where their server is.

    And the nicest part - I don't have to store ANY identifying data about you or your setup in order for it to work. As the client is written currently, the API token can only be used to send commands to Phlex, not access the UI, so the worst that could happen if the main server were compromised would be a person could download crappy movies or trigger player commands until the API key were reset on the client.

    All of this is very exciting for me. TBH, the concept of hosting a centralized server somewhere, as well as dealing with Google Auth and all this other stuff was a bit daunting. What started as a moderately simple project has become quite complex...so to have this part mostly worked out now is a big relief. I am hoping that in a few more days, I can have all the big moving pieces finalized and working so I can submit my Action to google for "for real" approval as an actual app.

    Y'know...versus a hacky implementation that requires hijacking the mic on your phone to do voice commands. Ain't nobody got time fo dat...

  • james.shoemakerjames.shoemaker Posts: 1Members

    This should really be implemented using a direct action rather than a conversation action, but the direct action API isn't open yet.

    James

  • Maximillion195Maximillion195 Posts: 7Members, Plex Pass Plex Pass
    edited February 3

    Hey All,

    I have made a small guide to get Google Home working with Plex. It's is a bit hacky and definitely no where near as amazing as digitalhigh's bespoke program sounds, but it just about works for anyone who desperate! :)

    https://www.reddit.com/r/googlehome/comments/5rfzkn/autovoice_voice_control_for_plex/

  • FlippageFlippage Posts: 69Members, Plex Pass Plex Pass

    @digitalhigh

    Did you see the new WebHooks?
    https://support.plex.tv/hc/en-us/articles/115002267687

    Can this make things easier for you?

  • herrerae0723herrerae0723 Posts: 3Members ✭✭

    For those of you with an echo Plex just became an Alex skill.

    https://www.plex.tv/alexa/

    Since I don't have an echo I'm still anxiously waiting for Phlex !

  • digitalhighdigitalhigh Posts: 300Members, Plex Pass Plex Pass

    @Flippage said:
    @digitalhigh

    Did you see the new WebHooks?
    https://support.plex.tv/hc/en-us/articles/115002267687

    Can this make things easier for you?

    Not...especially?

    No, the webhooks are more of a "update the status of other things on what Plex is doing" - from what I understood of the article.

    So, you've got a lighting system - you could auto-dim your light when plex sends a JSON message to controller X"s IP address saying playback has started.

    Hell, actually, I could do the same thing with Phlex...and the JSON format would even be similar! Although it could still be an interesting thing to play with for other purposes.

    Also, I saw the Alexa skill is available now too. Which is neat. But...does it download stuff you don't have?

    I could get all flustered and rush to release this just to say I had it out there now...but I think it'll wind up a much better product if I take my time and work on making this the best API-API interface out there. :D

    On that note - I'm noticing the "web app" for the actual Plex server is just .js files...I'm highly considering trying to convert all the work I've done so far into JS. Theoretically, I could just make this a bundle for Plex that you drop right onto your server, versus all the work of a separate instance and all that jazz. We'll see. It seems like every day is bringing big conceptual changes to this project.

  • theolympuservertheolympuserver Posts: 18Members, Plex Pass Plex Pass

    Hey, wanted to say thanks for your work and share some personal experience

    Having used sickbeard, the TPB sickbeard fork, sickrage, then finally landing on sonarr - I can say that for me nothing automated is going to be used too often. Kind of like sending text messages by voice commands, too many hooks needed for effectiveness. It may just be my personality, but the defaults on sonarr rarely ever serve me. When adding a series I sometimes want all past episodes, only future episodes, sometimes full HD, etc

    Also I never seem to be happy with couch potato for the same reason. I basically leave it as a metadata grabber / renamer but rarely ask it to go grab anything

    Anyway, not to discourage your work by any means, but after trying automation I mostly went to full manual for adding (except some tasks like renaming and sonarr which always finds new episodes without intervention already)

    Your project is exciting to follow. A bundle that you could drop in to your plex server that enables Plex playback on Google home would be very fun. Sometimes the best approach for multiple purpose apps is multiple apps. Just a thought. Thanks again for your work

Sign In or Register to comment.