Automatic response each time wakeword is triggered

Hello,
Is it possible to activate an automation in home assistant (in addition to my real speech command) each time rhasspy wakeword is triggered?
I want every time that i say “porcupine”, home assistant will mute / lower my tv volume automatically, so I don’t have to shout my real command.

The MQTT topics hermes/dialogueManager/sessionStarted and hermes/dialogueManager/sessionEnded should be suitable for that use-case.

Related topic: Mute music during Rhasspy session

Thanks.
How do I use them in automation?

Works as a charm.
Thanks

I have another question.
How can I know the site_it that started topic hermes/dialogueManager/sessionStarted, so I can know witch player I need to mute?

Yes, the payload includes the site id. Here’s the documentation: https://docs.snips.ai/reference/dialogue#session-started

Can you explain me how do I use the payload?

This is my automation
I need to use a different entity_id for each site_id.

- id: '1595866367366'
  alias: MQTT
  description: ''
  trigger:
  - platform: mqtt
    topic: hermes/dialogueManager/sessionStarted
  condition: []
  action:
  - data:
      entity_id: media_player.master_bedroom_tv_box
      is_volume_muted: true
    service: media_player.volume_mute
  mode: single

I think you can use “data_template” instead of “data” to do something like this:

- id: '1595866367366'
  alias: MQTT
  description: ''
  trigger:
  - platform: mqtt
    topic: hermes/dialogueManager/sessionStarted
  condition: []
  action:
  - data_template:
      entity_id: media_player.{{ trigger.payload_json.siteId}}_tv_box
      is_volume_muted: true
    service: media_player.volume_mute
  mode: single