Pushover service in OH3 broken?

Hi all,
Is anyone able to get Pushover working again in OH3? Worked perfectly in OH2.
Account all set up and Pushover Thing (from ver 3 Binding) shows as online.
Is there some problem with the Binding?
Has the (clunky) syntax for sending a message ‘sendPushoverMessage(pushoverBuilder(“Freezer defrost alert, check door”).withApiKey(“xxxxxxxxxxx”).withUser(“xxxxxxxxxx”))’ changed??
I’ve tried creating a simple script in OH3 to just test if anything gets sent at all but between not really knowing the java syntax for doing this and the uncertainty over the correct Pushover syntax, I had no success.
Lastly, how does one incorporate Pushover into the new Rule engine since only ‘OpenHab’ cloud notifications are offered and not Pushover, despite Pushover Thing all set up.
Hope some astute member out there has cracked this :exploding_head:
Denis

I have a few pushOver messages working. I think that clunky whatever that is has changed. I’m using the basic code from the documentation and it’s working fine.

https://www.openhab.org/addons/bindings/pushover/

If you have the binding configured(note the name of it) just do this :

val actions = getActions("pushover", "pushover:pushover-account:<YOURNAMEHERE>")
// send HTML message
actions.sendHtmlMessage("Hello <font color='green'>World</font>!", "openHAB")

Hi bhomeyer,
Thanks for your reply. Unfortunately I still can’t get the bloody script to run… :exploding_head: :exploding_head:
I’m getting this error in the OpenHAB log:
"2021-01-12 23:11:32.713 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘79811980da’ failed: :1:4 Expected ; but found actions
val actions = getActions(“pushover”, “pushover:pushover-account:mypushoverthingaccountnumber”)
^ in at line number 1 at column number 4 "
The rule is simply looking for a light to turn on. It does work to play a sound but the java script part won’t run! Even tried running script on its own within the edit window.

Here was my script:
val actions = getActions(“pushover”, “pushover:pushover-account:”)
// send plain message
actions.sendMessage(“Hello from Pushover service”, “openHAB”)

Is there a semicolon missing cos the error was expecting it??
Maybe I’ve substituted the wrong stuff for the ‘YOURNAMEHERE’ part? My Pushover Thing has an alpha-numeric unique ID there.
Denis

That part should be whatever the ID is of the thing for the binding.

I’m demented! I’ve tried typing LITERALLY “pushover:pushover-account:thingIDhere” and literally “pushover:thingIDhere” leaving out the phrase pushover-account… still getting that same script handler error. :confused:

What exact part are you circling in your pic?
Sorry to be a nuisance. Thanks

When I added a pushover thing(the main binding), it’ll look like this at the top :

Where I circled in blue is the ID. So if yours had that 2c8…number in there, it would look like this for the rule :
val actions = getActions(“pushover”, “pushover:pushover-account:2c85d0c268”)
var receipt = actions.sendPriorityMessage(“Emergency!!!”, “openHAB”, 2)

This is of course if you’re using Rule DSL (v1) for your rule. I’ve started using Blocky since my rules for this are pretty simple.

Still no joy. I deleted the Pushover thing, recreated it, entered the text EXACTLY as you had, using my particular thingID instead of your 2c85… number of course, and still the same bloody error.
I’m using the new Rules DSL and telling it to run a script as the action and typing that text into the javascript edit window that opens. Then saving it. Then trying to run it from within that window as well as triggering the rule. Same %^# error!!
I don’t think you can do anymore for me … :grimacing:

i cant get it to work with an attachment. i can get it to send basic messages but nothing else.

@denisdmenace i feel your pain. I’ll see if I can help you better in a few minutes when i finish my ice cream

@denisdmenace for the rule do

val actions = getActions("pushover", "pushover:pushover-account:PUTYOURLETTERSINHERE")
actions.sendMessage("test","openhab")

:grin: :slightly_smiling_face: :+1: :icecream: :icecream:

Thanks very much Scott for that. I had been typing the script text into the application/ java script code window instead of the rule/dsl/code window.
The engine offers the two scripting options and I had no idea of the difference between them :upside_down_face: … I just assumed everything was ‘in java script’ … I don’t really understand this language/coding/syntax stuff.
Think I’ll celebrate with some ice cream now …even if it is 1.30 am!!
Cheers!
btw. what does 'var receipt = ’ do as opposed to just having ‘.actions’ … this all does my head in.

@denisdmenace
I don’t blame you. im still using vscode for my rules. i dont know when i’ll wade into the UI rules as I’m not much of a coder and i dont know what i’m doing there
enjoy!

Amazingly I somehow managed to cobble all my rules together in OH2 using VS code…it was tortuous. That’s why I naively thought I was still in java-script land when I started exploring the new UI rules engine in OH3. Glad to hear there’s others like me out there… :grinning:
thank you again

1 Like

So everyone is clear, the above example should be put in Rule DSL :
image

Excellent! Thanks bhomeyer

1 Like

Thanks guys. Have it working. :+1: :+1: