You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using this for a while now, and pretty happy! I have a new use case where the phrases are different but the actions are largely the same, related to going to bed and getting up in the morning. This is the current Yarvis config I have:
bedStatus:
sentences:
- i'm (?P<which>going) to bed
- i'm going to (?P<which>sleep)
- i'm (?P<which>awake)
- i'm getting (?P<which>out) of bed
This works fine when HA hears correctly, but this seems to be a rare occurrence. Is there any possibility of passing hardcoded values for parameters? I'm thinking something along the lines of:
- i'm (?P<which=going>going) to bed
Obviously this breaks the regex, so you would have to change the sentence to remove the "=going" part before passing to regex. This could be done by using sub() to replace <(?P<param>.*)=(?P<value>.*)> with \<\g<param>\>. Then if it matches, send the static value for the named group instead of whatever it captured.
My logic in suggesting this is HA's speech-to-text often mis-hears words. So "going" might be heard as "doing", "gone" or "gong" (among others). So then I could code my sentences as:
- i'm (?P<which=going>going|doing|gone|gong) to bed
This way, even if it hears "gone" the intent script will receive "going". Without something like this I would need to deal with all the possible mis-hearings in the intent script as multiple sentences and different parameters.
The text was updated successfully, but these errors were encountered:
nice addition, I'm going to think about that, maybe we can even introduce a kind of fuzzy search that matches a sentence and return a match % if the result is above a certain threshold it activates that action. so this means that you don't have to provide a list with possible words
I've been using this for a while now, and pretty happy! I have a new use case where the phrases are different but the actions are largely the same, related to going to bed and getting up in the morning. This is the current Yarvis config I have:
This works fine when HA hears correctly, but this seems to be a rare occurrence. Is there any possibility of passing hardcoded values for parameters? I'm thinking something along the lines of:
Obviously this breaks the regex, so you would have to change the sentence to remove the "=going" part before passing to regex. This could be done by using
sub()
to replace<(?P<param>.*)=(?P<value>.*)>
with\<\g<param>\>
. Then if it matches, send the static value for the named group instead of whatever it captured.My logic in suggesting this is HA's speech-to-text often mis-hears words. So "going" might be heard as "doing", "gone" or "gong" (among others). So then I could code my sentences as:
This way, even if it hears "gone" the intent script will receive "going". Without something like this I would need to deal with all the possible mis-hearings in the intent script as multiple sentences and different parameters.
The text was updated successfully, but these errors were encountered: