Range node requested action "Scale and drop message outside input range"

I believe that using the range node to drop out of bounds data would be a great addition to the node capability. I find that I need this capability often but there is no easy way to implement this capability without work arounds.

Workaround 1: switch node with "otherwise" passthrough.

[{"id":"c25f532d.1f40a","type":"switch","z":"205d0e6a.aaefc2","name":"between 8-23","property":"myhour","propertyType":"msg","rules":[{"t":"lt","v":"8","vt":"num"},{"t":"gte","v":"23","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":3,"x":1720,"y":280,"wires":[,,["a5b05817.d3dd08"]]}]

Workaround 2: switch node with JSONata with logic

[{"id":"237febe9.75d584","type":"switch","z":"205d0e6a.aaefc2","name":"between 8-23","property":"payload","propertyType":"msg","rules":[{"t":"jsonata_exp","v":"payload >= 8 and payload < 23","vt":"jsonata"}],"checkall":"false","repair":false,"outputs":1,"x":1740,"y":380,"wires":[]}]

Proposal: add action "drop": "Scale and drop message outside input range"

[{"id":"7dd8b6b0.7a2f38","type":"range","z":"205d0e6a.aaefc2","minin":"8","maxin":"23","minout":"8","maxout":"23","action":"drop","round":false,"property":"payload","name":"between 8-23 (proposed)","x":1980,"y":100,"wires":[]}]

Nice idea - will look at adding that.

PR created at - Add drop mode to range node by dceejay · Pull Request #3935 · node-red/node-red · GitHub

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