Hey there, I am pretty new to all stuff regarding Home Assistant and just starting to get my first automations going. I just wondered if it is possible to have some sort of template array for the options of an input_select. For example to have all scenes added automatically as options instead of changing the input_select every time when you create a new scene. Also it would be pretty neat if you wouldn’t have to write an elseif for every option of the input slider to trigger an specific action. instead just have a template which selects a service and the specific entity id somehow…
Don’t know if something like this is possible, but if you create a lot of scenes you always have to edit several scripts and the input slider
I just include this in my scenes >
input_select.lighting_mode:
option: Evening Dim
That way everytime a scene is called it automatically updates my input select. Which I use for various other things. Not sure if this helps, I just recently realized I could do this and it simplified a lot of my setup haha
Okay yeah that helps a little bit. But is it possible to do it the other way round without a long automation. So that you select an option on the input select and it automatically turns a specific scene on?
That’s what I used to do, now all my scenes run automatically and update the input select. Had a bunch of automation that would do that, annoying though haha Sorry I never moved past that.
I think I have part of your solution. This will activate a scene based on your input select, without having to edit it further. Your list in input select must be the same as the scene names:
- id: sfeer
alias: 'Sfeer'
trigger:
- platform: state
entity_id: input_select.light_profiles
action:
- service: scene.turn_on
data_template:
entity_id: scene.{{ states.input_select.light_profiles.state | replace(' ', '_') | lower | string }}
I also tried to automatically make a list in the input_select, but I wasn’t succesfull so far:
scenes_profiles:
name: Kies scenes_profiles
data_template:
options: >
{% for state in states.scene %}
{{ ‘- ’ + state.name | replace(’ ', ‘_’) | lower}}
{%- endfor -%}
Were you ever able to get this to work? I’ve been trying to figure this out as well
No, the use of templates is not allowed in scenes.