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
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
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?
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.
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: