openHAB 3 - Syntax for sending

Pushsafer make it easy and safe to get push-notifications in real time on your Android or Windows mobile device, iPhone, iPad and Desktop!

Mit Pushsafer kann man in Echtzeit, einfach und sicher, Push-Benachrichtigungen auf sein iPhone, iPad, Android oder Windows Gerät sowie auf den Desktop senden lassen!

======================
Google Play
App Store
Windows 10 Store
Homepage
stianeik
Posts: 3
Joined: 25. May 2021, 17:34

openHAB 3 - Syntax for sending

Postby stianeik » 25. May 2021, 17:39

Hi,

I have created the pushsafer thing in the UI and are trying to send a message in a rule. According to the example the following shall be used

sendPushsaferMessage(String message, @Nullable String title) // ref https://www.pushsafer.com/en/openhab3

I have the used the following
sendPushsaferMessage("Test message", "MyTitle")
and are only recieving the following error message

[ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'test-1' failed: An error occurred during the script execution: index=2, size=2 in test

What am I doing wrong?

User avatar
admin
Site Admin
Posts: 711
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: openHAB 3 - Syntax for sending

Postby admin » 25. May 2021, 19:22

Hello,

go the things and open the pushsafer binding you created.
Now copy the identifier that you need in the script.

Example Script:

Code: Select all

val actions = getActions("pushsafer", "pushsafer:pushsafer-account:**********")  
//var receipt = actions.sendPushsaferAttachmentMessage("HelloWorld", "openHAB3", "D:/path/image.jpg","jpeg","")
//var receipt = actions.sendPushsaferAttachmentMessage("HelloWorld", "openHAB3", "http://192.168.2.222:8088/tmpfs/snap.jpg","jpeg","admin:password")
//var receipt = actions.sendPushsaferAttachmentMessage("HelloWorld", "openHAB3", "https://www.pushsafer.com/de/assets/img/screenshot_en_01.jpg","jpeg","")
//var receipt = actions.sendPushsaferMessage("HelloWorld", "openHAB3")
var receipt = actions.sendPushsaferURLMessage("HelloWorld", "openHAB3", "https://www.openhab.org/addons/", "Open openHab AddOns")
Hope that helps

Kevin
Pushsafer DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
Pushsafer EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10

stianeik
Posts: 3
Joined: 25. May 2021, 17:34

Re: openHAB 3 - Syntax for sending

Postby stianeik » 26. May 2021, 07:37

Thanks, it is now working!

User avatar
admin
Site Admin
Posts: 711
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: openHAB 3 - Syntax for sending

Postby admin » 26. May 2021, 10:31

great :D
Pushsafer DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
Pushsafer EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10


Who is online

Users browsing this forum: No registered users and 1 guest