#How does the default conversation agent work
1 messages ยท Page 1 of 1 (latest)
๐ cheers
here's where the pre-filled slots come from HA and get sent to the default conversation agent https://github.com/home-assistant/core/blob/2b7d37cbc2fa265fae0ea79511d369d15aaf7fd0/homeassistant/components/conversation/default_agent.py#L628-L629
Thought it was a list of "light" entities but makes sense it's not
As <name> is the actual entity
Is there a way to see which sentence actually matched the input speech?
Like in the debug screen or something
no, there isn't yet
Fair enough ๐ out of curiosity, how are you planning to expose the entity ID to custom intents? Just something like {{ rule_name_entity_id }} ? So Turn on <name> would let you use {{ name_entity_id }}
i only know it's needed and not there. i haven't thought of the actual solution yet
Would you mind me having a go at implementing exposing entity ID to script intents and opening a PR? Just want to have a play around with the assist code ๐
Don't want to steal the work you're planning on doing haha
are you kidding? you're absolutely welcome to have a go
it's not my code, you know ๐ i'm not even a code owner on the core repo ๐
Thanks! It seems like it should hopefully just be adding something to ScriptIntentHandler#async_handle if I've understood the code correctly
You know more about it than I do haha
if I may offer some advice, though: if you mind having your PR rejected because of a fundamental change required, drop a question on #devs_voice-archived first. if you don't mind redoing the work, you'll get the same in the PR
Good shout ๐ will bring it up there, thanks!
i mean about the approach, not whether you should do it
That code you sent before which passes the entity names as a slot - am I losing it or does it not actually pass the entity ID in? It seems like it's just passing the name in? Unlike areas which pass a (name, area_id) tuple in, it looks like it uses a (name, name, {"domain": ...}) tuple
Need to put some breakpoints in it really and work out what's going on
I wouldn't worry about it ๐ appreciate all the help
use the breakpoints, Luke! no offense, but that's what I did to better understand what's behind the hood and I could use not being among the few who did
Yeah breakpoints are definitely where it's at. Laptop is broken at the moment though so will have to use work computer and set it all back up ๐ญ
I think the name is passed in and then it goes to _has_name which checks the entity registry and the device registry including aliases for both
So the intent engine never actually gets the entity ID?
Ah yeah just found the code for this (intent.async_match_states), seems like it's all name based. Might be a bit more complicated to pull the ID back out then ๐ค
It's definitely in there as part of the returned states
I'll have a play around. I could just use async_match_states as it looks like all of its args are optional, so we could just pass through the ones which we have (e.g. a sentence using name would just lookup on name, one with area+name would use both, etc)
I'm away from my computer at the moment and at my nephew's 10th birthday, so I'd better potter off.