I have a script which I use as an alarm clock. It launches plex, and starts a show. However, every time I run it, it starts over from the first episode. Does anyone know how I could modify this to continue from where I left off?
alias: MB - Launch plex and start comedy show
sequence:
- type: turn_on
device_id: 30e6865be32227850e99fd615b2e7d0d
entity_id: cd9ed9aa7a65ee4dd227255dc85e2523
domain: remote
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- service: media_player.play_media
target:
entity_id: media_player.50_tcl_roku_tv
data:
media_content_id: "13535"
media_content_type: app
metadata:
title: Plex - Free Movies & TV
thumbnail: http://192.168.11.111:8060/query/icon/13535
media_class: app
children_media_class: null
navigateIds:
- {}
- media_content_type: apps
media_content_id: ""
- wait_for_trigger:
- platform: device
device_id: 30e6865be32227850e99fd615b2e7d0d
domain: media_player
entity_id: 853b5daf503f1eaf231969ee335194bb
type: playing
timeout:
hours: 0
minutes: 0
seconds: 15
milliseconds: 0
- delay:
hours: 0
minutes: 0
seconds: 3
milliseconds: 0
- service: remote.send_command
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0.2
command: Select
target:
entity_id: remote.50_tcl_roku_tv
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- repeat:
sequence:
- service: button.press
data: {}
target:
entity_id: button.scan_clients_musica
- delay:
hours: 0
minutes: 0
seconds: 8
milliseconds: 0
until:
- condition: state
entity_id: media_player.plex_plex_for_roku_50_tcl_roku_tv
state: idle
for:
hours: 0
minutes: 0
seconds: 0
- repeat:
sequence:
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: media_player.play_media
target:
entity_id: media_player.plex_plex_for_roku_50_tcl_roku_tv
data:
media_content_id: plex://f6d0e94c8faa73222b5f66d781eb1b2c52c731ee/279236
media_content_type: show
metadata:
title: ComedyCentralStandup [youtube2-UCtw7q4SyOeoCwM1i_3x8lDg]
thumbnail: null
media_class: tv_show
children_media_class: season
navigateIds:
- {}
- media_content_type: library
media_content_id: plex://f6d0e94c8faa73222b5f66d781eb1b2c52c731ee/15
- media_content_type: show
media_content_id: plex://f6d0e94c8faa73222b5f66d781eb1b2c52c731ee/279236
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
until:
- condition: state
entity_id: media_player.plex_plex_for_roku_50_tcl_roku_tv
state: playing
for:
hours: 0
minutes: 0
seconds: 2
mode: single
icon: mdi:youtube-tv