#built in intent taking over by mistake
1 messages ยท Page 1 of 1 (latest)
intent: name: HassTurnOff slots: area: huiskamer domain: fan name: all details: area: name: area value: huiskamer text: huiskamer domain: name: domain value: fan text: '' name: name: name value: all text: '' targets: {} match: true sentence_template: '[<doe>] [(<alle>|<in>)] <area>[ ]<ventilator> [<naar>] uit' unmatched_slots: {} source: builtin
the Assist devtool
`language: "nl"
intents:
CustomFanControl:
data:
- sentences:
- "(schakel|zet|stel) [de] ventilator [in] [de] {area} [op] {snelheid}"
- "(schakel|zet|stel) [de] {area} ventilator [in] [op] {snelheid}"
response: "customfancontrol"
lists:
snelheid:
values:
- in: "langzaam"
out: "Langzaamst"
- in: "gemiddeld"
out: "Gemiddeld"
- in: "medium"
out: "Gemiddeld"
- in: "snel"
out: "Snelst"
- in: "uit"
out: "Uit"`
This is the contents of the file in custom_sentence/nl/
it does work, when using the first sentence
"stel de ventilator in de huiskamer op uit"
top one triggers the custom one
the bottom one is getting picked up by the built in one
the config files as they are now.
I only just started
and yes, in configuration.yaml I have 'intent:' and the include for the intent_script.
apologies, i've been out for a bit and it was hard to track your code on my phone
as far as i can tell, this looks like a bug. indeed the custom sentence matches your input and should be matched before the built-in sentence
then again, i am not able to read proper Dutch and i might be misled. maybe @kindred quartz can take a second look
could you try this for me, please?
language: "nl"
intents:
CustomFanControl:
data:
- sentences:
- "(schakel|zet|stel) [de ]ventilator [in ][de ]{area} [op ]{snelheid}"
- "(schakel|zet|stel) [de ]{area} ventilator [in ][op ]{snelheid}"
that reduces the number of spaces outside optional components (making them optional along with the trailing whitespace), which might affect recognition, although it shouldn't
Doesn't it only overwrite the built in ones if they are also named the same?
The built in one is HassTurnOff, while this one is named CustomFanControl
not that i know of. the defined sentences should be (or rather, used to be) verified one by one against the user input in the following order:
- sentence triggers in automations
- sentences defined in
custom_sentences - sentences defined in
configuration.yaml - built-in sentences
the first match would stop the process
from a quick glimpse, that hasn't seemed to change https://github.com/home-assistant/core/blob/a16d98854ae0a396e1e2c929b4f94bc3f6b4a9af/homeassistant/components/conversation/default_agent.py#L603
but i may be misinterpreting some code here. @unborn shell am i right regarding the above message? โ๏ธ
As far as I can see the command used should match the custom intent
That's funny, as a similar thing is happening to an automation
if the sentence spoken is close to the one from the built-in intent it will be triggered, rather then the custom one from the automation.
it was the reason why I was looking into the scripted version too
to see if it was more reliable ๐
is there any way to completely disable the built-in intents?
Also, there is a difference in recognition between the Assistant and the ASSIST interpreter from the development tools. Where the ASSIST shows it reached a trigger, the Assistant processes it as if it is a built-in intent.
ASSIST: "zet de ventilator in de huiskamer op snel"
match: true source: trigger sentence_template: (stel|schakel|zet) [de] {ruimte} ventilator [in] [op] {snelheid}
Assistant: Hoe kan ik helpen? zet de ventilator in de huiskamer op snel Done
it says done, but it does actually do anything
this is because I do not expose any hardware to the assistant at the moment.
a futile attempt to get HA to recognise the custom intents first instead of using a built in one...
also
I just realised a thing
"zet de ventilator in de huiskamer uit"
this should trigger a different line in the automation I would say
`trigger:
- platform: conversation
command: (stel|schakel|zet) [de] ventilator in de {ruimte} [op] {snelheid} - platform: conversation
command:- (stel|schakel|zet) [de] {ruimte} ventilator [in] [op] {snelheid}`
{ "results": [ { "sentence": "schakel de ventilator in de huiskamer uit", "language": "nl", "result": { "match": true, "source": "trigger", "sentence_template": "(stel|schakel|zet) [de] {ruimte} ventilator [in] [op] {snelheid}" } }, { "sentence": "schakel de huiskamer ventilator uit", "language": "nl", "result": { "match": true, "source": "trigger", "sentence_template": "(stel|schakel|zet) [de] {ruimte} ventilator [in] [op] {snelheid}" } }, { "sentence": "zet de huiskamer ventilator uit", "language": "nl", "result": { "match": true, "source": "trigger", "sentence_template": "(stel|schakel|zet) [de] {ruimte} ventilator [in] [op] {snelheid}" } }, { "sentence": "zet de ventilator in de huiskamer uit", "language": "nl", "result": { "match": true, "source": "trigger", "sentence_template": "(stel|schakel|zet) [de] {ruimte} ventilator [in] [op] {snelheid}" } }
ASSIST downloaded snippet.
the trigger never changes, while it definitely should.
and there is a problem with the conversation response... it is never shown by the assistant. Very likely this is because it is using the built-in intent in the background instead of the automation.
never is an exaggeration, it is shown, if I ask it something silly and make it anwer something random it will work, just not when trying to control some piece of equipment
I have an automation listening for 'this is a test' and it will reply the custom response no problem. but when the sentence resembles the HassTurnOn/HassTurnOff built-in intents too much it will change to 'done' instead ๐คฆโโ๏ธ
no, not if you use the "Home Assistant" conversation agent
but that means it runs your automation, which does not provide a custom response. otherwise, the response would be that of the built-in intent
no, it does, with the set_cconversation_response
hold on
`alias: Voice Control - Testing
description: ""
trigger:
- platform: conversation
command: dit is een test
condition: []
action: - set_conversation_response: Test ontvangen
mode: single`
this works
you can make it 'this is a test' and 'Test received' if you wish
add this to your automations and tell the assistant (the written one or the voice one, that does not matter)
change the command to something close to a built in intent in your language that triggers a HassTurnOn or HassTurnOff.
see what it does
for Dutch it starts to fail
(the failing sentences used when you scroll back are a good starting point, in dutch that is)
ok, but the "done" response seems to indicate an automation sentence trigger without a set_conversation_response
yea, there is none
it is also the default response to anything built-in as far as I could find out
unless there is a custom response in the built-in intents or configured using the responses file.
that's not true. all built-in intents have a response https://github.com/home-assistant/intents/tree/main/responses/nl
if configured, yes.
but 'done' is the default if none is found.
and I am not sure which built-in intent is getting triggered
oh and remember
this default intent is only capable of turning on or off a fan
that is why I needed a custom one
as my ceiling fans have 3 settings (apart from off).
and whenever I try to turn them off a HassTurnOff built-in intent takes over
whenever I try to set a speed, it either works (using the custom intent, with a specific trigger) or fails (using a different trigger, it will trigger a HassTurnOn intent).
and either way
it will respond with 'done' most of the time when it hits the built-in intents.
I am not tying to be a dick here. I have litteraly tried almost everything to figure this one out...
something is not working 'as designed'.
And I am at a loss here, that is why I came here to ask for help or confirmation.
can you provide an example of a built-in intent which does not have a configured response? we seem to be basing our judgement on different knowledge and i want to make sure that's out of the way first, so we can establish a common "language"
i know for a fact that there are no built-in intents with no configured response, as that would trigger errors when packaging the intents
if you're experiencing a "done" response, my point is that it does NOT come from the built-in intents, but from a custom sentence you have somewhere
it actually says that in the raw log you posted #1229477902458818662 message
intent configuration in the configuration.yaml has been disabled
all other sentence/intent related automations are now off
custom response is ignored and 'Done' is the answer by HA.
if you need anything else, ask ๐
the used automation is included in that folder
the simple task of just giving a response is the only one which is enabled at this point.
oh, i forgot to say: if you look at the automation traces, you can actually see it's 'intent' to say something different as a response from what I actually get.
one of the screenshots shows you the assistant's actual answer, the trace shows you what the automation wanted it to say.
that's normal if you're trying to assign a dict where a string response is expected. I expect you even have a warning or something in the logs
not that I could find
the fact that you have an automation trace means that your automation is triggered by a sentence and that the built-in intent is not triggered
ok, point taken
but what causes it to not speak/write the created response sentence?
one of 2 things: either the response is not set (i.e. the set_conversation_response action is not run) or the response provided to the action is not a string
...or a bug ๐
if you see the custom_fancontrol.txt you can see it is.
a string that is
the if statements are disabled in that automation
not being formatted as a YAML, that's pretty hard to read. what i do notice, though, is that the first set_conversation_response sets the response to a dict
yes, if I change it to simply text, it still does not work. The dict actually works when I add it to the test automation though.
"zet de ventilator in de slaapkamer op Langzaam" is answered with 'Done' "Zet de ventilator in de slaapkamer uit" is answered with 'Sorry, ik kan geen fan vinden in slaapkamer' which means it can't find a fan in the bedroom.
this is the response to this command:
command: (stel|schakel|zet) [de] ventilator in de {ruimte} [op] {snelheid}
there are 2 issues here, correct?
- responding with "Done" when another response should be provided
- matching what you think is a built-in sentence when your custom intent should be matched
let's try to solve them one at a time, as i think we've been sort of mixing things up until now
When using the dict, on the 'dit is een test' example from earlier, set_conversation_response shows {'id': '0', 'idx': '0', 'alias': None, 'platform': 'conversation', 'sentence': 'dit is een test', 'details': {}, 'slots': {}, 'device_id': None}
forget about the tests and whatnot
so... first order of business: mathing your correct custom sentence. I think the easier approach is using custom sentence, not automation sentence trigger
first of all because you can't have a pre-populated {area} in a sentence trigger
rename your custom_sentences folder to something else (e.g. custom_sentences_old) and create a new one. create custom_sentences/nl/customfancontrol.yaml in it
place this inside it
language: "nl"
intents:
CustomFanControl:
data:
- sentences:
- "(schakel|zet|stel) [de ]ventilator [in ][de ]{area} [op ]{snelheid}"
- "(schakel|zet|stel) [de ]{area} ventilator [in ][op ]{snelheid}"
response: "customfancontrol"
responses:
intents:
CustomFanControl:
customfancontrol: "Whatever"
lists:
snelheid:
values:
- in: "langzaam"
out: "Langzaamst"
- in: "gemiddeld"
out: "Gemiddeld"
- in: "medium"
out: "Gemiddeld"
- in: "snel"
out: "Snelst"
- in: "uit"
out: "Uit"
obviously, feel free to replace "Whatever" based on your needs
make sure you have the following in your configuration.yaml
conversation:
intent_script:
CustomFanControl:
action: [] # you will populate this later on
would you rather define the response text in the intent_script?
wait a sec
this
I have intent:
instead of conversation:
add both
intent:
conversation:
...
ok
now restart HA and go to https://my.home-assistant.io/redirect/developer_assist/
punch in zet de huiskamer ventilator uit with the language set to Dutch. paste the raw result here please
restarting HA now
don't forget about the intent_script: part, ok?
I have that
ok
I have an include to a seperate yaml file
but in that there is that customfancontrol with an emtpy action
CustomFanControl: action: []
good, no speech:, that was important
intent: conversation: intent_script: !include intent_script.yaml
no speech: indeed
Result
{ "results": [ { "sentence": "zet de huiskamer ventilator uit", "language": "nl", "result": { "intent": { "name": "HassTurnOff" }, "slots": { "area": "huiskamer", "domain": "fan", "name": "all" }, "details": { "area": { "name": "area", "value": "huiskamer", "text": "huiskamer" }, "domain": { "name": "domain", "value": "fan", "text": "" }, "name": { "name": "name", "value": "all", "text": "" } }, "targets": {}, "match": true, "sentence_template": "[<doe>] [(<alle>|<in>)] <area>[ ]<ventilator> [<naar>] uit", "unmatched_slots": {}, "source": "builtin" } } ] }
and what about zet de huiskamer ventilator snel?
hold on, I had to switch VPN to test something for work.
that triggers the CustomFanControl
{ "results": [ { "sentence": "zet de huiskamer ventilator snel", "language": "nl", "result": { "intent": { "name": "CustomFanControl" }, "slots": { "area": "huiskamer", "snelheid": "snel" }, "details": { "area": { "name": "area", "value": "huiskamer", "text": "huiskamer" }, "snelheid": { "name": "snelheid", "value": "Snelst", "text": "snel" } }, "targets": { [SNIP] }, "match": true, "sentence_template": "(schakel|zet|stel) [de ]{area} ventilator [in ][op ]{snelheid}", "unmatched_slots": {}, "source": "custom", "file": "nl/customfancontrol.yaml" } }
good, thanks! that means that, for some reason, your custom sentences don't get precedence over the built-in ones. i am not sure if that's by design or a bug. as far as I remember, they should have been matched before the built-in HassTurnOff
happy, but unhappy? ๐
so we answered one issue: whether the built-in sentences get matched although you didn't want them to
yes
i'd suggest adding an issue about it in core https://github.com/home-assistant/core/issues/new/choose
thank you for that, it was driving me crazy...
second issue - the response was unexpectedly Done
but that depends on whether the response was coming from a sentence trigger or a custom sentence
for built-in sentences, I can assure you that you won't get a Done response
I have no automation with sentence triggers active at this point.
ok, so you were getting Done from a custom sentence
if I use the Assistant this is what happens:
Hoe kan ik helpen? zet de huiskamer ventilator snel Whatever zet de huiskamer ventilator uit Sorry, ik kan geen fan vinden in huiskamer
that most likely means that you haven't defined a response, neither in the intent_script, nor in the custom_sentences file. as you've probably noticed, i've provided one to match your key here #1229477902458818662 message
this is expected
which translates to 'how can I help?' and the last one 'sorry, can't find the device in that area'
yes, both responses are expected (by me, at least)
the first sentence (zet de huiskamer ventilator snel) matches your custom sentence defined for the CustomFanControl intent, where we have defined a response for nl, for the CustomFanControl intent, with the key customfancontrol
also, not defining a speech: section for the intent_script for that intent (CustomFanControl). hence, the response in the yaml will be used
understood
which is Whatever, which I said you can change #1229477902458818662 message
I did not, just so the test was valid by default (you could judge by the response that I actually used your scripts).
in case of the second sentence, zet de huiskamer ventilator uit, it matches the built-in HassTurnOff intent for domain: fan. Since you probably have no exposed fans in your huiskamer, the intent fails with that specific error message
yes, I unexposed everything on purpose when things got confusing
cool. so everything makes sense at this point, right?
yes
add that issue for the conversation integration and we'll get Mike's response eventually
ok
i may be wrong, but i remember that the idea was to have custom sentences take precedence over built-in ones. however, something may have got scrambled with the more coherent error messages