Newbie issue with Pushover notification from automation

I’m getting started with HA and automation, so apologies if this is a rookie mistake. Basically, I’ve set up a sample Pushover automation (when sunsets, send notification). It looks like this;

- id: '1572538327890'
  alias: Sunset Notification
  description: Send pushover notification on sunset
  trigger:
  - event: sunset
    platform: sun
  condition: []
  action:
    data:
      data:
        priority: 0
        sound: none
      title: Sunset
    data_template:
      message: >
        The sunset at {{ trigger.now }}
    service: notify.pushover

However, when I trigger it I’m getting the following log message;

Error while executing automation automation.sunset_notification. Invalid data for call_service at pos 1: extra keys not allowed @ data[‘data_template’]

If I move the message parameter into data then the message works fine, I was hoping to be able to pass the time in (just as a test).

Hopefully this is a simple formatting issue.

Try:

  action:
    data_template:
      data:
        priority: 0
        sound: none
      title: Sunset
      message: >
        The sunset at {{ now() }}
    service: notify.pushover
1 Like