Trigger switch upon arrival after dark, leave on for 5 minutes

Hi all, this is my first automation setup and I’m having trouble with the hass syntax I think. What I’d like to do is pretty basic - when someone arrives home (triggered by Life360 through IFTTT) and it’s after sunset, turn on a switch (ESP8266 homemade switch activated through a curl command) for 5 minutes, then turn off.
Here’s what I have so far, not working obviously. Anyone any suggestions?

#SCRIPTS
script:
  porchlight_timer:
    alias: Entryway Light Timer
    sequence:
      - event: LOGBOOK_ENTRY
        event_data:
          name: Entryway Light
          message: is turned ON
          entity_id: switch.zsoltswitch
          domain: switch
      - alias: Entryway Light Turns ON
        service: switch.turn_on
        data:
          entity_id: switch.zsoltswitch
      - delay:
          minutes: 5
      - alias: Entryway Light Turns OFF
        service: switch.turn_off
        data:
          entity_id: switch.zsoltswitch

#AUTOMATION
automation:
  alias: 'P1 arrived home after dark'
    # IFTTT sends trigger
    trigger:
      platform: event
      event_type: p1ArrivedHome
    condition:
      platform: state
      entity_id: sun.sun
      state: 'below_horizon'
    action:
      service: porchlight_timer

First error I can see is that your service in your automation is missing the domain “script”:

    action:
      service: script.porchlight_timer

I prefer to do it overly correct to have everything look the same so I would do it like this:

    action:
      service: script.turn_on
      data:
        entity_id: script.porchlight_timer

~Cheers

Thank you! I’ll give it a try