#Flatten filter not available - WTF? :)

1 messages · Page 1 of 1 (latest)

peak tide
#

I have variable in my script:

{{ f_areas|map('area_entities')|map('select', 'in', label_entities('Music'))|flatten|list }}

The f_areas field is the script field, area array selector.
This script is always unavailable on HA start on latest HA version, although:
It works perfectly in Dev template section, and if I change script and save it, still works good.

The problem is "flatten filter not available".
What the hell is going on?

cursive kernel
#

flatten isn’t a filter, unless you’ve installed the Spook integration

peak tide
#

Does it mean something is wrong with Spook?

cursive kernel
#

could be? My default reaction would be to uninstall spook and reinstall. You could also try this, which doesn't require spook:

{{ f_areas | map('area_entities') | map('select', 'in', label_entities('Music')) | sum(start=[]) | list }}
#

actually I'd do it like this:
{{ f_areas | map('area_entities') | sum(start=[]) | select('in', label_entities('Music')) | list }}