Telegram_bot.send_photo can't find photo

I have this configuration:

################## CAMERA RECORDING ################
- alias: 'Camera state recording -> send pic'
  hide_entity: True
  trigger:
    platform: state
    entity_id: camera.entrance, camera.garden, camera.parking
    to: recording
  action:
    - service: telegram_bot.send_message
      data_template:
        message: '{{ trigger.to_state.attributes.friendly_name }} : {{ trigger.from_state.state }} to {{ trigger.to_state.state }}'
    - service: camera.snapshot
      data_template:
        entity_id: '{{trigger.entity_id}}'
        filename: 'pics/camera_alert.jpg'
  
    - service: telegram_bot.send_photo
      data:
        title: 'Alert'
        message: 'Larm'
        data:
          photo:
            - file: 'pics/camera_alert.jpg'
              caption: 'Alert'

telegram_bot.send_message works, the camera.snapshot works and the camera_alert.jpg image is created but telegram_bot.send_photo fails.

2018-12-20 22:33:51 WARNING (SyncWorker_14) [homeassistant.components.telegram_bot] Can’t load data. No data found in params!
2018-12-20 22:33:51 ERROR (SyncWorker_14) [homeassistant.components.telegram_bot] Can’t send file with kwargs: {‘title’: ‘Alert’, ‘message’: ‘Larm’, ‘data’: OrderedDict([(‘photo’, [OrderedDict([(‘file’, ‘pics/camera_alert.jpg’), (‘caption’, ‘Alert’)])])])}

and in configuration.yaml

whitelist_external_dirs:
- /config/pics

Ok, the trick seems to be to introduce a delay after you initiated the save of the image. The below (also slightly rewritten) automation works for me.

- alias: 'Camera state recording -> send pic'
  hide_entity: True
  trigger:
    platform: state
    entity_id: camera.entrance, camera.garden, camera.parking
    to: recording
  action:
    - service: telegram_bot.send_message
      data_template:
        message: '{{ trigger.to_state.attributes.friendly_name }} : {{ trigger.from_state.state }} to {{ trigger.to_state.state }}'
    - service: camera.snapshot
      data_template:
        entity_id: '{{trigger.entity_id}}'
        filename: "/config/pics/{{trigger.entity_id}}_camera_alert.jpg"
    - delay: '00:00:05'
    - service: telegram_bot.send_photo
      data_template: 
        file: "/config/pics/{{trigger.entity_id}}_camera_alert.jpg"

Auotmation does not run thorugh

alias: Test 
description: ""
trigger:
  - platform: state
    entity_id:
      - light.schlafzimmer_lampe
      - light.gang_a
      - light.gang_b
      - light.tv_strip
      - light.bad_lampe
      - light.tv_lampe
    to: unavailable
condition: []
action:
  - service: notify.pushover
    data:
      message: "{{trigger.entity_id}} has gone offline"
      title: null
mode: single

I get an error message that the trigger ist undefined

grafik