MQTT - Analog Out Bricklet 2.0

This is the description of the MQTT API bindings for the Analog Out Bricklet 2.0. General information and technical specifications for the Analog Out Bricklet 2.0 are summarized in its hardware description.

An installation guide for the MQTT API bindings is part of their general description.

Examples

The example code below is Public Domain (CC0 1.0).

Simple

Download (example-simple.txt)

1
2
3
4
5
# Change XYZ to the UID of your Analog Out Bricklet 2.0

setup:
    # Set output voltage to 3.3V
    publish '{"voltage": 3300}' to tinkerforge/request/analog_out_v2_bricklet/XYZ/set_output_voltage

API

All published payloads to and from the MQTT bindings are in JSON format.

If an error occures, the bindings publish a JSON object containing the error message as member _ERROR. It is published on the corresponding response topic: .../response/... for .../request/... and .../callback/... for .../register/....

Basic Functions

request/analog_out_v2_bricklet/<UID>/set_output_voltage
Request:
  • voltage – Type: int, Unit: 1 mV, Range: [0 to 12000], Default: 0
Response:
  • no response

Sets the voltage.

request/analog_out_v2_bricklet/<UID>/get_output_voltage
Request:
  • empty payload
Response:
  • voltage – Type: int, Unit: 1 mV, Range: [0 to 12000], Default: 0

Returns the voltage as set by request/analog_out_v2_bricklet/<UID>/set_output_voltage.

Advanced Functions

request/analog_out_v2_bricklet/<UID>/get_input_voltage
Request:
  • empty payload
Response:
  • voltage – Type: int, Unit: 1 mV, Range: [0 to 15000]

Returns the input voltage.

request/analog_out_v2_bricklet/<UID>/get_identity
Request:
  • empty payload
Response:
  • uid – Type: string, Length: up to 8
  • connected_uid – Type: string, Length: up to 8
  • position – Type: char, Range: ["a" to "h", "z"]
  • hardware_version – Type: [int, ...], Length: 3
    • 0: major – Type: int, Range: [0 to 255]
    • 1: minor – Type: int, Range: [0 to 255]
    • 2: revision – Type: int, Range: [0 to 255]
  • firmware_version – Type: [int, ...], Length: 3
    • 0: major – Type: int, Range: [0 to 255]
    • 1: minor – Type: int, Range: [0 to 255]
    • 2: revision – Type: int, Range: [0 to 255]
  • device_identifier – Type: int, Range: [0 to 216 - 1]
  • _display_name – Type: string

Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.

The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an Isolator Bricklet is always at position 'z'.

The device identifier numbers can be found here. If symbolic output is not disabled, the device identifier is mapped to the corresponding name in the format used in topics.

The display name contains the Analog Out 2.0's name in a human readable form.