openHAB - Segment Display 4x7 Bricklet

Warning

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

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

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

Thing

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

Channels

Brightness

The brightness can be set between 0 (dark) and 7 (bright).

Type:
  • Choice
UID:
  • tinkerforge:brickletsegmentdisplay4x7:[UID]:BrickletSegmentDisplay4x7Brightness
Read only:
  • No
Options:
  • 0, 1, 2, 3, 4, 5, 6, 7
Range:
  • 0 to 7 (Step 1)
Show Colon

Turns the colon of the display on or off.

Type:
  • Switch
UID:
  • tinkerforge:brickletsegmentdisplay4x7:[UID]:BrickletSegmentDisplay4x7Colon
Read only:
  • No
Segments

The seven segment display can be set with bitmaps. Every bit controls one segment as shown here. The channel accepts an integer, that is split into 4 bytes, controlling one segment each. For example 1717263183, which is 0x665b5b4f in hex will be split into 0x66 for the first segment, 0x5b for the second, 0x5b for the third and 0x4f for the fourth.

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletsegmentdisplay4x7:[UID]:BrickletSegmentDisplay4x7Segments
Read only:
  • No
Range:
  • 0 to 127 (Step 1)
Text

Text to display on the seven segment display. Supported are A-Z, a-z, 0-9, ", (, ), +, -, =, [, ], ^, _ and |. An unsupported character will show as empty. A colon anywhere in the text will light the display's colon on. For example HiTF: will show as Hi:TF on the display.

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

Basic Actions

brickletSegmentDisplay4x7SetSegments(short[] segments, short brightness, boolean colon)
Parameters:
  • segments – Type: short[], Length: 4, Range: [0 to 127]
  • brightness – Type: short, Range: [0 to 7]
  • colon – Type: boolean

The 7-segment display can be set with bitmaps. Every bit controls one segment:

Bit order of one segment

For example to set a "5" you would want to activate segments 0, 2, 3, 5 and 6. This is represented by the number 0b01101101 = 0x6d = 109.

The brightness can be set between 0 (dark) and 7 (bright). The colon parameter turns the colon of the display on or off.

brickletSegmentDisplay4x7GetSegments()
Return Map:
  • segments – Type: short[], Length: 4, Range: [0 to 127]
  • brightness – Type: short, Range: [0 to 7]
  • colon – Type: boolean

Returns the segment, brightness and color data as set by Brightness.

Advanced Actions

brickletSegmentDisplay4x7StartCounter(short valueFrom, short valueTo, short increment, long length)
Parameters:
  • valueFrom – Type: short, Range: [-999 to 9999]
  • valueTo – Type: short, Range: [-999 to 9999]
  • increment – Type: short, Range: [-999 to 9999]
  • length – Type: long, Unit: 1 ms, Range: [0 to 232 - 1]

Starts a counter with the from value that counts to the to value with the each step incremented by increment. length is the pause between each increment.

Example: If you set from to 0, to to 100, increment to 1 and length to 1000, a counter that goes from 0 to 100 with one second pause between each increment will be started.

Using a negative increment allows to count backwards.

You can stop the counter at every time by calling Brightness.

brickletSegmentDisplay4x7GetCounterValue()
Return Map:
  • value – Type: int, Range: [-999 to 9999]

Returns the counter value that is currently shown on the display.

If there is no counter running a 0 will be returned.

brickletSegmentDisplay4x7GetIdentity()
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