1
0

Update F1TV script

Add script for bedroom tv
Extract original script to generic one
Add TV select for generic f1tv script
This commit is contained in:
Przemek Grondek 2023-05-06 21:55:43 +02:00
parent bea456e067
commit 7ff4e7864b
2 changed files with 72 additions and 21 deletions

View File

@ -109,6 +109,13 @@ input_select:
options: options:
- Spotify - Spotify
- Apple Music - Apple Music
tv_select:
name: TV Select for ATV
icon: mdi:android
options:
- remote.bedroom_atv
- remote.shield
input_text: input_text:
bathroom_playlist: bathroom_playlist:
name: Bathroom playlist name: Bathroom playlist

View File

@ -73,6 +73,48 @@ tv_atv:
entity_id: media_player.sync_box entity_id: media_player.sync_box
data: data:
mode: video mode: video
tv_f1tv_bedroom:
alias: F1TV Bedroom
icon: mdi:android
sequence:
- service: input_select.select_option
data:
option: remote.bedroom_atv
target:
entity_id: input_select.tv_select
- service: script.tv_f1tv
tv_f1tv_living_room:
alias: F1TV Living Room
icon: mdi:android
sequence:
- choose:
- conditions:
- condition: state
entity_id: switch.harmonyhub_shield_tv
state: 'off'
sequence:
- service: input_select.select_option
data:
option: remote.shield
target:
entity_id: input_select.tv_select
- service: switch.turn_on
entity_id: switch.harmonyhub_shield_tv
- service: media_player.select_source
data:
source: TV
target:
entity_id: media_player.living_room
- delay: 5
- service: script.tv_f1tv
- service: huesyncbox.set_sync_mode
target:
entity_id: media_player.sync_box
data:
mode: video
tv_f1tv: tv_f1tv:
alias: F1TV alias: F1TV
icon: mdi:android icon: mdi:android
@ -83,34 +125,36 @@ tv_f1tv:
entity_id: switch.harmonyhub_shield_tv entity_id: switch.harmonyhub_shield_tv
state: 'off' state: 'off'
sequence: sequence:
- service: switch.turn_on - service: remote.send_command
entity_id: switch.harmonyhub_shield_tv
- service: media_player.select_source
data:
source: TV
target:
entity_id: media_player.living_room
- delay: 5
- service: androidtv.adb_command
data: data:
command: HOME command: HOME
entity_id: media_player.nvidia_shield
- delay: 5
- service: media_player.select_source
data:
source: com.formulaone.production
target: target:
entity_id: media_player.nvidia_shield entity_id: "{{ states('input_select.tv_select') }}"
- delay: 5 - delay: 5
- service: androidtv.adb_command - service: remote.turn_on
data: data:
command: CENTER activity: http://play.google.com/store/apps/details?id=com.formulaone.production
entity_id: media_player.nvidia_shield
- service: huesyncbox.set_sync_mode
target: target:
entity_id: media_player.sync_box entity_id: "{{ states('input_select.tv_select') }}"
- delay: 5
- service: remote.send_command
data: data:
mode: video command: DPAD_CENTER
target:
entity_id: "{{ states('input_select.tv_select') }}"
- delay: 5
- service: remote.send_command
data:
command: DPAD_CENTER
target:
entity_id: "{{ states('input_select.tv_select') }}"
- delay: 5
- service: remote.send_command
data:
command: DPAD_CENTER
target:
entity_id: "{{ states('input_select.tv_select') }}"
tv_off: tv_off:
alias: 'TV Off' alias: 'TV Off'
icon: mdi:power icon: mdi:power