Sometime you need use a selector for a service that use certain values “not human”, so, you can create a selector with ugly labels or pretty label and remaped with map or if/else the human value to valid value, that is very boring and add complexity to automation
Example:
- input_select:
oven_program:
name: Oven Program
options:
- label: Pizza
value: 12
- label: Potates
value: 15
initial: 12
tom_l
September 30, 2022, 2:33pm
2
That would make a lot of mapping templates redundant.
(Your indentation on the second value is one space too many though).
frenck
(Franck Nijhof)
September 30, 2022, 2:34pm
3
This is technically already implemented, however, not exposed at this point.
Good suggestion
8 Likes
123
(Taras)
October 1, 2022, 1:11pm
5
Sounds like this nearly three year old Feature Request may soon be fulfilled.
An input_select currently allows you to specify a selection list:
input_select:
my_selector:
name: My Selector
options:
- Kitchen
- Garage
- Bedroom
- Office
The options (Kitchen, Garage, Bedroom, Office) will appear as choices in the selector’s list. However there are situations where the chosen option is not the value we wish to use (in an automation).
For example, “Garage” may represent the temperature value to set for the garage. However, input_select only allows…
2 Likes
kuchta
(Steve Kuchta)
October 1, 2022, 1:17pm
7
My initial thought was that this already existed, but after reading through the 2019 post, I realized that I am actually doing it using the more complex (and harder to read) templating methodology. This new way has a vote from me!
teachingbirds
(Isabella Gross Alström)
October 5, 2022, 12:31pm
8
Would be awesome also when you want to have all values in English but also like to have translated friendly names.
1 Like
jazzyisj
(Jason)
October 5, 2022, 12:37pm
9
Well hey I knew English wasn’t a “romantic” language but I didn’t think it was actually “unfriendly”
petro
(Petro)
October 5, 2022, 12:38pm
10
Translations in general need to be available in the backend somehow (even in templates). It’s a point of contention for me.
1 Like
EvertJob
(Toppe)
November 14, 2023, 1:04pm
11
Any idea if, and when, this will be released?
1 Like
It’s not as easy as it should be, but you can assign text to values or vice versa.
-mqtt:
- select:
unique_id: 'Set Warmwater Mode'
name: 'Set Warmwater Mode'
command_topic: 'stat/logamatic/Command'
retain: true
options:
- 'Off'
- 'On'
- 'Automatic'
state_topic: 'stat/logamatic/WW/Mode'
value_template: >-
{% set values = {'0':Off', '1':'On', '2':'Automatic'} %}
{{ values[value] if value in values.keys() else 'Off' }}
command_template: >-
WW_MODE:{% set values = {'Off':0, 'On':1, 'Automatic':2} %}
{{ values[value] if value in values.keys() else 0 }}
3 Likes
Would still be something very usefull!