# How to receive just one email

**URL:** <https://discourse.nodered.org/t/how-to-receive-just-one-email/68632>\
**Category:** General\
**Created:** [6 October 2022 09:05 UTC](https://discourse.nodered.org/t/how-to-receive-just-one-email/68632 "2022-10-06T09:05:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gwaag](https://avatars.discourse-cdn.com/v4/letter/g/45deac/32.png) [@gwaag](https://discourse.nodered.org/u/gwaag)\
**Post date:** [6 October 2022 09:05 UTC](https://discourse.nodered.org/t/how-to-receive-just-one-email/68632/1 "2022-10-06T09:05:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [6 October 2022 09:15 UTC](https://discourse.nodered.org/t/how-to-receive-just-one-email/68632/2 "2022-10-06T09:15:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [6 October 2022 09:18 UTC](https://discourse.nodered.org/t/how-to-receive-just-one-email/68632/3 "2022-10-06T09:18:45Z")

</div>

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)

```auto
[{"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":[]}]

```

---

<div class="post-metadata">

**Author:** ![gwaag](https://avatars.discourse-cdn.com/v4/letter/g/45deac/32.png) [@gwaag](https://discourse.nodered.org/u/gwaag)\
**Post date:** [8 October 2022 18:03 UTC](https://discourse.nodered.org/t/how-to-receive-just-one-email/68632/4 "2022-10-08T18:03:45Z")

</div>

Thank you for the sample, works like expected.

Best regards

Thomas

[flows(4).json](https://discourse.nodered.org/uploads/short-url/sy2NsloOiU9ZWqv4DHIBMVY0nPT.json) (4.28 KB)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 December 2022 18:04 UTC](https://discourse.nodered.org/t/how-to-receive-just-one-email/68632/5 "2022-12-07T18:04:17Z")

</div>

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