openHAB - Piezo Buzzer Bricklet

This is the description of the openHAB API bindings for the Piezo Buzzer Bricklet. General information and technical specifications for the Piezo Buzzer Bricklet are summarized in its hardware description.

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

Thing

UID:
  • tinkerforge:brickletpiezobuzzer:[UID]
Required firmware version:
  • 2.0.0
Firmware update supported:
  • yes
Channels:
Actions:

Channels

Beep

Beeps with the duration in s.

Type:
  • Number:Time
UID:
  • tinkerforge:brickletpiezobuzzer:[UID]:BrickletPiezoBuzzerBeep
Read only:
  • No
Unit:
  • Second
Morse Code

Morse code that will be played by the piezo buzzer. The morse code is given as a string consisting of '.' (dot), '-' (minus) and ' ' (space) for dits, dahs and pauses. Every other character is ignored. For example: If you set the string '...---...', the piezo buzzer will beep nine times with the durations 'short short short long long long short short short'. The maximum string size is 60.

Type:
  • String
UID:
  • tinkerforge:brickletpiezobuzzer:[UID]:BrickletPiezoBuzzerMorseCode
Read only:
  • No
Beep Finished

This channel is triggered if a beep set by the beep action is finished.

Type:
  • Trigger (system.trigger)
UID:
  • tinkerforge:brickletpiezobuzzer:[UID]:BrickletPiezoBuzzerBeepFinished
Read only:
  • No
Morse Code Finished

This channel is triggered if the playback of the morse code set by the morseCode action is finished.

Type:
  • Trigger (system.trigger)
UID:
  • tinkerforge:brickletpiezobuzzer:[UID]:BrickletPiezoBuzzerMorseCodeFinished
Read only:
  • No

Actions

Actions can be used in rules by creating an action object. All actions return a Map<String, Object>. Returned values can be accessed by name, sometimes the type deduction needs some hints, as shown below:

val actions = getActions("tinkerforge", "tinkerforge:brickletpiezobuzzer:[UID]")
val hwVersion = actions.brickletPiezoBuzzerGetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))

Basic Actions

brickletPiezoBuzzerBeep(long duration)
Parameters:
  • duration – Type: long, Unit: 1 ms, Range: [0 to 232 - 1]

Beeps for the given duration.

brickletPiezoBuzzerMorseCode(String morse)
Parameters:
  • morse – Type: String, Length: up to 60

Sets morse code that will be played by the piezo buzzer. The morse code is given as a string consisting of "." (dot), "-" (minus) and " " (space) for dits, dahs and pauses. Every other character is ignored.

For example: If you set the string "...---...", the piezo buzzer will beep nine times with the durations "short short short long long long short short short".

Advanced Actions

brickletPiezoBuzzerGetIdentity()
Return Map:
  • uid – Type: String, Length: up to 8
  • connectedUid – Type: String, Length: up to 8
  • position – Type: char, Range: ['a' to 'h', 'i', 'z']
  • hardwareVersion – Type: short[], Length: 3
    • 0: major – Type: short, Range: [0 to 255]
    • 1: minor – Type: short, Range: [0 to 255]
    • 2: revision – Type: short, Range: [0 to 255]
  • firmwareVersion – Type: short[], Length: 3
    • 0: major – Type: short, Range: [0 to 255]
    • 1: minor – Type: short, Range: [0 to 255]
    • 2: revision – Type: short, Range: [0 to 255]
  • deviceIdentifier – Type: int, Range: [0 to 216 - 1]

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). The Raspberry Pi HAT (Zero) Brick is always at position 'i' and the Bricklet connected to an Isolator Bricklet is always as position 'z'.

The device identifier numbers can be found here