Hi, everyone,
it would be possible to restart intent scripts separately without a complete system start (restart of the YAML configuration). That would have the charm that one could change and expand intents “on the fly”.
Many greetings
Michael
Did you mean “reload” and not “restart”?
In every case it is needed.
Probably nobody uses intents for there bad usability.
Seems like a lot have switched to automations or node red.
Why the heck is there no UI for intent_scripts like for scripts and automations???
No reload, no UI editing and no Debugging
If this can help, you can make “generic” intent that call automation.
That way, you don’t need to reload the whole Home Assistant.
Here is my intent_scripts.yaml
AutomationTrigger:
action:
service: automation.trigger
data: {}
target:
entity_id: automation.{{id}}
AutomationTriggerWithMessage:
action:
- service: tts.marytts_say
entity_id: media_player.mass_vlc_telnet
data_template:
message: "{{message}}"
- service: automation.trigger
data: {}
target:
entity_id: automation.{{id}}
ChangeState:
action:
- service_template: "{{service}}"
data:
entity_id: "{{entity}}"
RadioPlay:
action:
service: media_player.play_media
target:
entity_id: media_player.mass_vlc_telnet
data:
media_content_id: media-source://radio_browser/{{id}}
media_content_type: audio/mpeg
RadioStop:
action:
service: media_player.media_stop
data: {}
target:
device_id: 044bd8cf4fa394d68ef63f2e08207265
RadioVolume:
action:
service: media_player.volume_set
data:
volume_level: 0.{{state}}
target:
device_id: 044bd8cf4fa394d68ef63f2e08207265
And some exemple of uses with rhasspy
[AutomationTrigger]
(quelle heure est-il|il est quelle heure|c'est quelle heure){id:hour_tell}
(quelle temps fait-il|il fait quelle temps dehors|combien de degré){id:tell_temperature}
(qu'est-ce que tu peux faire|aide-moi){id:tell_help}
[AutomationTriggerWithMessage]
message_goodbye = (bonne nuit){message:bonne nuit} | (au revoir){message:à bientôt}
<message_goodbye>{id:goodbye}
[ChangeState]
light_name = (couloir){entity:light.couloir} | (étage){entity:light.etage} | (cuisine){entity:light.cuisines} | (toutes){entity:light.toutes} | (salle de bain){entity:light.bathroom} | (salle de bain){entity:light.bathroom} | (vc){entity:wc} | (en haut){entity:light.etage} | (maison){entity:light.toutes} | (en bas){entity:light.rdc} | (salon){entity:light.salon}
((allume|lumos){service:light.turn_on} | (éteind|nox){service:light.turn_off}) [(l' | le | la | les | au)] <light_name>
[RadioPlay]
radio_name = (de la musique electro | de l'electro){id:a99f5c52-9ae8-4cee-ad32-2e357bedc0b0} | (de la musique psytrance | de la psytrance){id:7efa60ba-1735-4eb0-b77f-90618329d94e} | (de la musique drum and bass | de la drum and bass){id:ece9a805-25d6-11e8-91bf-52543be04c81} | (de la musique mediéval | du mediéval){id:aa6ee95d-e208-4592-a121-047056106596} | (de la musique celtique | du celtique){id:a96e06f8-4d64-11ea-b877-52543be04c81}
joue <radio_name>
[RadioStop]
(stop | stop la) musique
[RadioVolume]
state_accepted = (1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 15 | 25 | 35 | 45){state}
volume à <state_accepted>
Added my vote for the ability to reload intent_script
vs. having to restart HA.
I’ve been playing around with Rhasspy and although it needs work, it definitely shows potential.
I did consider changing the intent handling in Rhasspy from intents to events so I can use automations instead of intent scripts, but I like the intents that come prebuilt into HA. Recreating them as automations or even putting them in Node-RED (which I also use) would require some work I’m not sure I’m up for. With 2023 being the year of voice for HA, I can only imagine that HA will be getting more built-in intents etc, something I would like to take advantage of also.
I would be excellent to have the service intent_script.reload
and or the ability to add / edit intents in the UI… This is especially true for the Year of the Voice
Assist custom intents as it is time consuming to restart Home Assistant every time when testing a script.
Just ran into this, seems like the custom_sentences directory reloads fine, but intent_scripts are not reloaded… that makes adding custom ones pretty odd…