Warning
The openHAB bindings are still in beta, but the development was stopped.
This is the description of the openHAB API bindings for the Piezo Speaker Bricklet. General information and technical specifications for the Piezo Speaker Bricklet are summarized in its hardware description.
An installation guide for the openHAB API bindings is part of their general description.
UID:
- tinkerforge:brickletpiezospeaker:[UID]
Required firmware version:
- 2.0.0
Firmware update supported:
- yes
Channels: Actions:
Beep Finished
¶This channel is triggered if a beep set by the beep action is finished.
Type:
- Trigger (system.trigger)
UID:
- tinkerforge:brickletpiezospeaker:[UID]:BrickletPiezoSpeakerBeepFinished
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:brickletpiezospeaker:[UID]:BrickletPiezoSpeakerMorseCodeFinished
Read only:
- No
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:brickletpiezospeaker:[UID]")
val hwVersion = actions.brickletPiezoSpeakerGetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))
brickletPiezoSpeakerBeep
(long duration, int frequency)¶Parameters: |
|
---|
Beeps with the given frequency for the given duration.
Changed in version 2.0.2 (Plugin): A duration of 0 stops the current beep if any, the frequency parameter is ignored. A duration of 4294967295 results in an infinite beep.
The Piezo Speaker Bricklet can only approximate the frequency, it will play the best possible match by applying the calibration (see This function is not available in openHAB. Please use Brick Viewer to change persistant device settings).
The following constants are available for this function:
For duration:
brickletPiezoSpeakerMorseCode
(String morse, int frequency)¶Parameters: |
|
---|
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".
brickletPiezoSpeakerGetIdentity
()¶Return Map: |
|
---|
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.