I know I’m doing something incorrectly, but I just cannot get the selector.select.options working. My full, but incomplete, script is below.
I get the error Array has too many items. Expected 1 or fewer. to the right of the next section, but the error highlighting starts at - Google
The error message goes away if I remove the second selection, namely - Sonos
The location of the selector does not matter. Meaning I can put it anywhere in the fields and I get the error.
door_chime:
variables:
default_volume: input_number.announcement_volume
fields:
player:
name: Media Player
description: Play on Sonos or Google
required: false
default: 'Google'
selector:
select:
options:
- Google
- Sonos
sound:
name: Sound File
description: The sound to play
example: matrixxx__ping.wav
required: false
default: 'matrixxx__ping.wav'
selector:
text:
volume:
name: Volume
description: The volume at which to play the sound
example: '0.5'
required: false
default: '{{ default_volume }}'
selector:
number:
min: 0
max: 1
step: 0.1
mode: slider
sequence:
- condition: state
entity_id: input_boolean.audible_notifications
state: 'on'
- service: media_player.volume_set
target:
entity_id: media_player.home_group
data:
volume_level: template
value_template: '{{ volume }}'
- service: media_player.play_media
target:
entity_id: media_player.home_group
data:
media_content_id: /local/sounds/matrixxx__ping.wav
media_content_type: music/wav
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: media_player.volume_set
target:
entity_id: media_player.home_group
data:
volume_level: 0.25
mode: single
alias: Door Chime
icon: mdi:bell-ring
I’m struggling to do the same thing as @RubenKelevra. Did you ever figure it out?
I want to replace the list of options in the field selector with an object (an input_select or even a template) containing a list of items. This list will then be shown when users click on the dropdown menu when running the script. But I can’t seem to figure out a way to do this.
Wondering if this is has been figured out. I’d like to do the same. Keep a list of selector options centrally in an input select helper and use that in different scripts and automations.
Thank you @Didgeridrew - that did it! Much appreciated.
Small nitpick, doing it this way includes two unintended options in my dropdown menu along with my main options, one is a blank spot and the other is “unavailable”. I can live with this, but any way to avoid it? Possible bug?