# Loop conditions

**URL:** <https://discourse.nodered.org/t/loop-conditions/26253>\
**Category:** General\
**Created:** [7 May 2020 16:24 UTC](https://discourse.nodered.org/t/loop-conditions/26253 "2020-05-07T16:24:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)\
**Post date:** [7 May 2020 16:24 UTC](https://discourse.nodered.org/t/loop-conditions/26253/1 "2020-05-07T16:24:05Z")

</div>

Hi all!

I have a simple condition check nodes. The chain is like this:

suncalc --\> switch --\> sonoff http on or off --\> function to send me a telegram message

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/4/d4aed5bdd72748d5648e19819003c02931ec9073.png)

The chains works ok but it is working in a repeating loop all the time and send me messages every one minute.

Any clues to stop that loop and only check when condition is true?

---

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [7 May 2020 16:41 UTC](https://discourse.nodered.org/t/loop-conditions/26253/2 "2020-05-07T16:41:15Z")

</div>

From the documentation:

```auto
The node provide two outputs. The first output emits a msg.payload of 1 or 0 every minute depending if day-time (1) or night-time (0).

The second output emits only on the transition between night to day (-> 1) or day to night (-> 0).

```

As you are using the top output, one payload every minute. Normal.  
If you want to have only when it is a transition, down output.

GV

---

<div class="post-metadata">

**Author:** ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)\
**Post date:** [7 May 2020 17:16 UTC](https://discourse.nodered.org/t/loop-conditions/26253/3 "2020-05-07T17:16:19Z")

</div>

Cool! Thanks!

---

<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 July 2020 17:16 UTC](https://discourse.nodered.org/t/loop-conditions/26253/4 "2020-07-06T17:16:24Z")

</div>

Closed on 6 July 2020 17:16 UTC

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