GithubHelp home page GithubHelp logo

maykar / plex_assistant Goto Github PK

View Code? Open in Web Editor NEW
276.0 21.0 61.0 522 KB

❱ Plex Assistant is a Home Assistant integration for casting Plex media to Google devices, Sonos devices, and Plex clients with Google Assistant, HA's conversation integration, and more.

License: MIT License

Python 100.00%

plex_assistant's Introduction

❱ Plex Assistant

hacs_badge hacs_badge

InstallationConfigurationCast DevicesCommands
Google Assistant SetupHA Conversation SetupAdvanced Config


Plex Assistant is a Home Assistant integration for casting Plex media to Google devices, Sonos devices, and Plex clients with Google Assistant, HA's conversation integration, and more. You can use this component with anything that can make a service call to HA as well.

Example: "Hey Google, tell Plex to play The Walking Dead on the Downstairs TV."

You can use the component's service (plex_assistant.command) to call the commands however you'd like. Visit the services tab in HA's Developer Tools to test it out.

Version 1.0.0+

There have been many changes in version 1.0.0, follow the 1.0.0 Update Guide if updating from a lower version.

This version requires Home Assistant 2021.2.0+. Use version 0.3.4 if you are on lower versions of HA and find the old readme here.

Supporting Development

Installation

Install by using one of the methods below:

  • Install with HACS: Search integrations for "Plex Assistant", select it, hit install, and restart.

  • Install Manually: Install this component by downloading the project and then copying the /custom_components/plex_assistant/ folder to the custom_components folder in your config directory (create the folder if it doesn't exist) and restart.

Configuration

You need to have HA's Plex integration setup in order to use Plex Assistant.

If you want a Plex Client as your default device, make sure it is open/reachable before setup.

  • In your sidebar click "Configuration"
  • Go to "Integrations" and click "Add Integration"
  • Search for "Plex Assistant" and click it
  • Follow the steps shown to select intial config options

Your Plex server is automatically retrieved from Home Assistant's Plex integration, if you have more than one server setup it will ask which one to use.

After setup you can click "Options" on Plex Assistant's card for more config options including: jump forward/back amount and Advanced Config Options.

Cast Devices

This component automatically detects compatible media_player entities from Home Assistant (Google Cast devices, Sonos devices, and Plex clients). Setting a default device will use that device if none is specified in the command. Plex Assistant uses the friendly name from the entities for commands. To change a Plex client's friendly name in HA it needs to be open and reachable before doing so.

Google Assistant Setup

You can either use IFTTT or DialogFlow to trigger Plex Assistant with Google Assistant.

  • IFTTT is the easiest way to set this up, but only if IFTTT supports your language.
  • DialogFlow is a bit more involved and has some quirks, like always responding "I'm starting the test version of Plex", but it has support for more languages. Only use DialogFlow if your language is otherwise unsupported.
IFTTT Setup Guide

IFTTT Setup

In Home Assistant

  • Go to "Configuration" in your HA sidebar and select "Integrations"
  • Hit the add button and search for "IFTTT" and click configure.
  • Follow the on screen instructions.
  • Copy or save the URL that is displayed at the end, we'll need it later.
  • Click "Finish"

In IFTTT

Visit ifttt.com and sign up or sign in.

  • Create a new applet
  • Click "Add" next to "If This".
  • Search for and select "Google Assistant"
  • Select "Say phrase with text ingredient"

Now you can select how you want to trigger this service, you can select up to 3 ways to invoke it. I use things like tell plex to $ or have plex $. The dollar sign will be the phrase sent to this component. You can also set a response from the Google Assistant if you'd like. Select your language (as long as it's supported, see list above), then hit "Create Trigger" to continue.

  • Click "Add" next to "Then That"
  • Search for and select "Webhooks", then select "Make a web request"
  • In the URL field enter the webhook URL HA provided you earlier
  • Select method "Post" and content type "application/json"
  • Then copy and paste the code below into the body field

{ "action": "call_service", "service": "plex_assistant.command", "command": "{{TextField}}" }

Finally click "Create Action", then "Continue", and then "Finish".

You can now trigger Plex Assistant by saying "Hey Google, tell plex to..." or "Hey Google, ask plex to..."

DialogFlow Setup Guide

DialogFlow Setup

In Home Assistant

The DialogFlow trigger requires Home Assistant's Conversation integration to be enabled.

  • Go to "Configuration" in your HA sidebar and select "Integrations"
  • Hit the add button and search for "Dialogflow".
  • Copy or save the URL that is displayed, we'll need it later.
  • Click "Finish"

In DialogFlow

Download Plex_Assistant_DialogFlow.zip and then visit https://dialogflow.cloud.google.com . Sign up or sign in using the same Google account tied to your Google Assistant. Keep going until you get to the "Welcome to Dialogflow!" page with "Create Agent" in the sidebar.

  • Click on Create Agent and Type "Plex" as the agent name and hit "Create"
  • Now click the settings icon next to "Plex" in the sidebar
  • Navigate to "Export and Import" and click "Restore from ZIP"
  • Select the Plex_Assistant_DialogFlow.zip file we downloaded earlier and restore
  • Click "Fulfillment" in the sidebar and change the URL to the one HA gave us for DialogFlow
  • Scroll down and hit "Save"

If you will be using English as your language you can ignore the next group of steps.

  • To add your language click the plus sign in the sidebar next to "en"
  • Select your language under "English - en" and hit "Save" in the top right
  • Click your language code next to "en" in the sidebar
  • Click "Intents" in the sidebar and then click the "Plex" intent
  • In the "Training phrases" section type "command"
  • Double click on the word "command" that you just entered and select "@sys.any:command"
  • Hit "Save" in the top right.

If you would like to add a response for the assistant to say after your command:

  • Click "Intents" in the sidebar and then click the "Plex" intent
  • In "Responses" write the desired result under "Text Response"
  • Hit "Save" in the top right.

Next you need to publish a test version:

  • Click "Integrations"
  • Click "Not ready yet? Continue with the integration" in the top panel.
  • You should see a dialog shown. Click the 'Test' button.

You can now trigger Plex Assistant by saying "Hey Google, tell plex to..." or "Hey Google, ask plex to..."

Currently Supported Languages:

Language Code IFTTT DialogFlow Music Support
   Danish "da" ✔️
   Dutch "nl" ✔️
   English "en" ✔️ ✔️ ✔️
   French "fr" ✔️ ✔️
   German "de" ✔️ ✔️
   Hungarian "hu" ✔️ ✔️
   Italian "it" ✔️ ✔️ ✔️
   Norwegian "nb" ✔️
   Portuguese "pt" ✔️ ✔️
   Spanish "es" ✔️ ✔️
   Swedish "sv" ✔️

Home Assistant Conversation Setup

Requires Home Assistant's Conversation integration to be enabled.

By default Plex Assistant will work with HA's Conversation integration with the phrases "Tell Plex to {command}" and "{command} with Plex" with no additional configuration nessisary. All the languages in the table above are supported, but you'd need to make a trigger phrase in your language. If you would like to add more trigger phrases you can do so by using the code below as an example.

conversation:
  intents:
    Plex:
     - "Plex please would you {command}"
     - "I command plex to {command}"

Commands

Fuzzy Matching

A media item's title and the device used in your phrase are processed using a fuzzy search. Meaning it will select the closest match using your Plex media titles and available cast device names. "play walk in deed on the dawn tee" would become "Play The Walking Dead on the Downstairs TV.". This even works for partial matches. play Pets 2 will match The Secret Life of Pets 2.

If no season/episode is specified for a TV show Plex Assistant will play the first unwatched or first in progress episode by default. If an artist, album, or track share the same name it will assume artist first, then album, then track. You can always specify by saying "Play album album name", "Play artist...", "Play track...", or even combine those with an artists name: "Play Never Gonna Give You Up by Rick Astley" or "Play the album Whenever You Need Somebody by Rick Astley". This can help with artists having a self titled album or track as well as multiple artists having items with the same name.

You can say things like:

  • "play the latest episode of Breaking Bad on the Living Room TV"
  • "play Breaking Bad"
  • "play Add it Up by the Violent Femmes"
  • "play the track Time to Pretend"
  • "play the album Time to Pretend by MGMT"
  • "play ondeck"
  • "play random unwatched TV"
  • "play season 1 episode 3 of The Simpsons"
  • "play the first season second episode of Taskmaster on the Theater System"

Filter Keywords:

  • season, episode, movie, show
  • artist, album, track, playlist
  • latest, recent, new
  • unwatched, next
  • ondeck
  • random, shuffle, randomized, shuffled

Filter keywords can be combined. For example "play random unwatched movies" will start playing a list of all unwatched movies in random order.

Control Commands:

  • play
  • pause
  • stop
  • next, skip, next track, skip forward
  • previous, back, go back
  • jump forward, fast forward, forward
  • jump back, rewind

Be sure to add the name of the device to control commands if it is not the default device. "stop downstairs tv" or "previous on the livingroom tv".

If no cast device is specified in your command, the default device set in your config is used. A cast device will only be found if at the end of the command and when preceded with the word "on" or words "on the". Example: "play friends ON downstairs tv"

Control commands are the only ones that don't require the "on" or "on the" before the device name.

I've tried to take into account many different ways that commands could be phrased. If you find a phrase that isn't working and you feel should be implemented, please make an issue or give the keyword replacement option a try (see below).

Advanced Configuration

There are two advanced configuration options: keyword replacements and start scripts. HA's UI configuration doesn't have a good way to impliment these kinds of options yet, so formatting is very important for these options. Once there is a better way to handle these I will update the UI.

Keyword Replacements

This option could be used for a few different purposes. The formatting is the word/phrase you want to say in quotes followed by a colon and then the word/phrase you want replace it with in quotes. Seperate multiple replacements with a comma.

Here's an example to add to the commands "next" and "previous" with alternatives:

"full speed ahead":"next", "reverse full power":"previous"

Using this config would allow you to say "full speed ahead" to go to the next track and "reverse full power" to go to the previous. You can still use the default commands as well.

Another use example would be if you have multiple Star Trek series, but want a specific one to play when you just say "Star Trek":

"star trek":"star trek the next generation"

And yet another use would be to improve translations, for example: If there are unsupported feminine and masculine variations for your language you can add them yourself. I would also encourage you to create an issue or help improve translations if you run into a situation like this.

Start Scripts

This option will trigger a script to start a Plex client if it is currently unavailable. For example: You have a Roku with the Plex app, but need it to be open for Plex Assistant to control it.

The formatting needed is the friendly name of the client that you want to open in quotes (case sensitive) followed by a colon then the HA script to start the client in quotes. Seperate multiple entries with a comma.

"LivingRoom TV":"script.start_lr_plex", "Bedroom TV":"script.open_br_plex"

The script would be different for every device and some devices might not have the ability to do this.
Plex Assistant will wait for the start script to finish before continuing, so having a check for device availability is advisable. That way the script can both wait for the device to be available or quickly end if it already is.

The example below would start the Plex app on a Roku device.
The script waits until the app is open on the device and the app reports as available (take note of the comments in the code).

roku_plex:
  sequence:
    - choose:
        #### If Plex is already open on the device, do nothing
        - conditions:
            - condition: template
              value_template: >-
                {{ state_attr('media_player.roku','source') == 'Plex - Stream for Free' }}
          sequence: []
      default:
      #### If Plex isn't open on the device, open it
      #### You could even add a service to turn your TV on here
      - service: media_player.select_source
        entity_id: 'media_player.roku'
        data:
          source: 'Plex - Stream for Free'
      - repeat:
          #### Wait until the Plex App/Client is available
          while:
            - condition: template
              #### Loop until Plex App or client report as available and stop after 20 tries
              value_template: >-
                {{ (state_attr('media_player.roku','source') != 'Plex - Stream for Free' or
                   is_state('media_player.plex_plex_for_roku_roku', 'unavailable')) and
                   repeat.index <= 20 }}
          sequence:
            #### Scan to update device status
            - service: plex.scan_for_clients
            - delay:
                seconds: 1
      #### Optional delay after device is found. Uncomment the 2 lines for delay below
      #### if your device needs a few seconds to respond to commands. Increase delay as needed.
      # - delay:
      #     seconds: 3
  mode: single

plex_assistant's People

Contributors

drauboss avatar exetico avatar fcastilloec avatar guilhem23 avatar hidaba avatar jes1417 avatar jjlawren avatar johanostlund avatar jokerigno avatar kernehed avatar kisty avatar matt8707 avatar maykar avatar nashant avatar ngreis avatar pergolafabio avatar samueljrush avatar swavans avatar taczirjak avatar yeahme49 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plex_assistant's Issues

Error "startswith first arg must be str or a tuple of str, not list"

Hi,

I tested plex_assistant.command service found in Developer Tools > Services with the example and I have the following error: "Failed to call service plex_assistant/command. startswith first arg must be str or a tuple of str, not list"

I installed plex_assistant using hacs and I am on freenas.

Thanks

Cast Device Not Found

Hi.

I've gotten everything installed, webhooks received from IFTTT, and automation firing.
I'm getting the following error in the logs:

Logger: custom_components.plex_assistant
Source: custom_components/plex_assistant/init.py:117
First occurred: 12:44:33 PM (1 occurrences)
Last logged: 12:44:33 PM

Cast device not found.

Have tried multiple Plex clients (both name and IP) and Chromecast devices and same error with all of them.
What am I missing?!

Thanks

Can't open a film on chromecast with plex

Hello,

I got trouble making work plex assistant again.
I reinstalled it after migrating from home assistant to hassio and now i have an error in the logs each time i send a command.

I use IFTTT.
i got an Plex software upgrade yesterday, that the first time i try to cast from plex since the upgrade.
The TV start the cast and show the message 'Ready to cast' but nothing start and i have the following error in the logs :

Logger: pychromecast.socket_client
Source: /usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py:721
First occurred: 23:31:10 (1 occurrences)
Last logged: 23:31:10
[Bbox(192.168.1.3):8009] Exception caught while sending message to controller ReceiverController: Message urn:x-cast:com.google.cast.receiver from receiver-0 to *: {'requestId': 3, 'status': {'applications': [{'appId': '9AC194DC', 'appType': 'WEB', 'displayName': 'Plex', 'iconUrl': 'http://lh3.ggpht.com/F-carnehpMLNP_IxDt3-IhX9qlnPZcgnC1Ri8E9xkkkIWoeWI_GcD5ZeIQlNkKblg2jOvZLHUm-metNK', 'isIdleScreen': False, 'launchedFromCloud': False, 'namespaces': [{'name': 'urn:x-cast:com.google.cast.debugoverlay'}, {'name': 'urn:x-cast:com.google.cast.cac'}, {'name': 'urn:x-cast:plex'}, {'name': 'urn:x-cast:com.google.cast.broadcast'}, {'name': 'urn:x-cast:com.google.cast.media'}], 'sessionId': '37f9f646-a516-46b0-ac51-be5a2793f874', 'statusText': 'Plex', 'transportId': '37f9f646-a516-46b0-ac51-be5a2793f874', 'universalAppId': '9AC194DC'}], 'isActiveInput': True, 'isStandBy': False, 'userEq': {}, 'volume': {'controlType': 'attenuation', 'level': 0.13333334028720856, 'muted': False, 'stepInterval': 0.06666667014360428}}, 'type': 'RECEIVER_STATUS'}

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py", line 707, in _route_message
    handled = self._handlers[message.namespace].receive_message(
  File "/usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py", line 1140, in receive_message
    self._process_get_status(data)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py", line 1272, in _process_get_status
    self.app_launch_event_function()
  File "/usr/local/lib/python3.8/site-packages/pychromecast/controllers/plex.py", line 449, in app_launched_callback
    self._send_start_play(media, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/controllers/plex.py", line 406, in _send_start_play
    msg = media_to_chromecast_command(
  File "/usr/local/lib/python3.8/site-packages/pychromecast/controllers/plex.py", line 114, in media_to_chromecast_command
    playQueue = server.createPlayQueue(media, startItem=startItem)
  File "/usr/local/lib/python3.8/site-packages/plexapi/server.py", line 289, in createPlayQueue
    return PlayQueue.create(self, item, **kwargs)
TypeError: create() got an unexpected keyword argument 'startItem'

Can't get Google Assistant to Trigger with "Tell Plex"

Hi,

I've followed the guide step-by-step, and my test-app is working fine, if I try to use the "test" option, and start the "test"-version, too.

Therefore, I think everything is defined as it should, right?

Expand "Responses" turn on “Set this intent as end of conversation”

image

I've added both Danish and English.

By saying "Talk with Plex", I'm able to get it to start my test-app. Hereafter I'm able to give the command. But I've not been able to say "Hey Google, ask Plex to play the latest episode of XYZ" - I've also tried with "talk" and so on, but it doesn't help.

What have I done wrong?

On "Integrations", Plex is added in both boxes.

By testing it, and using the "Manage Assistant App", I'm able to add "Plex" too.
image

But... It doesn't help.

The only wierd thing I've found, is that "Plex" is lost from the "Implicit invocation" field, after the page has been reloaded:
image
Here's only the "Default Welcome Intent", if I click on the field.
image

But Plex is created as documented in the "Intents"-section:
image
image
image

Things I've tried:

  • Remove the "Danish" Invocation-name, and only defined the english
  • Started all over, with no luck.
  • Webhook is working fine, as I've tested in the "test" section, where It's communication just fine by testing the test app.

Unwatched show not found

The unwatched command does not seem to work for some reason. Whenever I say "tell Plex to play unwatched Breaking Bad" or "tell Plex to play the next Breaking Bad", it'll reply with "unwatched Breaking Bad not found". It does correctly translate "play the next" or "play next" to "unwatched", but then it doesn't find any unwatched episodes. Other requests work fine, e.g. if I leave out the unwatched, it'll play the first episode of the first season (although I must admit I expected the default behaviour to be to continue where I left off, but that's another issue and probably personal preference).

My Plex is synced with Trakt and On Deck shows several in-progress shows with the next episode correctly, including Breaking Bad used here as an example.

Flow Documentation For Node Red

For users running Node Red automations, they can use the following flow instead of the automation YAML, thought you might want to include in your documentation.

image

[{"id":"68283b1e.000664","type":"server-events","z":"9208b996.c075c8","name":"IFTTT WebHook Received","server":"880f9a.58981068","event_type":"ifttt_webhook_received","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":1030,"y":460,"wires":[["30b25db9.8a44b2"]]},{"id":"84c76b7a.fdd458","type":"comment","z":"9208b996.c075c8","name":"IFTTT Plex_Assistant WebHook","info":"","x":1050,"y":420,"wires":[]},{"id":"30b25db9.8a44b2","type":"switch","z":"9208b996.c075c8","name":"Plex Assistant","property":"payload.event.service","propertyType":"msg","rules":[{"t":"eq","v":"plex_assistant.command","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1280,"y":460,"wires":[["b743ac06.b63e3"]]},{"id":"b743ac06.b63e3","type":"api-call-service","z":"9208b996.c075c8","name":"Call Plex Assistant","server":"880f9a.58981068","version":1,"debugenabled":false,"service_domain":"plex_assistant","service":"command","entityId":"","data":"{\t \"command\": $.payload.event.command\t}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1510,"y":460,"wires":[[]]},{"id":"880f9a.58981068","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Log Error

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:82
First occurred: 12:17:42 (1 occurrences)
Last logged: 12:17:42

Detected integration that attempted to create another Zeroconf instance. Please use the shared Zeroconf via await homeassistant.components.zeroconf.async_get_instance(hass). Please report issue to the custom component author for plex_assistant using this method at custom_components/plex_assistant/init.py, line 78: get_chromecasts(blocking=False, callback=cc_callback)

Issue with IFTTT Webhook

Probably not an issue, but do you have to have a public facing URL or port forward for typical home networks? The IFTTT applet is returning "The server '[my lan ip]' is not allowed in a web request."

Use Google Assistant's Default TV before default_cast

Want to start off by saying how awesome this project is! I could never get Phlex or FlexTV to work, but I got this up and running very quickly, and it just works. Thank you!

One thing I noticed during setup, is that while there is the default_cast option, it only allows a single value.

In the Google Home settings, you are able to set a "Default TV" per Google Home device. I'm not sure if it's possible to access that default value, but if it is, it would be awesome if that value could be used if a device is not explicitly mentioned, before falling back to default_cast. This is the way that other services work (e.g. Netflix, Spotify, etc.).

Ideally:

  • If I'm in the living room, the living room Google Home would hear me say "Ask plex to play Futurama" and it would play on the living room TV.
  • If I'm in the bedroom, the bedroom Google Home would hear me say "Ask plex to play Futurama", and it would play on the bedroom TV.
  • If I ask my phone "Ask plex to play Futurama", it wouldn't know where to play it, so it would fall back to playing it on default_cast.
  • And finally, if I explicitly say "Ask plex to play Futurama on the living room TV", it would play on the living room TV.

Jump forward/back not working

So i have everything setup and working for the most part, the only thing that eludes me is the jump forward or backward command as whenever i attempt it, my google assistant replies with the standard "sorry something went wrong" and then freezes whatever is running plex into an idle state to which i have to tell google to "stop" before i can run any other commands. I restarted HA then attempted the commands again to get a clean error report, but the only thing showing up is the standard 2 lines.

2020-10-02 11:16:08 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-10-02 11:16:08 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for plex_assistant which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

I checked IFTTT but the applet ran correctly and there's no error logs. Ill try adding in some manual commands to see if that helps but for now this is the issue i ran into.

Full build for this:
Rasberry Pi 3:
- Running a docker container for HA and having it use my external port forwarded IP so that IFTTT can reach it, as well as using the IFTTT key
- Running plex_assistant with all details specified in documentation besides the aliases for the config file
Google Nest mini 2nd Gen:
- My primary google assistant device that i use
Google chromecast 3rd gen:
- Connected to small LG TV that i don't feel like looking up the specific model for unless really needed.

Plex Assistant error after updating Home Assistant to 0.107.6

After updating Home Assistant from 0.107.5 to 0.107.6 the Plex Assistant isn't working anymore.

Output from homeassistant.log

2020-03-24 17:19:13 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package python-Levenshtein==0.12.0: ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tk6lbo/python-Levenshtein/setup.py'"'"'; file='"'"'/tmp/pip-install-tk6lbo/python-Levenshtein/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-r5ly49o0
cwd: /tmp/pip-install-tk6lbo/python-Levenshtein/
Complete output (31 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/Levenshtein
copying Levenshtein/StringMatcher.py -> build/lib.linux-x86_64-3.7/Levenshtein
copying Levenshtein/init.py -> build/lib.linux-x86_64-3.7/Levenshtein
running egg_info
writing python_Levenshtein.egg-info/PKG-INFO
writing dependency_links to python_Levenshtein.egg-info/dependency_links.txt
writing entry points to python_Levenshtein.egg-info/entry_points.txt
writing namespace_packages to python_Levenshtein.egg-info/namespace_packages.txt
writing requirements to python_Levenshtein.egg-info/requires.txt
writing top-level names to python_Levenshtein.egg-info/top_level.txt
reading manifest file 'python_Levenshtein.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*pyc' found anywhere in distribution
warning: no previously-included files matching '*so' found anywhere in distribution
warning: no previously-included files matching '.project' found anywhere in distribution
warning: no previously-included files matching '.pydevproject' found anywhere in distribution
writing manifest file 'python_Levenshtein.egg-info/SOURCES.txt'
copying Levenshtein/_levenshtein.c -> build/lib.linux-x86_64-3.7/Levenshtein
copying Levenshtein/_levenshtein.h -> build/lib.linux-x86_64-3.7/Levenshtein
running build_ext
building 'Levenshtein._levenshtein' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/Levenshtein
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.7m -c Levenshtein/_levenshtein.c -o build/temp.linux-x86_64-3.7/Levenshtein/_levenshtein.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1

ERROR: Failed building wheel for python-Levenshtein
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tk6lbo/python-Levenshtein/setup.py'"'"'; file='"'"'/tmp/pip-install-tk6lbo/python-Levenshtein/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-g6peeg32/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/python-Levenshtein
cwd: /tmp/pip-install-tk6lbo/python-Levenshtein/
Complete output (31 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/Levenshtein
copying Levenshtein/StringMatcher.py -> build/lib.linux-x86_64-3.7/Levenshtein
copying Levenshtein/init.py -> build/lib.linux-x86_64-3.7/Levenshtein
running egg_info
writing python_Levenshtein.egg-info/PKG-INFO
writing dependency_links to python_Levenshtein.egg-info/dependency_links.txt
writing entry points to python_Levenshtein.egg-info/entry_points.txt
writing namespace_packages to python_Levenshtein.egg-info/namespace_packages.txt
writing requirements to python_Levenshtein.egg-info/requires.txt
writing top-level names to python_Levenshtein.egg-info/top_level.txt
reading manifest file 'python_Levenshtein.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*pyc' found anywhere in distribution
warning: no previously-included files matching '*so' found anywhere in distribution
warning: no previously-included files matching '.project' found anywhere in distribution
warning: no previously-included files matching '.pydevproject' found anywhere in distribution
writing manifest file 'python_Levenshtein.egg-info/SOURCES.txt'
copying Levenshtein/_levenshtein.c -> build/lib.linux-x86_64-3.7/Levenshtein
copying Levenshtein/_levenshtein.h -> build/lib.linux-x86_64-3.7/Levenshtein
running build_ext
building 'Levenshtein._levenshtein' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/Levenshtein
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.7m -c Levenshtein/_levenshtein.c -o build/temp.linux-x86_64-3.7/Levenshtein/_levenshtein.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tk6lbo/python-Levenshtein/setup.py'"'"'; file='"'"'/tmp/pip-install-tk6lbo/python-Levenshtein/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-g6peeg32/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/python-Levenshtein Check the logs for full command output.
2020-03-24 17:19:13 ERROR (MainThread) [homeassistant.setup] Setup failed for plex_assistant: Requirements for plex_assistant not found: ['python-Levenshtein==0.12.0'].

Error in configuration.yaml when setting up Plex assistant with Home Assistant's conversation

First off this looks awesome, great job! Haven't tried anything like this since Phlex which didn't go so well so really excited to use this.

When setting up Plex Assistant with Home Assistant's conversation integration in the configuration.yaml, I get this error when starting Home Assistant. I copied the exact code you have on the readme without changing anything. Thanks for any help.

Home Assistant Error:

2020-09-24 23:28:05 ERROR (SyncWorker_0) [homeassistant.util.yaml.loader] while parsing a block collection
  in "/config/configuration.yaml", line 115, column 6
expected <block end>, but found '<scalar>'
  in "/config/configuration.yaml", line 116, column 18
2020-09-24 23:28:05 ERROR (MainThread) [homeassistant.bootstrap] Failed to parse configuration.yaml: while parsing a block collection
  in "/config/configuration.yaml", line 115, column 6
expected <block end>, but found '<scalar>'
  in "/config/configuration.yaml", line 116, column 18. Activating safe mode

configuration.yaml (ommited my url and token)

plex_assistant:
  url: 'MYURL'
  token: 'MYTOKEN'
  default_cast: 'Lounge TV'
  language: 'en'
  tts_errors: true

conversation:
  intents:
    PlexAssistant:
     # These trigger commands can be changed to suit your needs.
     - Tell Plex to {command}
     - {command} with Plex

intent_script:
  PlexAssistant:
    speech:
      text: Command sent to Plex.
    action:
      service: plex_assistant.command
      data_template:
        command: "{{command}}"

Plans for Music support?

Loving plex assistant so far. I see music and audio isn't supported at the moment. Any plans to add it in the future?

Automation fails with `TypeError: expected string or bytes-like object`

When I issue a command like "play darker than black", this is what I get:

ERROR (MainThread) [homeassistant.components.automation.plex_assistant_automation] While executing automation automation.plex_assistant_automation
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 426, in async_trigger
    await self.action_script.async_run(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 985, in async_run
    await asyncio.shield(run.async_run())
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 239, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 247, in _async_step
    await getattr(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 454, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1335, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1374, in _execute_service
    await self._hass.async_add_executor_job(handler.func, service_call)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/plex_assistant/__init__.py", line 135, in handle_input
    device = fuzzy(command["device"] or default_cast, devices)
  File "/config/custom_components/plex_assistant/helpers.py", line 42, in fuzzy
    return fw.extractOne(media, lib, scorer=scorer)
  File "/usr/local/lib/python3.8/site-packages/fuzzywuzzy/process.py", line 220, in extractOne
    return max(best_list, key=lambda i: i[1])
  File "/usr/local/lib/python3.8/site-packages/fuzzywuzzy/process.py", line 78, in extractWithoutOrder
    processed_query = processor(query)
  File "/usr/local/lib/python3.8/site-packages/fuzzywuzzy/utils.py", line 95, in full_process
    string_out = StringProcessor.replace_non_letters_non_numbers_with_whitespace(s)
  File "/usr/local/lib/python3.8/site-packages/fuzzywuzzy/string_processing.py", line 26, in replace_non_letters_non_numbers_with_whitespace
    return cls.regex.sub(" ", a_string)
TypeError: expected string or bytes-like object
  File "/usr/local/lib/python3.8/site-packages/fuzzywuzzy/utils.py", line 95, in full_process
    string_out = StringProcessor.replace_non_letters_non_numbers_with_whitespace(s)
  File "/usr/local/lib/python3.8/site-packages/fuzzywuzzy/string_processing.py", line 26, in replace_non_letters_non_numbers_with_whitespace
    return cls.regex.sub(" ", a_string)
TypeError: expected string or bytes-like object

Basically the only command that doesn't result in these errors is ask plex to update sensor.

Plex Managed User Support

I know you already addressed adding multiple Plex Account support.
#17

But.....what about Plex Managed User Suppport? All my users are under One single Plex account (my account). Plex supports multiple "managed users" in a single account. Can/Will plex_assistant support managed users?

Moving TV Show Name Disrecpencies

I am frequently encountering mismatches with names. I just tried to "Tell Plex to play Godfather" and it played the movie "Go (1999)" and does so every time I ask the same thing. No logs that I can see. What do I need to do to provide you with logs/help fixing these mismatches?

Intent needs to be Plex instead of PlexAssistant for Google Assistant

The intent in the readme needs to be just Plex instead of PlexAssistant to work with Google Assistant.
ie change PlexAssistant to Plex in https://github.com/maykar/plex_assistant#home-assistant-conversation-setup
so that it is the same as that in https://github.com/maykar/plex_assistant#in-home-assistant-3

intent_script:
  Plex:
    speech:
      text: Command sent to Plex.
    action:
      - service_template: plex_assistant.command
        data_template:
          command: "{{command}}"

Since 0.0.6 update I get an error

Component error: plex_assistant - Requirements for plex_assistant not found: ['python-Levenshtein==0.12.0'].

arch x86_64
dev false
docker true
hassio false
os_name Linux
os_version 4.4.59+
python_version 3.7.7
timezone Europe/Amsterdam
version 0.107.7
virtualenv false

Playing TV Show only plays one Episode

When I ask it to play a TV Show, it only plays a single episode of the show. Is it possible to modify this behavior so that it plays the show starting at that episode and continuing? Maybe even make it a setting.

If I start the playback from the mobile app, it always continues to the next episode, which is what I am wanting to replicate with the voice controls.

Request to play Live TV

Hi there - great work.

I can't seem to work out how to play live tv channels, it seems to only scan movie names.

pychromecast conflict? issue

Hi, as soon as i installed the plex assistant plugin, the HA stopped discovering casting devices and also shows this error:

2020-05-19 11:11:40 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform cast.media_player: Platform not found (No module named 'pychromecast.quick_play').
once i uninstalled plex_assistant, HA is able to discover chromecast devices again.

it seems that there's a conflict somewhere?

Device Naming Issues

The sensor.plex_assistant_devices shows
Connected Devices: Cast Devices: - Living Room

But I keep getting in the logs an error 2020-07-06 15:41:09 WARNING (SyncWorker_17) [custom_components.plex_assistant] Cast device not found: "Living Room"

which is odd because there is definitely a device named Living Room. It is a Chromecast, and it works otherwise with plex just not using this integration. Any thoughts on what to try?

No way to resume episode

Often I leave an episode half finished.
I'd like to have it resume from where I stopped when I ask it to play a show

play next/unwatched playing the wrong episode

For example: play the next breaking bad.
The current unwatched order might be season 2 episode 7, but it will play season 2 episode 1.

It's doing that for all shows. It'll pick the right season, but always go back to episode 1 regardless of whether its unwatched or not.
If I say play season 2 episode 7 of breaking bad then it will play, but still goes back to episode 1 again next time.
No errors in the logs.

Create() got an unexpected keyword argument 'startItem'

First of, this is an awesome project and I have actually been looking for this for a while. Great Job.
I just installed Home Assistant and added HACS and your plugin solely for this.

I create a simple service with the command:
"Play Die Hard on Living Room TV"
The chromecast starts and is connecting to plex however the film itself is not starting.
I found the following errors in the logs.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 137, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1315, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1354, in _execute_service
    await self._hass.async_add_executor_job(handler.func, service_call)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/plex_assistant/__init__.py", line 217, in handle_input
    plex_c.block_until_playing(media)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/controllers/plex.py", line 433, in block_until_playing
    self.play_media(media, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/controllers/plex.py", line 453, in play_media
    self.launch(app_launched_callback)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/controllers/__init__.py", line 44, in launch
    self._socket_client.receiver_controller.launch_app(
  File "/usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py", line 1183, in launch_app
    self._send_launch_message(app_id, force_launch, callback_function)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/socket_client.py", line 1198, in _send_launch_message
    callback_function()
  File "/usr/local/lib/python3.8/site-packages/pychromecast/controllers/plex.py", line 449, in app_launched_callback
    self._send_start_play(media, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/controllers/plex.py", line 406, in _send_start_play
    msg = media_to_chromecast_command(
  File "/usr/local/lib/python3.8/site-packages/pychromecast/controllers/plex.py", line 114, in media_to_chromecast_command
    playQueue = server.createPlayQueue(media, startItem=startItem)
  File "/usr/local/lib/python3.8/site-packages/plexapi/server.py", line 289, in createPlayQueue
    return PlayQueue.create(self, item, **kwargs)
TypeError: create() got an unexpected keyword argument 'startItem'

I can also see the requests comming in in the server logs without any errors:

Oct 01, 2020 11:51:09.405 [7622] Debug — Auth: authenticated user 1 as ******@gmail.com
Oct 01, 2020 11:51:09.405 [32601] Debug — Request: [192.168.2.19:35678 (Subnet)] GET /clients (5 live) GZIP Signed-in Token (******@gmail.com)
Oct 01, 2020 11:51:09.405 [7621] Debug — Completed: [192.168.2.19:35678] 200 GET /clients (5 live) GZIP 0ms 397 bytes (pipelined: 1)
Oct 01, 2020 11:51:10.401 [7621] Debug — Auth: authenticated user 1 as ******@gmail.com
Oct 01, 2020 11:51:10.402 [32601] Debug — Request: [192.168.2.19:35678 (Subnet)] GET /library/all?limit=1&sort=addedAt%3Adesc (5 live) GZIP Signed-in Token (******@gmail.com)
Oct 01, 2020 11:51:10.408 [7622] Debug — Completed: [192.168.2.19:35678] 200 GET /library/all?limit=1&sort=addedAt%3Adesc (5 live) GZIP 6ms 739 bytes (pipelined: 2)

Would be really happy if you could point me in the right direction.

Home Assistant Version: 0.115.6
Plex (Home Assistant) Version: 2.4.6
Plex Assistant version: 0.2.9
Plex Server: NVIDIA Shield
Plex Server Version: 4.43.1

Is Home Assistant a key requirement

Hi, more a question than an issue, but is HA a key requirement for this to work?
As a node-RED user, I have no purpose for using HA, but would really like to add Google Home functionality to Plex.
Another reason for not wanting to use HA is that I have a low performance server, and don't want to dilute Plex performance.

Play next episode of

Hello! Just wanna start by saying that the integration works great, fantastic work! I never got Phlex working right either and I really think this is so much nicer implemented as well!

It might just be me but I think it would be nice to be able to say “play next episode of (tv show)” and it would play the next unwatched episode of that series.

I get that the phrasing could be an issue but this is the most natural way I would do it when we are just sitting down and want to play the next episode of a specific series we are watching. I know there are alternative phrases for this already implemented but to me they don’t feel as natural.

AttributeError: 'NoneType' object has no attribute 'clients'

I just installed and configured Plex Assistant for the first time.
I get this error in my HA logbook:

Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 1680, in run
    self._service_state_changed.fire(
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 1438, in fire
    h(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 1536, in on_change
    listener.add_service(*args)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/discovery.py", line 65, in add_service
    self._add_update_service(zconf, typ, name, self.add_callback)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/discovery.py", line 123, in _add_update_service
    callback(uuid, name)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/__init__.py", line 242, in internal_callback
    callback(
  File "/config/custom_components/plex_assistant/helpers.py", line 17, in cc_callback
    PA.clients = PA.server.clients()
AttributeError: 'NoneType' object has no attribute 'clients'

My config:

plex_assistant:
  url: 'REDACTED'
  token: 'REDACTED'
  default_cast: 'PlexKodi TV'
  language: 'en'
  tts_errors: true

I do however see client devices in my companion sensor, including the one I set as default_cast.

Any idea what's happening here?

Accounts option

Is there an option to use multiple plexaccounts?
So that my family members don't watch on my account.

Sensor picks up on some devices as having no name

For both my PS4 Pro and Philips Smart TV the included sensor sees them as having no name and are just shown as device1, ,device2 with the middle being what I assume the TV is supposed to be. Using the device id's provided by the plex server intergration also does not work so I have no way of addressing my devices. I am able to address my pc successfully, however multiple instances of chrome all show up as chrome on the sensor.
Config as below:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor:
- platform: plex_assistant
plex_assistant:
  url: 'http://192.168.1.69:32400'
  token: '*****'
  default_cast: 'Downstairs TV'
  language: 'en'
  tts_errors: true
  aliases:
    Downstairs TV: plex_plex_for_playstation_4_playstation_4_pro
    Upstairs PC: Chrome
    PS4: plex_plex_for_playstation_4_playstation_4_pro
    PS 4: plex_plex_for_playstation_4_playstation_4_pro
automation:
  - alias: Plex Assistant Automation
    trigger:
    - event_data:
        action: call_service
      event_type: ifttt_webhook_received
      platform: event
    condition:
      condition: template
      value_template: "{{ trigger.event.data.service == 'plex_assistant.command' }}"
    action:
    - data_template:
        command: "{{ trigger.event.data.command }}"
      service_template: '{{ trigger.event.data.service }}'

Cant play on Plex Clients(Android tv app)

I cant play on Plex clients like the android tv app or on the Plex Website. Playing on Chromecasts is working fine.
It definetly worked on version 0.2.4, all the versions after that im not sure because i didnt used the Integration since than.
Thats what i got in the logs:

Logger: homeassistant.components.websocket_api.http.connection.2834268344
Source: custom_components/plex_assistant/__init__.py:211
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 11:16:00 (1 occurrences)
Last logged: 11:16:00

(404) not_found; http://192.***.***.**:32400/player/playback/playMedia?address=192.***.***.**&commandID=1&containerKey=%2FplayQueues%2F264%3Fwindow%3D100%26own%3D1&key=%2Flibrary%2Fmetadata%2F640&machineIdentifier=616a7017caad7c46dcc59cd580adc7d6adf89596&offset=0&port=32400&token=transient-6ac90674-97f1-4573-b16b-5c95b7daf901&type=video <html><head><title>Not Found</title></head><body><h1>404 Not Found</h1></body></html>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 138, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1335, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1374, in _execute_service
    await self._hass.async_add_executor_job(handler.func, service_call)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/plex_assistant/__init__.py", line 211, in handle_input
    plex_c.playMedia(media)
  File "/usr/local/lib/python3.8/site-packages/plexapi/client.py", line 490, in playMedia
    self.sendCommand('playback/playMedia', **dict({
  File "/usr/local/lib/python3.8/site-packages/plexapi/client.py", line 208, in sendCommand
    return query(key, headers=headers)
  File "/usr/local/lib/python3.8/site-packages/plexapi/server.py", line 448, in query
    raise NotFound(message)
plexapi.exceptions.NotFound: (404) not_found; http://192.***.***.**:32400/player/playback/playMedia?address=192.***.***.**&commandID=1&containerKey=%2FplayQueues%2F264%3Fwindow%3D100%26own%3D1&key=%2Flibrary%2Fmetadata%2F640&machineIdentifier=616a7017caad7c46dcc59cd580adc7d6adf89596&offset=0&port=32400&token=transient-6ac90674-97f1-4573-b16b-5c95b7daf901&type=video <html><head><title>Not Found</title></head><body><h1>404 Not Found</h1></body></html>

Adding language

Hi

What excatly is required in order to add support for an additional langauge ?

Regards
Brian

Playing movies from another library

Noticed a small issue that I would like to check if it is possible to fix.

Since my kids are watching plex quiet a lot I have created a separate “children’s movie” library. It seems movies that I ask for are only able to parse my main movie library. Would it be possible for a fix to this or would it be too complicated to solve? Worst case scenario I will put back everything into one folder!

Kodi addon as device

Although Kodi Plex addon is shoown in Hassio as device, with media_player entity, Assistant sensor does not see it - and can't play on it.
I tried 'tell plex to update sensor', reboot Hassio and put "Plex for Kodi" as default cast.
Is it possible, or not? And if so, how to achieve this?
Thank you!!!

P.S. sensor does see my GHome mini and can play (sound of) movies and shows to it.

'webhook URL HA provided you earlier'?

the setup directions say In the URL field enter the webhook URL HA provided you earlier but I'm not sure what this is. I install this through HACS, add the config, then restart. What url?

need to rename services.json to services.yaml

'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in _execute_service
await self._hass.async_add_executor_job(handler.func, service_call)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/plex_assistant/init.py", line 76, in handle_input
call.data.get("command").lower(),
AttributeError: 'NoneType' object has no attribute 'lower'

accept roman numerals as numbers

Could you add in a rule for roman numerals as well as numbers. I managed to say "OK Google, tell Plex to play Frozen eye eye" for "Frozen II" but not "Frozen 2".

Error with 0.8 and 0.107.7

Logger: homeassistant.setup
Source: custom_components/plex_assistant/helpers.py:26
First occurred: 4:38:20 PM (1 occurrences)
Last logged: 4:38:20 PM

Error during setup of component plex_assistant
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 174, in _async_setup_component
    component.setup, hass, processed_config  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/plex_assistant/__init__.py", line 75, in setup
    PA.lib = get_libraries(PA.plex)
  File "/config/custom_components/plex_assistant/helpers.py", line 26, in get_libraries
    shows.sort(key=lambda x: x.updatedAt)
TypeError: '<' not supported between instances of 'NoneType' and 'datetime.datetime'

I tried using master and got the same bug....FYI.

Plex Managed Users Support

I know you already addressed adding multiple Plex Account support.
#17

But.....what about Plex Managed User Suppport? All my users are under One single Plex account (my account). Plex supports multiple "managed users" in a single account. Can/Will plex_assistant support managed users?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.