Best way to change alert destination

So right now I have 2 users, one maps to a local(LAN) VeraAlert and the other through GCM. I have a VirtualSwitch that is updated by tasker and AutHomationHD that says if my phone is local or remote. I would like to switch the destination of alerts based on this. I have figured out how I can do this in luup, but I would be duplicating scenes. I know there are usually multiple ways to skin a cat.

So I guess my question which is the best way do this so I can leverage it across multiple notifications and scenes?

Ok so I am attempting this with PLEG.

So far I have.
Input - VirutalSwitch Off(means I am away)
Conditions - C1 Now
Actions → Advanced → VeraAlerts → SetProperty
PropertyName: UserProfileAssociation
PropertyValue: [‘DefaultRecipients=chris_phone_remote’,‘username=chris_phone_remote’,‘usernamelocal=chris_phone_local’]

Then I have another PLEG with:
Input - VirutalSwitch On(means I am home)
Conditions - C1 Now
Actions → Advanced → VeraAlerts → SetProperty
PropertyName: UserProfileAssociation
PropertyValue: [‘DefaultRecipients=chris_phone_remote’,‘username=chris_phone_local’,‘usernamelocal=chris_phone_local’]

However, it doesn’t seem to be flipping. If this works, I can just make my notifications go to “username” and it will go either local or GCM.

So no idea why I didn’t try to just a regular scene at first. I just created 2 scenes based off the VirtualSwitch and changing the VeraAlerts property instead. It works :slight_smile:

This Set Property is used to change variables for LUA Plugins. This is really accessing the INTERNAL API of most plugins and devices.

That does not mean the plugin will respond to the changes to the variables.
Normally to make a plugin respond you must call the appropriate ACTION or WebAction for the plugin.

So yes you are changing Vera Alerts Variables … ones that are NOT documented by the way!
My plugin will only see these changes when the appropriate internal API is called … or the next time Vera is reloaded.

This seems to be working pretty well for me so far and haven’t noticed any issues.