Hi,
I’m trying to make an script to resume a movie that I started watchig. I’ve tried 2 ways, one with an input text that saves the title of the last movie I’ve watched, then I call the service media.player to start the movie and resuming, but I’ve got a problem, the title that gets the input, the one in the plex sensor, saves the name and the year in the name, " title (2010) " the title is not in the original title, and that makes that the media.player to not find the movie.
The other option is saving the media_content_id, and that worked but I haven’t the option to resume the movie where I left it.
First option code:
alias: Poner última pelicula plex
sequence:
- service: media_player.turn_on
data: {}
target:
entity_id: media_player.sony_bravia_tv
- delay:
hours: 0
minutes: 0
seconds: 8
milliseconds: 0
enabled: true
- service: media_player.select_source
data:
source: Plex
target:
device_id: 8eded30c3e91d60317611f17956b8c99
- delay:
hours: 0
minutes: 0
seconds: 8
milliseconds: 0
enabled: true
- service: media_player.play_media
target:
entity_id: media_player.plex_plex_for_android_tv_bravia_4k_ur3
data:
media_content_id: >-
{ "library_name": "Movies", "title":
"{{states(''input_text.ultima_pelicula_vista_plex'')}}", "resume": 1 }
media_content_type: movie
mode: single
icon: mdi:movie-play
Second option code:
alias: Poner última pelicula plex
sequence:
- service: media_player.turn_on
data: {}
target:
entity_id: media_player.sony_bravia_tv
- delay:
hours: 0
minutes: 0
seconds: 8
milliseconds: 0
enabled: true
- service: media_player.select_source
data:
source: Plex
target:
device_id: 8eded30c3e91d60317611f17956b8c99
- delay:
hours: 0
minutes: 0
seconds: 8
milliseconds: 0
enabled: true
- service: media_player.play_media
target:
entity_id: media_player.plex_plex_for_android_tv_bravia_4k_ur3
data:
media_content_id: '{{ states(''input_text.ultima_pelicula_vista_plex'') }}'
mode: single
icon: mdi:movie-play
Could anyone help me with this?
Thank you!!