If used in automation I get the data but not the attached picture. Service call does work with picture and it has the exact same code/indentation.
Telegram complaining in logs about:
First occurred: 13:05:29 (31 occurrences)
Last logged: 13:52:42
* Error while executing automation automation.send_telegram_using_main: extra keys not allowed @ data['url']
* Error while executing automation automation.send_telegram_using_main: extra keys not allowed @ data['caption']
* Error while executing automation automation.send_telegram_using_main: required key not provided @ data['message']
Telegram call in developer tools:
service: notify.telegram_main
data:
data:
photo:
- url: >-
http://homeassistant.local:3000/api/storage/matches/565756d0-9cb4-4d02-8b03-00b2a6b874e0.jpg?box=true
caption: test
message: test1
Telegram call in automation:
action:
- service: notify.telegram_main
data:
message: ""
data:
photo:
- url: >-
{% if trigger.to_state.attributes.match is defined %}
http://homeassistant.local:3000/api/storage/matches/{{trigger.to_state.attributes.match.filename}}?box=true
{% elif trigger.to_state.attributes.unknown is defined %}
http://homeassistant.local:3000/api/storage/matches/{{trigger.to_state.attributes.unknown.filename}}?box=true
{% endif %}
caption: >-
{% if trigger.to_state.attributes.match is defined %}
{{trigger.to_state.attributes.friendly_name}},
{{trigger.to_state.attributes.unknown.gender.value}}, age
{{trigger.to_state.attributes.unknown.age.low}} -
{{trigger.to_state.attributes.unknown.age.high}} and {{
trigger.to_state.attributes.unknown.mask.value.replace('_',' ')}}
is near the {{trigger.to_state.state.replace('_',' ')}} @
{{trigger.to_state.attributes.match.confidence}}% by
{{trigger.to_state.attributes.match.detector}}:{{trigger.to_state.attributes.match.type}}
taking {{trigger.to_state.attributes.attempts}} attempt(s) @
{{trigger.to_state.attributes.duration}} sec {% elif
trigger.to_state.attributes.unknown is defined %} unknown,
{{trigger.to_state.attributes.unknown.gender.value}}, age
{{trigger.to_state.attributes.unknown.age.low}} -
{{trigger.to_state.attributes.unknown.age.high}} and {{
trigger.to_state.attributes.unknown.mask.value.replace('_',' ')}}
is near the {{trigger.to_state.state.replace('_',' ')}} @
{{trigger.to_state.attributes.unknown.confidence}}% by
{{trigger.to_state.attributes.unknown.detector}}:{{trigger.to_state.attributes.unknown.type}}
taking {{trigger.to_state.attributes.attempts}} attempt(s) @
{{trigger.to_state.attributes.duration}} sec {% endif %}
mode: single
max: 2