@luma wrote:
I’m trying to figure out how to get a template to produce a list that can be consumed as a list by a service call. Specific case right now is to enumerate a list of scenes, and send that list to an
input_select
as a list of available optionsCurrently, this is what I have:
- service: input_select.set_options data_template: entity_id: "input_select.hasp_plate01_page1button4scene" options: "[{% for item in states.scene %}'{{ item.entity_id }}'{% if not loop.last %}, {% endif %}{% endfor %}]"
That template renders as
["scene.daylight", "scene.lights_off", "scene.lights_on", "scene.night"]
which, if pasted into the service call, works like expected. However, I’m pretty sure it’s just rendering as a long string and I think I need it to somehow be returning a list.Is this possible?
Posts: 14
Participants: 6