thingsboard icon indicating copy to clipboard operation
thingsboard copied to clipboard

[Question] Rule Chain alert with timestamp filter

Open silviorodrigues98 opened this issue 2 years ago • 10 comments

Component

  • Rule Engine

Description

I'm using Thingsboard to monitor the temperature of a device, and I want to create a rule chain that will send me a notification only if the temperature stays consistently high for a certain period of time. Specifically, I want to set a threshold temperature (let's say 80 degrees Fahrenheit) and a time period (let's say 10 minutes), and receive a notification only if the temperature stays at or above 80 degrees for the entire 10-minute period. How can I set up this rule chain in Thingsboard?

Environment

  • OS: Ubuntu 22.04
  • ThingsBoard: 3.4.4

silviorodrigues98 avatar Mar 05 '23 13:03 silviorodrigues98

For this you can use the alarm rules in the devices profiles. https://thingsboard.io/docs/user-guide/device-profiles/#example-2-alarm-condition-with-a-duration

Backdraft007 avatar Mar 06 '23 07:03 Backdraft007

Thanks!

Em seg., 6 de mar. de 2023 04:26, Chris @.***> escreveu:

For this you can use the alarm rules in the devices profiles.

https://thingsboard.io/docs/user-guide/device-profiles/#example-2-alarm-condition-with-a-duration

— Reply to this email directly, view it on GitHub https://github.com/thingsboard/thingsboard/issues/8172#issuecomment-1455592841, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUURF6TV6RBOYU3XHDBR7ATW2WGS7ANCNFSM6AAAAAAVQFTL5Y . You are receiving this because you authored the thread.Message ID: @.***>

silviorodrigues98 avatar Mar 06 '23 09:03 silviorodrigues98

Good morning, a query is possible to delimit particular emails for each alarm by time. Since from what I see it only has alarm creation and deletion output, but not for particular alarms that are created within the device profile. I would be very grateful for your answer.

ezeroldan24 avatar Mar 08 '23 13:03 ezeroldan24

I can't follow you. What do you mean exactly?

Backdraft007 avatar Mar 08 '23 13:03 Backdraft007

For example, I have an alarm with a time of 10 minutes for a temperature greater than 80C° and another alarm for 20 minutes less than 40C°, I am aware that to perform these times the device profile node is used, which has outputs (Alarm created, Alarm Update, Alarm Severity Update, Alarm Cleared, Succes and failure), what I want is to create a particular email for those two alarms, and by putting alarm created it generates the same email for both alarms. It is understood?

ezeroldan24 avatar Mar 08 '23 13:03 ezeroldan24

I hope. :) In rule chain I use a script node after device profile node to enhance some data. Screenshot 2023-03-08 151047 And use email node with more details. Screenshot 2023-03-08 151114 In the device profile I have two alarm rules. High temperature and low temperature.

Here is a snap of my rule chain. Screenshot 2023-03-08 151500

Is it that you want to know?

Backdraft007 avatar Mar 08 '23 14:03 Backdraft007

@Backdraft007 helped me, thank you very much!

ezeroldan24 avatar Mar 08 '23 14:03 ezeroldan24

HI is there a way to wite this in a Rule node? for example image image

id like this to alam after 10 mins. How do I write that in this flite node? Thanks

Buhaw85 avatar Apr 21 '23 15:04 Buhaw85

I'm very interested in this original question, and I think it has not been resolved. How do you achive this without alarm rules? I'm redoing the question: How can I set up a rule chain in Thingsboard that get's the threashold and the duration from the customer (or the asset) and create the alarm if the value is over that customer's threashold during the customer's time specified as an attribute?

EduAltana avatar Mar 07 '24 13:03 EduAltana

Good morning, I don't know if it will help you but I will give you some ideas that I use or used. Counters (take time based on time of incoming data packets) or take start date and time and count minutes. Remember that in case of returning to the normal state, the timer or time would always be reset. I hope it helps. There is no time node in thingsboard, I also think that makes sense because it works with data inputs that are defined by the client. I hope it helps you

ezeroldan24 avatar Mar 07 '24 14:03 ezeroldan24