alias: Scene Den
trigger:
  platform: state
  entity_id: input_select.scene_den
condition:
  condition: or
  conditions:
    - condition: state
      entity_id: 'input_select.scene_den'
      state: 'Nightlight'
    - condition: state
      entity_id: 'input_select.scene_den'
      state: 'Dimmed'
    - condition: state
      entity_id: 'input_select.scene_den'
      state: 'Bright'
    - condition: state
      entity_id: 'input_select.scene_den'
      state: 'Off'
action:
  - service: scene.turn_on
    data_template:
      entity_id: >
        {% if is_state( "input_select.scene_den", "Nightlight" ) %}
          scene.den_nightlight
        {%-elif is_state( "input_select.scene_den", "Dimmed" ) %}
          scene.den_dimmed
        {%-elif is_state( "input_select.scene_den", "Bright" ) %}
          scene.den_bright
        {%-elif is_state( "input_select.scene_den", "Off" ) %}
          scene.den_off
        {% endif %}
  - service: input_select.select_option
    data:
      entity_id: input_select.scene_den
      option: "-"
