Pushover Binding in OH3: Help needed

Hello community!

Pushover Binding 3.0 is set up correctly with User-Key and API-Token.

The intention is very simple: I want to receive a push message when the front door is opened. Something like this:

When Haustuer.state changed to open
then sendMessage (“Haustür offen”, “openHAB”)

Unfortunately, I have no idea how to send a push message within a rule. I tried a lot but without any success.

Can anyone give me a hint on the correct syntax?

Thx in advance

There is an example at this link - any use?

I tried this example and copied the code to a script. It didn’t work for me.

Here’s the rule I ended up with when trying to get pushover in OH3 working:

  - id: "1"
      itemName: Sunset_Time_30
      state: ON
      previousState: OFF
    type: core.ItemStateChangeTrigger
conditions: []
  - inputs: {}
    id: "2"
      type: application/vnd.openhab.dsl.rule
      script: >
        val actions = getActions("pushover", "pushover:pushover-account:oh3")
        var receipt = actions.sendMessage("Hello!", "OH3")
    type: script.ScriptAction


How to configuration notifications sound?
I can not find it :frowning:

I don’t think there is an action take notification sound as a parameter. I see it is configurable on the Thing, though. You could create different things with different sounds If you have a small number of use cases where sound needs to be different. I haven’t tried that - I just use the default - but it reads like that should work.

sendPushoverMessage(pushoverBuilder("test message").withApiKey("KEY").withUser("USER").withDevice("DEVICE").withTitle("TITLE").withUrl("URL").withUrlTitle("URL_TITLE").withPriority(0).withSound("SOUND").withAttachment("/path/to/file.png").withContentType("image/png"))

this is how it worked in OH2.5
Many events were assigned different notifications.
I hope it can be solved under OH3.x as well

You must define multiple occurence of the Pushover Thing and there you can define different sounds

1 Like

Thanks, working :slight_smile:

I was about to post my things definition … I will anyway for others :wink:

Thing pushover:pushover-account:defaut 			[ apikey="my_api_key", user="my_user_key" ]
Thing pushover:pushover-account:sonnette 		[ apikey="my_api_key", user="my_user_key", sound="magic" ]
Thing pushover:pushover-account:soundTugBoat 	[ apikey="my_api_key", user="my_user_key", sound="tugboat" ]
Thing pushover:pushover-account:soundSiren 		[ apikey="my_api_key", user="my_user_key", sound="siren" ]
Thing pushover:pushover-account:gamelan 		[ apikey="my_api_key", user="my_user_key", sound="gamelan" ]

i did 14 things for the 14 notification sound. After each reboot, 3-5 things are offline. “too many request” error … and one must be disabled and then enabled to work … this is not a very good solution …
You should slow down the initialization of things somehow …

I only use the one I posted so no problem here. You might want to report it to the developpers.
Personnaly, I hate this new way of doing pushover notifications by the way…


1 Like

I meant to report the “too many request” issue :wink:

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

1 Like


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.

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.


Hi Torpex77,

I created a new post on the topic and a few members chipped in and we solved it :smiley:
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.