IFTTT sends no identifying information like which device sent the command, so if you have multiple devices you could try using a jinja template that either looks for the name of the device in trigger.event.data.command or the absence of any device names to use the default device.
but if I want it to work on media_player.kitchen_tv or media_player.basement etc, I gotta parse trigger.event.data.command and figure out how to call the correct entity. I’ll have to dig into what a jinja template is. Also looks like I’ll have to add some delay in after the update sensor command. Not sure if it’s worth the hassle but I think I can make it work. I have it launching plex and it plays the selection on a hard coded device, but sometimes it sits at the plex screen if the plex client isn’t registered yet.
mayker
(maykar (pronounced "maker" with a southern accent))
304
Yeah, unfortunately plex clients aren’t advertised unless they are open and the time that plex recognizes them depends on a multitude of factors. Doing this automatically won’t be the easiest thing and may not always work, but other than opening the plex app on the device yourself it’s the only option.
I’ve managed to get this working nicely but it’s for 1 device specifically. I created a sensor to check if plex can see my living room roku as an available player
Then have the plex assistant action keep checking the value of that sensor and running update sensor until it is true before having plex assistant do it’s magic.
edit- well this worked until I got more plex clients and my living room could show up at [1] or [2],etc. I need to fix my sensor but I don’t know how to search through the different attributes.
edit2 - I cut it off at [‘Plex Clients’] then pipe to string then pipe to regex search and it’s working
This is really interesting! I was longing for Plex to support this out of the box, but thank you for doing this yourself!
I’m having issues in setting this up though.
I followed the guide, configured as a DialogFlow integration, but I always get the error “this intent is not yet configured in Home Assistant” and in home assistant itself I see in the log an error [homeassistant.components.dialogflow] Unknown intent Plex
The weird thing I noticed is that, in the DialogFlow console, when I put the intent “Plex” as the implicit one, it’s not get saved. It only show “Default Welcome Intent” in the drop down.
Explicit Invocation looks ok instead.
Edit 2:
I managed to progress a bit more by creating an intent script for Plex, not PlexAssistant as the guide states.
I still get an error though in the logs Error handling Plex and Error executing script: connection refused
I’m connecting to the local address of the server, and ssl is not required for local network connections, so I don’t know why this happens.
mayker
(maykar (pronounced "maker" with a southern accent))
307
To be fair the intent was always named “plex” in the readme for DialogFlow, but in the “Home Assistant Conversation Setup” it was named “PlexAssistant”. I updated the readme to avoid confusion.
What is the full error you are receiving? Click on it to expand if you need to.
As far as DialogFlow setup, if that is where the errors are happening (in the DialogFlow component and not Plex Assistant), it can be finicky and should only be used if your language isn’t supported by IFTTT. Best advice I can give is to follow the instructions exactly, no more, no less.
The IP is the right one: I’m not using localhost but the right address from the server. It’s a weird error indeed.
Plex runs on a Shield, it’s in a separate machine from where HA runs.
EDIT: the address I removed was showing the right IP. I was just wondering if some private info were there
mayker
(maykar (pronounced "maker" with a southern accent))
311
Using a browser on a different machine, can you connect to your Plex server’s API? Adding your info in the URL below, do you see anything?
http://[IP]:[PORT]/?X-Plex-Token=[TOKEN]
If not, there are connection issues unrelated to Plex Assistant.
Ok, some steps forward. Probably the issue was the client in my LG Tv.
I tried with the Cast device, and it actually started something, but it’s not the “real” plex client, it’s using the Shield as a chromecast device.
The sensor.plex_assistant is not picking up the actual Plex client running on the Shield. I’ve tried waiting, while playing some content, but it never shows up. Web Clients are shown.
I will probably try again setting back DialogFlow again with the cast device, but the chance to use the real Plex client would be much better.
Is there anything that I can do to help troubleshooting this issue?
So is this about finding the Plex client to control? Is the Shield on a different subnet than the Plex server?
mayker
(maykar (pronounced "maker" with a southern accent))
317
All the sensor is doing is using Plex API to poll your Plex server for available clients. The sensor is updated manually and can only see what is reported by Plex. Plex Assistant also polls Plex for clients on every command.
Eventually the ID for the Plex Client running on the shield showed up. I was able to send some commands to it through Plex Assistant, but it’s not working well - I imagine mostly due to the language used, that even if supported by DialogFlow, is not working that well.
I also set the DialogFlow to work in English, but again the results are inconsistent.
Whenever I tell google assistant to play something, it says “ok, starting the test app” - then my app responds with “ok, what is the command?”. I thought I could just say the damn thing once instead of twice. What am I doing wrong?
mayker
(maykar (pronounced "maker" with a southern accent))
321
@diogo.rg Not sure why it isn’t finding your devices, could be they are on a different subnet? The next version of Plex Assistant will use media_player entities instead of searching for devices thanks to some upcoming changes in HA and PlexAPI.
@ciB DialogFlow is finicky and unless you need to use it (your language isn’t supported by IFTTT) then use IFTTT. Otherwise, delete the DialogFlow agent and start over, follow the directions and don’t do anything extra. Exit out of the DialogFlow window after following the directions.