2018-11-30 13:50:49 +01:00
<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
2020-01-30 22:39:34 +01:00
< script type = "text/html" data-help-name = "trigger" >
2018-11-30 13:50:49 +01:00
< p > When triggered, can send a message, and then optionally a second message, unless extended or reset.< / p >
< h3 > Inputs< / h3 >
< dl class = "message-properties" >
2020-09-28 22:10:23 +02:00
< dt class = "optional" > delay < span class = "property-type" > number< / span > < / dt >
2020-09-29 18:47:09 +02:00
< dd > Sets the delay, in milliseconds, to be applied to the message. This option only applies if the node is configured to allow the message to override the configured default delay interval.< / dd >
2018-11-30 13:50:49 +01:00
< dt class = "optional" > reset< / dt >
< dd > If a message is received with this property, any timeout or repeat
currently in progress will be cleared and no message triggered.< / dd >
< / dl >
< h3 > Details< / h3 >
< p > This node can be used to create a timeout within a flow. By default, when
it receives a message, it sends on a message with a < code > payload< / code > of < code > 1< / code > .
It then waits 250ms before sending a second message with a < code > payload< / code > of < code > 0< / code > .
This could be used, for example, to blink an LED attached to a Raspberry Pi GPIO pin.< / p >
< p > The payloads of each message sent can be configured to a variety of values, including
the option to not send anything. For example, setting the initial message to < i > nothing< / i > and
selecting the option to extend the timer with each received message, the node will
act as a watchdog timer; only sending a message if nothing is received within the
set interval.< / p >
< p > If set to a < i > string< / i > type, the node supports the mustache template syntax.< / p >
2020-09-28 22:10:23 +02:00
< p > The delay between sending messages can be overridden by < code > msg.delay< / code > if that option is enabled in the node. The value must be provided in milliseconds.< / p >
2018-11-30 13:50:49 +01:00
< p > If the node receives a message with a < code > reset< / code > property, or a < code > payload< / code >
that matches that configured in the node, any timeout or repeat currently in
progress will be cleared and no message triggered.< / p >
< p > The node can be configured to resend a message at a regular interval until it
is reset by a received message.< / p >
2020-01-30 22:39:34 +01:00
< p > Optionally, the node can be configured to treat messages as if they are separate streams,
using a msg property to identify each stream. Default < code > msg.topic< / code > .< / p >
2020-09-28 22:10:23 +02:00
< p > The status indicates the node is currently active. If multiple streams are used the status
2020-05-16 23:24:29 +02:00
indicates the number of streams being held.< / p >
2018-11-30 13:50:49 +01:00
< / script >