Getting MQTT topic

I have Snips running along HA. When I talk to Snips, he publishes the slot over various topics, e.g.
topic: ‘hermes/intent/greetings’
topic: ‘hermes/intent/musicplayer’
topic: ‘hermes/intent/calendar’
topic: ‘hermes/intent/volume’
etc. I made the following automations, which is triggered every time I speak to Snips

- alias: snips_mqtt
  trigger:
    platform: mqtt
    topic: 'hermes/intent/#'
  action:   
    service: persistent_notification.create
    data:
      message: "Your message goes here"
      title: "Snips"

How can I capture the topic and the slot values?

A complete guess (probably won’t work):

{{ trigger.to_state.state_topic }}

Unfortunately doesn’t work.

According to the documentation for MQTT template variables:

{{ trigger.topic }}
{{ trigger.payload }}

Thanks, this is working now. When I speak to Snips, something like this comes as payload:

{"sessionId":"92ae64c2-be5b-4e90-8e8d-2f6997277737",
"customData":null,
"siteId":"default",
"input":"are you happy",
"asrTokens":[[{"value":"are","confidence":1.0,"rangeStart":0,"rangeEnd":3,"time":{"start":0.0,"end":0.42}},{"value":"you","confidence":1.0,"rangeStart":4,"rangeEnd":7,"time":{"start":0.42,"end":0.59999996}},{"value":"happy","confidence":1.0,"rangeStart":8,"rangeEnd":13,"time":{"start":0.59999996,"end":1.68}}]],
"asrConfidence":1.0,"intent":{"intentName":"feeling","confidenceScore":1.0},
"slots":[{"rawValue":"happy","value":{"kind":"Custom","value":"happy"},"range":{"start":8,"end":13},
"entity":"state","slotName":"feeling","confidenceScore":1.0}]}

How can I parse the captured voice command, e.g. “are you happy”

{{ trigger.payload.input }}

Unfortunately it doesn’t work, the notification message is now empty:

- alias: snips_mqtt
  trigger:
    platform: mqtt
    topic: 'hermes/intent/#'  
  action:   
    service: persistent_notification.create
    data_template:
      title: "{{ trigger.topic }}"
      message: "{{ trigger.payload.input }}"

My mistake. It’s should be this:

    data_template:
      title: "{{ trigger.topic }}"
      message: "{{ trigger.payload_json.input }}"

yes yes, it’s working now. I’ve also trimmed the topic, so that the notification title doesn’t begin with “hermes/intent/…”

- alias: snips_mqtt
  trigger:
    platform: mqtt
    topic: 'hermes/intent/#'  
  action:   
    - service: persistent_notification.create
      data_template:
        title: "{{ trigger.topic[19:] }}"
        message: "{{ trigger.payload_json.input }}"