I’m using automations.yaml to compose my voice responses in Home Assistant. Where I’ve run into a bit of difficulty is obtaining the slots rawValue for any given slot. Below is the example JSON returned from the Rhasspy event where I’d like to obtain the rawValue data for the slot where slotName = “light”. It should be “brass lamp”.
What I have tried is shown here, but alas, neither are working.
{{ trigger.event.data._intent.slots["light"].rawValue }}
{{ trigger.event.data._intent.slots.light.rawValue }}
So exactly how should I specify a slot by name?
{
"event_type": "rhasspy_ChangeLightState",
"data": {
"light": "switch.brass_lamp",
"state": "off",
"_text": "switch.brass_lamp off",
"_raw_text": "brass lamp off",
"_intent": {
"input": "switch.brass_lamp off",
"intent": {
"intentName": "ChangeLightState",
"confidenceScore": 1
},
"siteId": "Listener1",
"id": null,
"slots": [
{
"entity": "light",
"value": {
"kind": "Unknown",
"value": "switch.brass_lamp"
},
"slotName": "light",
"rawValue": "brass lamp",
"confidence": 1,
"range": {
"start": 0,
"end": 17,
"rawStart": 0,
"rawEnd": 10
}
},
{
"entity": "state_on_off",
"value": {
"kind": "Unknown",
"value": "off"
},
"slotName": "state",
"rawValue": "off",
"confidence": 1,
"range": {
"start": 18,
"end": 21,
"rawStart": 11,
"rawEnd": 14
}
}
],
"sessionId": "Listener1-porcupine-1ed92005-9da1-433a-8d7d-671cd79390de",
"customData": null,
"asrTokens": [
[
{
"value": "switch.brass_lamp",
"confidence": 1,
"rangeStart": 0,
"rangeEnd": 17,
"time": null
},
{
"value": "off",
"confidence": 1,
"rangeStart": 18,
"rangeEnd": 21,
"time": null
}
]
],
"asrConfidence": null,
"rawInput": "brass lamp off",
"wakewordId": "porcupine",
"lang": null
}
},
"origin": "REMOTE",
"time_fired": "2020-07-05T18:15:43.376664+00:00",
"context": {
"id": "278fc19a54f349f7948dfa12882e2913",
"parent_id": null,
"user_id": "26ec3060f78f4880a6a70e903924eb1f"
}
}