Pushover import OH3 does not work

I am currently working out the porting path from 2.5.1 to 3.0.0 in regards to Jython file-based rules.
I am surprised how smooth things work out.

I hit a problem with using PushOver. In 2.5.1 the Pushover was an action that was configured in the service section. The pushover was imported by:

from core.actions import Pushover

and then accessed by:

def push(self, msg):
    Pushover.sendPushoverMessage(Pushover.pushoverBuilder(msg))

In OH3 the PushOver is a binding creating a Thing. The Thing does not have channels.

Any idea of how the pushover can be used?
How does the import statement look like?

pushover binding

       val actions = getActions("pushover", "pushover:pushover-account:ea7ed54800")
       var receipt = actions.sendAttachmentMessage("message", "title","/etc/openhab/html/kitchen.jpg","image/jpeg")
 

What import statement I need to resolve getActions?

NameError: name 'getActions' is not defined in <script> at line number 9

@lukics

The syntax you are using is for actions that are built in to OH only (see 2 sections up in the link below), binding actions are different. Using binding actions is covered in the Helper Libraries documentation.

here the solution:

def push(self, msg):
    actions.get("pushover", "pushover:pushover-account:471147114711").sendMessage(msg, "Openhab")

no import needed, just ad-hock getting the action and using it.
Thanks for pointing me to solution

1 Like