Need help for alarm notification via email

I read sensor data from a Hardware every second and plot it on the Dashboard.
I am trying to set up an alarm notification when I do not receive inputs from my sensors for a period of time say 10 seconds.

[{"id":"6eeb18ba.266468","type":"trigger","z":"7a7953cd.e2257c","name":"","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"10","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":480,"y":620,"wires":[["1a65b436.94b58c"]]},{"id":"9c5f9eae.edc54","type":"inject","z":"7a7953cd.e2257c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":290,"y":640,"wires":[["6eeb18ba.266468"]]},{"id":"1a65b436.94b58c","type":"change","z":"7a7953cd.e2257c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"check 1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":620,"wires":[["5961099e.552a88"]]},{"id":"5961099e.552a88","type":"debug","z":"7a7953cd.e2257c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":620,"wires":[]}]
  1. I have used the trigger node to set up a 10 seconds delay and get the notification if in case there is no input for 10 secs. I am not sure when I should use the ' second message to separate output' or Reset of trigger option. Can anyone kindly explain this?

  2. I also need a functionality where I do not receive the alarms every 10 seconds from the same sensor. If I have received an alarm notification once, then I need it to send after 30 secs. So I have added a second trigger node as shown here.

[{"id":"6eeb18ba.266468","type":"trigger","z":"7a7953cd.e2257c","name":"","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"10","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":490,"y":660,"wires":[["1a65b436.94b58c"]]},{"id":"9c5f9eae.edc54","type":"inject","z":"7a7953cd.e2257c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":680,"wires":[["6eeb18ba.266468"]]},{"id":"1a65b436.94b58c","type":"change","z":"7a7953cd.e2257c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"check 1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":660,"wires":[["9f9368f7.38f018"]]},{"id":"5961099e.552a88","type":"debug","z":"7a7953cd.e2257c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1050,"y":660,"wires":[]},{"id":"9f9368f7.38f018","type":"trigger","z":"7a7953cd.e2257c","name":"","op1":"","op2":"","op1type":"pay","op2type":"pay","duration":"30","extend":true,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":890,"y":660,"wires":[["5961099e.552a88"]]}]

Is there any other way I can improve the flow here?
I would be happy to receive your suggestions and corrections if you find any mistake in my nodes.

Thank you for helping out.

If you were using the node for a different purpose than yours, and needed to send an initial message and then the second message after the delay then you might want the second message sent to a second output. In that case you would select that option.

Similarly, in different scenarios, it may be useful to be able to cancel an operation before the second message is sent. In that case you would use the reset option.

Your requirement does not need either of those features.

1 Like

"Send second message to seperate output"
This option causes the node to have two outputs, allowing you to route the two messages differently.
Since you have "send nothing" for the initial message, this setting is not relevant.

"Reset the trigger if:"
This stops the current delay countdown. The second mesage is not sent.

It looks like your second Trigger will send you one extra email, 30 seconds after your alarm condition ceases.

To limit your emails to one every 30 seconds (which seems very frequent), you could use a Delay node set to Rate Limit:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.