Pushover Binding in OH3: Help needed

I found this thread as I was attempting to upgrade some rules that send Pushover messages to OH3. After research, it seems that the publicly available functions do not allow as much functionality as the previous versions of the binding. I’ve added a feature request issue in github and just wanted to you all and any other people who find this thread later aware of the request. It seems like a pretty easy update, so hopefully someone who is familiar with the code would be willing to make the changes.

Hi all, I have recently started migrating from OH2 to OH3 and have just hit a wall with the Pushover binding and sending messages with all parameters.

I have binding 3.0.2 working in OH3 sending messages with and without priority but I really want to send messages with sounds and priority specified. After RTFM I am still stuck, the only thing I can think is this is an old binding (3.0.2) without the additions of sending messages with all parameters? (I have reinstalled the pushover binding again with no luck.
The current script I am trying to run below

val actions = getActions("pushover", "pushover:pushover-account:NAS")
actions.sendMessage("TEST", "TEST", "gamelan", null, null, null, null, 1, null)

Any help is appreciated

When I run the logs are as follows, it doesn’t seem to be expecting this number of arguments. Am I suppose to be using something other that the method “sendMessage” to pass all parameters?

   Invalid number of arguments. The method sendMessage(ThingActions, String, String) is not applicable for the arguments (Th
ingActions,String,String,String,null,null,null,null,int,null); line 12, column 368, length 11

3.0.X documentation of pushover binding: Pushover - Bindings | openHAB
The syntax that you use if for 3.1 binding: Pushover - Bindings | openHAB

Hi @Wolfgang_S Thank you for the links, from the OH3 UI running the 3.0.2 binding I get the link on there for the 3.1 binding. I think this is where the confusion is. I have updated OH3 to newest release containing the 3.1 binding and it is now working.

1 Like

Hi @Wolfgang_S,

I’m using OH 3.2m4 with the PushOver binding.

Has anybody got PushOver to work using parameters on sendAttachmentMessage on OH3? If so, can I see your syntax?

				val String PushOverImage   = "/var/lib/openhab/pics/" + FrontDoorCam
				var String PushOverMessage = "OH3 Front Door"
				var String PushOverTitle   = "Front Door - OH3"
				// logInfo("PUSHOVER","PushOverImage is " + PushOverImage)
				// logInfo("PUSHOVER","PushOverMessage is " + PushOverMessage)
				// logInfo("PUSHOVER","PushOverTitle is " + PushOverTitle)
			    createTimer(now().plusSeconds(1),  [ |
					val PushOverActions = getActions("pushover", "pushover:pushover-account:account")
			        PushOverActions.sendAttachmentMessage(PushOverMessage, PushOverTitle, PushOverImage)
			    ])

Best, Jay

Hi @jwiseman ,
according to the documentation for 3.2 binding of the pushover binding it looks like the syntax changed - at least it looks differerent compared to yours:

actions.sendAttachmentMessage("Hello World!", "openHAB", "/path/to/my-local-image.png", "image/png")
actions.sendAttachmentMessage("Hello World!", "openHAB", "https://www.openhab.org/openhab-logo-square.png", null)

The first one uses a mime type as fourth argument while I assume that in case of the second one either the link is embedded or the mime type is handled internallly by the binding itself.

I was really trying to avoid copy/pasting actual values into the sendAttachmentMessage line.

Especially since I have dynamic parameters for the filename of the image.

Best, Jay

Hi @cweitkamp,

Would you happen to know how to use parameters with PushOver 3.2m4 per my example above?

Best, JAY

Your code looks good although I do not understand that the timer part is being used for.
Apart of that just add the mime type for the type of picture that you add.
In case it is a png picture use the same mime time as in the example.
In case it is a different one that one needs to be adapted.

It works for me

actions.sendAttachmentMessage("Image","Openhab","../pics/cam25.jpg","")

Those aren’t variables, those are hardcoded parameters.

Here’s my line with variables below:

PushOverActions.sendAttachmentMessage(PushOverMessage, PushOverTitle, PushOverImage)

Best, Jay

Going to try this now with the “image/jpeg” parameter.

PushOverActions.sendAttachmentMessage(PushOverMessage, PushOverTitle, PushOverImage, “image/jpeg”)

Best, Jay

@Wolfgang_S & @cweitkamp,

This syntax worked! We may want to change the documentation on this, the last MIME parameter says it defaults to that value below but it doesn’t. You have to actually put it in the syntax at least when your using variables.

PushOverActions.sendAttachmentMessage(PushOverMessage, PushOverTitle, PushOverImage, “image/jpeg”)

  • sendAttachmentMessage(String message, @Nullable String title, String attachment, @Nullable String contentType) - This method is used to send a message with an attachment. It takes a (local) path to the attachment (parameter attachment mandatory) and an optional contentType to define the content-type of the attachment (default: image/jpeg).

Best, Jay

Hi,

You can either pass any String or null to the contentType parameter. In later case it defaults to "image/jpeg". But it is not mandatory - you have to pass all for parameters to use this method correctly. I agree on a rewording in the docs. Can you take care?

Please advise how I can do this and I will. I don’t have access to the HTML pages to edit them.

Best, Jay

GitHub message while trying to edit it.

You’re making changes in a project you don’t have write access to.

Best, Jay

This is correct.
You should have a fork of the addons and the docs in your own github account (openhab-addons/bundles/org.openhab.binding.pushover/README.md) where you need to make the changes, then create a pull request.
After review it will be published.

Hey,
Is it possible to delete openHAB logo from notifications ?

Because when I read it on Apple Watch I see only big logo and need to move screen to read message.