@Oligarch wrote:
I get two variables (room and appliance) from DialogFlow. They are specified in template only for testing. Template works fine, but I wonder if there is any other way of filtering. I don’t like the output of {{entities}} is string, not an array. But I do not know how to do otherwise.
data_template: entity_id: > {% set room = ['kitchen','bedroom'] %} {% set appliance = 'livolo' %} {% set type = { 'livolo':'switch', 'neoclimaartvogue': 'climate', 'broadlinksp3sboiler':'switch' } %} {% set entities = type[appliance]+'.'+appliance+'_' +room | join(type[appliance]+'.'+appliance+'_') %} {{ states | selectattr('entity_id', 'in', entities) | map(attribute='entity_id') | join(', ') }}
Posts: 1
Participants: 1