Garage Automations

Can someone please check my code? I want to do the following

At any time, if the garage door is open for more than 4 minutes, send a notification to my phone through the App

15 minutes before sunset until sunrise, when the garage door is opened, immediately turn on the garage switch, which is connected to a light string

- id: '1589085567599'
  alias: Garage Door Open Notification
  description: ''
  trigger:
  - entity_id: binary_sensor.vision_security_zg8101_garage_door_detector_sensor
    for: 00:04:00
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      message: The garage door is up
      title: Garage door is up
    service: notify.notify
- id: '1589151804789'
  alias: Garage Lights After Dark
  description: ''
  trigger:
  - entity_id: binary_sensor.vision_security_zg8101_garage_door_detector_sensor
    platform: state
    to: 'On'
  condition:
  - before: sunset
    before_offset: -00:15
    condition: sun
  action:
  - device_id: bcd5830564b84a25814151cef5d83a29
    domain: switch
    entity_id: switch.garage
    type: turn_on
- id: '1589155041397'
  alias: Garage Door Closed
  description: ''
  trigger:
  - entity_id: binary_sensor.vision_security_zg8101_garage_door_detector_sensor
    platform: state
    to: 'off'
  condition: []
  action:
  - device_id: bcd5830564b84a25814151cef5d83a29
    domain: switch
    entity_id: switch.garage
    type: turn_off
to: 'On'

Should be

to: 'on'

Your times and offsets should be in single quotes '-00:15'

I’d also recommend using the alert component instead of your first automation: