Send Email Alarm only once

Hello, im new to Node-RED. I'm using a vibration sensor and I manage to send an email when the alarm triggered. The problem I'm having right now is, I want Node-RED only send the alarm once not multiple times when the alarm triggered. Is there a way to do this?

Sure, create a flow variable that will act as a switch. before you send the message, check if a msg has been sent (switch node) and after the email node, set the variable to indicate the message has been sent (change node).

Of course now you have to think about how you will reset the switch...after 5 hours, 10 minutes? I'd add a delay and another change node - after the first change node - to reset the switch

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