lukics
(Slaviša Lukić)
January 7, 2021, 12:13pm
1
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?
mpampinos
(charalampos varytimos)
January 7, 2021, 12:18pm
2
pushover binding
val actions = getActions("pushover", "pushover:pushover-account:ea7ed54800")
var receipt = actions.sendAttachmentMessage("message", "title","/etc/openhab/html/kitchen.jpg","image/jpeg")
lukics
(Slaviša Lukić)
January 7, 2021, 12:34pm
3
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 .
lukics
(Slaviša Lukić)
January 7, 2021, 1:02pm
5
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