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

Some update notifications don't appear to work correctly in certain scenarios #135259

Open
benwainwright opened this issue Jan 10, 2025 · 0 comments

Comments

@benwainwright
Copy link

benwainwright commented Jan 10, 2025

The problem

In my HASS setup, I've got a badge sitting at the top of my dashboard that displays a count of the total number of available updates that are pending. This count is based on the following template sensor

- sensor:
    - name: "Available updates count"
      unique_id: "available-updates-count"
      state: |
        {%- set count = namespace(value=0) -%}
        {%- for st in states.update  -%}
          {%- if st.attributes['installed_version'] != st.attributes['latest_version'] -%}
            {%- set count.value = count.value + 1 -%}
          {%- endif -%}
        {%- endfor -%}
        {{ count.value -}}

On several occasions now, I've found myself in a situation where that count is > 0, but when I go to the settings page, I see no update available. My setup is currently in just such a state, so I've just modified the above template in developer tools to print out the actual update that is pending; this is the output I get:

<template TemplateState(<state update.mealie_update=off; auto_update=False, display_precision=0, **installed_version=v2.4.2**, in_progress=False, latest_version=v2.4.2-3, release_summary=## v2.4.2-3 (09-01-2025)
- Minor bugs fixed
## v2.4.2-2 (08-01-2025)
- Minor bugs fixed
## v2.4.1-2 (21-12-2024)
- Minor bugs fixed

## v2.4.1 (21-12-2024)
- Update to latest version from mealie-recipes/mealie (changelog : https://github.com/mealie-recipe, release_url=None, skipped_version=None, title=Mealie, update_percentage=None, entity_picture=/api/hassio/addons/db21ed7f_mealie/icon, friendly_name=Mealie Update, supported_features=25 @ 2025-01-10T07:27:51.478280+00:00>)>
            <template TemplateState(<state update.card_mod_update=off; auto_update=False, display_precision=0, installed_version=v3.5.0, in_progress=False, latest_version=v3.4.4, release_summary=None, release_url=https://github.com/thomasloven/lovelace-card-mod/releases/v3.4.4, skipped_version=None, title=None, update_percentage=None, friendly_name=card-mod update, supported_features=23 @ 2025-01-10T07:28:04.108759+00:00>)>

Neither of these updates are displayed in the normal place at the top of the settings page. In both cases, it looks like there is something unusual about the value of the latest_version field, which suggests that HASS is using conditional logic that has decided to exclude these updates:

  • Mealie: installed_version=v2.4.2, latest_version=v2.4.2-3 (the -3 at the end)
  • Card-mod: installed_version=v3.5.0, latest_version=v3.4.4 (latest_version is lower than installed version)

This is the second time I've noticed this, and the first time it happened, the result of this investigation was similar. The first feels clearcut as a bug and something should be displayed. In the case of the second one, even though its not a later version (did 3.5.0 get removed?), I feel that something should be displayed in settings?

What version of Home Assistant Core has the issue?

core-2025.1.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

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

1 participant