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.)

digitalhighdigitalhigh Members, Plex Pass Posts: 288 Plex Pass

README

Introduction

What is Phlex? Phlex stands for Personal Home Language EXtension. I mean, I guess. I literally just made that up. Also, it sounds cool.

Aside from being a made-up name that sounds cool, The purpose of Phlex is to provide a natural language interface for Home Theater applications - effectively bridging the current gap between commercial AI Solutions like Google Home/Alexa and personal web applications like Plex, Couchpotato, and Sonarr.

Or, in short - you can watch and download movies and shows just by telling your phone to do so.

Phlex Demo #2

image

image

image

image

image

image

image

Installation

NOTE: YOUR config.ini.php file is IMPORTANT. DO NOT DELETE OR REMOVE THIS FILE ONCE YOU'VE GOT PHLEX RUNNING. IF UPDATING, KEEP A COPY OF THIS FILE AND REPLACE IT. REMOVING THIS FILE WILL ABSOLUTELY BREAK ACCOUNT LINKING FOR GOOGLE ASSISTANT.

There are many ways you can install Phlex, here are a few options.

Using Docker

There is a docker image available. Refer to the image documentation to get started.

Using XAMPP

Phlex requires a webserver and PHP 7.0+ with CURL and SSH enabled in order to work correctly.

For Cast Device Control, you will also need to enable the Sockets module.

For most use cases, XAMPP is going to be the easiest options.

XAMPP is a free, cross-platform web server package, and can be found here: https://www.apachefriends.org/index.html

When installing XAMPP, we only require the PHP and Apache features. You can uncheck the rest of the options in installation if you have no need for them:

MySQL, FileZilla FTP Server, Mercury Mail Server, Tomcat, Perl, phpMyAdmin, Webalizer, Fake Sendmail...ain't nobody got time fo dat.

Once installed, clone or download the Phlex directory to the root web directory of XAMPP, which should be the /htdocs folder. When done, the path should be something like C:\xampp\htdocs\phlex (windows) or usr/home/xampp/htdocs/phlex (linux).

That should be it. You can now restart the apache service for your webserver, and browse to your Phlex installation at 'http://yourserveraddress:80/Phlex'.

To log in, enter your Plex username and password.

If you are running Phlex on an existing webserver, Phlex PHP version 7.0 and up. Phlex will also require r/w access to the root of the /Phlex directory for configuration and logging purposes.
You will also need the CURL and openSSL extensions enabled, and sockets if you have any Cast devices. If you're not using Xampp, you may also need to enable the xml module.

Using a Raspberry Pi

(Thanks to giac0m0 for the writeup)

Check version of PHP

  1. On the Raspberry Pi, check version of PHP

    php -v
    
  2. If PHP is not v7.0, remove PHP and install 7.0

    sudo apt-get remove php*
    

Install PHP v7.0 and plugins needed

  1. Install Apache and PHP7.0 using instructions from site: https://www.stewright.me/2016/03/turn-raspberry-pi-3-php-7-powered-web-server/

  2. Install PHP XML (missing from previous guide)

    sudo apt-get install php-xml
    
  3. Change ownership of Phlex folder to www-data

    sudo chown -R www-data /var/www/html/Phlex/
    
  4. Add writeable folders to /etc/php/7.0/apache2/php.ini

    Add this line to the file, near the guidance notes for open_basedir :

    open_basedir = /var/www/html/Phlex/
    
  5. Edit php.ini for Dynamic Extensions. Add lines:

    extension=curl.so
    extension=openssl.so
    

Restart web server

    sudo service apache2 restart

Updating

Congratulations. If you installed Phlex via git or Docker, you're all set. Go into settings, click the "Auto update" toggle, and go to town!

If you installed from a .zip file, it is important to not delete config.ini.php, as this is where your server's API token is stored, which is used to associate your local Phlex client with your Google account.

Post-Installation (Network Stuff)

Port forwarding

First, you'll need to forward IP traffic to port 80 on the computer where Phlex is running. You do not have to forward port 80 to port 80, you can choose any open port you like.

If you wish to change the listening port for Phlex to something other than 80, you can do so in the Xampp control panel by clicking the "config" button next to Apache, and then opening httpd.conf.

In httpd.conf, you will see a line that reads "Listen 80". Change 80 to whichever port you want. Restart apache, and forward to that port. If you are on Windows, you will need to make a rule in Windows Firewall to allow that port's traffic as well.

MDNS/Multicast/Cast Discovery

Chromecasts are fun devices. They're fun for this project because they use Multicast DNS (Aka Bonjour, Aka Avahii, Aka Zeroconf) in order to talk to one another on a home network.

On a very basic home network with just one router and everything connected via wifi, MDNS usually just works. Usually.

However, there are thousands of different router manufactureres, and thousands of different network configurations that could play a part in how well your cast devices will talk with Phlex.

If you are experiencing issues with cast devices not showing up in Phlex, you should first verify that the php sockets module is installed and enabled. If you used XAMPP, it should be included, you just need to edit your php.ini file to enable it.

If you used an alternative webserver option, google it.

If sockets are enabled and you STILL can't see all of your cast devices, I would suggest looking in the web UI for your router and looking for any setting related to "multicast filtering", "bonjour","or MDNS discovery". Most of them should support it, it may just need to be enabled.

Setting it up with Google Assistant

Log into Phlex with your Plex.tv username and password.
Click on the gear icon to open settings.
In settings, under the general tab, make sure you fill in the "Public Address" box with the FULL address of your Phlex server. Typically, you will just need to append /Phlex to the directory path, and a port if you changed it to something other than 80.

For example

273.482.234.33:66678/Phlex

If you've set up a domain with reverse proxy, then just put the url you've setup

my.domain.com/Phlex

Or

phlex.my.domain.com

It is important to try the URL you are providing for "public address" before attempting to link your Google account. If the address is not accessible via a device that is not on your local network (your cell phone with the wifi turned off), then I can't talk to your Phlex client, and the server will refuse to link your account.

Once you've got the address entered, click the "register server" button. Your server address will be sent to the Phlex Mothership and verified, and if I determine your client is set up correctly for communication, will register you with the db and forward you to google to link your account.

Once this is done, you just need to ask your Google Assistant to "Talk to Flex TV". This is the invocation name you will use to talk to Phlex.

You should now be prompted to link your Google account(again).

Open the Google Home app on your phone, and look for the card prompting you to link your account. Go through that, and you should be all linked up!

Boom. You can now talk to Phlex by saying things like "Ask Flex TV to play batman begins" or "Ask Flex TV to play the lastest episode of THe Big Bang Theory". I'll be adding a wiki page for voice commands as time allows.

Multiple Google Home Users

If you have multiple people in your household, it's possible to allow them to link their account to your Phlex instance, without having them create their own Plex.tv account.
All you need to do is have them sign into the Phlex UI from a device linked to their Google account. Go into settings, click the "link server" button, and have them select their own Google account.

Now have them ask to talk to Flex TV through Assistant, and finish linking their account through the Ghome app.

This can be repeated for as many users as you have in your household.

Google Assistant Examples

When talking with Google Assistant, your speech is parsed using API.ai's natural language processing, meaning Phlex is always getting better! Below are just a few examples of the type of things you can ask Flex TV to do.

OK Google, Ask Flex TV to play Batman Begins.

OK Google, Tell Flex TV to play the latest episode of Game of Thrones.

Ok Google, Ask Flex TV to play Enter Sandman by Metallica.

Ok Google, Ask Flex TV to play Eminem.

Ok Google, Ask Flex TV to play The Slim Shady LP.

OK Google, Ask Flex TV to pause playback.

OK Google, Ask Flex TV to stop playback.

OK Google, Ask Flex TV to set the volume to 80%.

OK Google, Ask Flex TV turn the volume down.

OK Google, Ask Flex TV to turn on a Bill Murray movie.

OK Google, Ask Flex TV to fire up a Comedy.

OK Google, Ask Flex TV to play a movie.

OK Google, Ask Flex TV to play season 4 episode 3 of The Simpsons.

OK Google, Ask Flex TV to download the show Alf.

OK Google, Ask Flex TV to download Season 2 Episode 5 of the show The Americans.

OK Google, Ask Flex TV to fetch The Avengers Age of Ultron.

OK Google, Ask Flex TV what's playing.

OK Google, Ask Flex TV what the name of this movie is.

OK Google, Tell Flex TV I want to watch Frozen From 1 Hour and 45 Minutes.

OK Google, Ask Flex TV if I have any new movies.

OK Google, Ask Flex TV What's on deck.

Amazon Alexa

If you're reading this because you suddenly noticed that there is mention of Alexa floating around, you're in luck!

I'm currently looking for beta testers from both the US and UK to help work out bugs with Flex TV as I await certification from Amazon.

Trigger phrases

Below are all of the recognized trigger phrases for Google Assistant commands.

(Note, these values are always expanding, so you may want to try other "synonyms" for these phrases!)

"Play":

"I want to watch",
"I feel like watching",
"do I have",
"can you fire up",
"can you play",
"start",
"turn on",
"put on",
"throw on",
"find",
"can you find",
"cast"

"Resume":

"Play",
"Resume",
"Start",
"Continue"

"Pause":

"Pause"

"Stop":

"Stop Playback",
"Halt",
"End Playback",
"Cease",
"Desist"

"Skip Forward":

"Skip Forward",
"Skip Ahead",
"Jump Ahead",
"Next Chapter"

"Skip Backward":

"Skip Backward",
"Skip Back",
"Jump Back",
"Previous Chapter"

"Seek Forward":

"Seek Forward",
"Fast Forward",
"Step Forward",
"Seek Ahead"

"Seek Backward":

"Seek Backward",
"Rewind",
"Step Backward",
"Step Back"

"Jump To": // Not Implemented Yet

"Jump To",
"Seek To",
"Skip To",
"Fast Forward To",
"Rewind To",
"Go Back To"

"Stop":

"stop"

"Volume":

"set the volume",
"adjust the volume",
"turn the volume down",
"turn the volume up",
"turn it up",
"turn it down"

"Fetch":

"fetch",
"I want to download",
"can you download",
"download",
"grab",
"****",
"pirate",
"add",
"snag"

"Change Player"/"Change Server":

"switch player",
"choose player",
"change player",
"select player",
"pick player",
"swap player"

"Currently playing":

"What's playing?",
"What's on?",
"What is playing?",
"What is on?",
"What am I watching?",
"What movie is on?",
"What show is on?",
"Am I watching something?",
"Can you tell me what this movie is called?",
"Can you tell me what this show is called?",
"What is this called?",
"what the name of this"

"New Media":

"What new TYPE",
"have any new TYPE",
"What's new?",
"what is new",
"recent",
"recently added",
"just added"

"On Deck Items":

"ondeck",
"What's on deck",
"What is on deck",
"up next"

"DVR Control":

"dvr",
"Record Jeopardy",
"DVR Family Guy"

"What's airing":

"What's on TV tonight?",
"What's airing on Friday?",
"What's dvred this weekend?",
"What's recorded tomorrow?",
"What's scheduled on Sunday?"

(Note - What's airing commands work with Plex DVR, Sonarr, and Sickrage)

"Help":

Setting up IFTTT With Phlex (UPDATED)

  1. Head on over to https://ifttt.com/ and create an account.
  2. Go to the "applets" page.
  3. Click "New applet".
  4. Click the blue + button for IF THIS.
  5. Search for "Assistant".
  6. "Say a phrase with a Text Ingredient".
  7. What do you want to say:

    • Language parsing has been updated to use API.ai for all commands, so no need for separate URL's for separate commands.
    • Depends on the command you want to use. I use "Tell Plex to", "I want to watch", and I want to download" for playback, control, and fetch commands respectively.
    • You can mostly use whatever you want, but some triggers are reserved - these should work.
    • Put the $ sign where the thing you're sending to Phlex goes.
    • > "Tell plex to $"
  8. Save it.

  9. Click the "then that" button.

  10. Search for "Maker".

  11. Pick "Make a web request", the only option.

  12. Open the Phlex web UI, click the button under "Click to copy IFTTT URL:". The URL should be copied to your clipboard, and look something like this:

    http://{YOUR_SERVER_ADDRESS}/Phlex/api.php?say&apiToken=asdfaksdfjasae670a877d1a1e5931f5cbf326c&command={{TextField}}

  13. The "say" paramater tells Phlex to parse the command with API.ai, giving your greater flexibility over your commands. If you wish to use the "legacy" paramaters, you can replace 'say' with either 'play','control', or 'fetch' to create specific commands for those triggers.

  14. Click "Create Action", test it out.

  15. Repeat for a download and "control playback" command.

SUPPORT

For general help with installation, setup, or questions, head on over to the Plex forums and drop me a line.

https://forums.plex.tv/discussion/252910/phlex-google-home-plex-integration-with-support-for-sonarr-couchpotato-etc-now-live/

Reporting Issues

If you think you've found a bug or would like to make a feature request, feel free to use the issue tracker to let me know. When posting an issue, try to include the following information:

  1. On what OS are you running Phlex?
  2. Are you using a new instance of XAMPP, or an existing webserver?
    • If Using an existing Webserver, have you ensured the proper modules are enabled and installed, and that PHP can read and write to the /Phlex directory?
  3. If you're having issues communicating with a specific instance of Plex/Couchpotato/Sonarr/etc. - tell me the OS you're running that app on.
  4. Is Phlex using http or https?
  5. If you're having issues with a specific command, please note the timestamp in the web UI, and take a look at Phlex and Phlex_error.log files. Paste anything that looks related as well.

DONATIONS

Phlex/Flex TV is currently a one-person operation. There is no big team of people, there are no slick corporate sponsors. I cannot stand ad-sponsored projects or "freemium" apps, and will never try to use this garbage to gain revenue from users.

However, this is a massive undertaking, and has snowballed enormously from a simple IFTTT hook/script to the project you now see today.

SO, If you really really like this project and want to show a little love, you can send money via paypal to donate.to.digitalhigh@gmail.com.

This address is for donations only, if you need support, please look above for information on how to ask for it.

«13456756

Answers

  • JasonMeudtJasonMeudt Members, Plex Pass Posts: 217 Plex Pass
    edited January 6

    @digitalhigh said:

    What other apps besides plex/sonarr/couchpotato should it support? Ideally, they should have some kind of documented API that's not ridiculously complicated, and I can construct the queries needed to talk to them. ;)

    Nice work so far! I'm looking forward to seeing this grow!

    How do you intend to deal with Plex Home users and would the playback intent go to whomever is currently logged in?

    As far as what programs to integrate, how about Ombi (PlexRequests), and maybe PlexPy, although I am not sure what good the latter would do from a player's perspective and the former's usage would be tied to Sonarr/CouchPotato...

    • Intel Core i7 4790 @ 3.6 Mhz (Plex Server)
    • Netgear R7000 (Tomato by Toastman firmware)
    • 2x Google Chromecast V2 (Media Player)
    • 3x Roku (Media Player)
    • 10 TB of Storage Space
  • digitalhighdigitalhigh Members, Plex Pass Posts: 288 Plex Pass

    @JasonMeudt said:

    @digitalhigh said:

    What other apps besides plex/sonarr/couchpotato should it support? Ideally, they should have some kind of documented API that's not ridiculously complicated, and I can construct the queries needed to talk to them. ;)

    Nice work so far! I'm looking forward to seeing this grow!

    How do you intend to deal with Plex Home users and would the playback intent go to whomever is currently logged in?

    As far as what programs to integrate, how about Ombi (PlexRequests), and maybe PlexPy, although I am not sure what good the latter would do from a player's perspective and the former's usage would be tied to Sonarr/CouchPotato...

    Well, added more phrase handlers today, so it should now respond to "I want to watch a movie", I want to watch a show", and/or "I want to watch a new movie" and "I want to watch a new show" - these phrases will trigger the searching and playing of a random movie or series.

    Also, it should be noted that "I want to watch" is a customizeable trigger word, so you could change it to something like "Start playing a movie" or "beam a movie to the TV".

    To answer your question - I have no idea at this time. I'm still learning all the fun things I can do with the Plex API, as well as how to do it.

    Like - does anybody have any idea the proper way to set headers to send a "play" command to a web or PHT player? This works like a charm on Android TV devices, but I'm getting some funky stuff when I try to send it to web players. But, I'll figure it out eventually.

    So, handling users - as I think about it, I can probably read the available Plex Home users, and then allow you to select who to assign stuff to when using voice commands. That would make the most sense, as Google Home only allows one user to be the brains of everything anyway. OR, to make it more flexible, assuming I can read the list of users, we could theroetically assign a PHP handler to each person's name as a parameter of our GET command.

    Yeah, that sounds fun.

    For Ombi - I will see if they have a dedicated API that would allow passing show/movie names to it in lieu of CP/sonarr/etc, which would definitely make it easier on me in terms of how I request what media. I'd still want to have direct calls to CP and Sonarr in case people don't have or don't want to set up Ombi. I know it was a PITA for me to get set up on my Synology,, and I refused to have one webapp running on my server. But I'm rambling. I will look at Ombi and see if we can be friends with it.

    For PlexPy - I'm curious what it is we want to be able to ask about. I was under the impression that PlexPy/Plexivity is basically just an interface for the data that Plex already contains. Is there some specific information we can get from it that can't be gotten directly from Plex? More importantly, is there an API to get that information from it?

    Again - I'll check it out in time. Thanks for the feedback. :D

  • omareiomarei Members, Plex Pass Posts: 2 Plex Pass

    @digitalhigh Looks good and has a lot of potential.
    Name: Phlex :p

    Keep it up :)

  • kevman95kevman95 Validating, Plex Pass Posts: 7 Plex Pass

    This is awesome! Thank you for doing this, this has been something ive been looking for for awhile! :)

    Does this support playing to the chromcast client as well? Should definitely add that if not!

    Phlex also sounds like a good name to use for this.

    Cannot wait for some sort of release!

  • GuSoCastilloGuSoCastillo Members Posts: 2

    How abou sickrage integration? and place all in a docker package, that would be awesome

  • skipbrannanskipbrannan Members Posts: 1

    Great work! I use my plex server only as my audio library. Will it support playing full albums/individual songs/songs by certain artists, etc. that I have in my library?

  • JasonMeudtJasonMeudt Members, Plex Pass Posts: 217 Plex Pass

    @digitalhigh said:

    Well, added more phrase handlers today, so it should now respond to "I want to watch a movie", I want to watch a show", and/or "I want to watch a new movie" and "I want to watch a new show" - these phrases will trigger the searching and playing of a random movie or series.

    Also, it should be noted that "I want to watch" is a customizeable trigger word, so you could change it to something like "Start playing a movie" or "beam a movie to the TV".

    Just checking... Do you have your current work up on GitHub or ...?

    • Intel Core i7 4790 @ 3.6 Mhz (Plex Server)
    • Netgear R7000 (Tomato by Toastman firmware)
    • 2x Google Chromecast V2 (Media Player)
    • 3x Roku (Media Player)
    • 10 TB of Storage Space
  • chetstrikerchetstriker Members, Plex Pass Posts: 3 Plex Pass

    Thanks for your work on this, this is super exciting.

  • ifollettifollett Members Posts: 1

    @chetstriker said:
    Thanks for your work on this, this is super exciting.

    Second this.

    @JasonMeudt said:

    Just checking... Do you have your current work up on GitHub or ...?

    Looking forward to a code release and eager to help contribute.

  • digitalhighdigitalhigh Members, Plex Pass Posts: 288 Plex Pass

    http://i803.photobucket.com/albums/yy318/d8ahazard/Screen2.png

    So, lots more work done in the past days, both on the UI portion and the backend's ability to handle all the commands I can think of (within reason).

    Still focusing just on Plex, but as you can see from my more slightly polished screenshots, I've now standardized the return object generated from queries, allowing me to parse it and display it all pretty-like in the UI. Clicking the little "Json" bit in a return will show the full JSON object. :D

    Commands now support "the latest/newest/new" "season/episode" of "tvshow", " a movie" "with/featuring/starring" "actor". I spent the first half of the day doing the JSON return stuff, and a portion of the afternoon making the display nice and responsive, so it works as well on the phone as it does on the PC. And the commands...Oh, it's so buttery.

    I started with the hooks for "play/pause/stop/skip/volume" as well. Working out a command that didn't feel too awkward on IFTTT was probably the harder part - I settled on using "Tell plex to " "pause the movie." "Tell plex to set the volume to 70%.". Etc. You can replace "tell plex to" with whatever you want via IFTTT, it's just what I picked.

    Um - no, the code is not on github yet. I wanted to get this somewhat workable, and iron out all the bugs in the ginormous challenge of figuring out a way to parse a multitude of text commands in a logical way, and still write code that isn't 100% embarrassing. ;)

    In addition to this now, I've also contributed heavily to the app Muximux, so much that it's due for a 2.0 release just as soon as I go squash a few last bugs on it. So, I want to finish that up first, which isn't a lot, I've just been distracted. Once that's done, I need to add "random movie by year" - which should be easy now that I've got the "random movie by actor" bit worked out.

    Once THAT is done, I want to add the couchpotato support I've already working via Scriptr.IO+IFTTT, and maybe Sonarr if CP doesn't snowball too badly.

    Point is - I tend to get a lot of scope creep, and my coding methods are sometimes unorthodoxed and messy. I hack stuff together till it works, then go back over it obsessively and refine it...then release.

    But, I promise you, I'll put up a commit in a few days. I've made a lot of progress today and yesterday, so tomorrow should be even more fun.

    Stay tuned. XD

  • digitalhighdigitalhigh Members, Plex Pass Posts: 288 Plex Pass

    Oh, I get it. You can just use plain old HTML code to insert stuff here. Neato.

    So, did some work on the UI today, think I'm happy with the overall idea. The main screen is where you can test your various commands, do debugging, and generally figure out what is and isn't going to work for you. Still want to tweak the colors, I hate that shade of green.

    Added filtering options for seasons as pictured somewhere below - you can say "I want to watch the third season of game of thrones" - and it'll start that season. I'm currently working out filtering for "the tenth episode", and eventually " season XX" episode xx" - although I'm not sure how many people know that off the top o their heads.

    Playback controls are now implemented and working wonderfully. You can say "set the volume to XX percent", "fast forward", "rewind", and a number of combinations of "jump, seek, skip" and "ahead, back, forward, backwards" to control back/forward control.

    I still want to work out searching by year, then I can jump onto CouchPotato and Sonarr, then think about making this public.

    But, for now, check out the pretty screenshots...

    photo Phlex1.png

    photo Phlex6.png

    photo Phlex2.png

    photo Phlex5.png

    photo Phlex4.png

    photo Phlex3.png

  • XmemphistoXXmemphistoX Members, Plex Pass Posts: 23 Plex Pass

    Once it's released - How do you integrate this? This is awesome by the way!

  • digitalhighdigitalhigh Members, Plex Pass Posts: 288 Plex Pass

    To integrated, you need to do a couple things. Your Plex server needs to be accessible from the internet, which is pretty common. You will need to run some kind of web server that can handle PHP. you will have to have your web server be available via the Internet. You then set up if this then that to point at your web server, with a trigger like "I want to watch" for playback comma and "tell Plex to" for commands, which then forwards the command on to the web server, and talks with Plex.

  • XmemphistoXXmemphistoX Members, Plex Pass Posts: 23 Plex Pass
    edited January 9

    Ahh gotcha. Thanks for the diagram. Can't wait for this! Will it support multiple plex clients (IE multi rooms) or would it be best to create more than one Webserver per plex client with a different unique IFTTT command?

  • FlippageFlippage Members, Plex Pass Posts: 69 Plex Pass

    Hey @digitalhigh

    Any update on this one?

    This looks really promising, and exactly what I was hoping for when I bought the Google Home.

    Any chance of getting a beta of this? Are you still working on it?

  • lolcatzurulolcatzuru Members Posts: 9 ✭✭

    Hey im also really really interested in this, i'd also be willing to donate if itll help get this out!

  • digitalhighdigitalhigh Members, Plex Pass Posts: 288 Plex Pass
    edited January 13

    @Flippage said:
    Hey @digitalhigh

    Any update on this one?

    This looks really promising, and exactly what I was hoping for when I bought the Google Home.

    Any chance of getting a beta of this? Are you still working on it?

    Actually, yes. I've been tearing through my code on this, adding, polishing, tweaking, improving. I've done a number of things since last checking in.

    I've now incorporated a direct login with your plex username to the portal for configuration. You go to the page for your Phlex server, log in with your Plex credentials. I then generate some session data to associate your creds with your token and preferences, and bladow - anybody who can use your server can log into it and customize commands for their device which is tied directly to their plex account.

    Additionally, I've got the generation and authentication mechanism in place so that once a user has logged in, they can get an API key that will allow Plex-authenticated voice commands without having to store your creds on IFTTT/etc.

    For Media searching, I literally went off the deep end and back again trying to account for a bajillion different requests and phrases - stuff as complex as "I want to watch season 1 episode 2 of Game of thrones from 15 minutes and 45 seconds in". I had trouble getting google to figure out that I was using my IFTTT command because this was so long, but typing it into the web UI works no problem, so the issue there is on Google's end, not mine. :D

    But you can easily say "I want to watch Goonies from the beginning." or "I want to watch Goonies from 1 hour 45 minutes and 33 seconds", and it will start Goonies at 1:45:33.

    I've done a ton of work on handling multiple results as well, whereas before I'd just kinda grab the first result, I've now refined it to the point of looking for the exact match first, then expanding to other results if none are found.

    Similarly, while small and nuanced, I can now say "I want to watch a Bill Murray Movie" or "A movie with Bill Murray", or really just say "Bill Murray", or "Bill Murray" and "Movie", etc.

    What about if there are two movies with the exact same name, but you want to watch the new one that came out this year? Well then, say the name of the movie followed by the year. Because nobody wants to watch "Passengers" that was made in 2008... XD

    I've still got a lot of work to do. Right now, the login page is ugly as sin and has zero styling or design whatsoever.

    As a result of needing to check the status of the player I'm requesting to play stuff to, I figured I might as well build a little "Now Playing" bar into the WebUI. I'm currently checking the result of the "play" command, but that will return a positive result as long as the request is well-formed - it doesn't actually tell you if what you wanted to play started playing.

    Which brings me to the biggest issue I'm currently facing - which is that I can only send media for playback to my Shield currently. I have not tested with my Nexus Player, but have been working to get the same results with a copy of Plex Media Player I've got installed on my computer downstairs. (It's running server 2016, so no store app). But, I really, really, really want this to be able to do anything you can do from the regular plex web app, so I'll keep talking to people who know more about Plex than I do and see what I'm doing wrong. As of right now, I can see from the logs that my commands are making it where they need to go and they're recognized as coming from a valid Plex device, so that's good.

    But, for those of you running an Android-based version of the Plex app, it should work right now. The rest are WIP.

    Here are a couple of screenshots. I still have a lot of UI work to do...like I said, I want to add an actual poll to the designated player so you can see that commands are working all proper-like. I want the web UI to display not only the results of commands entered directly, but also fired by the API, so that any weirdness with other apps is easy to figure out. Right now, the list of clients is only updated when the page is loaded - I need to make it load every time you click the dropdown menu for the players. Same with settings - now that I'm able to scrape data directly from Plex.tv, there's no reason to have to enter that info into Settings - just pick the main server from the dropdown and go.

    And the text parsing. While a lot of it works wonderfully, the more complex commands still cause some quirky results. Or, on the programming side, it'd be better to say that not every successful command will return a successful JSON array containing any and all relevant data needed to debug unsuccessful commands. Additionally, a uniform response system would ensure that future compatibility with AI/assistants could include smarter responses.

    Here's the initial screen after login.


    photo Phlex14.png

    A simple, single-title search with no modifier.


    photo Phlex10.png

    A more complex search, with series name, episode/season designator, and a starting offset


    You can also see the dropdown where you can select the command set to test/send. (Media, control, fetch).

    photo Phlex11.png

    An nth-selector, asking for the most recent episode of a series


    photo Phlex12.png

    Indicate that you want to resume playback from the currently saved offset


    photo Phlex13.png

    The same query, only with a general indicator to start at the begnning


    photo Phlex15.png

    Mobile-responsive version

    photo Phlex16.png

  • digitalhighdigitalhigh Members, Plex Pass Posts: 288 Plex Pass

    Oh yeah, and I've got an array built up out of the genres in my library, I just need to add a bit in my parser to look for those keywords and return a random movie in that category. Same for year. ;)

  • drummondstdrummondst Members, Plex Pass Posts: 32 Plex Pass

    This all looks great! I am very eager to get a hold of this. Is Chromecast support on your roadmap? or Searching multiple servers?

    Also I would be very willing to help alpha/beta test if you are looking for volunteers!

  • digitalhighdigitalhigh Members, Plex Pass Posts: 288 Plex Pass

    @drummondst said:
    This all looks great! I am very eager to get a hold of this. Is Chromecast support on your roadmap? or Searching multiple servers?

    Also I would be very willing to help alpha/beta test if you are looking for volunteers!

    Once I get all/more Plex player types working, I'll consider looking at the cast protocol. Multiple servers should be easy.

    Beta testers... Not ready yet, but anybody volunteering should have an Android player and some technical knowledge to help debug stuff.

«13456756
Sign In or Register to comment.