The following is an extract from my configuration.yaml
- adopted from the great contribution by @bigmac
c4_services:
input_select:
# Family Living audio sources
family_living_c4_input:
name: Audio Input
options:
- Squeezebox
- Volumio
- Fetch
- Chromecast Audio
family_living_amp_input:
name: Zone Input
options:
- 1
- 2
- 3
- 4
# Gallery audio sources
gallery_c4_input:
name: Audio Input
options:
- Squeezebox
- Volumio
- Fetch
- Chromecast Audio
gallery_amp_input:
name: Zone Input
options:
- 1
- 2
- 3
- 4
# Master audio sources
master_c4_input:
name: Audio Input
options:
- Squeezebox
- Volumio
- Fetch
- Chromecast Audio
master_amp_input:
name: Zone Input
options:
- 1
- 2
- 3
- 4
# Outdoor audio sources
outdoor_c4_input:
name: Audio Input
options:
- Squeezebox
- Volumio
- Fetch
- Chromecast Audio
outdoor_amp_input:
name: Zone Input
options:
- 1
- 2
- 3
- 4
input_number:
family_living_amp_volume:
name: Volume
min: 0
max: 1
step: .01
initial: .04
gallery_amp_volume:
name: Volume
min: 0
max: 1
step: .01
initial: .04
master_amp_volume:
name: Volume
min: 0
max: 1
step: .01
initial: .04
outdoor_amp_volume:
name: Volume
min: 0
max: 1
step: .01
initial: .04
input_boolean:
switch_state_1:
name: Family Living
switch_state_2:
name: Gallery
switch_state_3:
name: Outdoor
switch_state_4:
name: Master
switch:
- platform: template
switches:
family_living_switch:
friendly_name: Family Living
value_template: "{{ is_state('input_boolean.switch_state_1', 'on') }}"
turn_on:
- service: c4_services.handle_family_living_amp_on_select
- service: input_boolean.turn_on
data:
entity_id: input_boolean.switch_state_1
turn_off:
- service: c4_services.handle_family_living_amp_off_select
- service: input_boolean.turn_off
data:
entity_id: input_boolean.switch_state_1
- platform: template
switches:
gallery_switch:
friendly_name: Gallery
value_template: "{{ is_state('input_boolean.switch_state_2', 'on') }}"
turn_on:
- service: c4_services.handle_gallery_amp_on_select
- service: input_boolean.turn_on
data:
entity_id: input_boolean.switch_state_2
turn_off:
- service: c4_services.handle_gallery_amp_off_select
- service: input_boolean.turn_off
data:
entity_id: input_boolean.switch_state_2
- platform: template
switches:
outdoor_switch:
friendly_name: Outdoor
value_template: "{{ is_state('input_boolean.switch_state_3', 'on') }}"
turn_on:
- service: c4_services.handle_outdoor_amp_on_select
- service: input_boolean.turn_on
data:
entity_id: input_boolean.switch_state_3
turn_off:
- service: c4_services.handle_outdoor_amp_off_select
- service: input_boolean.turn_off
data:
entity_id: input_boolean.switch_state_3
- platform: template
switches:
master_switch:
friendly_name: Master
value_template: "{{ is_state('input_boolean.switch_state_4', 'on') }}"
turn_on:
- service: c4_services.handle_master_amp_on_select
- service: input_boolean.turn_on
data:
entity_id: input_boolean.switch_state_4
turn_off:
- service: c4_services.handle_master_amp_off_select
- service: input_boolean.turn_off
data:
entity_id: input_boolean.switch_state_4
As part of my attempt to simplify configuration.yaml
by splitting it up I would like to keep this whole section intact.
From what I understand so far the only way to keep this together is to use a package given we use different integrations; e.g. input_select
, input_number
, switch
…
Is that correct? How would this look like?