@lonebaggie wrote:
Not sure if this has been documented anywhere, but I have been using Input select as Global variables lists (Arrays) in Automations.
Take the following input Select
Array: name : Array Test options: - Option A - Option B - Option C - Option D
You can convert this to a list in JInga2 with the following
{% set arraytest = state_attr("input_select.array","options") %}
You can extract an array element by using
`{% set obj = arraytest[1] %}` {{obj}}
This will return ‘Option B’ Jinga2 lists start at element 0
I use this to trigger actions from Alexa using a virtual bulb . The brightness level corresponds to an element in the item select.
see
Hope this is of some use
Posts: 1
Participants: 1