Thanks for responding! Your solution with the auto-entities card and custom-template-entity-row was exactly what I was trying to achieve: getting only the device (no repeat entities) that was unavailable into a dynamic dashboard card and have the tap action go to that device page. I was able to get everything working.
Firstly, I was getting errors initially because I was accidentally commenting out a necessary line when editing the ignore_list portion of the macro. After figuring that out, I just needed to edit your macro call in the developer tools area to this:
Unfortunately I do not get the expected result from integration_entities.
For example HACS creates an update sensor for each custom integration, which has the value “unavailable” when no updates are available. Yet,
{{ integration_entities(‘hacs’) }}
returns just [‘sensor.hacs’] despite the UI showing more entities under HACS. All unavailable except the single one returned.
Same with UniFi.
If integration_entities does not report unavailable entities, it may not not be a good method of excluding devices.
if i remove the template: portion i no longer see any errors but when i restart home assistant and check for an entity called sensor.unavailable_devices i cant find it.
here is what i get in my logs when i restart HA
Logger: homeassistant.config
Source: config.py:592
First occurred: 10:21:00 AM (1 occurrences)
Last logged: 10:21:00 AM
Invalid config for ‘template’ at templates.yaml, line 70: ‘sensor’ is an invalid option for ‘template’, check: sensor->1->sensor Invalid config for ‘template’ at templates.yaml, line 70: required key ‘state’ not provided
Do you know if there is a way of excluding “disabled” entities/devices from the list? These seem to show up as unavailable, but I’ve manually disabled them as they are unused or out of action.
ta
I stumbled upon a pyscript based solution to detect unavailable devices. In pyscript limitations of the templates are gone.
Check here for a the pyscript version that I updated a little for some corner cases I ran into (but it’s fully based on the solution of the original author)
This script is timer based and creates a sensor as requested by the OP.
I’m using this template, but it’s returning devices that have only one entity with an unavailable state. I want to get only the devices where all their entities are unavailable.
Anyone know how I’d go about excluding certain devices by name? Here’s my template that returns a correct list of Devices (showing user names), but I want to be able to exclude certain ones.