Pushover with attachment to specific device only

Hi all,

in OH2 I used the following pushover command to send a camera image via pushover to a specific device:

sendPushoverMessage(pushoverBuilder(CameraName).withAttachment("/tmp/image_receiver.jpg").withContentType("image/jpeg").withDevice("devicename"))

with OH3 I use to following command:

var receipt = actions.sendAttachmentMessage(CameraName, "openHAB", "/tmp/image_receiver.jpg", "image/png")

The works but the message is send to all devices.

Refering to the the pushover binding documentation, I tried the following command to send the message to the specific device only:

var receipt = actions.sendMessage(CameraName, "openHAB", null, null, null, "/tmp/image_receiver.jpg", "image/png", null, "devicename")

Unfortunately, now, the attachement is missing.
(Whereas the documentation indeed says: “This method is used to send a plain text message providing all available parameters.”)

Is there a way to the get the OH2 version working in OH3? Or am I missing anything?

Thanks in advance!

No because sendPushoverMessage wasn’t an OH 2 version add-on, it was an OH 1 version add-on and 1.x version add-ons are no longer supported.

Ok, thanks!

But then the question is, can I use the OH3 binding to send a pushover message with an attachment to a specific device only? And how?

I don’t use Pushover but it the docs say how to do it it probably can’t be done. If the docs do saw how to do it and it doesn’t work file an issue.

This works for me, like stated in the docs:

actions.sendMessage("Test attachment", "openHAB", "pushover", null, null, "/opt/openhab/conf/html/test/test.gif", "image/gif", null,"YourDevice")

1 Like

Thanks @sihui!

Now it works for me. The feature to pass all parameters was just introduced in 3.1.0, and I was still on 3.0.1. Therefore, all additional parameters were just ignored…

2 Likes