Multiple Wakewords and Automations

I have two wakewords (gandalf and arnee) configured and connected to individual pipelines with each one responding with a different voice. I also have some custom sentences and automations, for example what time is it (and variations of that question). I’d like to be able have a single automation or custom sentence which can detect either the wakeword used or the pipeline used and speak using the appropriate voice. For example if the arnee wakeword is used the response will be terse but if gandalf was used it would be more verbose. But I can’t seem to find a way to do this so any pointers would be welcome. Thanks

The esp device logs register which wake word triggered wake

You could possible create sensor on esp voice device to tell which wake word triggered and use that as automation trigger

I would probably just create binary_sensor.gandoff_wake and have simple ON/OFF. I’d have one for each wake word.

Thank you. I implemented this on_wake_word_detected:
- homeassistant.action:
action: input_select.select_option
data:
entity_id: input_select.assist_persona
data_template:
option: >-
{% set w = ww | lower %}
{% if ‘gandalf’ in w %}gandalf
{% elif ‘arnee’ in w or ‘arnie’ in w %}arnie
{% else %}unknown
{% endif %}
variables:
ww: !lambda ‘return wake_word;’

in the device config and it appears to work