I have 15 input booleans. When any one of them turns on, I want the other 14 to turn off. What’s the most efficient way to do this?
Cheers, Richard
I have 15 input booleans. When any one of them turns on, I want the other 14 to turn off. What’s the most efficient way to do this?
Cheers, Richard
The most efficient way would be to remove the booleans and use an input_select instead, which can only have 1 of its options active at a time.
Sounds good. I’ll check it out.
What does the error say?
My bad. I thought I had put this after my input booleans, but I had somehow broken them apart. Thanks.
to expand on what @anon43302295’s solution… If you use an input_select but you want input booleans, you can make template switches and expose them in the UI while hiding the input select:
input_select:
myoptions:
name: My Options
options:
- None
- Option 1
- Option 2
Then make a switch templates:
switch:
- platform: template
switches:
option_1:
value_template: "{{ is_state('input_select.myoptions', 'Option 1') }}"
turn_on:
- service: input_select.select_option
data:
entity_id: input_select.myoptions
option: Option 1
turn_off:
- service: input_select.select_option
data:
entity_id: input_select.myoptions
option: None
option_2:
value_template: "{{ is_state('input_select.myoptions', 'Option 2') }}"
turn_on:
- service: input_select.select_option
data:
entity_id: input_select.myoptions
option: Option 2
turn_off:
- service: input_select.select_option
data:
entity_id: input_select.myoptions
option: None
Thanks for that helpful suggestion. I can see I will need to get into templates. I can read yaml pretty well, but the curly-brackets add another level of abstraction.