openHAB - Industrial Digital In 4 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 Industrial Digital In 4 Bricklet. General information and technical specifications for the Industrial Digital In 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:brickletindustrialdigitalin4:[UID]
Required firmware version:
  • 2.0.1
Firmware update supported:
  • yes
Channels:
Actions:

Channels

Input Value 0

The logic level that is currently measured on the channel.

Type:
  • Contact
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4Input0
Read only:
  • No
Input Value 1

The logic level that is currently measured on the channel.

Type:
  • Contact
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4Input1
Read only:
  • No
Input Value 2

The logic level that is currently measured on the channel.

Type:
  • Contact
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4Input2
Read only:
  • No
Input Value 3

The logic level that is currently measured on the channel.

Type:
  • Contact
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4Input3
Read only:
  • No
Edge Count 0

The current value of the edge counter of the channel.

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

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4EdgeCount0
Read only:
  • Yes
Parameters:
  • Edge Type – Type: Choice, Default: Rising
  • Configures if rising edges, falling edges or both are counted.
  • Options: Rising, Falling, Both

  • Debounce Time – Type: integer, Default: 100, Min: 0, Max: 255
  • The debounce time is the minimum time between two count increments.

  • Reset Edge Counter On Update – Type: boolean, Default: false
  • Enabling this will reset the edge counter after openHAB reads its value. Use this if you want relative counts per update.

  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Edge Count 1

The current value of the edge counter of the channel.

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

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4EdgeCount1
Read only:
  • Yes
Parameters:
  • Edge Type – Type: Choice, Default: Rising
  • Configures if rising edges, falling edges or both are counted.
  • Options: Rising, Falling, Both

  • Debounce Time – Type: integer, Default: 100, Min: 0, Max: 255
  • The debounce time is the minimum time between two count increments.

  • Reset Edge Counter On Update – Type: boolean, Default: false
  • Enabling this will reset the edge counter after openHAB reads its value. Use this if you want relative counts per update.

  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Edge Count 2

The current value of the edge counter of the channel.

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

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4EdgeCount2
Read only:
  • Yes
Parameters:
  • Edge Type – Type: Choice, Default: Rising
  • Configures if rising edges, falling edges or both are counted.
  • Options: Rising, Falling, Both

  • Debounce Time – Type: integer, Default: 100, Min: 0, Max: 255
  • The debounce time is the minimum time between two count increments.

  • Reset Edge Counter On Update – Type: boolean, Default: false
  • Enabling this will reset the edge counter after openHAB reads its value. Use this if you want relative counts per update.

  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Edge Count 3

The current value of the edge counter of the channel.

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

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4EdgeCount3
Read only:
  • Yes
Parameters:
  • Edge Type – Type: Choice, Default: Rising
  • Configures if rising edges, falling edges or both are counted.
  • Options: Rising, Falling, Both

  • Debounce Time – Type: integer, Default: 100, Min: 0, Max: 255
  • The debounce time is the minimum time between two count increments.

  • Reset Edge Counter On Update – Type: boolean, Default: false
  • Enabling this will reset the edge counter after openHAB reads its value. Use this if you want relative counts per update.

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

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

Basic Actions

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

Returns the input value with a bitmask. The bitmask is 16bit long, true refers to high and false refers to low.

For example: The value 3 or 0b0011 means that pins 0-1 are high and the other pins are low.

brickletIndustrialDigitalIn4GetEdgeCount(short pin, boolean resetCounter)
Parameters:
  • pin – Type: short, Range: [0 to 3]
  • resetCounter – Type: boolean
Return Map:
  • count – Type: long, Range: [0 to 232 - 1]

Returns the current value of the edge counter for the selected pin. You can configure the edges that are counted with the configuration of Edge Count 0.

If you set the reset counter to true, the count is set back to 0 directly after it is read.

New in version 2.0.1 (Plugin).

Advanced Actions

brickletIndustrialDigitalIn4GetEdgeCountConfig(short pin)
Parameters:
  • pin – Type: short, Range: [0 to 255]
Return Map:
  • edgeType – Type: short, Range: See constants, Default: 0
  • debounce – Type: short, Unit: 1 ms, Range: [0 to 255], Default: 100

Returns the edge type and debounce time for the selected pin as set by the configuration of Edge Count 0.

The following constants are available for this function:

For edgeType:

  • val EDGE_TYPE_RISING = 0
  • val EDGE_TYPE_FALLING = 1
  • val EDGE_TYPE_BOTH = 2

New in version 2.0.1 (Plugin).

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