How to prevent trigger from happening until reset

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.

[
    {
        "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"
            ]
        ]
    }
]

Use the RBE (filter) node

[{"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

1 Like

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