home-assistant / intents

Intents to be used with Home Assistant
https://developers.home-assistant.io/docs/voice/overview/
Creative Commons Attribution 4.0 International
455 stars 521 forks source link

support for controlling entities in an area based on a partial name #976

Open ruifung opened 1 year ago

ruifung commented 1 year ago

for example entity name: person room ceiling lights area: person room

sentence: turn on the ceiling lights in person room

I notice that at present, it expects a mostly exact match with the entity name or aliases, and this sentence form would be more natural in my opinion.

Not sure if this is the right place to be asking this though.

dontinelli commented 1 year ago

As a workaround you could define an alias "ceiling lights". I assume this should work, as long as you indeed only call the intent with the area as well.

ruifung commented 1 year ago

You sure about that? I checked https://github.com/home-assistant/intents/blob/main/sentences/en/homeassistant_HassTurnOn.yaml and it doesnt seem to support areas for generic entities.

And it definitely doesnt work. SmartSelect_20230213_082025_Telegram

dontinelli commented 1 year ago

You sure about that? I checked https://github.com/home-assistant/intents/blob/main/sentences/en/homeassistant_HassTurnOn.yaml and it doesnt seem to support areas for generic entities.

And it definitely doesnt work. SmartSelect_20230213_082025_Telegram

It should work, if you define an alias "alcove lights" (or in the first example "ceiling lights") for person room ceiling lights. So no support for generic entities but you can rename entities to match your needs.

ruifung commented 1 year ago

so the home assistant matching logic can match "area" "entity" as an entity name? Well, it's good to know I guess.

But IMO, in should probably be suported too, if only for consistency with the other actions. And feels more natural in an english sentence to me. But that's probably out of scope of this particular issue I suppose.

And I still think having some kind of partial/fuzzy matching for entities would probably be beneficial for the user experience. Assuming it doesn't perform an action on a low-confidence match I suppose.

synesthesiam commented 1 year ago

Partial/fuzzy matching will come later when we use the sentences from this repo to train actual machine learning models. For example: generating all possible sentences and using snips-nlu to train an English model.