Pushover Binding in OH3: Help needed

I know, I am pretty sure that problem will be solved then.

1 Like

True!

We are waiting for the developments: D

Hello Torpex77,
Iā€™m struggling with getting Pushover working in OH3 as well. Worked perfectly in OH2 with that whole syntax stuff ā€œsendPushoverMessage(pushoverBuilder(ā€ blah blahā€¦).
Has the syntax totally changed now??
Can you clarify your exact syntax that you got working please for me? Are the words ā€˜scriptā€™ followed by a colon and the chevron ā€˜>ā€™ and the word ā€˜typeā€™ followed by colon at end essential? Many thanks. Bloody syntax fiddling driving me nuts.
Denis

Yes - thatā€™s the complete copy/paste from my rule.

I created the rule from the UI. I might have had to add the actions section by editing the text file - I donā€™t remember exactly. I canā€™t get to my system from work, but I can recreate the steps tonight.

Doug

Hi Torpex77,

I created a new post on the topic and a few members chipped in and we solved it :smiley:
https://community.openhab.org/t/pushover-service-in-oh3-broken/113937/13
The clunky syntax that Pushover used for sending in OH2 seems to have changed and appears more simplified. Check out the new Binding guide here.
[Pushover - Bindings | openHAB]
Most significantly, I had been typing the syntax code into the wrong script code window.
The UI rules and Scripts in OH3 offer TWO different script language systems to put your code into. I had been blithly choosing the ECMAScript javascript code window (cos I had been doing everything in java rule script with VScode in OH2) when I should have used the Rule/DSL script code window. This is because I was creating my rule in the UI this time and I guess the new engine is DSL based? Anyway, coding & scripting is painful and not my thing really.
Hope this might help you out too.
Denis

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?