@mschaeffler/node-red-debounce
v1.3.0
Published
Node Red nodes to debounce a payload.
Readme
@mschaeffler/node-red-debounce
Node Red nodes for debouncing data.

Install
$ npm install @mschaeffler/node-red-debouncedebounce
The debounce node is for a general purpose debouncing of any data (string, boolean, number ...):
- What data is debounced can be selected with the
propertyproperty. filter: The data can be checked for a change before the debounce.- Debouncing means here that the node waits
timetime before sending out the last received message. - It can be changed from debouncing to blocking mode.
Input
|msg. | type | description |
|:-------|:-------|:----------------------------------|
|topic | string | name of the input channel. |
|payload | | input value for topic. |
|debounceMs|number| if set, this is the debounce time for this message.|
|invalid |boolean | if true, this message is ignored. |
|reset |boolean | if true, resets the node; if combined with a topic, only this topic is reseted.|
Output
|msg. | type | description | |:-------|:-------|:----------------------------------| |topic | string | same is in corresponding input message.| |payload | | data evaluated out of the input message.|
Parameters
|config| type | description | |:-----|:-------|:----------------------------------| |Property| string | defines the message property to be used as payload.| |Time | number | debouncing time.| |Block |boolean | block instead of decounce. this means that an incoming message is sent out immediately and afterwards for time all following messages are blocked| |Filter |boolean | shall messages received with unchanged data be ignored.| |Restart |boolean | shall the debouncing time be restarted with every received message.| |byTopic |boolean | shall resending be done on a topic base.| |Status |boolean |shows the actual value as a node status.|
debounce N
The debounce N node is for debouncing of numerical values:
- What data is debounced can be selected with the
propertyproperty. filter: The value can be checked for a change greater then before the debounce.- This threshold can be an absolute or a relative value.
- Debouncing means here that the node waits
timetime before sending out the last received message.
Input
|msg. | type | description |
|:-------|:-------|:----------------------------------|
|topic | string | name of the input channel. |
|payload | | input value for topic. |
|debounceMs|number| if set, this is the debounce time for this message.|
|invalid |boolean | if true, this message is ignored. |
|reset |boolean | if true, resets the node; if combined with a topic, only this topic is reseted.|
Output
|msg. | type | description | |:-------|:-------|:----------------------------------| |topic | string | same is in corresponding input message.| |payload | number | data evaluated out of the input message.|
Parameters
|config| type | description | |:-----|:-------|:----------------------------------| |Property| string | defines the message property to be used as payload.| |Time | number | debouncing time.| |Filter in |boolean| data must differ at least by this value; it can be an absolute number or a percentage.| |Filter out|boolean| shall messages with unchanged data not been sent.| |Restart |boolean | shall the debouncing time be restarted with every received message.| |byTopic |boolean | shall resending be done on a topic base.| |Status |boolean | shows the actual value as a node status.|
Example Flow
Author
License
LGPL-2.1
