Use this Topic to Subscribe to a Variable's Last Dot

Replace the {DEVICE_LABEL} and {VARIABLE_LABEL} with the unique label of the device and the variable to subscribe for retrieving values update. If the specified Device or Variable do not exist, you will not able to establish the subscription with it.

Topic

/v1.6/devices/{DEVICE_LABEL}/{VARIABLE_LABEL}

Field

Value

Required

Host

industrial.api.ubidots.com

Yes

Port

1883/8883 (Non-TLS/TLS)

Yes

Username

Your Ubidots Token

Yes

Password

Any character or leave blank

No

Quality of Service

0 or 1

No

Example

📘

Note

The bash example from this section makes use of the Eclipse Mosquitto library, if you wish to test it please install it using the official instructions.

Subscribe to a Variable's Last Dot
Constantly obtain a Variable's Last Dot:

$ mosquitto_sub \
-h "industrial.api.ubidots.com" \
-t "/v1.6/devices/weather-station/temperature" \
-u "BBFF-Rfcgaxns6HlVb155WA0RhSY85xNDmB" \
-p 1883 \
-q 1
{
  "value": 34.0, 
  "timestamp": 1634311791000, 
  "context": {
    "status": "cold"
  }, 
  "created_at": 1634311791000
}