Theoretically you could create a template sensor doing just that (all update sensors from integration== HACS) and output a binary sensor with the old entity name.
If any of xyz are true == true.
In sure Taras could gen up such an animal in 40 seconds…
Oh, but wait, they did the update very good, there is no need for notification. Seems that it will show an update notification in settings, like a normal addon update. Which is perfect.
Yes, certainly has some polish on it - very happy that the updates come in as repairs (been using the new version for months now in the pre-release version)
However, some people are probably still going to want a binary sensor or count to show on their dashboards so I hope my example can help those who do want something like that.
I needed to change the examples in the custom-sidebar repo because the examples to get the HACS updates in JavaScript and Jinja templates got outdated with the removal of the HACS sensor.
@teskanoo example works perfect, posting my alternative here just as another way to retrieve that number:
Thank you!
This works but it includes all updates on the system, not only the HACS ones (it shows me 12 updates).
The initial example of @teskanoo works and shows me the correct HACS updates available and that is 1 only at this point.
Question, is there a way to exclude certain integrations from the counter?
For example integration_entities not == unifi or integration_entities != unifi
Thank you, I will have two sensors, one for HACS updates and one for the rest but I want to exclude updates from certain integrations, here is my example to exclude HACS and also the Unifi integration.
I’m trying to narrowing down the HACS update sensor to distinguish if it is a dashboard or an integration update. The attribute seems to be available as shown on the screenshot below, but I cannot find an info on how to access it. Does somebody have an idea? So the goal would be to have two sensors, one for available HACS Dashboard updates and one for available HACS integration updates.
Throws another error: TypeError: device_attr() takes 3 positional arguments but 4 were given
I was also trying different things with 'eq' etc, but I’m not skilled enough to get it working - can someone help me? I’m not sure if I can use device_attr or is_device_attr in an expand…?
Checked the docs, is_device_attr is a test, the device_attr is a filter. So I was trying to loop through the filter device_attr, but it fails big-time with the error TypeError: 'NoneType' object is not iterable.
{% for plugin in device_attr('entity_id', 'model') %}
{{
expand(states.update)
| selectattr('state', 'eq', 'on')
| rejectattr('entity_id', 'in', integration_entities('unifi'))
| rejectattr('entity_id', 'in', integration_entities('hacs'))
| list
| count
}}
{% endfor %}
I believe instead of
device_attr('entity_id'
something like
device_attr(expand
is required, but it fails when I try to pack the whole expand section into the device_attr brackets
Beautiful, thank you! FYI, the attr_name was missing in is_device_attr
I now created two sensors. One will show me a count of all System & Intregration Updates (excluding Unifi Firmware Updates in my case). This includes Home-Assistant and Supervisor updates. The other sensor will show me a count of all Frontend-Updates.