-
-
Notifications
You must be signed in to change notification settings - Fork 28.6k
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
List entries within an attribute are processed twice #99972
Comments
Hey there @PhracturedBlue, @tetienne, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) template documentation |
Hi @pedolsky , Maybe this will help: adding a random() statement to the template confirms that the value is fully evaluated twice (with 2 different values of random). |
Until the bug is fixed, enhance the template to discard duplicates using the Change this: {{ (new + current)[:10] }} To this: {{ ((new + current) | unique(attribute='time') | list)[:10] }} In Mariusthvdb's example, duplicates would be list items with the same |
This bug is not related in special to attributes, but that every trigger is now fired twice? So this could be same reason as in my case, described in the forum: |
Fixed by #100119 |
The problem
I'm using several trigger based template sensors with a list within an attribute, based on examples like
here or here.
Since 2023.9, the list entries are duplicated.
What version of Home Assistant Core has the issue?
core-2023.9.1
What was the last working version of Home Assistant Core?
core.2023.8
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
Template
Link to integration documentation on our website
https://www.home-assistant.io/integrations/template/
Diagnostics information
No response
Example YAML snippet
Additional information
No response
The text was updated successfully, but these errors were encountered: