Hi all,
I am trying to get double take snapshots (and ultimately videos but i probably need to use frigate for that) on telegram, and while the text is getting through, i’m not getting the snapshot for some reason.
I changed the token in the automation to id, as token is part of attributes anymore, but id is. Not sure if that’s the right thing to do.
The interesting thing is i lifted the code from a notify for the mobile app automation and when i pull down the notification on IOS, it says Failed to load attachment, URLSessionTask failed with error: Could not connect to the server.
Any help appreciated.
alias: SendTelegram notify if unknown person is detected
description: ""
trigger:
- platform: state
entity_id: sensor.double_take_me
- platform: state
entity_id:
- sensor.double_take_friend
- platform: state
entity_id: sensor.double_take_unknown
condition:
- condition: template
value_template: "{{ trigger.to_state.state != trigger.from_state.state }}"
action:
- service: notify.telegram_main
data_template:
message: |-
{% if trigger.to_state.attributes.match is defined %}
{{trigger.to_state.attributes.friendly_name}} is near the {{trigger.to_state.state}} @ {{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 is near the {{trigger.to_state.state}} @ {{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 %}
data:
attachment:
url: |-
{% if trigger.to_state.attributes.match is defined %}
http://localhost:3000/api/storage/matches/{{trigger.to_state.attributes.match.filename}}?box=true&token={{trigger.to_state.attributes.**id**}}
{% elif trigger.to_state.attributes.unknown is defined %}
http://localhost:3000/api/storage/matches/{{trigger.to_state.attributes.unknown.filename}}?box=true&token={{trigger.to_state.attributes.**id**}}
{% endif %}
actions:
- action: URI
title: View Image
uri: |-
{% if trigger.to_state.attributes.match is defined %}
http://localhost:3000/api/storage/matches/{{trigger.to_state.attributes.match.filename}}?box=true&token={{trigger.to_state.attributes.**id**}}
{% elif trigger.to_state.attributes.unknown is defined %}
http://localhost:3000/api/storage/matches/{{trigger.to_state.attributes.unknown.filename}}?box=true&token={{trigger.to_state.attributes.**id**}}
{% endif %}
mode: parallel
max: 10