#"Prefer handling the commands locally" do not work for my native language

1 messages · Page 1 of 1 (latest)

dreamy ember
#

Hi all,

I'm running latest HA as HAOS on an iNUC, Assist PE, local Whisper (GPU) & Piper. Conversational Agent is OpenAI.

I have the "Prefer handling the commands locally" activated. Testing this with English works great but when switching to native language (Norwegian) it doesn't work. Tested both with text and speech. Flipper HA language between EN and NB, no changes.

I've checked the aliases, all is good.

Testing in my home office with a single light entity.

Any tips to look next?

#

"Prefer handling the commands locally" do not work for my native language

reef cedar
#

Please describe what "doesn't work" means. 🙂
Doesn't local part work, or LLM doesn't?

dreamy ember
#

The command will not run Local. From debug, I can see "Processed locally" is false. Here is a screenshot as an example - this time I started from conversation (non-verbal).

My phrase is in English "Turn on the lights in the office".
According to intents/sentences/nb/light_HassTurnOn.yaml https://github.com/home-assistant/intents/blob/main/sentences/nb/light_HassLightSet.yaml this should be straight forward

language: "nb"
intents:
 HassTurnOn:
   data:
     - sentences:
         - "<skru_på> [<alle>] <lys> [<i_på>] <område>"
         - "<skru_på> [<alle>] <område>[s][ ]<lys>"
         - "<skru_på> <område> [<alle>] <lys>"

This one should kick'd in: "<skru_på> [<alle>] <lys> [<i_på>] <område>"
Equal for EN is: "<turn> on <name> <light> [<in_area_floor>]"

GitHub

Intents to be used with Home Assistant. Contribute to home-assistant/intents development by creating an account on GitHub.

#

I can add also, setting up a new profile where I use all for Norwegian, it do work...

Really stuck....

dapper tendon
#

the 2 sentences you're testing with are different ("skru på" vs "skru av", which i'm guessing means "turn on" vs "turn off")
i recommend that you go to https://my.home-assistant.io/redirect/developer_assist/ and test each sentence to see if it can match anything (it won't be executed). my guess is that the actual sentence you're saying is not matched by the local conversation agent and is thus passed to the LLM agent. if the dev tools shows that it does match a built-in sentence, then we can go on to to see why the LLM is taking over

maybe @rich salmon can also help here with the matching part

#

oh, one more thing to check: when you configure the pipeline and check out the LLM conversation agent's settings, Control Home Assistant is set to Assist rather than No Control, right? it is a bug that you are allowed to see/toggle Prefer handling commands locally when the agent is set to not control anything, so that may be the source of your troubles

dreamy ember
dreamy ember
# dapper tendon oh, one more thing to check: when you configure the pipeline and check out the L...

Hi @dapper tendon All my Assist setups are set to "Assist"

As earlier described - I did set up an Assist profile with all local, then all run fine, both conversation by text and voice, on Onju and PE. But when involving an LLM (I normal use OpenAI but do also have Claude & Gemini available) I can't get it to use local when running Norwegian.

My other Assists which is set up for English, run local just fine. Something here with LLM and Norwegian/non-English (not tested with other languages).

dapper tendon
#

or, if all of your LLM agents behave the same (OpenAI, Claude, Gemini), then tag the issue for the conversation integration

ocean terrace
#

My guess, it matches 2 entities, and therefor doesn't know which one to target, and that's why it sends it to the LLM

#

I gave two lights the alias Test light and when using Assist (without LLM) that errors

#

when using LLM with local preference, it sends it to the LLM

#

in this case it gives a simlar response, but based on the LLM and it's mood the response will differ

#

oh wait, scrap all that, you are using an area as target

dreamy ember
#

Gemini....:

#

Damn it! Figured out what caused it (now to figure out how to resolve it)... I run external Whisper (GPU) on a remote docker.

Switching to Home Assistant Cloud did the trick, now it works Local !

green harbor
#

huh weird, wonder why the STT would affet it

dreamy ember
#

Did the same test now using Google Cloud for STT, back to "false" again

green harbor
#

is it hearing the same string each time?

dreamy ember
#

This is then related to STT

green harbor
#

doesn't really make sense though, the STT just converts speech to text, it isn't responsible for intent handling

#

from the perspective of the conversation agent it shouldn't know or care which STT is being used, it just receives the text

dreamy ember
#

Agree, but in reality (at least here) this is it. Weird is that with ChatGPT (Open AI) it wors in English

green harbor
#

so if you type your command in the assist window, with all those settings in place, including the "bad" stt, does it still work?

dreamy ember
#

Test ENGLISH with ChatGPT/OpenAI:

green harbor
#

assist window should be using the exact same pipeline

#

Yeah the issue seems language specific, but it seems like either the intent has some issue, or somehow the particular STT you are using is doing something weird, like maybe inserting an invisible special character or something perhaps that the intent handler can't understand, that'd be my guess

dreamy ember
#

Test NORWEGIAN (different pipeline though):

#

Test NORWEGIAN (same pipeline as previous Norwegian) with Home Assistant Cloud:

green harbor
#

maybe you should delete the pipeline entirely and recreate it, maybe something is broken in it

#

wouldn't remove your openAI stuff or anything, it's just the glue that ties them together

dreamy ember
#

To me, this at least proves that the combination LLM and at least Norwegian fails for using Local

green harbor
#

yah but the pipeline could have something broken in it, if you delete it entirely and recreate it that could rule that out

#

otherwise yeah, maybe that language has trouble somewhere with the STT

#

the Cloud STT is a bit more robust, maybe it handles your language better 🤷

#

this is also super silly, but I notice in one case "skruv" is lowercase and in the other it is uppercase. That technically shouldn't matter, but it is one difference I see

dreamy ember
#

Made a new Pipline, tested with HA Cloud and Whisper - HA Cloud let it run locally, not when changing to Whisper

#

Also tested changing STT to "faster-whisper" which run locally on my HAOS - same, still not local.

#

So definitly something when using any LLM combined with (at least) Norwegian

green harbor
#

so if you remove the LLM and just do the Home Assistant agent, with any of these STT, does that work correctly?

dreamy ember
#

Not entirely correct; I can use ANY conversational agent incl any LLM.

The difference is:

STT set to remote or local Whisper, do not run local on Norwegian**, BUT, run local if English is selected.

To get Norwegian to work, STT need to be set to Home Assistant Cloud.

#

Here is the test with Home Assistant Cloud and "turn off the lights in the office" and after that "turn them back on"

Run exactly is it should, BUT, not using Whisper.

Could this be related to Whisper (as it happens with both remote and local agent) ?

#

My Wyoming. faster-whisper-ct2 is the remote powered by an RTXA4000 GPU and the Large model 🙂 wheres whisperis the local running from add-on.

#

No, hold-on, didn't work with Google Cloud either, so it is not related to Whisper...

#

...then the only thing as far as I understand is causing this is (at least) the Norwegian language.

Anybody that can test the same from any other country than one speaking native English?

dapper tendon
#

I'll test in a second (hopefully i can revive whisper), but please do me a favor: from the debug log, copy (actually copy, don't rewrite) what the STT has transcribed in a case where it does not process locally and paste that in the Assist dev tool. let me know if the sentence matches

#

i suspect there are some extra/odd characters in what the STT transcribes. I'm hoping that they get passed to the frontend

dreamy ember
#

Here's the test

dapper tendon
#

i'm stumped. @lusty tree please take a look at this, as you know the pipeline components much better than anyone

dreamy ember
#

hehe, good that you're "out" also 🙂 To make it more intersting - I have a remote localtion (summer house) with full HA setup - did the same test there 30 mins ago and exact same result. There I run HA in Docker (Debian).

There I only have faster-whisper as an add-on

final solar
#

I checked, it works as expected in german.

dreamy ember
final solar
#

google cloud, whisper and HA cloud.

dreamy ember
#

The screenshot show Home Assistant Cloud as STT?

final solar
#

one is HA cloud the other is whisper and google as STT

reef cedar
#

Could it be that Whisper is producing some (invisible) symbols or some visible similar, but different symbols in the transcribed text, which leads to unmatched sentence?

dreamy ember
#

Both whispers? The add-on and the remote? And this also happens with Google Cloud...

green harbor
#

It is indeed possible, the whispers would behave the same regardless of being local or remote, they use the same internal model. It's possible Google Cloud's model behaves similarly

#

I think you'd have to analyze the string potentially and see if it is using a slightly different unicode character for instance

dreamy ember
#

Sorry guys, I don't buy it - it can't be. Google Cloud and Whisper do the same "mistake" ?

At the summer house I used "Skru av lysene i spisestue" which means "turn off the lights in the dining room" and this sentence do not contain any Norwegian characters.

How would I troubleshoot something like this?

#

I now even pulled the log from the PE to see what is read from STT: "Skru av lysene på kontoret." This is plain text.

reef cedar
dapper tendon
lusty tree
#

This might be a combination of a few things. The language of a pipeline is usually set by the conversation agent, but LLMs report supporting "all languages" so we have to do more digging to guess the intent language. We currently look at the STT and then TTS languages, and I'm wondering if STT being "no" vs. the intent language being "nb" is what's causing it to skip over local processing.

dreamy ember
#

Btw, do the language set for the user (user profile) in any way interfere or affecting what we set in the pipeline configurations ?

lusty tree
dreamy ember
#

Will you be looking into this? I really dunno how I can assist in this atmo

lusty tree
#

@dreamy ember I tested this locally with "skru på lysene på kontoret" and it works fine for me here 🤷‍♂️
It runs the local intent and then goes to the LLM if I add extra stuff.

dreamy ember
#

U got to be shitting me! 🙂 What what?

lusty tree
#

Let me try with Whisper...

dreamy ember
dreamy ember
lusty tree
#

Ah ha! It's something with Whisper. I tested originally with HA cloud.

dreamy ember
#

HA Cloud always worked here also. Test with Google Cloud, will not work either

lusty tree
#

OK, got it figured out and fixed. Just need to write up a test and make a PR. Thanks 👍

dreamy ember
#

Wow! Great! Something I can test locally ?

lusty tree
dreamy ember
lusty tree
#

Yes, it should fix the general problem.

dreamy ember
lusty tree
#

Just the default agent file should be enough.

dreamy ember
dapper tendon
#

yes, you can

dreamy ember
#

... but it didn't work

dapper tendon
#

i'm guessing you did restart, right?

dreamy ember
#

Indeed I did

#

My structure

dapper tendon
#

by "didn't work" you mean you get the same issue, right?

#

i.e. Whisper + NO/NB does not process locally

dreamy ember
#

No, it didn't read the default_agent.py from the custom_components - and I didn't get an error in the log either at boot

#

I did only copy the entire folder conversationfrom core/homeassistant/components/ in branch dev to my custom_components so I have custom_components/conversation/ locally

dapper tendon
#

are you sure your Samba settings are correct? I see you're using Windows to copy it, so it could be a permissions issue, maybe

dreamy ember
#

Never had it before - I've even made my own custom integration which works just fine which I did copy straight over