As per the docs, file sensor only uses the last line, so that’s expected behavior.
If you use */ instead of * in the filter for folder platform, you can list only folders. However, you can’t get subfolders (with **/), because glob does not have the recursive flag in the component’s code. See screenshots below.
You also can create the select in the UI if you prefer, no problem. See this, if you want to change the sorting order when the automation updates the select.
but need some help with the syntax to go through all 3 sensors:
- id: winamp_folders_input_select
alias: "WINAMP folders input select"
description: "Load/Update folders in select."
trigger:
- platform: homeassistant
event: start
- platform: state
entity_id: sensor.music_genres
- platform: state
entity_id: sensor.music_off_record
- platform: state
entity_id: sensor.music_playlists
action:
- service: input_select.set_options
target:
entity_id: input_select.winamp_folders
data:
options: >
{%- set folders = namespace(value=[]) %}
{%- for folder in (state_attr("sensor.music_genres", "file_list") | map('replace', '/media/', '') | sort) and (state_attr("sensor.music_off_record", "file_list") | map('replace', '/media/', '') | sort) and (state_attr("sensor.music_playlists", "file_list") | map('replace', '/media/', '') | sort) %}
{%- set folders.value = folders.value + [folder] %}
{%- endfor %}
{{ folders.value }}
Also, can I append an extra option to the beginning of the list, something like “select folder:” to ensure I have the option to select any option/folder (as the currently selected option in input_select can’t be “reselected”)