We have moved at community.getvera.com

Author Topic: Simple way to control alerts by calendar  (Read 1051 times)

Offline clippermiami

  • Hero Member
  • *****
  • Posts: 1394
  • Karma: +27/-6
Simple way to control alerts by calendar
« on: May 18, 2014, 09:18:48 am »
i'm trying ot find a simple way to change the recipient list for notification depending on a calendar event. For example, i have some set up to test the GCAL Sensor for Google Calendar driven events. I set the Google Calendar to look for "VERA_Travel" when I'm traveling. I have some PLEG code to check this and if it indicates traveling it send notifications to "Notify_Travel" which omits my mobile phone from the notification (on the theory that I can't do anything about it anyway :) ); conversely if I'm not traveling it sends notifications to "Notify_Normal" which includes my mobile phone.

But doing this for every notification in every place in Vera is a pain in the backside and not easy to change. It would be nice it if were possible to make this determination in  VeraAlerts; i.e. provide a test of GCAL_Sensor and if its hits change the target notification settings.
Two Vera Plus UI7 Linked via HTTP, 90+ Devices. PlugIns: PLEG, DSC, Blue Iris, MySensors,  AutoVera, ImperiHome, VeraAlerts, EventWatcher

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: Simple way to control alerts by calendar
« Reply #1 on: May 18, 2014, 09:49:41 am »
Clever use of Vera Alerts UserProfileAssociation  variable from LUA may solve your request ...

Or you could just quiet your Vera Alerts messages when you are away ...

It's one think to not be able to do something about your home burning down when you are away ... and another thing to not even know it happened.

Offline clippermiami

  • Hero Member
  • *****
  • Posts: 1394
  • Karma: +27/-6
Re: Simple way to control alerts by calendar
« Reply #2 on: May 18, 2014, 09:58:56 am »
Clever use of Vera Alerts UserProfileAssociation  variable from LUA may solve your request ...

Or you could just quiet your Vera Alerts messages when you are away ...

It's one think to not be able to do something about your home burning down when you are away ... and another thing to not even know it happened.

"Clever use of Vera Alerts UserProfileAssociation  variable from LUA may solve your request ..."
This might do it, how do I find it? (Not a Lua expert)

"It's one think to not be able to do something about your home burning down when you are away ... and another thing to not even know it happened." VERY TRUE ... :) But there are lots of notifications that are really not Earth shattering :)
Two Vera Plus UI7 Linked via HTTP, 90+ Devices. PlugIns: PLEG, DSC, Blue Iris, MySensors,  AutoVera, ImperiHome, VeraAlerts, EventWatcher

Offline PJJP

  • Full Member
  • ***
  • Posts: 149
  • Karma: +2/-0
Re: Simple way to control alerts by calendar
« Reply #3 on: May 20, 2014, 05:09:23 pm »
My plan is to implement a solution with a multi-switch. Each button will be labeled with the name of who he is watching the house and gets notified while I am away. I have a lot of alerts, including high-priority alerts regarding my alarm and flood sensors, as well as low priority alerts like notifications when doors or gates are left open for the alarm panel is armed or disarmed. When I'm away, I don't want the low priority alerts being pushed to my phone.

I'm thinking of writing a function for LUA start up that will determine who gets what alerts based on what multi-switch buttons are on. Then, I will start the tedious task of going through all of my scenes and calling VeraAlerts using this newly created function. If I get it working, I'll post the code and results here.

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: Simple way to control alerts by calendar
« Reply #4 on: May 20, 2014, 06:59:31 pm »
You could use a function

     ActiveProfiles(SomeCategory)

The function would return a space or comma separated list of profiles for the specified category.
Then call Vera Alerts with:
      luup.call_action("urn:richardgreen:serviceId:VeraAlert1", "SendAlert", {Message="Your Message", Recipients = ActiveProfiles("Security")}, VeraAlertsDevice)