Hi
I’m want to have a custom action for a standard intent.
So I created intent_scripts for HassMediaPause and HassMediaUnpause, hoping that the standard (integrated) sentences would prefer my custom intent_script. But that did not work.
I then copied the standard sentences into my custom senteces, hoping that when that “custom sentence” is triggered, it would trigger the custom intent_script.
When I use dev-tools assist, that works half-way, I can see that it triggers the custom intent instead of the standard intent. However, when executing it via the voice assistant, the message is “there is no player with status pause” - so it does not prefer my custom script, it fires the standard response.
Is there a way around this?
Sure thing.
FYI, I have various custom actions, but this is the first one that I want to fire for a standard/included sentence. It seems though that standard “answers” are preferred over custom “answers”.
Content of my /custom_sentences/en/specificlanguage.yaml (this is a pure copy of github intents)
Then, in confiuguration.yaml: intent_script: !include intent_script.yaml
And finally, my custom action for that in the intent_script.yaml:
HassMediaPause:
action:
- action: script.voice_assistant_media_player_toggle
speech:
text: "Ok, music has been paused."
HassMediaUnpause:
action:
- action: script.voice_assistant_media_player_toggle
speech:
text: "Ok, music has been continued."
No, I’m not passing any variables, its just executing the script.
Anyway, its solved!
Beautiful the renaming did the trick, thank you! Why did I not think about this…!
If this is helpful for someone else, overwriting actions for standard intents:
copy the intents 1:1 from github to your /custom_sentences folder
Give the intents a specific Name, for example instead of HassMediaPause, rename to CustomHassMediaPause
Define your actions & own intents in the intent_script with the same intent name CustomHassMediaPause
Make sure to reboot HA, else it wont pickup your additional custom_intents! Reloading the config is only enough if you make changes to custom_intents, but not if you add new ones.