MQTTEvent
Description
With this Action we can add one or more event handlers that can be received by the MQTT connection. After this Action is executed, the MQTTConnect Action can be called.
Properties
Specific
-
Connection
EXPRESSION (object:MQTTConnection)
-
MQTT connection to the server whose events are to be handled.
-
Event handlers
Array
-
List of events to be handled. For each item in the list, it will be necessary to select
Event
,Handler type
and optionallyAction
.Event
is the type of event we want to handle and the possible values are:Connect
– It is sent in case of successful connection or reconnect.Reconnect
– Sent when attempting to reconnect after a connection has been terminated.Close
– It is sent after the connection is terminated.Disconnect
– Sent when a disconnect packet is received by the broker.Offline
– Sent when the client goes offline.End
– Sent when the MQTTDisconnect Action is performed.Error
– Sent when the client cannot connect or a parsing error has occurred.Message
– It is sent when the client receives a published packet from the server for the topic we previously subscribed to with the MQTTSubscribe Action. Data of the typestruct:$MQTTMessage
is sent through the output, it is a system structure that has these members:topic
– The name of the topic for which the packet was published.payload
– Content of the received message.
Handler type
can beFlow
orAction
. IfFlow
is selected then an output will be added through which the Flow execution continues if the event is sent. IfAction
is selected, thenAction
must also be set, i.e. the name of the User action that is executed when the event is received.
General
-
Description
String
-
This is the description of the Action component. Description is displayed below the component in the Project editor/viewer. In the main toolbar, it is possible to hide or display descriptions of all components with one click.
Flow
-
Inputs
Array
-
Additional component inputs that the user can add as desired in order to use them to receive additional data needed when evaluating expressions in properties. Each input is given a name and type. Name is used when referencing an input within an expression. A type is used to project Check to check whether a data line that transmits data of that type is connected to the input or not.
-
Outputs
Array
-
Additional component outputs that the user can add to send data through. Each output is assigned a name and type. An example of using this output is e.g. in the Loop component, where we can put the output name for the
Variable
property instead of e.g. variable name. In that case, the Loop component will not change the content of the variable in each step, but will send the current value through that output. -
Catch error
Boolean
-
If this checkbox is enabled then an
@Error
output will be added to the component and if an error occurs in this component during the execution of the Flow, the Flow will continue through that output. The data that will be passed through that output is the textual description of the error.
Position and size
-
Align and distribute
Any
-
Alignment icons and component distribution. Alignment icons appear when two or more components are selected, and distribution icons appear when three or more components are selected.
Inputs
-
seqin
SEQ | OPTIONAL
-
A standard sequence input.
Outputs
-
seqout
SEQ | OPTIONAL
-
A standard sequence output.
Examples
- MQTT