Can I claim entity_id in automation as an variable

Hi,
My scenario is when I receive notification on iOS App, I put an actionable Notification to quick turn ON/OFF devices. I can attach entity_id of targeted device in the payload of “action_data” in ios_notification_action_fired. I saw it in log when I press butto likes:
Bus:Handling <Event ios.notification_action_fired[R]: actionName=TURN_ON, sourceDeviceName = sepo, action_data=switch.light, sourceDevicePermanentID= xxxx>

My issue is I cannot know how to calm action_data=switch.light to another automation alias likes:

- alias: 'turn on'
 trigger:
  platform: event
  event_name: ios.notification_action_fired
  event_data:
    actionName: TURN_ON
  action:
    service: homeassistant.turn_on
    entity_id: '{{ push.action_data }}'

I tried with ‘{{ ios.notification_action_fired.action.data}}’ but always ERROR in log: Invalid config for [automation]: Entity ID {{ push.action_data }} is an invalid entity for disctionary value @ data[‘action’][0][‘entity_id’]

Could someone help to extract this parameter and input to entity_id.

Thanks and Regards,
Sebastian

Hi,

I can found another way but it will make code is longer.

- alias: 'turn on'
  trigger:
  platform: event
  event_name: ios.notification_action_fired
  event_data:
  actionName: TURN_ON
  action_data: switch.light
  action:
    service: homeassistant.turn_on
    entity_id: switch.light

But I need many aliases. Anyone have better idea?

Interesting I was trying this as well.