script:
master_room_tv_turn_on_tv:
alias: Master Room Turn On TV
sequence:
# Turn on TV
- service: media_player.turn_on
target:
entity_id: media_player.master_room_tv
- service: media_player.play_media
target:
entity_id: media_player.master_room_fire_tv
data:
media_content_type: routine
media_content_id: TurnOnMasterRoomTV
master_room_tv_turn_off_tv:
alias: Master Room Turn Off TV
sequence:
- service: media_player.turn_off
target:
entity_id: media_player.master_room_tv
master_room_slideshow_update_tv_setting:
alias: Master Room Slideshow Update TV Setting
sequence:
# Mute TV
- service: media_player.volume_set
data:
volume_level: 0
target:
entity_id: media_player.master_room_tv
# Change to FireTV input
- service: media_player.select_source
target:
entity_id: media_player.master_room_tv
data:
source: "Amazon Fire TV stick"
# Set Picture Mode to a Dim One
- service: samsungtv_smart.select_picture_mode
data:
entity_id: media_player.master_room_tv
picture_mode: Movie
automation:
- alias: L-MR Master Room TV Slideshow
id: "1599907343079"
description: "automation.master_room_tv_slideshow"
trigger:
action:
# TV is off
- condition: state
entity_id: media_player.master_room_tv
state: "off"
# Turn on TV and change settings
- alias: "Repeat turning on tv until tv is switched its input to fire tv"
repeat:
sequence:
- service: script.turn_on
entity_id: script.master_room_tv_turn_on_tv
- service: script.turn_on
entity_id: script.master_room_slideshow_update_tv_setting
- delay: "00:00:03"
until:
- condition: template
value_template: "{{state_attr('media_player.master_room_tv', 'source') == 'Amazon Fire TV stick'}}"
# Play Slideshow on FireTV after TV is mute to avoid Alexa feedback
- service: media_player.play_media
target:
entity_id: media_player.master_room_fire_tv
data:
media_content_type: routine
media_content_id: MasterRoomSlideshow