# Stop two flows from triggering each other

**URL:** <https://discourse.nodered.org/t/stop-two-flows-from-triggering-each-other/40417>\
**Category:** General\
**Created:** [5 February 2021 03:30 UTC](https://discourse.nodered.org/t/stop-two-flows-from-triggering-each-other/40417 "2021-02-05T03:30:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![molsonb](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@molsonb](https://discourse.nodered.org/u/molsonb)\
**Post date:** [5 February 2021 03:30 UTC](https://discourse.nodered.org/t/stop-two-flows-from-triggering-each-other/40417/1 "2021-02-05T03:30:44Z")

</div>

I have two flows. If you change the thermostat to heat\_cool mode, it turns on the hvac schedule boolean in homeassistant.

If you turn on the hvac schedule boolean in homeassistant, it changes the thermostat to heat\_cool mode.

What is the best way so they don't trigger each other?

 ![hvac](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d01e2064422b54d3dd7c08bfc9f439c091622ec8.jpeg)

---

<div class="post-metadata">

**Author:** ![molsonb](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@molsonb](https://discourse.nodered.org/u/molsonb)\
**Post date:** [5 February 2021 03:44 UTC](https://discourse.nodered.org/t/stop-two-flows-from-triggering-each-other/40417/2 "2021-02-05T03:44:29Z")

</div>

I've used the 'Traffic' in the past, but it gets very messy quick. I'm wondering if there is a flag, to tell when the user actually clicked the boolean button in HomeAssistant, vs when the node-red automation actually updated it. Then I could check 'If a human changed this, then continue'. OR if there is a better way to handle this?

 ![hvac2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d050614c98ec15b5042bd26aaf8be3b366aedb75.jpeg)

---

<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:** [5 February 2021 13:46 UTC](https://discourse.nodered.org/t/stop-two-flows-from-triggering-each-other/40417/3 "2021-02-05T13:46:23Z")

</div>

> [@molsonb](#):
>
> to tell when the user actually clicked the boolean button in HomeAssistant, vs when the node-red automation actually updated it

add a topic to the messages to differentiate them. Then you can use a switch node and re-direct msg flow based on the value of topic.

e.g. `"node-red"` for node-red messages and `"home-assistant"` for HA messages.

NOTE: it doesnt even have to be the `topic` - any parameter if `msg` is possible.

e.g. you could set `msg.src = "home-assistant"` or `msg.src = "node-red"` then in a later switch node see if `msg.src` is `==` to `"node-red"`

---

<div class="post-metadata">

**Author:** ![molsonb](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@molsonb](https://discourse.nodered.org/u/molsonb)\
**Post date:** [5 February 2021 18:59 UTC](https://discourse.nodered.org/t/stop-two-flows-from-triggering-each-other/40417/4 "2021-02-05T18:59:32Z")

</div>

I was trying to think of the cleanest steps. For this simple flow, just checking the entity before hand to see if it needs changing, fixes my problem of the flow trigger the other flow.

 ![hvac3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/4/c40d9b6d923f06d2de2a9f6145ada80eec05a5b2.jpeg)

---

<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 April 2021 18:59 UTC](https://discourse.nodered.org/t/stop-two-flows-from-triggering-each-other/40417/5 "2021-04-06T18:59:37Z")

</div>

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