Open erkr opened 9 months ago
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (group
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
group documentation group source (message by IssueLinks)
Update:
I got more templates errors, always related to state_attr()
.
It seems that state_attr
slightly changed since 2023.9.x. It now can return none
instead of empty strings or empty lists.
So I fixed that by adding or []
, when a list
should be returned:
{% set entities = state_attr('group.myalerts','entity_id') or [] %}
Or adding or ''
, when a string
should be returned:
{% set entities = state_attr('group.myalerts','entity_id') or '' %}
Then I discovered a second issue that explains the errors for templates I don't have anymore! During startup 'older' versions of the templates in the cards where still evaluated. After a few restart these errors where gone.
Update: This is a more general problem with templates in UI cards. While editing these templates, the code is temporary invalid.
Since core 2023.9 this results in a huge pile of template errors that are bloating the log.
This biggest issue is that these errors continue to emerge up to hours after finishing the template. Even after a restart!
This is very confusion as you get errors for template code that is not there anymore!
I changed the title of this issue accordingly
Hi,
I get errors from templates in the log but these templates are deletet already (I search the RAW dashboard code and all files textbase). After some restarts sometimes the errors a gone but sometimes the errors are still there for days.
Any idea or news?
Steffen
@SteffenM-DE Yes that is exactly the issue I raised here. For some reason the errors logged from the template integration get seriously delayed when there are many errors.
@erkr I test many things, reboot full server, saving again ore something but I could not recognize patterns. Sometimes the log shows the error in a template while creating this part an never using it really. This stays in log for many reboots and suddenly it's gone.
I think there are two issues:
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment π This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Bump
Hi same issue for me. Very old templates and errors are still there
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment π This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
bump
The problem
During startup I have a few template errors. It is not the error itself that concerns me (I understand the attribute list was still empty during the call). But I can't find where it is coming from. The groups exist and are old-style groups configured in groups.yaml. the errors:
As far I'm aware of I don't have templates with this code (I check my automation, scripts, templates and Lovelace cards). So can it be that this happens when HA e.g. renders the default lovelace view? If so, it is a bug in HA rendering groups that are not yet initialized. Or the template filtering of empty attribute lists has changed since core 2023.9 I added the full log below.
What version of Home Assistant Core has the issue?
core 2023.9.x
What was the last working version of Home Assistant Core?
core 2023.8.x
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Don't know, would start with group
Link to integration documentation on our website
https://www.home-assistant.io/integrations/group/
Diagnostics information
No response
Example YAML snippet
The group definitions (old style in groups.yaml):
Anything in the logs that might be useful for us?
Additional information
Its the first log statement directly after the standard warning for custom integrations. None of these custom integrations is using these groups. I have more groups defined. No errors for the others