Node red contribution node that triggers an error if a second message has not been received within a configurable timeframe.
This node receives at first a message with the eot_trigger
property set and then starts the delay until a message with the eot_input
flag arrives.
This node is not suitable for high frequency message processing. It is meant to help control the flow by checking a command / acknowledgement
pattern such as switching equipment on and off. See my use case.
Once the node receives a message with the eot_trigger
flag set, it'll be waiting for a message with the eot_input
flag and won't accept any more trigger messages untile the configured timeout has been triggered.
- Success output: All messages that have arrived within the configured timeframe
- Error output: When no message arrives within the configured timeframe
- Late output: All messages that arrived after the configured timeframe
The message with the eot_trigger
property can have a eot_timeout
property set to the desired interval in milliseconds.
The following properties/fields are added to the messages coming out of each individual output of the node:
Output | Fields |
---|---|
Success |
|
Error |
|
Late |
|
I'm working on an IoT project running on MQTT where successfull execution of commands is crucial. After sending a command to a device I needed to ensure that the command has been executed successfully by having the device send out an ack
message within a certain timeframe before turning on other heavy duty equipment (and potentially blow up the entire infrastructure).
sequenceDiagram
Actor Node Red
Actor Selenoid
Actor Pump
Node Red->>Selenoid: Open
Selenoid->>Node Red: ACK
Node Red->>Pump: Run
Pump->>Node Red: ACK
The default nodes that come with Node Red seemed to be too... redundant for my needs and I preferred to develop something simple and concise and wrap it into a node.
I sincerely do hope that you make good use of it.
Please see the examples by importing them through the Import > Examples dialog.