# If and wait command?

**URL:** https://discourse.nodered.org/t/if-and-wait-command/46797
**Category:** General
**Created:** [7 June 2021 07:18 UTC](https://discourse.nodered.org/t/if-and-wait-command/46797 "2021-06-07T07:18:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ysfkhvc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ysfkhvc/32/40903_2.png) [@ysfkhvc](https://discourse.nodered.org/u/ysfkhvc)
#### Post date: [7 June 2021 07:18 UTC](https://discourse.nodered.org/t/if-and-wait-command/46797/1 "2021-06-07T07:18:03Z")

</div>

Hello ,  
I just started using node-red and I don't know js. I would be glad if you help.  
What I want to do is to send an e-mail if an incoming temperature information is above a certain value, but then wait 30 minutes to send second e-mail again. In short, I would like to inform by e-mail every half hour if still temperature is over than compared value.  
Thanks in advance  
Regards

---

<div class="post-metadata">

### Author: ![michaelblight](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/michaelblight/32/445_2.png) [@michaelblight](https://discourse.nodered.org/u/michaelblight)
#### Post date: [7 June 2021 07:25 UTC](https://discourse.nodered.org/t/if-and-wait-command/46797/2 "2021-06-07T07:25:52Z")

</div>

Can you show what you've got so far. I assume you've got some node checking the temperature on a regular basis, or perhaps a node that gets triggered based on the temperature (is this all from Home Assistant?). Then after some logic, you're sending an email. Assuming another high temp will trigger the flow again, it sounds like you just need to introduce a `delay` node, configured to "Rate Limit" to 1 message per 30 minutes (with the option set to drop intermediate messages).

---

<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: [7 June 2021 07:27 UTC](https://discourse.nodered.org/t/if-and-wait-command/46797/3 "2021-06-07T07:27:40Z")

</div>

> [@ysfkhvc](#):
>
> I just started using node-red and I don't know js. I would be glad if you help

Hi & welcome to the forum.

Before trying to solve something you dont understand, I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

Once watching those, your problem can be solved with built in nodes. e.g. switch (for checking temprature) and trigger node (for re-sending) etc - but do yourself a favour, watch the vids 🙂

---

<div class="post-metadata">

### Author: ![ysfkhvc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ysfkhvc/32/40903_2.png) [@ysfkhvc](https://discourse.nodered.org/u/ysfkhvc)
#### Post date: [7 June 2021 08:00 UTC](https://discourse.nodered.org/t/if-and-wait-command/46797/4 "2021-06-07T08:00:05Z")

</div>

Thank you . I had found delay but didn't see the rate limit option. It works perfectly with delay.

---

<div class="post-metadata">

### Author: ![ysfkhvc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ysfkhvc/32/40903_2.png) [@ysfkhvc](https://discourse.nodered.org/u/ysfkhvc)
#### Post date: [7 June 2021 08:01 UTC](https://discourse.nodered.org/t/if-and-wait-command/46797/5 "2021-06-07T08:01:09Z")

</div>

Thanks for these links. I had watched some of them but i have to see all of them. Thanks again

---

<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: [6 August 2021 08:01 UTC](https://discourse.nodered.org/t/if-and-wait-command/46797/6 "2021-08-06T08:01:59Z")

</div>

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