1.1.1 • Published 1 year ago

@mschaeffler/node-red-debounce v1.1.1

Weekly downloads
-
License
LGPL-2.1
Repository
github
Last release
1 year ago

@mschaeffler/node-red-debounce

Node Red nodes for debouncing data.

image of example flow

Install

$ npm install @mschaeffler/node-red-debounce

debounce

The debounce node is for a general purpose debouncing of any data (string, boolean, number ...):

  • What data is debounced can be selected with the property property.
  • filter: The data can be checked for a change before the debounce.
  • Debouncing means here that the node waits time time before sending out the last received message.
  • It can be changed from debouncing to blocking mode.

Input

msg.typedescription
topicstringname of the input channel.
payloadinput value for topic.
invalidbooleanif true, this message is ignored.
resetbooleanif true, resets the node; if combined with a topic, only this topic is reseted.

Output

msg.typedescription
topicstringsame is in corresponding input message.
payloaddata evaluated out of the input message.

Parameters

configtypedescription
Propertystringdefines the message property to be used as payload.
Timenumberdebouncing time.
Blockbooleanblock instead of decounce. this means that an incoming message is sent out immediately and afterwards for time all following messages are blocked
Filterbooleanshall messages received with unchanged data be ignored.
Restartbooleanshall the debouncing time be restarted with every received message.
byTopicbooleanshall resending be done on a topic base.
Statusbooleanshows 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 property property.
  • 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 time time before sending out the last received message.

Input

msg.typedescription
topicstringname of the input channel.
payloadinput value for topic.
invalidbooleanif true, this message is ignored.
resetbooleanif true, resets the node; if combined with a topic, only this topic is reseted.

Output

msg.typedescription
topicstringsame is in corresponding input message.
payloadnumberdata evaluated out of the input message.

Parameters

configtypedescription
Propertystringdefines the message property to be used as payload.
Timenumberdebouncing time.
Filternumberdata must differ at least by this value; it can be an absolute number or a percentage.
Restartbooleanshall the debouncing time be restarted with every received message.
byTopicbooleanshall resending be done on a topic base.
Statusbooleanshows the actual value as a node status.

Example Flow

example flow

Author

Mathias Schäffler

License

LGPL-2.1

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago