# Prevent flow tigger on node-red startup

**URL:** <https://discourse.nodered.org/t/prevent-flow-tigger-on-node-red-startup/76948>\
**Category:** General\
**Created:** [26 March 2023 05:47 UTC](https://discourse.nodered.org/t/prevent-flow-tigger-on-node-red-startup/76948 "2023-03-26T05:47:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gibbz](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@Gibbz](https://discourse.nodered.org/u/Gibbz)\
**Post date:** [26 March 2023 05:47 UTC](https://discourse.nodered.org/t/prevent-flow-tigger-on-node-red-startup/76948/1 "2023-03-26T05:47:26Z")

</div>

I have a zigbee doorbell, its default action is "single" click. And it is the default state. So when I restart node-red it triggers the doorbell. This is annoying as I don't want this to happen when im updating the server etc.

Any suggestions on disabling the doorbell update on the start? Maybe using a startup timer?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 March 2023 06:51 UTC](https://discourse.nodered.org/t/prevent-flow-tigger-on-node-red-startup/76948/2 "2023-03-26T06:51:24Z")

</div>

I don't understand exactly what is happening. Do you mean that on startup something is sending a message? Add debug nodes to work out exactly what is happening. If it is a contrib node that is sending a message then tell us what it is.  
Also please export and post just the nodes in your flow that are causing the problem. That should not need to be more than about five nodes.

---

<div class="post-metadata">

**Author:** ![Gibbz](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@Gibbz](https://discourse.nodered.org/u/Gibbz)\
**Post date:** [26 March 2023 11:54 UTC](https://discourse.nodered.org/t/prevent-flow-tigger-on-node-red-startup/76948/3 "2023-03-26T11:54:54Z")

</div>

Ok ive found my issue was that mosquitto persistence setting was enabled. Whenever a mqtt connection was established, all the signals would be sent to the client. In my case triggering the doorbell through node-red.

Is there an option to ignore all the initial messages when node-red connects to an mqtt server?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 March 2023 12:38 UTC](https://discourse.nodered.org/t/prevent-flow-tigger-on-node-red-startup/76948/4 "2023-03-26T12:38:31Z")

</div>

> [@Gibbz](#):
>
> Is there an option to ignore all the initial messages when node-red connects to an mqtt server?

Yes, change the topic to non-persistent. That does not sound like a topic that should be set as persistent.

---

<div class="post-metadata">

**Author:** ![Gibbz](https://avatars.discourse-cdn.com/v4/letter/g/dc4da7/32.png) [@Gibbz](https://discourse.nodered.org/u/Gibbz)\
**Post date:** [27 March 2023 07:28 UTC](https://discourse.nodered.org/t/prevent-flow-tigger-on-node-red-startup/76948/5 "2023-03-27T07:28:01Z")

</div>

The topic I am using on the mqtt node is "zigbee2mqtt/Front Door/action".

Ive just notice that if i change to mqtt v5 i have the options for retained message handling. This should solve the issue 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 March 2023 08:17 UTC](https://discourse.nodered.org/t/prevent-flow-tigger-on-node-red-startup/76948/6 "2023-03-27T08:17:11Z")

</div>

In the web UI for zigbee2mqtt you can configure whether you want it retained or not.

---

<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:** [26 May 2023 08:17 UTC](https://discourse.nodered.org/t/prevent-flow-tigger-on-node-red-startup/76948/7 "2023-05-26T08:17:24Z")

</div>

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