openHAB - Accelerometer Bricklet

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

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

Thing

UID:
  • tinkerforge:brickletaccelerometer:[UID]
Required firmware version:
  • 2.0.0
Firmware update supported:
  • yes
Channels:
Actions:
Parameters:
  • Data Rate – Type: Choice, Default: 100Hz
  • The data rate of 0Hz to 1600Hz. Decreasing data rate or full scale range will also decrease the noise on the data.
  • Options: Off, 3Hz, 6Hz, 12Hz, 25Hz, 50Hz, 100Hz, 400Hz, 800Hz, 1600Hz

  • Full Scale Range – Type: Choice, Default: 4g
  • Full scale range of ±2gₙ up to ±16gₙ. Decreasing data rate or full scale range will also decrease the noise on the data.
  • Options: 2g, 4g, 6g, 8g, 16g

  • Filter Bandwidth – Type: Choice, Default: 200Hz
  • Filter bandwidth between 50Hz and 800Hz.
  • Options: 800Hz, 400Hz, 200Hz, 50Hz

  • Acceleration Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • Specifies the update interval for the acceleration in milliseconds. A value of 0 disables automatic updates.

Channels

Acceleration X

The acceleration in g (1g = 9.80665m/s²), not to be confused with grams.

Type:
  • Number:Acceleration
UID:
  • tinkerforge:brickletaccelerometer:[UID]:BrickletAccelerometerAccelerationX
Read only:
  • Yes
Unit:
  • Standard Gravity
Acceleration Y

The acceleration in g (1g = 9.80665m/s²), not to be confused with grams.

Type:
  • Number:Acceleration
UID:
  • tinkerforge:brickletaccelerometer:[UID]:BrickletAccelerometerAccelerationY
Read only:
  • Yes
Unit:
  • Standard Gravity
Acceleration Z

The acceleration in g (1g = 9.80665m/s²), not to be confused with grams.

Type:
  • Number:Acceleration
UID:
  • tinkerforge:brickletaccelerometer:[UID]:BrickletAccelerometerAccelerationZ
Read only:
  • Yes
Unit:
  • Standard Gravity
Temperature

The temperature of the accelerometer

This channel will only update after the configured update interval, not on changed values.

Type:
  • Number:Temperature
UID:
  • tinkerforge:brickletaccelerometer:[UID]:BrickletAccelerometerTemperature
Read only:
  • Yes
Unit:
  • Celsius
Range:
  • -103 Celsius to 152 Celsius (Step 1 Celsius)
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
LED

Enables/Disables the LED on the Bricklet.

Type:
  • Switch
UID:
  • tinkerforge:brickletaccelerometer:[UID]:BrickletAccelerometerLED
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:brickletaccelerometer:[UID]")
val hwVersion = actions.brickletAccelerometerGetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))

Basic Actions

brickletAccelerometerGetAcceleration()
Return Map:
  • x – Type: short, Unit: 1/1000 gₙ, Range: ?
  • y – Type: short, Unit: 1/1000 gₙ, Range: ?
  • z – Type: short, Unit: 1/1000 gₙ, Range: ?

Returns the acceleration in x, y and z direction. The values are given in gₙ/1000 (1gₙ = 9.80665m/s²). The range is configured with the thing configuration.

If you want to get the acceleration periodically, it is recommended to use the Acceleration X channel and set the period with the thing configuration.

brickletAccelerometerGetTemperature()
Return Map:
  • temperature – Type: short, Unit: 1 °C, Range: [-103 to 152]

Returns the temperature of the accelerometer.

brickletAccelerometerLEDOn()

Enables the LED on the Bricklet.

brickletAccelerometerLEDOff()

Disables the LED on the Bricklet.

brickletAccelerometerIsLEDOn()
Return Map:
  • on – Type: boolean, Default: false

Returns true if the LED is enabled, false otherwise.

Advanced Actions

brickletAccelerometerGetConfiguration()
Return Map:
  • dataRate – Type: short, Range: See constants, Default: 6
  • fullScale – Type: short, Range: See constants, Default: 1
  • filterBandwidth – Type: short, Range: See constants, Default: 2

Returns the configuration as set by the thing configuration.

The following constants are available for this function:

For dataRate:

  • val DATA_RATE_OFF = 0
  • val DATA_RATE_3HZ = 1
  • val DATA_RATE_6HZ = 2
  • val DATA_RATE_12HZ = 3
  • val DATA_RATE_25HZ = 4
  • val DATA_RATE_50HZ = 5
  • val DATA_RATE_100HZ = 6
  • val DATA_RATE_400HZ = 7
  • val DATA_RATE_800HZ = 8
  • val DATA_RATE_1600HZ = 9

For fullScale:

  • val FULL_SCALE_2G = 0
  • val FULL_SCALE_4G = 1
  • val FULL_SCALE_6G = 2
  • val FULL_SCALE_8G = 3
  • val FULL_SCALE_16G = 4

For filterBandwidth:

  • val FILTER_BANDWIDTH_800HZ = 0
  • val FILTER_BANDWIDTH_400HZ = 1
  • val FILTER_BANDWIDTH_200HZ = 2
  • val FILTER_BANDWIDTH_50HZ = 3
brickletAccelerometerGetIdentity()
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