#How to better organise custom responses?

1 messages · Page 1 of 1 (latest)

tough dune
#

Hey, I found in the documentation that I can configure my own responses https://www.home-assistant.io/voice_control/custom_sentences/#customizing-responses but when I need test more then few responses it is quite problematic to put them to one file. Is it possible to create divided files for responses? What do I mean:

└── pl
    ├── homeassistant_HassGetCurrentDate.yaml
    ├── homeassistant_HassGetCurrentTime.yaml
    └── responses
        ├── HassGetCurrentDate.yaml
        └── HassGetCurrentTime.yaml
Home Assistant

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

tough stream
tough dune
#

Thank's @tough stream I will check this configuration today.

If I may, I have other question. Is it possible to replace/remove the current sentences of the configuration? I noticed that even though the Polish language is checked in the intents repository and all tests pass there correctly, in the Home Assistant itself after entering a sentence they are incorrectly recognized. I would like to check and debug why hassil incorrectly recognizes selected phrases, but directly in HA. It will be easier for me to delete a single sentence and check whether it will then work properly. I know how to add new sentences but I don't know how to delete existing ones.

#

Good example.. hassil should return HassClimateGetTemperature not HassGetState .. I checked and I don't have any device with the name temperatura. Also in conversation I don't see correct response.. I also checked and I have the correct device in the selected area to provide the temperature. Also the aliases for all areas are configured correctly (with aliases).

tough stream
#

You can't delete/ignore builtin sentences. In your specific case, you might want to excludes_context: { domain: climate } here and make sure you don't have any entities named temperatura in the salonie area

tough dune
#

Yes, I checked that I don't have any entities call temperatura in my salon area. I also thought about the exclusion of climate domain from this sentences but until new version will release I can't check if this changes will solve this problem.

tough stream
#

how are you running HA?

tough dune
#

in Virtual Machnie and HA OS

#

I know I can go to core docker HA and update intents directly on this container, but I don't know if it's a completely correct way 😅

tough stream
#

⚠️ take a full backup of your HAOS before you start ⚠️

if you can SSH into the HAOS host, then you can docker exec -it homeassistant /bin/bash to get into the core container, then the files you can modify are under /usr/local/lib/pythonXX.YY/site-packages/home_assistant_intents/data/

#

you will need to restart the core after messing with them

tough dune
#

hm.. I think enough restart Intents domain in developer tools.. I don't need restart all ha container

tough stream
tough dune
#

o.. I didn't know about it

tough stream
#

either way, you could end up preventing the core from loading intents or conversation if you save a badly formatted JSON. tread carefully

#

take backups of your HAOS before you start

tough dune
#

@tough stream I checked and we don't need restart HA, everything what we need do is just click INTENT SCRIPT in YAML configuration reloading.

tough stream
#

something must've changed. last time I checked, the entire core needed a restart. thanks for sharing!

tough dune
#

Second problem wich I have is problem with intent. I don't understand why some random text was revealed as a color. In intent I have a list of color.. but when I check my intents Ustaw temperaturę na 30 stopni the 30 stopni is set as a color.. 🤔

#

adding exclude_domain change nothing.. because from some reason color is wrongly recognised

#

but when I run this test locally everything works correct 🤔

tough stream
#

looks like a hassil bug, in that case. @clear vine should he add a new issue?

tough dune
#

hm.. I have something more.. In my HA the configuration for HassClimateSetTemperature don't exist... it exist in repository, but when I use this script script/package from intents-package repo to build new one json file, HassClimateSetTemperature was not added this this file..

tough stream
#

now i see my mistake. in the beginning we were talking about HassClimateGetTemperature, which I knew was supported. Then the discussion got switched around to HassClimateSetTemperature, which I didn't realize soon enough, so I set you on a wild goose chase. Sorry about that

#

HassClimateSetTemperature is not yet supported (i.e. there's no handler in core), so it's not packed along with the other sentences. The parse script in the intents repo does not care that the intent is not supported, which is why recognition works and tests pass

tough dune
#

That's right, we solved one problem. 😅

#

But we still haven't solved the problem with HassClimateGetTemperature 😅 It looks like there is some error here..

tough stream
#

I know why that is, but I can't explain why that is 🙂

tough dune
#

@tough stream Thank you very much for your help, I am working on the Polish language all by myself and sometimes I miss someone with whom I could talk about such surprises.

tough stream
#

in the rendered JSON, the sentences for HassGetState are before the sentences for HassClimateGetTemperature (I haven't looked in the logic concerning why that is the case). As such, the HassGetState sentence simply gets matched first

#

to prevent this, you would need to the add excludes_context: {domain: climate} to the HassGetState sentence(s), but you said you already have

tough dune
#

yep

tough stream
#

my guess is you have for a single variation and it matches another variation in the same file, but i'm not dismissing a bug

tough dune
#

yes, but still I don't understand why te variable {color} was wrongly set to 30 stopni

#

We don't have this name of the color in polish lang 😃

#

this is just 30 degrees

tough stream
tough dune
#

but what it mean?

tough stream
#

that sentence was the closest thing it could match, sort of. Unless I'm misunderstanding exactly how hassil works now

tough dune
#

hm.. I give you other wrong example which I found.. but this time configuration exist in json file..

#

Jaka jest temperatura w salonie? -> What is the temperature in the living room?.. it should be HassClimateGetTemperature not HassGetState

tough stream
tough dune
#

HassGetState is in line 680, but HassClimateGetTemperature in 1644