How to send message with Pushover at Ecmas script OpenHab 3

  • openHAB version: 3.0

I need help with pushover from ecmas script. For a dsl script this works:

val actions = getActions(“pushover”, “pushover:pushover-account:888xxdfca2”)
var receipt = actions.sendMessage(“HELLO!”, “PLEASE”)

for an ecmascript, which would be correct ?
Thank You

You can use the get method of the built-in actions object in a similar way to the getActions function you were using.

actions.get(“pushover”, “pushover:pushover-account:888xxdfca2”).sendMessage(“HELLO!”, “PLEASE”);

note: because actions is a built-in object you should avoid creating your own variable of the same name in your script.

2 Likes

working, thank you!