Need help with Home Assistant NVR notifications - Images only working on local network

Hi everyone! I hope you can help me with an issue I’m experiencing with my Home Assistant NVR notifications setup. I have two similar automations for NVR alerts. The first one works perfectly, sending notifications for face and person detection without images, regardless of wether I’m on my local network or using mobile data. Here’s my working automation without images:

alias: NVR Alarm
trigger:

  • platform: webhook
    webhook_id: notification_alarmevent
    allowed_methods:
    • POST
      local_only: false
      condition:
      action:
  • choose:
    • conditions:
      • condition: template
        value_template: “{{ trigger.json.data.ai_snap_picture.FaceInfo is defined }}”
        sequence:
      • service: notify.mobile_app_iphone_kevin
        data:
        message: >-
        Stranger CH{{ (trigger.json.data.ai_snap_picture.FaceInfo[0].Chn + 1) }}
        Time: {{ (trigger.json.data.ai_snap_picture.FaceInfo[0].StartTime | int) | timestamp_custom(‘%H:%M:%S’) }}
        title: NVR Alarm - Face Detection
    • conditions:
      • condition: template
        value_template: “{{ trigger.json.data.ai_snap_picture.SnapedObjInfo is defined }}”
        sequence:
      • service: notify.mobile_app_iphone_kevin
        data:
        message: >-
        Person detected CH{{ (trigger.json.data.ai_snap_picture.SnapedObjInfo[0].Chn + 1) }}
        Time: {{ (trigger.json.data.ai_snap_picture.SnapedObjInfo[0].StartTime | int) | timestamp_custom(‘%H:%M:%S’) }}
        title: NVR Alarm - Person Detection
        mode: single

I then created a second automation that’s almost identical but includes the detected images as attachments:

alias: NVR Alarm Push2
trigger:

  • platform: webhook
    webhook_id: notification_alarmevent
    allowed_methods:
    • POST
      local_only: false
      condition:
      action:
  • choose:
    • conditions:
      • condition: template
        value_template: “{{ trigger.json.data.ai_snap_picture.FaceInfo is defined }}”
        sequence:
      • service: notify.mobile_app_iphone_kevin
        data:
        message: >-
        Stranger CH{{ (trigger.json.data.ai_snap_picture.FaceInfo[0].Chn + 1) }}
        Time: {{ (trigger.json.data.ai_snap_picture.FaceInfo[0].StartTime | int) | timestamp_custom(‘%H:%M:%S’) }}
        title: NVR Alarm - Face Detection
        data:
        attachment:
        url: “data:image/jpeg;base64,{{ trigger.json.data.ai_snap_picture.FaceInfo[0].Image2 }}”
        content-type: “jpeg”
    • conditions:
      • condition: template
        value_template: “{{ trigger.json.data.ai_snap_picture.SnapedObjInfo is defined }}”
        sequence:
      • service: notify.mobile_app_iphone_kevin
        data:
        message: >-
        Person detected CH{{ (trigger.json.data.ai_snap_picture.SnapedObjInfo[0].Chn + 1) }}
        Time: {{ (trigger.json.data.ai_snap_picture.SnapedObjInfo[0].StartTime | int) | timestamp_custom(‘%H:%M:%S’) }}
        title: NVR Alarm - Person Detection
        data:
        attachment:
        url: “data:image/jpeg;base64,{{ trigger.json.data.ai_snap_picture.SnapedObjInfo[0].ObjectImage }}”
        content-type: “jpeg”
        mode: single

The strange thing is, the second automation only works when I’m connected to my local network. As soon as I switch to mobile data, the notifcations stop working. I’d really like to receive these image notifications even when I’m away from home. Has anyone encountred a similar issue or knows what might be causing this?
Any help would be greatly appreciated! Thanks in advance!