Telegram unable to send photo notification

I am able to send text based messages and now I am attempting to send a photo via notify.me_telegram service however I am getting the following error.

Logger: homeassistant.components.telegram_bot
Source: components/telegram_bot/__init__.py:675
Integration: Telegram bot ([documentation](https://www.home-assistant.io/integrations/telegram_bot), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+telegram_bot%22))
First occurred: 3:21:13 PM (7 occurrences)
Last logged: 3:36:39 PM

* Can't send file with kwargs: {'title': '*Send a message*', 'message': "That's an example that _sends_ a *formatted* message with a custom inline keyboard.", 'file': '/tmp/snapshot_cam2.jpg', 'caption': 'Plex'}
* Can't send file with kwargs: {'title': '*Send a message*', 'message': "That's an example that _sends_ a *formatted* message with a custom inline keyboard.", 'file': '/local/media_icons/plex.png', 'caption': 'Plex'}
* Can't send file with kwargs: {'title': '*STesting*', 'message': 'Test', 'file': '/local/media_icons/plex.png', 'caption': 'Plex'}
* Can't send file with kwargs: {'file': '/local/media_icons/plex.png'}
* Can't send file with kwargs: {'file': '/local/crunchroll.png'}

I have the following in configuration.yaml.

homeassistant:
  allowlist_external_dirs:
    - /config/tmp
    - /config/www
    - /config/www/media_icons

I have tested with multiple files in several locations and nothing seems to be working.

edit: I am attempting this in the Services tab with notify.me_telegram with the following in data:

title: '*STesting*'
message: "Test"
data:
  photo:
    - file: /local/media_icons/plex.png
      caption: Plex

and also with telegram_bot.send_photo and the following in data:

file: /local/crunchroll.png
target: *my_chat_id*

Can’t see your full service so no idea what you have tried but this works for me: Telegram - sending a photo. Docs error?

I thought about the fact that my services were missing so added them in an edit. But I see you are referencing the file with it’s complete actual directory where I used /local instead of /config/www

I will change that and see what happens. Thanks!

/local for URLs, /config/www for file paths.

1 Like

For anyone that may appear here later - - -

I was incorrectly referencing the files. In my service calls, I used /local and /tmp. I should have used /config/www and /config/tmp respectively.

1 Like