# Processing Time-Series Sensor Data

**URL:** <https://discourse.nodered.org/t/processing-time-series-sensor-data/54439>\
**Category:** General\
**Created:** [29 November 2021 06:45 UTC](https://discourse.nodered.org/t/processing-time-series-sensor-data/54439 "2021-11-29T06:45:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamin123](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hamin123/32/51757_2.png) [@hamin123](https://discourse.nodered.org/u/hamin123)\
**Post date:** [29 November 2021 06:45 UTC](https://discourse.nodered.org/t/processing-time-series-sensor-data/54439/1 "2021-11-29T06:45:50Z")

</div>

Hi,

I am looking for a filter node that would give me output when it receives N number of inputs e.g. 1 for a specific message.  
For example, I have a dry contact on port 0 and it gives output every second. Now, if port 0 is "On" or "1" for 5 seconds or more then filter node gives me "1", otherwise it should not give any output.  
Do, we have any such node, if yes can you share some example or tutorial.

Regards,

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [29 November 2021 08:11 UTC](https://discourse.nodered.org/t/processing-time-series-sensor-data/54439/2 "2021-11-29T08:11:28Z")

</div>

The standard nodes can help here, and in this case you can use the trigger node that can "hold" the message for x time. Send a msg.reset to it if value != On or 1.

Example flow:

```auto
[
    {
        "id": "d00ea6ff78d085b2",
        "type": "inject",
        "z": "7b1ac6193bf71367",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "On",
        "payloadType": "str",
        "x": 270,
        "y": 300,
        "wires": [
            [
                "f809eb7bf9e8592a"
            ]
        ]
    },
    {
        "id": "0f07c030672ecbae",
        "type": "inject",
        "z": "7b1ac6193bf71367",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1",
        "payloadType": "str",
        "x": 270,
        "y": 340,
        "wires": [
            [
                "f809eb7bf9e8592a"
            ]
        ]
    },
    {
        "id": "39e37785a2957881",
        "type": "inject",
        "z": "7b1ac6193bf71367",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "something else",
        "payloadType": "str",
        "x": 300,
        "y": 380,
        "wires": [
            [
                "f809eb7bf9e8592a"
            ]
        ]
    },
    {
        "id": "f809eb7bf9e8592a",
        "type": "switch",
        "z": "7b1ac6193bf71367",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "On",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "1",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 3,
        "x": 450,
        "y": 340,
        "wires": [
            [
                "0e73367409c5a5bd"
            ],
            [
                "0e73367409c5a5bd"
            ],
            [
                "994ffeec449c157b"
            ]
        ]
    },
    {
        "id": "994ffeec449c157b",
        "type": "change",
        "z": "7b1ac6193bf71367",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "reset",
                "pt": "msg",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 620,
        "y": 380,
        "wires": [
            [
                "0e73367409c5a5bd"
            ]
        ]
    },
    {
        "id": "0e73367409c5a5bd",
        "type": "trigger",
        "z": "7b1ac6193bf71367",
        "name": "",
        "op1": "",
        "op2": "1",
        "op1type": "nul",
        "op2type": "num",
        "duration": "5",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 780,
        "y": 320,
        "wires": [
            [
                "f0fbaf6071ee18ad"
            ]
        ]
    },
    {
        "id": "f0fbaf6071ee18ad",
        "type": "debug",
        "z": "7b1ac6193bf71367",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "true",
        "targetType": "full",
        "statusVal": "\"timer passed!\"",
        "statusType": "jsonata",
        "x": 930,
        "y": 320,
        "wires": []
    }
]

```

---

<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:** [28 January 2022 08:11 UTC](https://discourse.nodered.org/t/processing-time-series-sensor-data/54439/3 "2022-01-28T08:11:30Z")

</div>

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