Tsar
(Christian)
January 24, 2025, 11:43am
1
Hello,
I figured out to get a list of HACS installations (up-to-date or not), now I want the same for the Add-On’s but I have no idea how to do this…
Number HACS (up-to-date) : {{ states.update | selectattr('state', 'eq', 'off') |
map(attribute='entity_id') | select('in',
integration_entities('hacs'))| list | count }}
Number HACS (not up-to-date) : {{ states.update | selectattr('state', 'eq', 'on') |
map(attribute='entity_id') | select('in',
integration_entities('hacs'))| list | count }}
{{ states.update | selectattr('state', 'eq', 'off') |
map(attribute='entity_id') | select('in',
integration_entities('hacs')) | list }}
I tried this, but this seems not to work :
Number ADD-ON (up-to-date) : {{ states.update | selectattr('state', 'eq', 'off') |
map(attribute='entity_id') | select('in',
integration_entities('Home Assistant Supervisor')) | list | count }}
{{ states.update | selectattr('state', 'eq', 'off') |
map(attribute='entity_id') | select('in',
integration_entities('Home Assistant Supervisor')) | list }}
Tsar
(Christian)
January 24, 2025, 12:52pm
2
Found it : “Supervisor” instead of “Home Assistant Supervisor”
And add this : | reject(‘match’, ‘update.home_assistant’)
I like this, but it shows items with skipped updates as ‘up-to-date’, correct?
123
(Taras)
January 24, 2025, 5:57pm
4
This lists all update
entities for Add-ons only.
{{ integration_entities('Supervisor')
| select('match', 'update\.(?!home_assistant)')
| list }}
On my system, it correctly lists 7 entities for 7 Add-ons.
Tsar
(Christian)
January 25, 2025, 7:38am
5
One little problem with this one, the add-on “update.home_assistant_google_drive_backup_update”
Meanwhile I do it this way :
{{ states.update
| map(attribute='entity_id')
| select('in', integration_entities('Supervisor'))
| reject('match', 'update.home_assistant_core_update')
| reject('match', 'update.home_assistant_supervisor_update')
| reject('match', 'update.home_assistant_operating_system_update')
| list | count }}
123
(Taras)
January 25, 2025, 3:35pm
6
Ah! I don’t have that Add-on (or HA OS) so it wasn’t part of my testing sample. In that case, the regex pattern needs to be a bit more sophisticated.
{{ integration_entities('Supervisor')
| select('match', 'update\.(?!home_assistant_(core|supervisor|operating_system))')
| list | count }}
Or if you prefer a version with a simpler regex pattern.
{{ integration_entities('Supervisor')
| select('match', 'update')
| reject('search', '(core|supervisor|operating_system)')
| list | count }}
EDIT
FWIW, you can probably reduce the string operating_system
to just operating
because it’s unlikely there are Add-ons with home_assistant_operating_some_other_name
.
{{ integration_entities('Supervisor')
| select('match', 'update\.(?!home_assistant_(core|supervisor|operating))')
| list | count }}
{{ integration_entities('Supervisor')
| select('match', 'update')
| reject('search', '(core|supervisor|operating)')
| list | count }}
1 Like