Rhasspy intent and siteId

hey all

i m trying to get the siteId in one of my intents handling nothing worked so far…
here is the intent_script:

intent_script:
  ChangeLightState:
    action:
      - service_template: 'switch.turn_{{state}}'
        data_template:
          entity_id: 'switch.{{room}}_{{objet}}'
      - service: persistent_notification.create
        data_template: 
          message: '{{ siteId }}'

and the json from the mqtt hermes/intent/ChangeLightState

{
    "input": "on 0 lampe 0 salon",
    "intent": {
        "intentName": "ChangeLightState",
        "confidenceScore": 1
    },
    "siteId": "salon",
    "id": null,
    "slots": [
        {
            "entity": "state",
            "value": {
                "kind": "Unknown",
                "value": "on"
            },
            "slotName": "state",
            "rawValue": "allume",
            "confidence": 1,
            "range": {
                "start": 0,
                "end": 2,
                "rawStart": 0,
                "rawEnd": 6
            }
        },
        {
            "entity": "objet",
            "value": {
                "kind": "Unknown",
                "value": "lampe"
            },
            "slotName": "objet",
            "rawValue": "lampe",
            "confidence": 1,
            "range": {
                "start": 5,
                "end": 10,
                "rawStart": 10,
                "rawEnd": 15
            }
        },
        {
            "entity": "room",
            "value": {
                "kind": "Unknown",
                "value": "salon"
            },
            "slotName": "room",
            "rawValue": "salon",
            "confidence": 1,
            "range": {
                "start": 13,
                "end": 18,
                "rawStart": 19,
                "rawEnd": 24
            }
        }
    ],
    "sessionId": "salon-jarvis-02cfe8c7-9ff3-4a55-8c8d-b1119b560fd6",
    "customData": null,
    "asrTokens": [
        [
            {
                "value": "on",
                "confidence": 1,
                "rangeStart": 0,
                "rangeEnd": 2,
                "time": null
            },
            {
                "value": "0",
                "confidence": 1,
                "rangeStart": 3,
                "rangeEnd": 4,
                "time": null
            },
            {
                "value": "lampe",
                "confidence": 1,
                "rangeStart": 5,
                "rangeEnd": 10,
                "time": null
            },
            {
                "value": "0",
                "confidence": 1,
                "rangeStart": 11,
                "rangeEnd": 12,
                "time": null
            },
            {
                "value": "salon",
                "confidence": 1,
                "rangeStart": 13,
                "rangeEnd": 18,
                "time": null
            }
        ]
    ],
    "asrConfidence": null,
    "rawInput": "allume la lampe du salon",
    "wakewordId": "jarvis"
}

fixed ! use

{{ site_id }}

https://www.home-assistant.io/integrations/snips/#special-slots

Hey all and sorry for grave-digging.This topic comes up when searching for “site_id rhasspy home-assistant”. The suggestion above does not work for this use case, however {{ _intent.siteId }} works. Under this key a number of other keys can also be accessed for usage. A clean way to introspect incoming intents would be great though.

1 Like