❱ Plex Assistant

@GFawkes Take a look at the automations in the IFTTT & DialogFlow sections of the readme. This component takes in a string as a command.

@pergola.fabio will check it out

Sorry for reviving this – quick question. Is this error isolated to IFTTT? Would dialogflow be affected as well?

Both would be affected. I know what’s causing it and should have a fix later today

@mayker Thanks very much. Sorry I had not expanded those sections, so i missed the info.

After a bit of head scratching around the Plex Device id i have it working with a roll of duck - tape. :slight_smile:

Ill do a proper job integrating it with Rhasspy voice assistant at the weekend, but am happy that this will be much better than the integrated solution.

So i get to keep my foil hat.

Thanks again.

Omg how could I have missed this for months… I was looking for this for a few weeks now (I was actually hoping on FlexTV to work as it supposedly has sonarr/radarr support with Google Assistant, but I have never seemed to get the assistant working on FlexTV, though I did manage to install the software and run it).

I also believe there was some interest in doing something like this for Ombi (if you don’t know ombi and you use plex/sonarr/radarr this is a MUST have).

I will definitely try this as this will solve my search for at least 1/3d thanks!

I’m sorry for coming back to this…

I set the cast delay for my device to 10 seconds, same grey screen. Jumped it to 20 just to be sure, and same grey screen… Am I doing something wrong?

Have you tried a cast delay of less than 10 seconds? If you’re using a chromecast ultra I would think that it would be less than that. Others with ultras have had success with a cast delay of 3 seconds.

FlexTV hasn’t been in working order or updated in quite some time, which is one of the main reasons I created this.

Please consider making a PR to Plex Assistant’s readme on Github with instructions on how to use it with Rhasspy or at least share it here. I’m sure others would find it useful.

After much trial and error, I finally have Home Assistant running in Docker for Windows, and I’ve gotten the Plex_Assistant and sensor set up and working. I can use the Developer Tools “Call Service” test to get media to play on my Android phone or on my web browser, which show up as “Plex Clients” on the sensor.

But… I can’t get any of my three Chromecast devices to be detected by the sensor. It shows up as “Cast Devices: None”. Oddly, if I use the “PlexURL/clients?x-token” trick, the cast devices don’t show up there either, even though I can cast media to all three of them from my browser or from the android Plex app. They aren’t even detected after playing a show on them for half an hour.

The only thing that shows up in the logs when I manually send an “update sensor” command is:

2020-08-01 03:38:35 DEBUG (SyncWorker_6) [custom_components.plex_assistant] Command: update sensor
2020-08-01 03:38:37 ERROR (MainThread) [frontend.js.latest.202007160] http://[plex IP address]/frontend_latest/chunk.cf565e41b8a8dce0642a.js:133:238 Uncaught TypeError: Cannot read property 'header' of null

And I have no idea what that means, or if it’s even relevant. This is the last thing standing between me and having working voice commands… any help would be much appreciated.

Do your Chromecast devices show up in Home Assistant? Are they on the same subnet?

Sorry for the delay in response, I was without power since Tuesday (thanks Isaias :stuck_out_tongue: )

My chromecast devices do not show up in Home Assistant with Google Cast, but they are on the same subnet. Interestingly, in the “Plex Media Server” integration, I am able to see the Plex (Plex Cast - Chromecast) device listed as a Media Player. It even shows the content that is playing when it is active, so it appears to be accessible in some way to Home Assistant.

A bit more research suggests that HA under Docker for Windows is not capable of sharing its host network directly, which is why it uses a 172 address and port 8123 forwarding. It seems like that breaks the ability to discover Cast devices directly, and even adding the information for the Cast device directly in the config file doesn’t work. Is there any way around this?

I’m using HA solely for this Plex functionality so I don’t mind setting up a new instance, but I don’t have a dedicated device (like a Pi) to do that. Do you think this would work better in a linux virtual machine?

The two methods I’ve used for my HA installations have been RasPi and now a dedicated Linux machine. I’ve had no issues connecting to Chromecast devices on either, but beyond those two methods I have no experience or recommendations.

Update v0.2.2

Thanks to a recent update to Pychromecast cast_delay is no longer required and has been removed. Cast delay was added as a workaround to prevent the grey screen and “something went wrong” bugs. I’m very happy to say that it is no longer needed. It makes setup easier and response times snappier.

I’ve also squashed a couple of bugs in speech recognition that should help with finding the correct media and cast device/client.

1 Like

Just for “fun”, I set up a Linux Mint partition on my primary Windows computer and configured HA in VirtualBox. Wouldn’t you know it, it immediately saw all of my Cast devices and had no issues casting to them. I tried setting up the exact same VDI in a new VirtualBox instance under Windows and it wouldn’t even complete booting up. So… moral of the story, don’t use HA under any kind of Windows.

Also, slightly off topic, I found that there is a Home Assistant plugin for Tasker, which allows you to send Service Calls. That means you can use Tasker to send Plex Assistant commands, or you can combine it with the AutoVoice plugin and use the Google Assistant to issue voice commands to Plex Assistant. The big benefit of that approach is that it doesn’t require any external processing whatsoever- no IFTTT, no DiagFlow, you don’t even need to have your home network connected to the internet at all. (Edit: I suppose that’s not entirely true because the Google Home devices won’t run without an internet connection…)

If you think it’d be useful, I can write up the details for how that’s set up and you can add it to the IFTTT/DiagFlow section as a third potential use case. Otherwise I’ll just make a post under the “share your projects” section.

For sure, that would be useful and appreciated. I think I’m going to have to make a separate readme with all the different options that people come up with for calling the service. Since it’s just a service call there are quite a few, but I have yet to collect them in one place. So far there are ones for IFTTT, DialogFlow, Node Red, and Rhasspy, you got one for Tasker, I have a write up for using HA’s built in Almond/Ada, and I’m sure there are quite a few others. Should also include a generic write up on how to integrate others.

Any progress on adding music to Plex Assistant? With Google Play Music going away soon, there’s going to be a lot of people looking for a way to use Google Assistant to play music on Plex and/or other free apps.

1 Like

i’m trying this com ifttt integration and it’s awesome !!! Is there a way to make sure that when I say “ok google” you ask plex to play doctor who on tv living room "he picks up from the last episode seen and not from the first season episode 1?

@SoundSailor I have not worked on audio at all personally and have yet to even use Plex for anything other than video. There are a few forks of the project where folks are working on implementing music/audio features, but as with any open source project, it’s impossible to say when/if this will be available.

@legolas08 This is a bug/feature request that is currently being worked on.

thank you!!!