Get amount of updates available?

Anybody know how I can get a simple number returned that will state the amount of all the updates available, summed up?

In other words, I want to grab the same number that is shown on the sidebar, next to “Settings”

It usually shows all updates for devices, addons, cor services, and other things that need attention.

configuration.yaml

template:
  - sensor:
      - name: "Total Updates Available"
        state: "{{ states.update | selectattr('state', 'eq', 'on') | list | count }}"

It shows repair issues and other things too. The updates are just part of it.
The update sensor tom_l have posted will capture most of them, but some integrations do not follow the HA standard with an update sensor. You will have to handle those case-by-case.

Thanks guys!
And yeah, I’ll need to keep that in mind for the other integrations. For now, it’s handy to know externally when I need to open HA and apply some updates :slight_smile: