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