Giter Club home page Giter Club logo

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

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?

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!

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.

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'

'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?

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

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

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

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'

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.

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?

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

Accounts option

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

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?

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?

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)

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

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.

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.

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}}"

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

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>

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 }}'

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.

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.

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}]

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'].

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?

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.

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?

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?

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.

Adding language

Hi

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

Regards
Brian

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.

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.

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.

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}}"

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.

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.