Ubidots Community

Is it possible to have some logic on alerts for a common event?

I have an organization with a number of similar devices. I would like to create a single event that would be common for each of the devices in the organization. However, each device is installed in a different location and when the event is triggered, I need to send the SMS/ email alerts to different contacts based on the device. Is this possible?

Thanks, Chip

Hello @chipmc,

Thanks for sharing your question with the community.

Now, that could be done by adding custom fields to the number/Email address box, so once the event is triggered, it will retrieve the info of the device that triggered it. For your use case, the “Device property” custom field would be the one needed, meaning that you will have to set the numbers and email addresses directly from the device as a key-value property.

Please notice that you can edit the custom field by double-clicking it, that way being able to access each property. Makes sense?

Sergio,

Wow! Makes perfect sense. A few things:

  1. Apparently, you cannot see or edit the properties on a device if you look at the device page in the list view. Could that be fixed?

  2. What if some devices have two emails and some have three? Will the event still run?

  3. This approach is not working, can you please take a look and see what I am doing wrong?

  • I have a device Electron-Dev2 in the group Hauler Caller and in the Organization Hauler Callers
  • I created two properties (sms and email) for each device with type “List” and added the two emails to each. I then used the formant device.context.sms1. and device.context.sms2 to reference them in the event.
  • I have created an event in the Hauler Callers organization called HC01 - …
  • In that event, I am triggering on the input1 variable from the group Hauler Caller
  • I created the events you see listed in the screen shots below.

But I am not getting any alerts?

Thanks, Chip

Update on this thread. Based on a suggestion from David in a support chat, I was able to get the email alerts working by not using the “List” type but creating two “Text” type messages. This works for email.

However, the SMS alerts are still not working even after moving from “Text” to “Number” type and calling them each out as separate events.

Is there a particular property “type” that I should use? I will keep experimenting.

Thanks,

Chip

Hi @chipmc,

Just for the sake of informing the community about the finding made in the support chat, we detected a bug with the SMS and Telegram “To” fields using “text” and “number” Device properties.
This has been reported and our team will be handling it.

I’ll get back to you (all) to let you know once this has been fixed and deployed.

–David