#Sentence trigger with lists

1 messages · Page 1 of 1 (latest)

quartz horizon
#

Sorry if it is dumb question - couldn't find clear info.
I have several dozens of intent scripts and custom sentences. It works good. But in order to trace or fix something quickly, I need to do it from desktop. So I started to move them to automations with sentence triggers.

However, I don't know how to use lists in automation sentence template. Everything there is a wildcard, basically. Is there documentation on it?

dusk siren
#

there are no dumb questions, only dumb answers... would love to help, but have no clue.. lol

icy crescent
#

List when sentence is said as trigger or some other list like for list to choose from several available as response? Don't really understand your question

quartz horizon
icy crescent
#

@quartz horizon I may be off here that again I did not understand, but here it goes: for wildcard we are using {} brackets. If you want more like variations, you can use [] or () with | in combination

#

English is not my native language so will be general

  • Start of some sentence (vatiant1|variant2) finish of sentence. - Stat and finish of sentence must exactly match, together with one of the variant words, also exact match
#

If this is what you need, I can elaborate more regarding applications

#

If this is not what you are after, than I have no clue 🙂

quartz horizon
# icy crescent <@299947094674767872> I may be off here that again I did not understand, but he...

Thanks. I know all that.
With () it's variants of the sentence, but not for slots.
Let me give an example.
I have TV with several applications that I can launch. So I want the sentence "launch {app} on TV" with {app} be a list of possible values (e.g. Netflix, Jellyfin, Prime Video), not just any word or even phrase.
I can achieve this in intent script - but in automation there's seemingly only wildcard. Which is okay, I guess, but inconvenient.

robust vault
#

Hi,

I did something similar by creating an input helper (list) and adding a template condition in my automations. But it's quite a pain to deal with punctuation, spaces and lower/upper case of the slot.

Here is a template I use:

`{% set list = state_attr('input_select.ambiance_salon','options') | map('lower') | list %}

{{trigger.slots.ambiance | regex_replace('[.,;!?()\[\]{}"\'':-]', '') | regex_replace('^\s+', '') | lower in list }}`

icy crescent
#

@quartz horizon why not use multiple triggers with one sentence and assign id to each trigger

#
triggers:
  - trigger: conversation
    command: launch Netflix on TV
    id: netflix
  - trigger: conversation
    command: launch Youtube on TV
    id: youtube
quartz horizon