# Problems with the trigger node when switching from 1 to 0

**URL:** <https://discourse.nodered.org/t/problems-with-the-trigger-node-when-switching-from-1-to-0/18298>\
**Category:** General\
**Created:** [22 November 2019 21:34 UTC](https://discourse.nodered.org/t/problems-with-the-trigger-node-when-switching-from-1-to-0/18298 "2019-11-22T21:34:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seppel1078](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@seppel1078](https://discourse.nodered.org/u/seppel1078)\
**Post date:** [22 November 2019 21:34 UTC](https://discourse.nodered.org/t/problems-with-the-trigger-node-when-switching-from-1-to-0/18298/1 "2019-11-22T21:34:31Z")

</div>

Hi,

I have a problem with the trigger node. If first a "1" is applied to the input and then a "0" then the trigger node makes the "0" again a "1"

But I would like that if a "1" is applied to the input this is also 5 seconds at the output. But if a "0" is applied to the input should continue to be a "0" at the output and not as now 5 seconds a "1".

```auto
[{"id":"64d54ff7.5e66f","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"61ed6400.86d44c","type":"trigger","z":"64d54ff7.5e66f","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":350,"y":360,"wires":[["fc9a7f7f.3e85d8"]]},{"id":"fc9a7f7f.3e85d8","type":"debug","z":"64d54ff7.5e66f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":750,"y":360,"wires":[]},{"id":"9cbd3877.9c64e8","type":"inject","z":"64d54ff7.5e66f","name":"","topic":"1","payload":"","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":360,"wires":[["61ed6400.86d44c"]]},{"id":"bcfeb78c.4d3bf8","type":"inject","z":"64d54ff7.5e66f","name":"","topic":"0","payload":"","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":420,"wires":[["61ed6400.86d44c"]]}]

```

Is there a solution to the problem?

Excuse my English. This text was written with a translator

Greeting Volker

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 November 2019 21:56 UTC](https://discourse.nodered.org/t/problems-with-the-trigger-node-when-switching-from-1-to-0/18298/2 "2019-11-22T21:56:32Z")

</div>

Hi.

I think you will need to explain it another way.

The `trigger` node may not be what you really want/need.

This node (as you have it set) waits for an input signal to _trigger_ it.  
When triggered, it sends a `1` then waits 5 seconds and sends a `0`.

Node-red doesn't support

> [@seppel1078](#):
>
> this is also 5 seconds at the output.

It sees the `1` appearing on/at the input and sends a `1` to the output.

Ok, it could be said that it _remains there_ because in 5 seconds a `0` is sent.  
That is true in saying what happens, but I think there is a problem with what you want and what you are getting.

---

<div class="post-metadata">

**Author:** ![seppel1078](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@seppel1078](https://discourse.nodered.org/u/seppel1078)\
**Post date:** [22 November 2019 22:17 UTC](https://discourse.nodered.org/t/problems-with-the-trigger-node-when-switching-from-1-to-0/18298/3 "2019-11-22T22:17:27Z")

</div>

I got it. After the trigger node, I set a switch node that can only output a "1". Not nice but it works

---

<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:** [24 November 2019 09:13 UTC](https://discourse.nodered.org/t/problems-with-the-trigger-node-when-switching-from-1-to-0/18298/4 "2019-11-24T09:13:56Z")

</div>

It might make more sense to put the switch node on the input of trgger node, so you only send '1' messages to the trigger.
