Hi all,
I’m using rhasspy to handle voice control with homeassistant. Where I’m struggling is:
I want to build an intent_script that starts music on a certain media_player.
Through rhasspy slots/sentences configuration I can see that rhasspy reliably puts correct entity_id from slots in the output json under entiteis → value.
But how can I access this value in the intent script ?
Can I “watch” intent events in ha to debug more ?
Hope you all can help me.
intent_script:
StartPlayer:
speech:
text: Wiedergabe auf {{ entity }} gestartet
action:
- service: notify.notify
data:
message: Entity {{ entities.name }} Name {{ text }}
- service: media_player.media_play
data_template:
entity_id: {{ WHATDOINEEDTOPUTHERE }}
JSON Rhasspy
{
"intent": {
"name": "StartPlayer",
"confidence": 1
},
"entities": [
{
"entity": "name",
"value": "media_player.wohnzimmer",
"value_details": {
"kind": "Unknown",
"value": "media_player.wohnzimmer"
},
"raw_value": "sonos media_player.wohnzimmer",
"start": 18,
"end": 41,
"raw_start": 18,
"raw_end": 47
}
],
"slots": {
"name": "media_player.wohnzimmer"
},
"text": "starte wiedergabe media_player.wohnzimmer",
"raw_text": "starte wiedergabe sonos media_player.wohnzimmer",
"tokens": [
"starte",
"wiedergabe",
"media_player.wohnzimmer"
],
"raw_tokens": [
"starte",
"wiedergabe",
"sonos",
"media_player.wohnzimmer"
],
"wakeword_id": "jarvis_raspberry-pi",
"siteId": "default",
"sessionId": "default-jarvis_raspberry-pi-a61148da-8b17-40fc-a2aa-357533f33559",
"customData": "jarvis_raspberry-pi",
"wakewordId": "jarvis_raspberry-pi",
"lang": null
}
mediaplayer slots:
sonos: media_player.wohnzimmer
mopi: media_player.mopi_local
sentences.ini
[StartPlayer]
players = $hass/entities,media_player
entities = $mediaplayers
play [(wiedergabe | auf )] (<entities>){name}
starte [(wiedergabe | auf )] (<entities>){name}