openHAB - Analog Out Bricklet

Bemerkung

Die openHAB-Dokumentation ist nur auf Englisch verfügbar.

Warnung

The openHAB bindings are still in beta, but the development was stopped.

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

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

Thing

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

Channels

Voltage

The output voltage. The possible range is 0V to 5V. Sending a command to this channel will set the Mode to Analog Value.

Type:
  • Number:ElectricPotential
UID:
  • tinkerforge:brickletanalogout:[UID]:BrickletAnalogOutVoltage
Read only:
  • No
Unit:
  • Volt
Range:
  • 0 Volt to 5 Volt (Step 0.001 Volt)
Mode

The mode of the output. Setting the mode to Analog Value will result in an output voltage of 0. You can jump to a higher output voltage directly by sending a command to the Voltage Channel.

Type:
  • Choice
UID:
  • tinkerforge:brickletanalogout:[UID]:BrickletAnalogOutMode
Read only:
  • No
Options:
  • Analog Value, 1k To Ground, 100k To Ground, 500k To Ground

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:brickletanalogout:[UID]")
val hwVersion = actions.brickletAnalogOutGetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))

Basic Actions

brickletAnalogOutSetVoltage(int voltage)
Parameters:
  • voltage – Type: int, Unit: 1 mV, Range: [0 to 5000], Default: 0

Sets the voltage. Calling this function will set the mode to 0 (see Mode).

brickletAnalogOutGetVoltage()
Return Map:
  • voltage – Type: int, Unit: 1 mV, Range: [0 to 5000], Default: 0

Returns the voltage as set by Voltage.

brickletAnalogOutSetMode(short mode)
Parameters:
  • mode – Type: short, Range: See constants, Default: 1

Sets the mode of the analog value. Possible modes:

  • 0: Normal Mode (Analog value as set by Voltage is applied)
  • 1: 1k Ohm resistor to ground
  • 2: 100k Ohm resistor to ground
  • 3: 500k Ohm resistor to ground

Setting the mode to 0 will result in an output voltage of 0 V. You can jump to a higher output voltage directly by calling Voltage.

The following constants are available for this function:

For mode:

  • val MODE_ANALOG_VALUE = 0
  • val MODE_1K_TO_GROUND = 1
  • val MODE_100K_TO_GROUND = 2
  • val MODE_500K_TO_GROUND = 3
brickletAnalogOutGetMode()
Return Map:
  • mode – Type: short, Range: See constants, Default: 1

Returns the mode as set by Mode.

The following constants are available for this function:

For mode:

  • val MODE_ANALOG_VALUE = 0
  • val MODE_1K_TO_GROUND = 1
  • val MODE_100K_TO_GROUND = 2
  • val MODE_500K_TO_GROUND = 3

Advanced Actions

brickletAnalogOutGetIdentity()
Return Map:
  • uid – Type: String, Length: up to 8
  • connectedUid – Type: String, Length: up to 8
  • position – Type: char, Range: ['a' to 'h', '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). A Bricklet connected to an Isolator Bricklet is always at position 'z'.

The device identifier numbers can be found here