Main Content

Publish to a Channel Field Feed

Publish message to update single channel field with MQTT

Topic

channels/<channelID>/publish/fields/field<fieldnumber>

Description

channels/<channelID>/publish/fields/field<fieldnumber> updates a channel field by publishing a message to the specified topic. Replace <channelID> with the channel ID, and <fieldnumber> with field number that you want to update. To learn more about configuring your channel, see Channel Properties. Use this method to update a single field in a channel.

  • Set the PUBLISH messages to a QoS value of 0.

  • Set the connection RETAIN flag to 0 (off).

  • Set the connection CleanSession flag to 1 (true).

To learn more about these flags, see MQTT v3.1.1 specification.

Input Arguments

expand all

Channel ID for the publish target, specified as a positive integer.

Field number of the Publish target, specified as a positive integer

Payload Parameters

The payload defines the data to be entered in the specified field of a channel. For example: 100

Examples

Configure MQTT X to send a PUBLISH message to update a channel field.

Topic: channels/33301/publish/fields/field1
Payload: 45

This PUBLISH message publishes a value of 45 to field1 of channel 33301.