Asymmetric deadband settings in filter node

Hi all,

New to Node Red, and had a corner case that I could not seem to accomplish with core nodes. I wanted to filter out all messages where a specific value was decreasing (items in a to do list), and only allow increasing values to continue in the flow. At first I tried using the node red supplied filter node, but this was also allowing through a value delta of -1, not just +1. I ended up creating a more complicated flow that stashed the value in the flow context, read it back out, used a switch node to "filter" out decreasing messages via the > operator, etc. Then I realized this was basically what the filter node was already doing anyway, but I just could not find a way to configure the filter node to get what I wanted in the first place.

So, my question is "Was there a more elegant way to accomplish this functionality that I did not stumble upon in my searching?". If the answer is no, then please consider this a feature request for being able to set the filter node to:

  • have different deadband exclusion parameters for an increase in value or decrease in value compared to last
  • have the deadband extend to infinity in one direction (i.e. filter all decreasing values)
  • consider also allowing asymmetric and infinite narrowband configuration as well?

Thanks

  • DH

I would think that most of us would simply record the previous value to context and then use a switch to compare new with old.

I did stumble across a more elegant solution for this exact use case, thanks to the Home Assistant state change node providing the previous state value also...

But I think this FR still has some merit for increasing the functionality of the filter node, though I will concede that this FR is not a huge priority.

There are plenty of nodes in the catalogue, probably worth having a browse at gates and perhaps finite state machine nodes? Some of these may well do what you are looking for.

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