Open cvwillegen opened 7 months ago
Same issue here. I have some entities I would like to track whether they will become unavailable. So I have given them a label and below template:
{% for item in label_entities('trace_unavailable') %} {% if states('item') == 'unavailable' %} {{ item }} {% endif %} {% endfor %}
A change in the state of the entities tagged with this label doesn't trigger the template sensor to be evaluated again.
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.
This is still an issue in the latest version of HA.
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.
I would very much still like this to be fixed. Not stale, don't close!
The problem
I have a template sensor helper with the following configuration:
{%- set ns=namespace(alerts = 0) %}{%- for alert in expand(label_entities('alert') + label_entities('alert clock')) -%}{%- if alert.state== "on" -%}{% set ns.alerts = ns.alerts+1 %}{%- endif %}{%-endfor %}{{ ns.alerts }}
I have a couple of
input_boolean
helpers tagged with the labelalert
. I accidentally labeled a few automations with the same label. After that, the state of the helper went to 11 (probably because one the referenced entities changed). When I removed the label from the automations, the state of the template sensor stayed at 11, even though the preview in the helper editor showed a value of 0, and the correct selection of entities the template looked at.So, when labels are added/removed, template sensors that use
label_entities()
are not evaluated again.What version of Home Assistant Core has the issue?
2024.4.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
https://www.home-assistant.io/docs/configuration/templating/#labels
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response