We have moved at community.getvera.com

Author Topic: LUUP Vera Alerts from Scene  (Read 1769 times)

Offline mdgibbons

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
LUUP Vera Alerts from Scene
« on: October 18, 2016, 05:22:10 pm »
I read in the VeraAlerts documentation that you can send an alert using LUUP code. 

I've got a Scene which, when triggered, I want to send an alert.  Here is what I have in the LUUP code for that Scene

Code: [Select]
luup.call_action("urn:richardgreen:device:VeraAlert:1", "SendAlert", {Message = "Testing Alert!", Recipients = "mdgibbons1"}, 23)
return true

However, when I "Run" the scene, it doesn't seem to send the Alert (although the rest of the scene's actions work fine).  '23' is the Device id for my VeraAlert Device.  I wasn't 100% sure what to put in the 'urn:...'.  My Device Type for the VeraAlerts is "urn:richardgreen:device:VeraAlert:1" but I've tried other variations (ex. without the ':1' at the end).  In the recipients, I put one of my 'Users' from VeraAlerts but I've also tried it with one of the 'Profiles'.  Not sure if this matters.

All of my other alerts (from PLEG, Device Notifications, etc...) are working just fine.

Any suggestions on what I'm doing wrong?

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: LUUP Vera Alerts from Scene
« Reply #1 on: October 18, 2016, 05:28:32 pm »
You  do not need to call it from LUA

You can call it it from the ADVANCED tab of the scene editor.

You do not have a valid serviceId  ... you used a deviceId.

Offline mdgibbons

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: LUUP Vera Alerts from Scene
« Reply #2 on: October 18, 2016, 05:49:09 pm »
Thanks for the quick reply!  I found the Serviceid (oops!).  The reason I want to call it from the LUA editor is that (eventually) I want to pass along the status of a device on my system (my alarm).   I know there is probably some other way (Template Library?) to include another device's status from the ADVANCED tab but I wasn't 100% sure how to do it.

Anyway, if somebody stumbles here for future reference, my actual (now working) code looks something like this

Code: [Select]
alarmstatus = luup.variable_get("urn:micasaverde-com:serviceId:AlarmPartition2","DetailedArmMode",10)

luup.call_action("urn:richardgreen:serviceId:VeraAlert1", "SendAlert", {Message = "Alarm Status: "..alarmstatus, Recipients = "Pushover1"}, 23)

return true

Thanks again!

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: LUUP Vera Alerts from Scene
« Reply #3 on: October 22, 2016, 04:50:36 pm »
In PLEG  you can have INPUT propertys bound to the variables you want in your message:

i.e.
HouseTemp  - Current House Temp

Then when some condition triggers an Action ... you can have the action call the SendAlertt action for the Vera Alerts device
Then message would be something like:

             The House temperature is {(HouseTemp)}