victronenergy / node-red-contrib-victron

MIT License
87 stars 18 forks source link

[Feature]Include payload rounding in 'On change' handling #186

Closed pippajb closed 10 months ago

pippajb commented 10 months ago

This for me is sort of a problem, but I see it is coded this way most likely intentionally...

With the introduction of the 'On change' and 'Rounding' node configuration I was expecting to only see a new message when the rounded payload changed! This make more sense to me and would also reduce unnecessary downstream processing.

What currently happens is that any change in payload triggers an 'On change' message, regardless if after rounding the payload isn't actually seen to change.

Thus I would like to see the payload rounding taken into account, rather than the 'raw' data only.

dirkjanfaber commented 10 months ago

The quick work-a-round is to put a filter node between it. But I agree that it should be handled by the node.

pippajb commented 10 months ago

Yes I have a subflow for processing all my inputs, which discards messages with the same payload value, oh and counts msg reception too. But as I think we agree, it would be nice for this to be handled by default.

dirkjanfaber commented 10 months ago

Added this feature to the code and merged it into master.