#Naming Conventions for Voice Assist?

1 messages · Page 1 of 1 (latest)

unkempt kestrel
#

Is there a best practice or a recommended naming convention for devices that allow local AI voice assistant to best detect and understand which device in talking about?

For example, I have an ESP device with a garage door relay and a garage door sensor (see pic).

When I ask my Voice Assist (running local Llama 3.1 via Ollama integration), sometimes it answers correctly, but then sometimes it gets confused and seems like it doesn't know what I'm talking about. It won't open the garage door cuz I suspect it isn't making the logical connection that I want it to activate the relay.

I could make an automation to have it trigger the relay when I say a certain phrase, but I want Voice Assist to be smarter than that.

Any recommendations for easiest ways to ensure voice assist reads the correct device?

gusty junco
#

Well "open garage door" has a little connection to the switch. LLM doesn't know you want to turn on the switch. Usually garage door is "cover" domain. If you say "turn on garage door", most probably it will do.
Or make cover entity.
Which quantization level you're using? I found 7B too stupid to perform good with HA...
Also might be helpful to add aliases to your entities.
Ah, and check if you8not exposing too much to Assist. If there's many entities, they might be missed in the context, and model won't "see" them.

prime ravine
#

I'd say the best option is to expose neither of those and create a template cover inside ESPHome, exposing that to Assist. To be honest, that's the only thing i would expose out of ESPHome too (so you can't see the switch and binary_sensor entities in HA), not just from HA to Assist.
Once you do that, you can "open garage door" and "is the garage door open?"

unkempt kestrel
# gusty junco Well "open garage door" has a little connection to the switch. LLM doesn't know ...

I'm just playing around with Llama3.1:8b rn as suggested on the Ollama integration webpage. I don't have dedicated hardware (yet) for running better models. Rn I'm just using my gaming PC for testing purposes. I've also used Google Gemini via the Google Generative AI integration.

I was considering changing that relay from a switch to a cover. That would probably help for this specific device.

I have not gone through and added aliases yet, that would probably help. I definitely feel I need to go through my devices and clean up the naming Conventions. I've got about 28 devices exposed rn I think.

unkempt kestrel
prime ravine
unkempt kestrel
#

Like why couldn't I create the ESP Home device but then create a template cover in HA?

prime ravine
#

also, template covers are not the same as templating in HA. templating is HA is a means of generating strings or other objects for use in automations/scripts/dashboards using a language called Jinja2 and some internal helpers (see #1284966664357810196 )

#

template entities are merely a way of creating virtual entities using "templates", i.e. sets of properties and actions which define how the virtual device/entity should behave

unkempt kestrel
#

Where would you define the template code? Inside the yaml for the ESP device?

prime ravine
unkempt kestrel
prime ravine
#

sure

#

remember: the end goal is having a cover entity in HA, as that would provide more natural commands both in UI and in voice control

unkempt kestrel
#

So I've actually got the cover template working now

#

Was fairly easy

#

Thanks for the suggestions. I'm gonna keep deep diving on templates

#

I'm playing with my Ollama AI prompt. I've found if I pass it a csv of all the exposed entities, it actually controls them much much better

#
Available Devices csv:

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

The current state of devices is provided in Available Devices.```
#

This is part of my prompt. It actually seems like it makes the voice control much more consistent

#

I stole part of this template from a youtube video I saw by FutureProofHomes

prime ravine
unkempt kestrel
#

Perhaps. It does seem more reliable now though for other entities as well. Anyways, I digress. Templating seems like a new rabbit hole for me to go down. Thanks for the help

unkempt kestrel