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?
openHAB 3 - Syntax for sending
- admin
- Site Admin
- Posts: 943
- Joined: 1. Dec 2014, 12:41
- Location: Germany
Re: openHAB 3 - Syntax for sending
Hello,
go the things and open the pushsafer binding you created.
Now copy the identifier that you need in the script.
Example Script:
Hope that helps
Kevin
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")
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
Pushsafer EN: You like Service and Support! Then we look forward to your review!
Pushsafer.com Website - iOS - Android - Windows 10
- admin
- Site Admin
- Posts: 943
- Joined: 1. Dec 2014, 12:41
- Location: Germany
Re: openHAB 3 - Syntax for sending
great ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
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
Pushsafer EN: You like Service and Support! Then we look forward to your review!
Pushsafer.com Website - iOS - Android - Windows 10
-
- Posts: 3
- Joined: 13. Aug 2022, 22:46
Re: openHAB 3 - Syntax for sending
Hi I have installed the OH3 binding and have a pushsafer Account Thing online.
I have the correct pushsafer:pushsafer-account:******** identifier, but I am having problems with setting a rule in OH3. I tried using the synatx that you replied to @stiannek but this didn't work for me.
My rule (extract) looks like this:
var myaction = actions.thingActions("pushsafer","pushsafer:pushsafer-account:********")
myaction.sendPushsaferMessage("Test", "BEVHOME")
and the rule file saves correctly (no synatx errors reported by OH3).
However when I execute the rule, OH3 reports "[ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sms-1' failed: An error occurred during the script execution: index=0, size=0 in sms" (the rule file is sms.rules)."
I tried using a var (variable) and a val (value) statement but neither works. I also changed the name of the variable/value to "myaction" as I read somewhere that "actions" is reserved by OH. Can you tell me what I am doing wrong?
Many thanks in advance!
vbevan
I have the correct pushsafer:pushsafer-account:******** identifier, but I am having problems with setting a rule in OH3. I tried using the synatx that you replied to @stiannek but this didn't work for me.
My rule (extract) looks like this:
var myaction = actions.thingActions("pushsafer","pushsafer:pushsafer-account:********")
myaction.sendPushsaferMessage("Test", "BEVHOME")
and the rule file saves correctly (no synatx errors reported by OH3).
However when I execute the rule, OH3 reports "[ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sms-1' failed: An error occurred during the script execution: index=0, size=0 in sms" (the rule file is sms.rules)."
I tried using a var (variable) and a val (value) statement but neither works. I also changed the name of the variable/value to "myaction" as I read somewhere that "actions" is reserved by OH. Can you tell me what I am doing wrong?
Many thanks in advance!
vbevan
- admin
- Site Admin
- Posts: 943
- Joined: 1. Dec 2014, 12:41
- Location: Germany
Re: openHAB 3 - Syntax for sending
Hi,
As the error log already says, the problem is not with Pushafer but with the SMS plugin, uninstall it and try again.
Kevin
As the error log already says, the problem is not with Pushafer but with the SMS plugin, uninstall it and try again.
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
Pushsafer EN: You like Service and Support! Then we look forward to your review!
Pushsafer.com Website - iOS - Android - Windows 10
-
- Posts: 3
- Joined: 13. Aug 2022, 22:46
Re: openHAB 3 - Syntax for sending
Hi Kevin, I created a new rules file just for pushsafer alerting, the rule (alert.rules) text complete is:
Code: Select all
rule "Send Alert"
when
Item testalert changed from OFF to ON
then
logInfo("ALERT:", "Alert message sent")
var myaction = actions.thingActions("pushsafer","pushsafer:pushsafer-account:2******1")
myaction.sendpushSaferMessage("Test", "BEVHOME")
end
Code: Select all
2022-08-14 11:33:48.939 [INFO ] [org.openhab.core.model.script.ALERT:] - Alert message sent
2022-08-14 11:33:48.942 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'alert-1' failed: An error occurred during the script execution: index=0, size=0 in alert
Any help appreciated
![Wink ;)](./images/smilies/icon_e_wink.gif)
Cheers
Vincent
- admin
- Site Admin
- Posts: 943
- Joined: 1. Dec 2014, 12:41
- Location: Germany
Re: openHAB 3 - Syntax for sending
Hello,
i think it is not a pushsafer plugin issue.
Please write a thread to the openhab3 forum and reffer to this post.
They will help better than i can
Kevin
i think it is not a pushsafer plugin issue.
Please write a thread to the openhab3 forum and reffer to this post.
They will help better than i can
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
Pushsafer EN: You like Service and Support! Then we look forward to your review!
Pushsafer.com Website - iOS - Android - Windows 10
-
- Posts: 3
- Joined: 13. Aug 2022, 22:46
Who is online
Users browsing this forum: No registered users and 26 guests