Does anyone have sample code for how to send an alert from inside luup? I have a luup scripted scene and I need to add an alert to the middle of it, so I can’t use the standard command window.
Have you looked at Ap15e’s SND plugin?
Once setup, you would add this part to your code.
luup.call_action( "urn:upnp-ap15e-com:serviceId:SND1", "SendMail", { subject = 'Subject message', body = 'Body message' }, SND device # )
JOD.
I am specifically looking for the code to send a VeraAlert message. SND uses email which is slower…and gets lost in my Inbox.
I am thinking it would be something like this (but this isn’t working for me):
luup.call_action(“urn:micasaverde-com:serviceId:HaDevice1”, “SendAlert”, { lul_settings.alertMessage = “someone unlocked the door” , lul_settings.recipient = “” } ,0)
ChrisAZ,
You can send an alert using this code :
local http = require(“socket.http”)
http.request(“http://vera-alert.appspot.com/stat?msg=YourMessage&recipient=YourVeralertCode”)
LG
I made some improvements on the Android side which have been incorporated.
I have some ideas/work in progress to improve the Vera Server side as well.
These include:
[ul][li]Ability to specify multiple target pins (i.e. Android Devices)[/li]
[li]Ability to specify a default target(s) on the Vera Device. Then Notifiers only need to specify the message and the Vera Device[/li]
[li]I will keep the luup programmig in mind. I hate to see Server address in lots of places.[/li]
[li]Option in Device Notifications to use VerAlert[/li][/ul]
I was going to wait until the UI5 stuff is stable on the Vera2 platform before proceeding. I mentioned to Richard he should change the algorythm for pin … so that on the same phone if you re-install you get the same pin. You also do not like to have that ID spread out in lots of places on your Vera server.
LG - thanks for the code. That will fill my needs for now.
Richard - glad to hear you’re working on improvements. I’m in a unique situtation where I get a new phone every few months, so having to reprogram my new PIN into all the different scripts is a pain. Not sure if there would be a simple way to keep the same PIN across different phones, but just a centralized PIN in the Vera Device would save me a lot of grunt work. Multiple PINs would also be great.
Glad to see that development has stoppped completely. VeraAlert is a great tool.