Rhasspy event, multiple automations

I’ve succesfully connected Rhasspy to HASS, so whenever an intent is passed from Rhasspy, an event is triggered in HASS and some automation is started. Now for debugging purposes, when any Rhasspy event is triggered in HASS, I would like also to send a notification containing intent name and notification. I know this could be achieved by adding "service: persistent_notification.create … … " to each automation, but that would mean repeating the same code in each automation.
Is there a trigger, that would capture ALL Rhasspy events using some wildcard or something, e.g.:

- alias: rhasspy
  trigger:   
    platform: event
    event_type: 'rhasspy_*'

Off course the code above doesn’t work.

- alias: rhasspy
  trigger:
    platform: event
  condition:
    - "{{ 'rhasspy_' in trigger.event.event_type }}"

At least, I think those things are stored in trigger.event. Maybe trigger.event.data.event_type? lol

I get the following error:

Invalid config for [automation]: required key not provided @ data[‘event_type’]. Got None.

I gues specifying event_type is mandatory…

Yeah, then I’m not sure. I’ve tried a bunch, but can’t get anything to work. Template triggers don’t seem to understand when to fire when i specify an event. I tried a template in the event_type, but that didn’t do anything (pretty sure it just used the template as-is and is waiting for some funky event_type that looks like my template lol).

I’m not sure how many there are. If there are a ton, maybe use a script to generate a rhasspy.yaml that will generate an automation on all events. If there are a handful, just manually create the file. (assuming you are doing !include_dir_merged_list for your automations folder.

Just have the action be the same…call a script and pass in event and event.data so if you wanted to modify the action, you just do a single script.

trigger:
  # Generate one of these for every event. Only difference is the event_type for each one. 
  platform: event
  event_type: rhasspy_ChangeLightColor
action:
  - service: script.rhasspy_event
    data:
      event: "{{ trigger.event }}"

Then create the script.rhasspy_event to do what you want. Make sure to set the script mode to queued in the event multiple fire in a row.

I was thinking, maybe another approach would be to make an automation, which would be triggered, whenever some other automations is started, which would contain specific word in its name (e.g. “rhasspyevent”). Any suggestion how to write this (I’m not to good with coding).