39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
automation: !include ../automations/ui.yaml
|
|
media_player:
|
|
- platform: template
|
|
media_players:
|
|
receiver:
|
|
friendly_name: Receiver
|
|
current_source_template: "{{ states('input_text.selected_source') }}"
|
|
value_template: >
|
|
{% if is_state("input_boolean.receiver_on", "on") -%}
|
|
on
|
|
{%- else -%}
|
|
off
|
|
{%- endif %}
|
|
turn_on:
|
|
service: switch.turn_on
|
|
data_template:
|
|
entity_id: switch.receiver_on
|
|
turn_off:
|
|
service: switch.turn_on
|
|
data_template:
|
|
entity_id: switch.receiver_off
|
|
volume_up:
|
|
service: switch.turn_on
|
|
data_template:
|
|
entity_id: switch.volume_up
|
|
volume_down:
|
|
service: switch.turn_on
|
|
data_template:
|
|
entity_id: switch.vol
|
|
input_templates:
|
|
source 1:
|
|
service: input_boolean.turn_on
|
|
data_template:
|
|
entity_id: input_boolean.source_1
|
|
source 2:
|
|
service: input_boolean.turn_on
|
|
data_template:
|
|
entity_id: input_boolean.source_2
|