thomassorensen2650 / node-red-contrib-mqtt-sparkplug-plus

A node that makes it simple to implement MQTT Sparkplug in Node-Red
21 stars 6 forks source link

Feature request: enforce report by exception #14

Open nonujigu opened 1 year ago

nonujigu commented 1 year ago

Sorry @thomassorensen2650 for bothering you with feature requests, but I think this one could be worth considering:

Currently, it is the liability of the user of the mqtt sparkplug device node, to filter out metrics which value did not change since the last time. Within Node-RED, this functionality can be achieved with the filter node (formerly known as rbe). As far as I understand the sparkplug specification, this report by exception behavior is not mandatory but recommended. That is why I think it could be useful to optionally enforce report by exception. As far as I understand, the mqtt sparkplug device node already has an internal state that contains all the latest values of all available metrics. It should be relatively easy to implement a function that drops all metrics which value has not changed. In a second step, an advanced report by exception filtering mode like "block unless value change is greater than" as utilized in the filter node, could be considered.

The report by exception behavior usually has a huge impact on the payload size. Implementing it would further optimize the footprint of the resulting data traffic, which is particularly relevant if you are sending data on a mobile 3G/4G/5G connection.