How to receive just one email

Hello,
I have a flow, so that when power consumption is < 5 it should send 1x email.
Now, when value is < 5, I recive many, many, mails.
How can I change the flow to only recive 1 mail?
Thanks and regards
gwaag

maybe use the Filter / RBE node to remove duplicates and only send when they change.

Try this demo to understand how to convert the number to a boolean then you can watch for change from true->false->true and filter (RBE) to ignore same message being sent....

demo flow (use CTRL-I to import into node-red)

[{"id":"929dad11814b3aa5","type":"inject","z":"c876e57260edd2ab","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"3","payloadType":"num","x":1010,"y":600,"wires":[["909af9087aebd993"]]},{"id":"28af9ec052c6ca4d","type":"inject","z":"c876e57260edd2ab","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":1010,"y":640,"wires":[["909af9087aebd993"]]},{"id":"3989f467f38f0045","type":"inject","z":"c876e57260edd2ab","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-2","payloadType":"num","x":1010,"y":680,"wires":[["909af9087aebd993"]]},{"id":"0113fde212b1ef73","type":"inject","z":"c876e57260edd2ab","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-7","payloadType":"num","x":1010,"y":720,"wires":[["909af9087aebd993"]]},{"id":"bc209cd296d4f26c","type":"inject","z":"c876e57260edd2ab","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-10","payloadType":"num","x":1010,"y":760,"wires":[["909af9087aebd993"]]},{"id":"909af9087aebd993","type":"switch","z":"c876e57260edd2ab","name":"<= -5? \\n > -5","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"-5","vt":"num"},{"t":"gt","v":"-5","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":1230,"y":680,"wires":[["86df9b3115940317"],["a019054f57ede562"]]},{"id":"86df9b3115940317","type":"change","z":"c876e57260edd2ab","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"cold","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":660,"wires":[["7a034e5fd04e10be"]]},{"id":"a019054f57ede562","type":"change","z":"c876e57260edd2ab","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"cold","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":700,"wires":[["7a034e5fd04e10be"]]},{"id":"7a034e5fd04e10be","type":"rbe","z":"c876e57260edd2ab","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":1620,"y":680,"wires":[["a98e3ede03c3585e"]]},{"id":"a98e3ede03c3585e","type":"switch","z":"c876e57260edd2ab","name":"is cold?","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":1380,"y":780,"wires":[["6e250c7f3f5d5599"]]},{"id":"6e250c7f3f5d5599","type":"debug","z":"c876e57260edd2ab","name":"Send an email","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1550,"y":780,"wires":[]}]

Thank you for the sample, works like expected.

Best regards

Thomas

flows(4).json (4.28 KB)

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