# How to prevent trigger from happening until reset

**URL:** <https://discourse.nodered.org/t/how-to-prevent-trigger-from-happening-until-reset/80524>\
**Category:** General\
**Created:** [12 August 2023 22:38 UTC](https://discourse.nodered.org/t/how-to-prevent-trigger-from-happening-until-reset/80524 "2023-08-12T22:38:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmystique](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rmystique/32/84365_2.png) [@rmystique](https://discourse.nodered.org/u/rmystique)\
**Post date:** [12 August 2023 22:38 UTC](https://discourse.nodered.org/t/how-to-prevent-trigger-from-happening-until-reset/80524/1 "2023-08-12T22:38:29Z")

</div>

This what i have, i want it to send a pulse when the input is under 21, and then wait until the input is above 24 before sending another pulse, where each trigger prevents the itself from happening again until the other one gets triggered. It is for a battery shutoff, so when the battery goes under 21volts it sends a pulse that turns off the power and when the battery is above 24 again it will send a pulse to turn the power back on.

```auto
[
    {
        "id": "f0326ee0294ff5c1",
        "type": "rpi-gpio out",
        "z": "f672d0ac69fd5b97",
        "name": "Relay output",
        "pin": "4",
        "set": true,
        "level": "0",
        "freq": "",
        "out": "out",
        "bcm": true,
        "x": 490,
        "y": 660,
        "wires": []
    },
    {
        "id": "9ff92398d9234754",
        "type": "switch",
        "z": "f672d0ac69fd5b97",
        "name": "21-off, 24-on",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "lt",
                "v": "21",
                "vt": "num"
            },
            {
                "t": "gt",
                "v": "24",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 130,
        "y": 660,
        "wires": [
            [
                "6b613274f98aac45"
            ],
            [
                "55e1e1d4d98c78ac"
            ]
        ]
    },
    {
        "id": "6b613274f98aac45",
        "type": "trigger",
        "z": "f672d0ac69fd5b97",
        "name": "",
        "op1": "1",
        "op2": "0",
        "op1type": "num",
        "op2type": "str",
        "duration": "1",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 320,
        "y": 640,
        "wires": [
            [
                "f0326ee0294ff5c1"
            ]
        ]
    },
    {
        "id": "55e1e1d4d98c78ac",
        "type": "trigger",
        "z": "f672d0ac69fd5b97",
        "name": "",
        "op1": "1",
        "op2": "0",
        "op1type": "num",
        "op2type": "str",
        "duration": "1",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 320,
        "y": 680,
        "wires": [
            [
                "f0326ee0294ff5c1"
            ]
        ]
    }
]

```

---

<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:** [12 August 2023 22:57 UTC](https://discourse.nodered.org/t/how-to-prevent-trigger-from-happening-until-reset/80524/2 "2023-08-12T22:57:26Z")

</div>

Use the RBE (filter) node

```auto
[{"id":"9ff92398d9234754","type":"switch","z":"b7b8756f264f62df","name":"21-off, 24-on","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"21","vt":"num"},{"t":"gt","v":"24","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":1500,"y":160,"wires":[["0048f0da792e9465"],["7df35e22ffa6dbaa"]]},{"id":"875ba3740cb42ba2","type":"inject","z":"b7b8756f264f62df","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"5","payloadType":"num","x":1290,"y":80,"wires":[["9ff92398d9234754"]]},{"id":"c2c298d059b81d08","type":"inject","z":"b7b8756f264f62df","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":1290,"y":140,"wires":[["9ff92398d9234754"]]},{"id":"1b744d8141e59e19","type":"inject","z":"b7b8756f264f62df","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"22","payloadType":"num","x":1290,"y":200,"wires":[["9ff92398d9234754"]]},{"id":"231bb08190b04afc","type":"inject","z":"b7b8756f264f62df","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"26","payloadType":"num","x":1290,"y":260,"wires":[["9ff92398d9234754"]]},{"id":"6b613274f98aac45","type":"trigger","z":"b7b8756f264f62df","name":"","op1":"1","op2":"0","op1type":"num","op2type":"num","duration":"1","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1720,"y":280,"wires":[["69840e220ade3d79"]]},{"id":"05eda27ef23bf347","type":"rbe","z":"b7b8756f264f62df","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":1870,"y":160,"wires":[["6b613274f98aac45"]]},{"id":"0048f0da792e9465","type":"change","z":"b7b8756f264f62df","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1700,"y":120,"wires":[["05eda27ef23bf347"]]},{"id":"7df35e22ffa6dbaa","type":"change","z":"b7b8756f264f62df","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1700,"y":200,"wires":[["05eda27ef23bf347"]]},{"id":"69840e220ade3d79","type":"debug","z":"b7b8756f264f62df","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1880,"y":280,"wires":[]}]

```

![chrome_brELMP3DYg](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/c/ec9f81ec6230522fd2343d2d69f05ce8937cc4ee.gif)

---

<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 August 2023 22:57 UTC](https://discourse.nodered.org/t/how-to-prevent-trigger-from-happening-until-reset/80524/3 "2023-08-26T22:57:27Z")

</div>

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