Custom Component / Card: Plex meets Home Assistant

Stupid question. would it be possibel to use url iso ip for also external access?

Yes it is possible

Found it

Does not work through configuration UI because of plexPlayer key

type: 'custom:plex-meets-homeassistant'
token: QWdsqEXAMPLETOKENqwerty
ip: remote.plex.server.com # remote shared plex instance
port: 443
libraryName: Deck
protocol: https
maxCount: 10
sort: title:desc
runBefore: script.turn_on_tv_and_wait
runAfter: script.movie_time
showExtras: true
playTrailer: muted
entity:
  kodi:
    - media_player.kodi_bedroom
    - media_player.kodi_living_room
  androidtv:
    - media_player.living_room_nvidia_shield
    - media_player.bedroom_nvidia_shield
    - media_player.kithen_nvidia_shield
  plexPlayer:
    - identifier: TV 2020 # plex client device located on local plex server network
      server:
        ip: local.plex.server.com # Mandatory
        token: QWdsqEXAMPLETOKENqwerty # Mandatory
        port: 32400
        protocol: http
    - 192.168.13.50 # without definition for server, it will look for device on remote.plex.server.com network
  cast: media_player.bedroom_tv
1 Like

Is it possible to have shuffle as an option?

Say Iā€™m playing a playlist, it starts from the first each time. Can the shuffle be enacted?

Currently no, please open a new feature request on github.

hey,

Has anyone found issues with the script run before play media? i can not seem to get it to wait long enough for plex to start. it seems to me it will wait approximately 10 seconds before it tryā€™s to play media but this is not long enough for the tv to startup and the app. if i try to change the delay time to 1 min i still get the error message on homeassistant after 10 seconds.

i keep getting the error Failed to call service rest_command/pmha_playmedia. Service not found

I need to document this, this is an undocumented workaround for some issues that were fixed long time ago.

					await this.hass.callService('rest_command', 'pmha_playmedia', {
					// eslint-disable-next-line @typescript-eslint/camelcase
					url,
					// eslint-disable-next-line @typescript-eslint/camelcase
					target_client_identifier: machineID,
					// eslint-disable-next-line @typescript-eslint/camelcase
					client_identifier: 'PlexMeetsHomeAssistant'
				});

It is called when the usual request from card to plex server fails. You can create a rest_command:

rest_command:
  pmha_playmedia:
    url: "{{ url }}"
    headers:
      X-Plex-Target-Client-Identifier: "{{ target_client_identifier }}"
      X-Plex-Client-Identifier: "{{ client_identifier }}"

in your config and restart. I am 99.9% sure that it will not help as that just does the same thing card does, but from Home Assistant instead (can ignore http vs https issues).

Issue is most probably somewhere else - most probably play device not being available at that time.

i agree, i think it is play device not being ready. however even though i have set up a wait time of 40 seconds in a script i am running before media is played i still get the error approx 10 seconds after pressing playing. it seems to me it is trying to play without waiting the full 40 seconds.

You can try executing the script yourself. Card executes the script, waits for it to finish and then run whatever play action it needs.

i changed my script to turn on a light after the wait time it works fine when i run the script myself.

So when running the script in run_before it only waits for 10 seconds at most?

yes that is correct

Hmm that sounds like something that should be look at. Please create a bug report on github and I will take a look when I have some time.

thank you very much

2.3 has been released

New Features:

  • Ability to add title to card
  • Ability to specify maximum number of rows to display

Bug Fixes

  • Card does not wait longer than 10 seconds for script in runBefore to finish
  • Fixes wrong look inside sidebar card view reported in #35 .

I have cast functionality for Live TV almost done but am stuckā€¦

I can get the m3u8 link which works in VLC but cannot cast it. If any developer wants to help out I have described all in detail at https://github.com/JurajNyiri/PlexMeetsHomeAssistant/issues/39 .

1 Like

hi great card love it.
iā€™m now using nabu casa to also connect remotely to HA, But now the plex tab doesnā€™t show the content anymore. it only is visable on the ip not remote. how can i fix this??

regards

Hello.

Read readme right at the top, numerous closed issues or similar questions in this topic.

Quick question, any chance to add music to this awesome kick ass integration? This looks amazing but I really need it mostly for music, so Artists ā†’ Albums ā†’ Songs. It works really well for the TV Shows ā†’ Seasons ā†’ Episodes but not for music :frowning_face:

If it is not planned, I am not an expert in python but maybe I can help get it done?

Thanks,
Jorge

1 Like