# May I ask what node used for "state continued" and how to set it?

**URL:** <https://discourse.nodered.org/t/may-i-ask-what-node-used-for-state-continued-and-how-to-set-it/64041>\
**Category:** General\
**Created:** [17 June 2022 06:52 UTC](https://discourse.nodered.org/t/may-i-ask-what-node-used-for-state-continued-and-how-to-set-it/64041 "2022-06-17T06:52:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![etmomoabc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/etmomoabc/32/53077_2.png) [@etmomoabc](https://discourse.nodered.org/u/etmomoabc)\
**Post date:** [17 June 2022 06:52 UTC](https://discourse.nodered.org/t/may-i-ask-what-node-used-for-state-continued-and-how-to-set-it/64041/1 "2022-06-17T06:52:15Z")

</div>

I use "get entities" to get the number of devices in the same state for automation!

If it is equal to 0, turn off the light, if it is greater than 0, turn on the light

However, the device is not stable and jumping around. I hope to have a node can makesure that the state 0 has keep for 5 minutes or more. Then pass.

Can someone help me? please

Thanks!

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [17 June 2022 11:34 UTC](https://discourse.nodered.org/t/may-i-ask-what-node-used-for-state-continued-and-how-to-set-it/64041/2 "2022-06-17T11:34:06Z")

</div>

You could possibly use a trigger node combined with a switch node to filter betwen state 0 and greater, if greater send msg reset to the trigger, then send latest payload after 5 mins

---

<div class="post-metadata">

**Author:** ![etmomoabc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/etmomoabc/32/53077_2.png) [@etmomoabc](https://discourse.nodered.org/u/etmomoabc)\
**Post date:** [17 June 2022 15:05 UTC](https://discourse.nodered.org/t/may-i-ask-what-node-used-for-state-continued-and-how-to-set-it/64041/3 "2022-06-17T15:05:23Z")

</div>

This will have a problem, the trigger can only receive greater, when the state changes the trigger does not know.

Can you please give me a example?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [17 June 2022 15:36 UTC](https://discourse.nodered.org/t/may-i-ask-what-node-used-for-state-continued-and-how-to-set-it/64041/4 "2022-06-17T15:36:16Z")

</div>

Would be helpful if you supplied examples of the incoming data, but to guess i would think something like this.

```auto
[{"id":"932b6c8.9517f9","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":120,"y":3620,"wires":[["12917235.b92ee6"]]},{"id":"12917235.b92ee6","type":"switch","z":"bf9e1e33.030598","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":260,"y":3640,"wires":[["23ac18a8.48ff98"],["39b76aea.15f0e6"]]},{"id":"85624c72.86a75","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"3","payloadType":"num","x":130,"y":3660,"wires":[["12917235.b92ee6"]]},{"id":"23ac18a8.48ff98","type":"trigger","z":"bf9e1e33.030598","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"on","bytopic":"all","topic":"topic","outputs":1,"x":470,"y":3620,"wires":[["d75462a8.4fb38"]]},{"id":"39b76aea.15f0e6","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":3680,"wires":[["23ac18a8.48ff98","6b19140d.17a95c"]]},{"id":"d75462a8.4fb38","type":"change","z":"bf9e1e33.030598","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":3620,"wires":[["6b19140d.17a95c"]]},{"id":"6b19140d.17a95c","type":"rbe","z":"bf9e1e33.030598","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":850,"y":3680,"wires":[["838111ef.f0b218"]]},{"id":"838111ef.f0b218","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":3820,"wires":[]}]

```

[edit] added fuller example

---

<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:** [16 August 2022 15:37 UTC](https://discourse.nodered.org/t/may-i-ask-what-node-used-for-state-continued-and-how-to-set-it/64041/5 "2022-08-16T15:37:15Z")

</div>

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