#built in intent taking over by mistake

1 messages ยท Page 1 of 1 (latest)

celest axle
#

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

celest axle
#

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.

cinder merlin
#

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

kindred quartz
#

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

cinder merlin
kindred quartz
#

As far as I can see the command used should match the custom intent

celest axle
#

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?

celest axle
#

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 ๐Ÿคฆโ€โ™‚๏ธ

cinder merlin
cinder merlin
celest axle
#

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)

cinder merlin
#

ok, but the "done" response seems to indicate an automation sentence trigger without a set_conversation_response

celest axle
#

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.

celest axle
#

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.

cinder merlin
# celest axle if configured, yes.

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

cinder merlin
celest axle
#

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.

celest axle
#

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.

cinder merlin
celest axle
#

not that I could find

cinder merlin
#

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

celest axle
#

ok, point taken

#

but what causes it to not speak/write the created response sentence?

cinder merlin
#

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 ๐Ÿ˜…

celest axle
#

if you see the custom_fancontrol.txt you can see it is.

#

a string that is

#

the if statements are disabled in that automation

cinder merlin
celest axle
#

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}

cinder merlin
#

there are 2 issues here, correct?

  1. responding with "Done" when another response should be provided
  2. 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

celest axle
#

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}

cinder merlin
#

forget about the tests and whatnot

celest axle
#

ok

#

and yes

#

1 & 2 are correctly assumed

cinder merlin
#

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?

celest axle
#

wait a sec

celest axle
#

I have intent:

#

instead of conversation:

cinder merlin
#

add both

intent:
conversation:
...
celest axle
#

ok

cinder merlin
#

punch in zet de huiskamer ventilator uit with the language set to Dutch. paste the raw result here please

celest axle
#

restarting HA now

cinder merlin
celest axle
#

I have that

cinder merlin
#

ok

celest axle
#

I have an include to a seperate yaml file

#

but in that there is that customfancontrol with an emtpy action

#

CustomFanControl: action: []

cinder merlin
#

good, no speech:, that was important

celest axle
#

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" } } ] }

cinder merlin
#

and what about zet de huiskamer ventilator snel?

celest axle
#

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" } }

cinder merlin
#

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

celest axle
#

happy, but unhappy? ๐Ÿ™ˆ

cinder merlin
#

so we answered one issue: whether the built-in sentences get matched although you didn't want them to

celest axle
#

yes

cinder merlin
celest axle
#

thank you for that, it was driving me crazy...

cinder merlin
#

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

celest axle
#

I have no automation with sentence triggers active at this point.

cinder merlin
#

ok, so you were getting Done from a custom sentence

celest axle
#

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

cinder merlin
#

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

celest axle
#

which translates to 'how can I help?' and the last one 'sorry, can't find the device in that area'

cinder merlin
#

yes, both responses are expected (by me, at least)

celest axle
#

ok

#

(shutting up, reading what you wrote now)

cinder merlin
#

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

celest axle
#

understood

cinder merlin
celest axle
#

I did not, just so the test was valid by default (you could judge by the response that I actually used your scripts).

cinder merlin
#

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

celest axle
#

yes, I unexposed everything on purpose when things got confusing

cinder merlin
#

cool. so everything makes sense at this point, right?

celest axle
#

yes

cinder merlin
#

add that issue for the conversation integration and we'll get Mike's response eventually

celest axle
#

ok

cinder merlin
#

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

celest axle
#

right

#

you said to report it in Core, right?

#

shoot lol ... I created that issue with the wrong account ๐Ÿ™ˆ oh well ๐Ÿซ 

#

as it is the account I used for work, I just changed the username ๐Ÿ˜‡

celest axle