Trying to get an event_type from a notification into a message

This looked easy but have been struggling for days at every combination.
I have an automation based on a tumble dryer notification

alias: Tumble dryer notification
description: ""
triggers:
  - trigger: state
    entity_id:
      - event.dryer_notification
conditions: []
actions:
  - action: notify.send_message
    metadata: {}
    target:
      entity_id: notify.chris_study_announce
    data:
      message: "{{dryer_notification.event_type }}"

In developer tools->states I see
event.dryer_notification

event_types:
  - drying_failed
  - drying_is_complete
event_type: drying_is_completed
friendly_name: Dryer Notification

but whichever combination I use the automation fails at the action stage with errors similar to
Error: Error rendering data template: UndefinedError: ‘dryer_notification’ is undefined

I have tried
event.dryer_notification…
trigger.event…
dryer.event…

Can anyone point me to the solution?

You are using a State Trigger, so you need to use the trigger data that is available for that trigger type. And you’ll likely want to modify it a little for TTS to work properly:

{{ trigger.to_state.attributes.event_type | replace('_',' ') }}

Other topics you might want to review:

State vs. State Object

Script Syntax - Variables

1 Like