alias: Scene Master Bedroom
trigger:
  platform: state
  entity_id: input_select.scene_master_bedroom
condition:
  condition: or
  conditions:
    - condition: state
      entity_id: 'input_select.scene_master_bedroom'
      state: 'Nightlight'
    - condition: state
      entity_id: 'input_select.scene_master_bedroom'
      state: 'Dimmed'
    - condition: state
      entity_id: 'input_select.scene_master_bedroom'
      state: 'Relax'
    - condition: state
      entity_id: 'input_select.scene_master_bedroom'
      state: 'Read'
    - condition: state
      entity_id: 'input_select.scene_master_bedroom'
      state: 'Bright'
    - condition: state
      entity_id: 'input_select.scene_master_bedroom'
      state: 'Off'
action:
  - service: scene.turn_on
    data_template:
      entity_id: >
        {% if is_state( "input_select.scene_master_bedroom", "Nightlight" ) %}
          scene.master_bedroom_nightlight
        {%-elif is_state( "input_select.scene_master_bedroom", "Dimmed" ) %}
          scene.master_bedroom_dimmed
        {%-elif is_state( "input_select.scene_master_bedroom", "Relax" ) %}
          scene.master_bedroom_relax
        {%-elif is_state( "input_select.scene_master_bedroom", "Read" ) %}
          scene.master_bedroom_read
        {%-elif is_state( "input_select.scene_master_bedroom", "Bright" ) %}
          scene.master_bedroom_concentrate
        {%-elif is_state( "input_select.scene_master_bedroom", "Off" ) %}
          scene.master_bedroom_off
        {% endif %}
  - service: input_select.select_option
    data:
      entity_id: input_select.scene_master_bedroom
      option: "-"
