Getting double take snapshots in telegram

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

So i removed the token as i’m pretty sure i don’t use them, but if i open the URL in the homeassistant app i get:

{“error”: “Access denied to IP address:
::ffff:172.30.32.1”}

Which is presume is the docker host ip address. Not sure what’s going on though other then a seeming authentication issue?

info: Access denied to IP address: ::ffff:172.30.32.1
error: IpDeniedError: Access denied to IP address: ::ffff:172.30.32.1
    at error (/double-take/api/node_modules/express-ipfilter/lib/ipfilter.js:156:17)
    at /double-take/api/node_modules/express-ipfilter/lib/ipfilter.js:202:12
    at newFn (/double-take/api/node_modules/express-async-errors/index.js:16:20)
    at Layer.handle [as handle_request] (/double-take/api/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/double-take/api/node_modules/express/lib/router/index.js:328:13)
    at /double-take/api/node_modules/express/lib/router/index.js:286:9
    at Function.process_params (/double-take/api/node_modules/express/lib/router/index.js:346:12)
    at next (/double-take/api/node_modules/express/lib/router/index.js:280:10)
    at module.exports (/double-take/api/src/middlewares/respond.js:54:3)
    at newFn (/double-take/api/node_modules/express-async-errors/index.js:16:20)
info: Access granted to IP address: ::ffff:127.0.0.1

So when i click on the image in double take, i takes me to :slight_smile:

http://homeassistant.local:8123/api/hassio_ingress/o89R0CKjo78gGwBz_wcXGW6sXtfSEgtLaFRSepJZURU/api/storage/matches/abe4e9f6-781e-46f9-8250-3a84e81d6b31.jpg?box=true

And that works, so i just changed

 http://localhost:3000/api/storage/matches/{{trigger.to_state.attributes.match.filename}}?box=true&token={{trigger.to_state.attributes.**id**}}

To:


http://homeassistant.local:8123/api/hassio_ingress/o89R0CKjo78gGwBz_wcXGW6sXtfSEgtLaFRSepJZURU/api/storage/matches/{{trigger.to_state.attributes.match.filename}}?box=true&token={{trigger.to_state.attributes.id}}

So i guess that’s a workaround to the access issues.
It still doesn’t load the image on iPhone, but when i load the generated http url from the automation, it works fine on the desktop PC.