Files
sarah/config/packages/modules/media/tv.yaml

127 lines
3.5 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# https://www.home-assistant.io/integrations/webostv
webostv:
- host: !secret living_room_tv_ip
name: Living Room TV
turn_on_action:
service: wake_on_lan.send_magic_packet
data:
mac: !secret living_room_tv_mac
media_player:
- platform: androidtv
name: nvidia shield
host: !secret nvidia_shield_host
script:
tv_twitch:
icon: mdi:twitch
alias: TV · Start Twitch stream
sequence:
- service: script.tv_prepare_for_playback
- service: androidtv.adb_command
entity_id: media_player.nvidia_shield
data_template:
command: "am start -a android.intent.action.VIEW -d twitch://stream/{{ channel }}"
tv_fireplace:
icon: mdi:fireplace
alias: TV · Fireplace
sequence:
- service: script.tv_prepare_for_playback
data:
volume_level: 0.08
- service: media_extractor.play_media
entity_id: media_player.shield
data:
media_content_id: "https://www.youtube.com/watch?v=AWKzr6n0ea0"
media_content_type: video/youtube
latest_pds:
alias: Play the latest PDS
sequence:
- service: media_extractor.play_media
entity_id: media_player.shield
data_template:
media_content_id: "{{ state_attr('sensor.philip_defranco', 'url') }}"
media_content_type: video/youtube
tv_prepare_for_playback:
alias: TV · Prepare for playback
sequence:
- service: sonos.unjoin
entity_id: media_player.living_room
- service: media_player.select_source
entity_id: media_player.living_room
data:
source: TV
- service: media_player.volume_set
entity_id: media_player.living_room
data_template:
volume_level: "{{ volume_level | default(0.3) }}"
- service: media_player.turn_on
entity_id: media_player.nvidia_shield
automation:
- alias: TV · Join Beam to Sonos group when off
trigger:
platform: state
entity_id: media_player.living_room_tv
to: "off"
condition:
condition: state
entity_id: input_select.house_mode
state: "day"
action:
- service: sonos.join
data:
master: media_player.master_bedroom
entity_id: media_player.living_room
- alias: TV · State · Sync on TV on
trigger:
platform: state
entity_id: media_player.living_room_tv
to: "on"
action:
- service: media_player.turn_on
entity_id: media_player.nvidia_shield
- alias: TV · State · Sync on TV off
trigger:
platform: state
entity_id: media_player.living_room_tv
to: "off"
action:
- service: media_player.turn_off
entity_id: media_player.nvidia_shield
- alias: TV · State · Sync on Shield on
trigger:
platform: state
entity_id: media_player.nvidia_shield
from: "off"
action:
- service: media_player.turn_on
entity_id: media_player.living_room_tv
- service: media_player.select_source
entity_id: media_player.living_room_tv
data:
source: "Shield"
- alias: TV · State · Sync on Shield off
trigger:
platform: state
entity_id: media_player.nvidia_shield
to: "off"
action:
- service: media_player.turn_off
entity_id: media_player.living_room_tv
homeassistant:
customize:
media_player.living_room_tv:
icon: mdi:television
friendly_name: LG TV
media_player.nvidia_shield:
icon: mdi:set-top-box
friendly_name: Nvidia Shield