spook
spook copied to clipboard
flatten not consistently working for template sensor
What version of Spook are you using?
3.0.1
What version of Home Assistant are you using?
2024.5.3
The problem
I created a template sensor in configuration. yaml. I am using flatten within the state template. When loading the yaml in developer tools, everything works. When restarting HA, the sensor gets unavailable and error log shows that flatten function is unknown.
Is there a way to overcome that issue?
Anything in the logs? Paste it here!
No response
I've got the same issue. I'm using flatten filter in a template within a script. Home assistant disables that script because it claims it could not be validated:
„invalid template (TemplateAssertionError: No filter named 'flatten'.) for dictionary value @ data['sequence'][1]['variables']['result']. Got '{{ { "entity_id": (entities + areas|map("area_entities")|flatten + labels|map("label_entities")|flatten)|unique|list } }}'“.