Would this work ? calendar attribute message and state

Can I mess with the state attribute right in the condition like I do in the action field or do I need to set it as a separate template value ?

alias: Erik announce class event
description: Announce event for Erik his current class
trigger:
  - platform: state
    entity_id:
      - calendar.website_calendar
    to: "on"
condition:
  - condition: state
    entity_id: calendar.home_assistant
    state: {{ state_attr('calendar.website_calendar','message') | lower | regex_search('y2 | year 2') }}
    attribute: message
action:
  - service: notify.alexa_media_everywhere
    data:
      message: "{{ state_attr('calendar.website_calendar','message') }} is about to start"
      data:
        type: announce
        method: all
mode: single