Listing all entities exposed to voice

Is there a way of listing all entities that are exposed to voice. I’ve seen this question asked before, but not seen anyone give a definitive answer.

I’m trying to create an LLM instruction for my voice assistant and found this template

{% for entity in exposed_entities -%}
{{ entity.entity_id }},{{ entity.name }},{{ entity.state }},{{entity.aliases | join('/')}}
{% endfor -%}

However, when I try it in the template editor I get

exposed_entities is undefined

So how do I define exposed_entities?

5 Likes

I’ve been in the same boat for months, and haven’t found a solution.
I don’t know why “exposed_entities” is part of some default templates for assistant agents, but it doesn’t seem to work. I thought that “exposed_entities” would be maybe defined only when rendering a prompt template, but according to my ollama logs, that is not the case.

I’m keeping an eye out though!

5 Likes

Im looking for how to find this now - I think this is the last piece in understanding how your context looks from a dashboard perspective.

I’m pretty sure ‘state data’ in context is just expand[exposed_entites], if only I had a way to do it myself and get length(of that expansion)… (Divide by three-flourish and it’s approximate token consumption)

1 Like

Any luck in the last 7 months? I’m learning template syntax in an attempt to get to this. I can work with states, names and attributes, at least at a beginner level.

I can’t see how to find what is exposed and I can’t show aliases, which is the next thing I will want to do once I have the listed of exposed entities.

Anything?

One other thought: http://homeassistant.local:8123/config/voice-assistants/expose has pretty much everything I want. Is there a way to see how that page is generated? Perhaps if I can find the source it will give a clue to this issue.

I don’t have that in my config?

I’ve not found a solution to this, sorry. However, there is always more than one way to skin a cat. Pay @NathanCu’s Friday’s Party thread a visit and have him blow your mind with LLM related stuff for Home Assistant.

1 Like

Im working on a way to both do this AND expose the log in read only mode - should eb done by next week. Let me ge the prompt engine posted first…

1 Like