Min x minutes; value >= y or brightness value must have reached a value x minutes, then value 'true' is displayed

Hello
I am still a newbie in node red and have a little problem.
I want to evaluate the brightness for the control of my shutters. For this I have a Lux sensor whose data I smooth with a Smooth Node. The result is already as I expected, that there are not so many and high outliers.
But now I wanted that for the control at sun, the Lux value at least y minutes does not fall <= x Lux.
Which node can I use for this.
In other words, only when the sun shines with value x longer than y minutes, a 'true' should be output, otherwise 'false'.
Instead of minutes it can also be the number of values
many thanks already
Greetings
Roland

I would turn the lux into a boolean, then filter it so only changes pass. You can then use a trigger node to output if true for x time limit, and cancel if false.
e.g

[{"id":"66db13a174d0e2c2","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload >= 30","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":1340,"wires":[["935f052bde6d386f"]]},{"id":"192f88434812be55","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":110,"y":1320,"wires":[["66db13a174d0e2c2"]]},{"id":"8046a2b36c02ca27","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"40","payloadType":"num","x":110,"y":1360,"wires":[["66db13a174d0e2c2"]]},{"id":"935f052bde6d386f","type":"rbe","z":"d1395164b4eec73e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":430,"y":1340,"wires":[["496359ffd82aac09"]]},{"id":"496359ffd82aac09","type":"trigger","z":"d1395164b4eec73e","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"false","bytopic":"all","topic":"topic","outputs":1,"x":590,"y":1340,"wires":[["ae98bcd52b983f26"]]},{"id":"ae98bcd52b983f26","type":"debug","z":"d1395164b4eec73e","name":"debug 346","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":1400,"wires":[]}]

Here is an example using the trigger node to create your "y minutes" delay (But I used 10 seconds)

[{"id":"76a1b73b.183d68","type":"inject","z":"2b607c7076581b35","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"10","payloadType":"num","x":90,"y":40,"wires":[["4603783e173d2c21"]]},{"id":"65d40db8.a06334","type":"debug","z":"2b607c7076581b35","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":80,"wires":[]},{"id":"6652e6559c315eb3","type":"trigger","z":"2b607c7076581b35","name":"","op1":"","op2":"true","op1type":"nul","op2type":"bool","duration":"10","extend":false,"overrideDelay":true,"units":"s","reset":"false","bytopic":"all","topic":"topic","outputs":1,"x":430,"y":40,"wires":[["65d40db8.a06334"]]},{"id":"980226acba0a15ef","type":"inject","z":"2b607c7076581b35","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":90,"y":80,"wires":[["4603783e173d2c21"]]},{"id":"9182ac22892c5c27","type":"inject","z":"2b607c7076581b35","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"30","payloadType":"num","x":90,"y":120,"wires":[["4603783e173d2c21"]]},{"id":"acd9fee7bf6aff98","type":"switch","z":"2b607c7076581b35","name":">= 19?","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"19","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":240,"y":80,"wires":[["6652e6559c315eb3"],["ad35e9aeb395f7f8"]]},{"id":"ad35e9aeb395f7f8","type":"change","z":"2b607c7076581b35","name":"false","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":120,"wires":[["65d40db8.a06334","6652e6559c315eb3"]]},{"id":"4603783e173d2c21","type":"junction","z":"2b607c7076581b35","x":160,"y":80,"wires":[["acd9fee7bf6aff98"]]}]

An input greater than 19 starts the 10sec delay, less than 20 cancels it.
Edit - OOPS, pipped at the post!

Hello,
thank you very much for the explanations, I will have a look at it and try to implement it like this
If you know how to do it, everything is easy ...

@ jbudd "Edit - OOPS, pipped at the post!"
looks like a competition with E1cid :wink:

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