如何通过电子邮件传输警报变量

发布于 2025-01-10 16:14:35 字数 293 浏览 4 评论 0原文

我是 AggreGate IoT 平台的新手,我正在尝试使用其警报功能。我需要将触发警报的设备名称插入到正在发送的电子邮件中。

我在文档中看到一些警报示例,但我找不到提取的方法当前设备的上下文。我尝试编写警报消息表达式,如 {env/context} 或 cell({env/context},"value") 但它没有效果。

请帮助我让它发挥作用。

I’m a newbie in AggreGate IoT platform and I’m trying to use its Alerts feature. I need to insert the name of the device that triggered the alert into the email message being sent.

I see some Alert Examples in the documentation but I can’t find the way to extract the context of the current device. I’ve tried to write the Alert Message expression like {env/context} or cell({env/context},"value") but it has no effect.

Please help me to make it work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海少女心 2025-01-17 16:14:35

您需要在警报出现或停用时发送电子邮件,但使用您自己的主题和消息格式。

  1. 打开“自动纠正措施”选项卡
  2. 添加操作“执行类型”-上升,“操作”-发送电子邮件,然后单击“参数”字段。
  3. 您应该看到电子邮件发送参数,例如收件人、主题、消息等。您可以自己编写或使用绑定,在我们的例子中我们将使用绑定。
  4. 要从警报中获取变量,我们应该使用 ex 的表达式。 “单元格({env/值},”触发“)”。该表达式将返回“触发消息”。您可以获取我们在警报事件中拥有的任何变量(请参阅随附的屏幕截图)。
  5. 当您获得变量值时,您可以将其与 AggreGate 表达式语言一起使用。例如,如果您获取cell({env/value}, "context"),它将返回设置此警报的设备的上下文。您需要使用上下文获取此设备的名称 - 您可以编写表达式 cell(getVariable(cell({env/value}, "context"),"genericProperties"),"name")。
    输入图片此处描述

在此处输入图像描述

在此处输入图像描述

You need to send e-mail when Alert rises or deactivates, but with your own subject and message format.

  1. Open "Automatic Corrective Actions" tab
  2. Add action "Execution type" - Rise, "Action" - Send E-mail and click on "Parameters" field.
  3. You should see e-mail sending parameters, such as Recipients, Subject, message, etc. You can write it by yourself or use bindings, in our case we will use bindings.
  4. To get variables from alert we should use an expression for ex. "cell({env/value},"trigger")". This expression will return "Trigger message". You can get any variables that we have in Alert Event (see attached screenshot).
  5. When you get variable value, you can use it with AggreGate expression language. For example, if you get cell({env/value}, "context") it will return context of the device for which this alert was set. You need to get name of this device, using context - you can write expression cell(getVariable(cell({env/value}, "context"),"genericProperties"),"name").
    enter image description here

enter image description here

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文