Help with Input Select for Scenes

I’m trying to setup Input Select to select some scenes for some lights. I’ve not done it before, so don’t really know what I’m doing.

Here’s what I have up to now:

input_select:
  living_room_scenes:
    name: Scenes
    options:
      - Full Brighness
      - Early Evening
      - Late Evening
      - Dim to 50%
    initial: Full Brighness
    icon: mdi:lightbulb-on-outline


scene:
  - name: Full Brighness
    entities:
      input_select.full_brightness:
        option: Full Brighness
      switch.lounge_light:
        state: on
        transition: 2
        brightness: 254
      switch.dining_room_light:
        state: on
        transition: 2
        brightness: 254

  - name: Early Evening
    entities:
      input_select.early_evening:
        option: Early Evening
      switch.lounge_light:
        state: on
        transition: 2
        brightness: 191
      switch.dining_room_light:
        state: off
        transition: 2

  - name: Late Evening
    entities:
      input_select.late_evening:
        option: Late Evening
      switch.lounge_light:
        state: off
        transition: 2
      switch.dining_room_light:
        state: on
        transition: 2
        brightness: 25

  - name: Dim to 50
    entities:
      input_select.dim_50:
        option: Dim to 50
      switch.lounge_light:
        state: on
        transition: 2
        brightness: 127
      switch.dining_room_light:
        state: on
        transition: 2
        brightness: 127

This doesn’t work at the moment. I wasn’t sure if I should also add some ‘automation’ code or not? If so, any help with that code would be appreciated :slight_smile:

1 Like

Yes you need some automations to actually activate those scenes. Right now all you have is just scenes which never get called.

~Cheers

Yes, so you have your menu, and you have your scenes, and you need to tie them together with an automation for each one just like you’re thinking. Something like this:

 - alias: Full Brightness selected
        trigger:
          platform: state
          entity_id: input_select.living_room_scenes
          to: "Full Brightness"
        action:
          service: scene.turn_on
          entity_id: scene.full_brightness

 - alias: Early Evening selected
        trigger:
          platform: state
          entity_id: input_select.living_room_scenes
          to: "Early Evening"
        action:
          service: scene.turn_on
          entity_id: scene.early_evening

And so on…

3 Likes

That works, thanks a lot!

Awesome. I also got it working! I added
hide_entity: true

So it doesnt show on on the main view

Bump!

I’ve done this on my own, but was wondering instead of having separate automations for each input_select option, is there a more elegant way of passing the chosen option to the action?

Something like

- alias: Trigger Scene from Input Select
  trigger:
    platform: state
    entity_id: input_select.light_scene_selector
  action:
    service: scene.turn_on
    entity_id: scene.{{WHATEVER WAS CHOSEN}}

I also have a “None” initial option. So I’m guessing I’d need some logic (or a blank scene called None) if I were to select it?

Thanks.

I’ve managed to do this, for anyone looking for something similar in the future. Calling the None option doesn’t seem to trigger any errors in the log so I’m just going to leave it.

Config

input_select:

  scene_selector:
    name: Light Scene
    icon: mdi:ceiling-light
    options:
      - None
      - Concentrate
      - Dimmed
      - Reading
      - Relax
      - RedAlert
      - Movie

The the automation to call it.

- id: SceneToConcentrate
  alias: Scene Concentrate
  trigger:
    platform: state
    entity_id: input_select.scene_selector
  action:
    service: scene.turn_on
    data_template:
      entity_id: scene.{{trigger.to_state.state}}
5 Likes

I used the Hue App and HA to record all the scenes it had and then created a select option to switch them, see here – the main difference I notice is that you appear to have multiple aliases/automation(?) per scene whereas I have one to switch depending on choice:

Might help you save some code, helped me out :slight_smile: