Pushover Node with base64 image

Hi everyone,

I'm trying to send an image via the Pushover node in Node-RED as an embedded image attachment.

Here's what I’ve done so far:

  • I used the HTTP request node to fetch an image over HTTPS.
  • I converted the image to base64.
  • In a Function node, I added the base64 image to msg.attachment using this code:
msg.attachment = Buffer.from(msg.payload, 'base64');
return msg;

However, when I pass this to the Pushover node, the image doesn't show up in the message.

Has anyone successfully sent a base64-encoded image with the Pushover node? Do I need to include any additional metadata (like filename or content-type), or is just passing the Buffer enough?

Any advice or working example would be greatly appreciated!

Thanks in advance!

Not sure what to want to do, attach an image or embed an image.
To see the image in the message I'm using msg.image to the Pushover node.

Thanks for your reply!

What I’m trying to do is embed the image directly into the Pushover message so that it shows up inline in the notification — not just as an attachment.

From what I found, setting msg.image is indeed the way to do that. However, in my case, it only works when the image is provided as a buffer, not as an HTTPS URL. When I try to set msg.image to an HTTPS link (e.g. from my camera), it doesn't display in the message — at least not for me.

But I’m not sure if this is the right approach — or if something else is required for the Pushover node to embed the image properly.

You can't set it as a link - how could your end device (eg phone) browse to your camera to access that link ? (I hope it couldn't anyway). You need to get the image locally (eg using http request node - then send the buffer to pushover.

Yes, this is the way i am trying to do this right now.

Function2 has the code from my first post.

But with msg.attachment the picture is not shown in the pushover message. And that's why i am asking here ;-).

But don't you receive a buffer from the http request node ? Now you are converting it to base64 and then back to a buffer in the function node (?) - ie. what @dceejay is suggesting, just send the buffer directly from the http req node (set it to output a buffer) as msg.image

I used the change Node to set msg.image = msg.payload after the http request. But i get this error: "TypeError: msg.image.match is not a function".

have you confirmed (with a debug node) what the http-request is returning?

how exactly do you have the change node set ? match is a comparison operation

You should probably be using Move msg.payload To msg.image

When I fetch the image using an HTTP Request node, I receive a buffer (1055996 bytes). I process this for email by converting it to base64 and embedding it into the email, which is then sent using an Email node — and the image displays correctly in the email.

Now, after the HTTP Request node, I’ve added a Move node that transfers the content of msg.payload into either msg.image or msg.attachment, depending on the test. However, in both cases the image is not delivered via Pushover anymore.

  • If I use msg.image, I get the error: TypeError: msg.image.match is not a function, and the Pushover message is not sent.
  • If I use msg.attachment, the Pushover message is sent, but without an image.

What can I do to make the image work with Pushover?

Is that coming from the Change node?

No, from the pushover node.

Which pushover node are you using? Library - Node-RED shows several.

This one:
image

From node-red-contrib-pushover (node) - Node-RED

msg.image: The URL of the image in notification. Local file path or http(s) url

It says it can be a file path or a url, not a buffer.

Thanks! Now it works. I choosed node-red-node-pushover and this worked with msg.attachment.

1 Like