-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Sentence Trigger #672
Comments
@craigbarratt this one is for you :) |
This would be an awesome feature! I would most definitely merge a well-written PR that supports this. Could the trigger include something like wildcards, which could be any word(s) that are passed as parameters to the function? That would make it a lot more flexible, since you could provide verbal parameters to the trigger. I'm not sure if the voice assistant code would support that. |
I think wildcards would definitely be doable - mostly since HA already supports them as part of the sentence trigger. I'd imagine we can hook into that. The docs refer to them as "slots". I imagine we could get it to work as, @sentence_trigger("turn on the lights in {room}")
def turn_on_room(slots):
if slots.room == "kitchen":
...
return f"turned on lights in {slots.room}" or separate each wildcard into a function parameter could work as well. |
I'd absolutely love to have this, my Voice PE just arrived and I thought about routing maybe just all sentences I have from a single automation to the same pyscript function and continuing from there, but that seems like quite a workaround (and if I can't do magic quite limited with the slot stuff). After a quick glance at the trigger code inside pyscript I don't think I feel confident enough in my understandings of HA-Core workings and the pyscript architecture to write this extension for pyscript myself, but I would very much love and use it, if it arrives! :D 💯 |
For all the new voice assistant stuff being developed currently, it'd be awesome if sentence triggers made their way to pyscript. Something like this would be awesome,
where the return value is the "conversation response" and spoken by the triggered voice assistant.
I had planned to give this a try once I did the easier webhook triggers (in #592), but handling the return response ended up not as straightforward as I had expected and I frankly haven't found the time. Happy to collaborate if someone wants to tackle this or do it together. I think we could track any progress that happens here if @craigbarratt is open to a PR :)
Note, this is also similar to the request in discussion #591.
The text was updated successfully, but these errors were encountered: