openHAB - Industrial Digital Out 4 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 Industrial Digital Out 4 Bricklet. General information and technical specifications for the Industrial Digital Out 4 Bricklet are summarized in its hardware description.

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

Thing

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

Channels

Output Value 0

The logic level that is currently set on the pin.

Type:
  • Switch
UID:
  • tinkerforge:brickletindustrialdigitalout4:[UID]:BrickletIndustrialDigitalOut4Output0
Read only:
  • No
Output Value 1

The logic level that is currently set on the pin.

Type:
  • Switch
UID:
  • tinkerforge:brickletindustrialdigitalout4:[UID]:BrickletIndustrialDigitalOut4Output1
Read only:
  • No
Output Value 2

The logic level that is currently set on the pin.

Type:
  • Switch
UID:
  • tinkerforge:brickletindustrialdigitalout4:[UID]:BrickletIndustrialDigitalOut4Output2
Read only:
  • No
Output Value 3

The logic level that is currently set on the pin.

Type:
  • Switch
UID:
  • tinkerforge:brickletindustrialdigitalout4:[UID]:BrickletIndustrialDigitalOut4Output3
Read only:
  • No
Monoflop 0

Triggers a monoflop as configured.

Type:
  • Commands (String)
UID:
  • tinkerforge:brickletindustrialdigitalout4:[UID]:BrickletIndustrialDigitalOut4Monoflop0
Read only:
  • No
Commands:
  • Accepts any string
Parameters:
  • Monoflop Duration – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • The time that the channel should hold the configured value.

  • Monoflop Value – Type: boolean, Default: true
  • The desired value of the channel.
Monoflop 1

Triggers a monoflop as configured.

Type:
  • Commands (String)
UID:
  • tinkerforge:brickletindustrialdigitalout4:[UID]:BrickletIndustrialDigitalOut4Monoflop1
Read only:
  • No
Commands:
  • Accepts any string
Parameters:
  • Monoflop Duration – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • The time that the channel should hold the configured value.

  • Monoflop Value – Type: boolean, Default: true
  • The desired value of the channel.
Monoflop 2

Triggers a monoflop as configured.

Type:
  • Commands (String)
UID:
  • tinkerforge:brickletindustrialdigitalout4:[UID]:BrickletIndustrialDigitalOut4Monoflop2
Read only:
  • No
Commands:
  • Accepts any string
Parameters:
  • Monoflop Duration – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • The time that the channel should hold the configured value.

  • Monoflop Value – Type: boolean, Default: true
  • The desired value of the channel.
Monoflop 3

Triggers a monoflop as configured.

Type:
  • Commands (String)
UID:
  • tinkerforge:brickletindustrialdigitalout4:[UID]:BrickletIndustrialDigitalOut4Monoflop3
Read only:
  • No
Commands:
  • Accepts any string
Parameters:
  • Monoflop Duration – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
  • The time that the channel should hold the configured value.

  • Monoflop Value – Type: boolean, Default: true
  • The desired value of the channel.

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

Basic Actions

brickletIndustrialDigitalOut4SetValue(int valueMask)
Parameters:
  • valueMask – Type: int, Range: [0 to 216 - 1]

Sets the output value with a bitmask (16bit). A 1 in the bitmask means high and a 0 in the bitmask means low.

For example: The value 3 or 0b0011 will turn pins 0-1 high and the other pins low.

All running monoflop timers will be aborted if this function is called.

brickletIndustrialDigitalOut4SetSelectedValues(int selectionMask, int valueMask)
Parameters:
  • selectionMask – Type: int, Range: [0 to 216 - 1]
  • valueMask – Type: int, Range: [0 to 216 - 1]

Sets the output value with a bitmask, according to the selection mask. The bitmask is 16 bit long, true refers to high and false refers to low.

For example: The values (3, 1) or (0b0011, 0b0001) will turn pin 0 high, pin 1 low the other pins remain untouched.

Running monoflop timers for the selected pins will be aborted if this function is called.

brickletIndustrialDigitalOut4GetValue()
Return Map:
  • valueMask – Type: int, Range: [0 to 216 - 1]

Returns the bitmask as set by SetValue().

Advanced Actions

brickletIndustrialDigitalOut4SetMonoflop(int selectionMask, int valueMask, long time)
Parameters:
  • selectionMask – Type: int, Range: [0 to 216 - 1]
  • valueMask – Type: int, Range: [0 to 216 - 1]
  • time – Type: long, Unit: 1 ms, Range: [0 to 232 - 1]

Configures a monoflop of the pins specified by the first parameter bitmask.

The second parameter is a bitmask with the desired value of the specified pins. A 1 in the bitmask means high and a 0 in the bitmask means low.

The third parameter indicates the time that the pins should hold the value.

If this function is called with the parameters (9, 1, 1500) or (0b1001, 0b0001, 1500): Pin 0 will get high and pin 3 will get low. In 1.5s pin 0 will get low and pin 3 will get high again.

A monoflop can be used as a fail-safe mechanism. For example: Lets assume you have a RS485 bus and a Digital Out 4 Bricklet connected to one of the slave stacks. You can now call this function every second, with a time parameter of two seconds and pin 0 high. Pin 0 will be high all the time. If now the RS485 connection is lost, then pin 0 will turn low in at most two seconds.

brickletIndustrialDigitalOut4GetMonoflop(short pin)
Parameters:
  • pin – Type: short, Range: [0 to 15]
Return Map:
  • value – Type: int, Range: [0 to 1]
  • time – Type: long, Unit: 1 ms, Range: [0 to 232 - 1]
  • timeRemaining – Type: long, Unit: 1 ms, Range: [0 to 232 - 1]

Returns (for the given pin) the current value and the time as set by Monoflop 0 as well as the remaining time until the value flips.

If the timer is not running currently, the remaining time will be returned as 0.

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