Pushover image support

compared to the latest stable version of the binding we do not have breaking changes, since all older methods are still supported, they are deprecated though

Thx for clarifying.

Either I’m to stupid or it does not work any more :frowning:
I got the supposedly latest snapshot jar from here:

http://areiter.net/org.openhab.action.pushover-1.12.0-SNAPSHOT.jar

I replaced my former snapshot.jar (1.12.0.201803261500) with this version (1.12.0.201804032255, dated 04.04.2018). It resides in my addons folder with an updated ZWAVE binding (which works fine, so this addon folder is used) and the pushover action is NOT installed via Paper UI. Naturally, I restarted openHAB :wink:

I still get this warning in my log file:

Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.

I can use the standard pushover action, but get an ‘?’ instead of an umlaut character on my phone.

If I try to use the new sendPushoverMessage instead I’ll get this error in my log:

The name 'sendPushoverMessage' cannot be resolved to an item or type; line 107, column 5, length 95

What may be wrong?

Solved! It looks like the older snapshot jar still lived somewhere in a cache or tmp folder of openHAB and was preferred by openHAB, maybe because the filename of the .jar-file did not change between versions?
After clearing those folders and restarting openHAB all problems are solved :slight_smile:

Hi Hartmut,

Assuming you are using the snapshot version of OH2 have a look at the snapshot documentation:

Is this version added to the snapshot release(s) or do I have to manually download it?

Yes.

1 Like

Is it possible to use “URL” instead of “local file”?

This is my .sitemap

Text label="Garden" icon="garden" {
    Image url="http://192.168.1.123/channels/1/picture" refresh=3000
}

And I need to push that “Image” from “real-time”

Regards

Sim

@Sim
yes, not directly though
this is, how i do it

val camURL = "http://user:pw@camera1/Streaming/channels/1/picture"
val file = now.toString.replaceAll("[:\\/ \\+]+", "_") +".jpg"
val outputFile = "/tmp/camera/" + file
var String curl_result = executeCommandLine("curl -m 10 -o " + outputFile + " " + camURL, 5000)
sendPushoverMessage(pushoverBuilder(msg).withAttachment(outputFile))
// delete the temp file after 60 seconds
createTimer(now.plusSeconds(60)) [|
    executeCommandLine("rm " + outputFile)
]

“curl” must be installed

2 Likes

are there plans to support OH image items?

Hi scott,

let’s assume you have an Image item called Webcam_Image. You can adjust the above script in the first line:

val camURL = Webcam_Image.state.toFullString
val file = now.toString.replaceAll("[:\\/ \\+]+", "_") +".jpg"
...

// Edit: I filed an issue for it:

1 Like

even better would be
sendPushoverMessage(“message”,openHabImageItem) :wink:

With Openhab 2.2 I only have the option of getting version 1.11.0 which does not seem to have this support. Can anyone explain where to get a newer version?

Edit: Sorry, just figured that it would be available normally considering the new documentation is up. I understand now that it needs to be manually downloaded / installed for now.

Edit2: Doesn’t seem to be working?
19:54:53.426 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule ‘driveway_camera_alert_rule’: The name ‘sendPushoverImage’ cannot be resolved to an item or type; line 67, column 3, length 87

253 │ Active │ 80 │ 1.12.0.201804032255 │ openHAB Pushover Action

Edit3: What kintrupf said about the cache seems correct? I had to restart openhab to get the binding to load properly. Everything is working now. I found a link to the latest module I think here: https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/action/org.openhab.action.pushover/1.12.0-SNAPSHOT/
It is what the latest documentation describes: https://docs.openhab.org/addons/actions/pushover/readme.html

Nice work guys! Pretty awesome!

First of all, thanks for putting all your effort in this great binding!

I’m trying to get the new Pushover commands working in Jython. The following works in xTend:

sendPushoverMessage(pushoverBuilder(msg))

But this doesn’t work in Jython:

Pushover.sendPushoverMessage(pushoverBuilder(msg))

(The command pushover(msg) works, via Pushover.pushover(msg)

Does anyone has an idea what the Jython syntax should be?

Hi @ricadelic,

I am not familiar with Jython and do not know if I can help you very much. But if the Jython syntax requires to prepend the class name in front of a method name you maybe can try to use it like this:

Pushover.sendPushoverMessage(Pushover.pushoverBuilder(msg))
1 Like

That works! Thanks a million :slight_smile:

Sounds good. You’re welcome.

Gents,

I’ve been trying to get myself some nice attachments in my pushover messages but whatever i try… adding an attachment to my pushover rules gives me:

Could not process file '/static/Haardmeubel1.jpg': File is not a normal file., will send the message without attachment.

Part of my rule :slight_smile:

sendPushoverMessage(pushoverBuilder("test message").withApiKey("BLABLABLA").withUser("BLABLABLA").withDevice("sm-g960f").withPriority(0).withSound("echo").withAttachment("/static/Haardmeubel1.jpg"))

What am i doing wrong?

see the source code
you get an IOException for some reason.
does the file ‘/static/Haardmeubel1.jpg’ really exist and is it readable by the user, which is running openhab?

Got it… it actually requires the full file path, not just a relative one like i used…