EDIT: device_entities() only exists in 2021.10.0+ or the current beta. So you’ll need to be on the latest.
You can only find entities in an integration if the integration is implemented through the ui. But first, you’ll need to find the integration identifier. Then use that identifier to list the entities.
Here’s a template that will find you the identifiers for each integration that’s implemented in the UI.
{% set devices = states | map(attribute='entity_id') | map('device_id') | unique | reject('eq',None) | list %}
{%- set ns = namespace(integrations = []) %}
{%- for device in devices %}
{%- set ids = device_attr(device, 'identifiers') | list | first %}
{%- if ids and ids | length == 2 %}
{%- set integration, something_unique = ids %}
{%- if integration not in ns.integrations %}
{%- set ns.integrations = ns.integrations + [ integration ] %}
{%- endif %}
{%- endif %}
{%- endfor %}
{{ ns.integrations }}
If the integration you desire is not listed in the output, then you cannot get the list of entities.
e.g.
Then, take a listed integration and paste it into the following tempalte. For example, I’m pulling hyperion
entities.
{%- set find_integration = 'hyperion' %}
{%- set devices = states | map(attribute='entity_id') | map('device_id') | unique | reject('eq',None) | list %}
{%- set ns = namespace(entities = []) %}
{%- for device in devices %}
{%- set ids = device_attr(device, 'identifiers') | list | first %}
{%- if ids and ids | length == 2 and ids[0] == find_integration %}
{%- set ns.entities = ns.entities + device_entities(device) %}
{%- endif %}
{%- endfor %}
{{ ns.entities }}
e.g.
EDIT2: If you don’t want to wait for 2021.10, this will work currently:
{%- set find_integration = 'hyperion' %}
{% set entities = states | map(attribute='entity_id') | list %}
{%- set ns = namespace(entities = []) %}
{%- for entity_id in entities %}
{%- set ids = device_attr(entity_id, 'identifiers') %}
{%- if ids %}
{%- set ids = ids | list | first %}
{%- if ids and ids | length == 2 and ids[0] == find_integration %}
{%- set ns.entities = ns.entities + [ entity_id ] %}
{%- endif %}
{%- endif %}
{%- endfor %}
{{ ns.entities }}
EDIT3: 1 liner in current version of HA for list of UI integrations:
{{ states | map(attribute='entity_id') | map('device_id') | reject('eq',None) | map('device_attr', 'identifiers') | map('list') | map(attribute='0') | map('list') | reject('eq', []) | map(attribute='0') | unique | sort }}