We have moved at community.getvera.com

Author Topic: Changing Alert Settings based on Condtions  (Read 758 times)

Offline clippermiami

  • Hero Member
  • *****
  • Posts: 1394
  • Karma: +27/-6
Changing Alert Settings based on Condtions
« on: November 03, 2015, 10:37:57 am »
I need to change the User Profile Associations based on whether I am at home or traveling. At home I receive a large number of SMS status alerts from Vera which is not a problem since I have unlimited SMS on my phones. But traveling, especially internationally, SMS can be very expensive so I want to significantly reduce the number of alerts I receive.

I have added TWO User Variables to Vera Alerts called AtHomeAssociations and TravelAssociations. These store the "UserProfileAssociation" values that cross reference what Profiles are used for what UserNames, thus I can change which devices receive which notifications.

The selection of which of these values is transferred to the "UserProfileAssociation" is to be made in a PLEG depending on the status of a "Device Property" from the GCAL Plug In.

Two questions:

1. I'm not clear on how to write the chosen value into the VeraAlerts field "UserProfileAssociation". I have two PLEG Input/Device Property fields called "AlertsNormal" and "AlertsTravel" set from the corresponding User Variables in VeraAlerts.

In the PLEG ACTION settings I can select the VeraAlerts "SetProperty" option which gives me two fields:
"PropertyName"
"PropertyValue"
I know to set PropertyName to "UserProfileAssociation" but how do I specify the CONTENT of the PLEG Device Property field "AlertsTravel" or "AlertsNormal" to be written into "PropertyValue"

2. With respect to VeraAlerts can I make this change on the fly or must I trigger a Vera Reload somehow, which raises its own complications so that it only happens once when the change is made.
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: Changing Alert Settings based on Condtions
« Reply #1 on: November 04, 2015, 12:58:42 am »
You can't change the UserProfile association from an action ... (actually you can ... but if you screw it up you will hose your configuration ... it's not indented to be changed except by the provided UI)

You can call Vera Alert SendAlert in an Action from PLEG.
You can make the Recipient conditional on some condition:

     i.e.  in the action (Advanced Mode) set the recipient to something like:
       {(AtHome ? "ClipperHome" : "ClipperAway")}

Offline clippermiami

  • Hero Member
  • *****
  • Posts: 1394
  • Karma: +27/-6
Re: Changing Alert Settings based on Condtions
« Reply #2 on: November 04, 2015, 07:58:25 am »
You can't change the UserProfile association from an action ... (actually you can ... but if you screw it up you will hose your configuration ... it's not indented to be changed except by the provided UI)

You can call Vera Alert SendAlert in an Action from PLEG.
You can make the Recipient conditional on some condition:

     i.e.  in the action (Advanced Mode) set the recipient to something like:
       {(AtHome ? "ClipperHome" : "ClipperAway")}

Thanks Richard. That complicates matters :) Back to the drawing board.
Two Vera Plus UI7 Linked via HTTP, 90+ Devices. PlugIns: PLEG, DSC, Blue Iris, MySensors,  AutoVera, ImperiHome, VeraAlerts, EventWatcher