openHAB - Industrial Digital In 4 Bricklet

Bemerkung

Zur Zeit ist nur die englische openHAB-Dokumentation verfügbar.

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 (Pin 0)

The logic level that is currently measured on the pin.

Type:
  • Switch
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4InputPin0
Read only:
  • No
Input Value (Pin 1)

The logic level that is currently measured on the pin.

Type:
  • Switch
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4InputPin1
Read only:
  • No
Input Value (Pin 2)

The logic level that is currently measured on the pin.

Type:
  • Switch
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4InputPin2
Read only:
  • No
Input Value (Pin 3)

The logic level that is currently measured on the pin.

Type:
  • Switch
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4InputPin3
Read only:
  • No
Edge Count Pin 0

The current value of the edge counter for the selected channel

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

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4EdgeCountPin0
Read only:
  • Yes
Parameters:
  • Edge Type – Type: Choice, Default: Rising
  • The edge type parameter 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 in ms.

  • Reset Edge Count On Update – Type: boolean, Default: false
  • Enabling this will reset the edge counter after OpenHAB reads its value. Use this if you want relative edge 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 Pin 1

The current value of the edge counter for the selected channel

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

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4EdgeCountPin1
Read only:
  • Yes
Parameters:
  • Edge Type – Type: Choice, Default: Rising
  • The edge type parameter 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 in ms.

  • Reset Edge Count On Update – Type: boolean, Default: false
  • Enabling this will reset the edge counter after OpenHAB reads its value. Use this if you want relative edge 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 Pin 2

The current value of the edge counter for the selected channel

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

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4EdgeCountPin2
Read only:
  • Yes
Parameters:
  • Edge Type – Type: Choice, Default: Rising
  • The edge type parameter 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 in ms.

  • Reset Edge Count On Update – Type: boolean, Default: false
  • Enabling this will reset the edge counter after OpenHAB reads its value. Use this if you want relative edge 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 Pin 3

The current value of the edge counter for the selected channel

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

Type:
  • Number:Dimensionless
UID:
  • tinkerforge:brickletindustrialdigitalin4:[UID]:BrickletIndustrialDigitalIn4EdgeCountPin3
Read only:
  • Yes
Parameters:
  • Edge Type – Type: Choice, Default: Rising
  • The edge type parameter 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 in ms.

  • Reset Edge Count On Update – Type: boolean, Default: false
  • Enabling this will reset the edge counter after OpenHAB reads its value. Use this if you want relative edge 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 Pin 0.

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

Neu 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 Pin 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

Neu 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', '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