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

UI template binary has wrong state in core #133967

Open
Mariusthvdb opened this issue Dec 24, 2024 · 5 comments
Open

UI template binary has wrong state in core #133967

Mariusthvdb opened this issue Dec 24, 2024 · 5 comments

Comments

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Dec 24, 2024

The problem

created in UI:
Scherm­afbeelding 2024-12-24 om 15 25 44

an showing it is 'Aan' (on) which is true, as there is an update entity being 'on'

however:
Scherm­afbeelding 2024-12-24 om 15 25 28

is displayed in the dev tools states, and as a consequence the conditions based on this dont evaluate correctly, nor does to show the right state-color/icon in the frontend cards

What version of Home Assistant Core has the issue?

2025.1.0b1

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

template

Link to integration documentation on our website

https://www.home-assistant.io/integrations/template

Diagnostics information

No response

Example YAML snippet

{{label_entities('update')|select('is_state','on')
 |list|count > 0 }}

Anything in the logs that might be useful for us?

No response

Additional information

filing this explicitly as a backend issue, because the UI Frontend config is correct, and the backend isnt

@home-assistant
Copy link

Hey there @PhracturedBlue, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (template) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of template can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign template Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


template documentation
template source
(message by IssueLinks)

@joostlek
Copy link
Member

Can you show the full picture by also executing this query in the dev tools and by showing all entities with this label and its state?

@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Dec 28, 2024

yes I will when the next update is there, currently all are 'off' and the state of the binary template is correct

btw, I forgot to mention that the one entity being on when the issue appeared was the diskstation_dsm_update

dev tools

Scherm­afbeelding 2024-12-28 om 14 48 20

template UI
Scherm­afbeelding 2024-12-28 om 14 47 48

manually updating that now to be 'on' forces the state changes, and does so correctly:

Scherm­afbeelding 2024-12-28 om 14 53 19

@Skeletorjus
Copy link

Facing the exact same issue. Preview shows correct state, pasting the template in devtools shows correct state, but the actual state is wrong - 'None' in my case. Could the usage of label_entities be the reason?

{% set entities = label_entities('LastMotion') | expand | selectattr('state', 'eq', 'on') | list %}
{% if entities %}
{{ (entities | sort(attribute='last_changed'))[-1].name }}
{% else %}
None
{% endif %}

Running 2025.1.0b6 right now. I believe this was working on 2024.12.x.

@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Jan 3, 2025

yeah, in my case it certainly has to do with the label, more specifically, changing/adding it.

My template got out of sync doing so, and required a restart (so not a reload of templates) before all was registered correctly again

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

No branches or pull requests

3 participants