Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatten not consistently working for template sensor #762

Open
DarthSonic opened this issue May 12, 2024 · 1 comment
Open

flatten not consistently working for template sensor #762

DarthSonic opened this issue May 12, 2024 · 1 comment

Comments

@DarthSonic
Copy link

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

@caphm
Copy link

caphm commented Aug 8, 2024

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 } }}'“.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants