MQTT - RGB LED Bricklet

This is the description of the MQTT API bindings for the RGB LED Bricklet. General information and technical specifications for the RGB LED Bricklet 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 RGB LED Bricklet

setup:
    # Set light blue color
    publish '{"r": 0, "g": 170, "b": 234}' to tinkerforge/request/rgb_led_bricklet/XYZ/set_rgb_value 

API

All published payload to an from the MQTT bindings is in the JSON format.

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

Basic Functions

request/rgb_led_bricklet/<UID>/set_rgb_value
Request payload:
 
  • r -- int
  • g -- int
  • b -- int

Sets the rgb value for the LED. The value can be between 0 and 255.

request/rgb_led_bricklet/<UID>/get_rgb_value
Response payload:
 
  • r -- int
  • g -- int
  • b -- int

Returns the rgb value of the LED as set by request/rgb_led_bricklet/<UID>/set_rgb_value.

Advanced Functions

request/rgb_led_bricklet/<UID>/get_identity
Response payload:
 
  • uid -- string
  • connected_uid -- string
  • position -- string
  • hardware_version -- [int,int,int]
  • firmware_version -- [int,int,int]
  • device_identifier -- int (has symbols)
  • _display_name -- 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' or 'd'.

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 RGB LED's name in a human readable form.