Can no longer send Photos to Telegram (using node-red-controb-telegrambot)

I have been using the "sender" node from: "node-red-controb-telegrambot" in my home assistant.
Many moons ago, I followed the documentation from: to set it up and it has served me very will for a long time

Every time movement was detected, home-assistant took a picture, saved it to a file, and then the "sender" node from: "node-red-controb-telegrambot" posted that picture to my telegram channel.
Until last week.... I did some updates and must have broken it.

Here, below, is the output from a Debug Node before the message enters the "sender" node.

if I change the payload.type from photo to message, then I receive a (text) message in telegram, so the connectivity seems OK. But with photo or document, I get nothing. Also I don't get an error message in the Node-red UI. (I'd be interested in any pointers to potential debug logs)

Also the file "/config/www/cam_captures/camera.westcam1_20240105_161813.jpg" does exist. On the filesystem, it is actually under /usr/share/hassio/homeassistant/www/cam_captures/camera.westcam1_20240105_161813.jpg but it has always worked like this. I assume it is a chroot re-mapping for home-assistant.

Not sure if it is important:
My issues (a domino effect) started by a volume running out space, but now there is more than enough free space on that harddrive

OUTPUT of a DEBUG NODE before the message enters the "sender"
1/5/2024, 4:18:13 PMnode: msg5
msg : Object
payload: object
  chatId: "[redacted]"
  messageId: 431
  type: "photo"
  content: "/config/www/cam_captures/camera.westcam1_20240105_161813.jpg"
  caption: "camera.westcam1_20240105_161813.jpg"
originalMessage: object
  message_id: 431
  from: object
    id: [redacted]
    is_bot: false
    first_name: "[redacted]"
    username: "[redacted]2"
    language_code: "en"
  chat: object
    id: [redacted]
    first_name: "[redacted]"
    username: "[redacted]2"
    type: "private"
  date: 1704467893
  text: "/westcam1"
  entities: array[1]
   0: object
    offset: 0
    length: 9
    type: "bot_command"
    _msgid: "36c7506d0636a26a"

Any pointers are greatly appreciated,


Node-red is logging in the plugin section of Home-Assistant
invalid file HTTP URL specified: URL host is empty

Unhandled rejection Error: ETELEGRAM: 400 Bad Request: invalid file HTTP URL specified: URL host is empty
    at /config/node_modules/node-telegram-bot-api/src/telegram.js:284:15
    at tryCatcher (/config/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/config/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/config/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/config/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/config/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/config/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/config/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/config/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/config/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (node:internal/timers:476:21)

Not sure why it mentions HTTP URL
Also, Node-red is running in a container and I don't know the mapping to the root of that volume.
I tried a offsets,
But it worked in the past

Just created a quick test flow and can report 'telegrambot' (v 15.1.7) still works for me.

Note: Like many people on this Forum, I don't use HA or run NR inside a Container.


Code in function node is...

let cId = 'enter your Chat ID';

msg.payload = { chatId: cId, type:"photo", content:msg.payload, caption:"Snapshot from remote server"};
return msg;
1 Like

Thank you for testing @dynamicdave
I finally restored an old Home Assistant backup and things are working again.
I upgraded HA core and several other things and the "sender" node from: "node-red-controb-telegrambot" in my Node-Red in my HA is still working..
root cause
I kept my Node-Red Nodered on 14.2.2.
I assume that it was the upgrade of Node-Red from 14.2.2 to 16.0.2 that broke the sender node of node-red-contrib-telegrambot v 8.4.0 package.
I'm running out of time now, and I will have to address the issue later
I have a crontab that makes a Backup of my HA every Sunday evening and pushes it to my Dropbox. I want this backup to happen before I experiment any further

PS: there seems to be a lot of different Telegram bot packages
I am using node-red-contrib-telegrambot 15.1.7 ( don't ask my why... it was a looong time ago
I briefly tested with @danielnguyen/node-red-contrib-telegrambot-home 0.5.3 ( node-red-contrib-telegrambot-home (node) - Node-RED ) It has exactly the same issue
I have not tested node-red-node-telegrambot 0.1.4 (node-red-node-telegrambot (node) - Node-RED) yet..
This one will be the next one on my list

Just note this version means nothing to us.
The current version of Node RED is 3.1.3 - HA seems to handle their own versioning with Node RED.

As said by @dynamicdave most here do not use HA or container platforms.
So if this error is being caused by some layer in your setup, you will need to seek guidance from said community.

With that said ETELEGRAM: 400 Bad Request doesn't appear that it would be caused by the layers involved, maybe telegram has updated their API, and the node you are using has not been patched :man_shrugging:

NR Version:
interesting... so, the version number may be the version of the HA integration middleware for NR.

I restarted NR and found the real NR version in the log

Welcome to Node-RED
6 Jan 17:26:11 - [info] Node-RED version: v3.0.2
6 Jan 17:26:11 - [info] Node.js  version: v18.16.0
6 Jan 17:26:11 - [info] Linux 6.1.21-v8+ arm LE
6 Jan 17:26:14 - [info] Loading palette nodes

This Community
Good feedback about this community, thank you.
If I need more help I will go to the HA forums

One last thing about the error:

Unhandled rejection Error: ETELEGRAM: 400 Bad Request: invalid file HTTP URL specified: URL host is empty

In my setup of NR v3.0.2, this node accepts a filepath, but after the upgrade it seems to expect an HTTP URL... or at least the error message seems to suggest that
Things may have changed either in NR or in the HA integration
More things to discover later..

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.