# Filter - pass only stable input for some time

**URL:** https://discourse.nodered.org/t/filter-pass-only-stable-input-for-some-time/85386
**Category:** General
**Created:** [9 February 2024 21:04 UTC](https://discourse.nodered.org/t/filter-pass-only-stable-input-for-some-time/85386 "2024-02-09T21:04:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jttjtt](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jttjtt](https://discourse.nodered.org/u/jttjtt)
#### Post date: [9 February 2024 21:04 UTC](https://discourse.nodered.org/t/filter-pass-only-stable-input-for-some-time/85386/1 "2024-02-09T21:04:12Z")

</div>

Hello, i was not able to define my problem to google, so I am asking here.  
I have a sensor which is sending values continuosly (2-5 values every second). Lets say its a temperature sensor and the temperature in the room is still raising.  
I need to take only the value of the temperature which is stable, so lets say, the temperature sensor will be sending the same value of temperature for 5 seconds. Then, if the value will be still the same, I need to pass it to another node.  
How to achieve it? What node to use? Thanks.

---

<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: [9 February 2024 21:14 UTC](https://discourse.nodered.org/t/filter-pass-only-stable-input-for-some-time/85386/2 "2024-02-09T21:14:04Z")

</div>

A filter and trigger should get you close.

![chrome_FxyUm1lxXc](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/25237a22613a785db385d78cbf32ebb981f708af.gif)

```auto
[{"id":"30ac4c0932da1033","type":"trigger","z":"1b95bb0cab495f48","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"5","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":400,"y":1520,"wires":[["e5a59d80a3e15006"]]},{"id":"2d73dccd61bda825","type":"inject","z":"1b95bb0cab495f48","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"15","payloadType":"num","x":210,"y":1440,"wires":[["937a421de26ae88e"]]},{"id":"d2f2a5c65951648f","type":"inject","z":"1b95bb0cab495f48","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"17","payloadType":"num","x":210,"y":1480,"wires":[["937a421de26ae88e"]]},{"id":"7d3d382a225a03f7","type":"inject","z":"1b95bb0cab495f48","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21","payloadType":"num","x":210,"y":1520,"wires":[["937a421de26ae88e"]]},{"id":"937a421de26ae88e","type":"rbe","z":"1b95bb0cab495f48","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":370,"y":1460,"wires":[["30ac4c0932da1033"]]},{"id":"e5a59d80a3e15006","type":"debug","z":"1b95bb0cab495f48","name":"stable","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":1520,"wires":[]}]

```

---

<div class="post-metadata">

### Author: ![jttjtt](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@jttjtt](https://discourse.nodered.org/u/jttjtt)
#### Post date: [9 February 2024 21:38 UTC](https://discourse.nodered.org/t/filter-pass-only-stable-input-for-some-time/85386/3 "2024-02-09T21:38:19Z")

</div>

Yes, it really works! I think, if i set the trigger to bigger value, like 30 seconds, it should do the job i wanted to make.  
I wanted to write code in function node first, to accomplish this task, but this seems to me much easier.  
Thanks for help @Steve-Mcl !

---

<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: [23 February 2024 21:38 UTC](https://discourse.nodered.org/t/filter-pass-only-stable-input-for-some-time/85386/4 "2024-02-23T21:38:36Z")

</div>

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