Use this Topic to Subscribe to a Variable's last value
Replace <device_label> and <variable_label> with the unique labels of the device and variable you want to subscribe to for value updates. If the specified device or variable does not exist, you will not be able to establish the subscription.
Topic
/v1.6/devices/<device_label>/<variable_label>/lv| 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
NoteThe Bash example in this section uses the Eclipse Mosquitto library. To test it, install the library using the official instructions.
Subscribe to a Variable's Last Value
Continuously obtain a variable's last value:
$ mosquitto_sub \
-h "industrial.api.ubidots.com" \
-t "/v1.6/devices/weather-station/temperature/lv" \
-u "BBFF-Rfcgaxns6HlVb155WA0RhSY85xNDmB" \
-p 1883 \
-q 124.0
