openHAB - Thermal Imaging Bricklet

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

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

Thing

UID:
  • tinkerforge:brickletthermalimaging:[UID]
Required firmware version:
  • 2.0.0
Firmware update supported:
  • yes
Channels:
Actions:
Parameters:
  • Image Type – Type: Choice, Default: High Contrast Image
  • The necessary bandwidth of this Bricklet is too high to use the high contrast and temperature image at the same time. You have to configure the one you want to use, the Bricklet will optimize the internal configuration accordingly.
  • Options: High Contrast Image, Linear Temperature Image

  • Scale Factor – Type: integer, Default: 1, Min: 1
  • Multiplicator for the image width and height. The image has a resolution of 80x60, so for a image of size 160x120 use a scale factor of 4.

  • Resolution – Type: Choice, Default: 0 To 655 Kelvin
  • The Thermal Imaging Bricklet can either measure
    • from 0 to 6553 Kelvin (-273.15°C to +6279.85°C) with 0.1°C resolution or
    • from 0 to 655 Kelvin (-273.15°C to +381.85°C) with 0.01°C resolution.
    The accuracy is specified for -10°C to 450°C in the first range and -10°C and 140°C in the second range.
  • Options: 0 To 6553 Kelvin, 0 To 655 Kelvin

  • Color Palette – Type: Choice, Default: Standard
  • The thermal image color palette.
  • Options: Standard, Greyscale, Hot Cold

  • Spotmeter Column Start – Type: integer, Default: 39, Min: 0, Max: 79
  • First column of the spotmeter region of interest.

  • Spotmeter Row Start – Type: integer, Default: 29, Min: 0, Max: 59
  • First row of the spotmeter region of interest.

  • Spotmeter Column End – Type: integer, Default: 40, Min: 0, Max: 79
  • Last column of the spotmeter region of interest.

  • Spotmeter Row End – Type: integer, Default: 30, Min: 0, Max: 59
  • Last row of the spotmeter region of interest.

  • Status LED Config – Type: Choice, Default: Show Status
  • The status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
  • Options: Off, On, Show Heartbeat, Show Status

Channels

High Contrast Image

The current high contrast image. See here for the difference between High Contrast and Temperature Image. If you don't know what to use the High Contrast Image is probably right for you.

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

Type:
  • Image
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingHighContrastImage
Read only:
  • No
Predicate:
  • This channel will only be available if Image Type is High Contrast Image.
Parameters:
  • High Contrast Column Start – Type: integer, Default: 0, Min: 0, Max: 79
  • First column of the high contrast region of interest.

  • High Contrast Row Start – Type: integer, Default: 0, Min: 0, Max: 59
  • First row of the high contrast region of interest.

  • High Contrast Column End – Type: integer, Default: 79, Min: 0, Max: 79
  • Last column of the high contrast region of interest.

  • High Contrast Row End – Type: integer, Default: 59, Min: 0, Max: 59
  • Last row of the high contrast region of interest.

  • Dampening Factor – Type: integer, Default: 64, Min: 0, Max: 256
  • This parameter is the amount of temporal dampening applied to the HEQ (history equalization) transformation function. An IIR filter of the form:
    (N / 256) * previous + ((256 - N) / 256) * current
    is applied, and the HEQ dampening factor represents the value N in the equation, i.e., a value that applies to the amount of influence the previous HEQ transformation function has on the current function. The lower the value of N the higher the influence of the current video frame whereas the higher the value of N the more influence the previous damped transfer function has.

  • AGC HEQ Clip Limit Low – Type: integer, Default: 512, Min: 0, Max: 1024
  • This parameter defines an artificial population that is added to every non-empty histogram bin. In other words, if the Clip Limit Low is set to L, a bin with an actual population of X will have an effective population of L + X. Any empty bin that is nearby a populated bin will be given an artificial population of L. The effect of higher values is to provide a more linear transfer function; lower values provide a more non-linear (equalized) transfer function.

  • AGC HEQ Clip Limit High – Type: integer, Default: 4800, Min: 0, Max: 4800
  • This parameter defines the maximum number of pixels allowed to accumulate in any given histogram bin. Any additional pixels in a given bin are clipped. The effect of this parameter is to limit the influence of highly-populated bins on the resulting HEQ transformation function.

  • Empty Counts – Type: integer, Default: 2, Min: 0, Max: 16383
  • This parameter specifies the maximum number of pixels in a bin that will be interpreted as an empty bin. Histogram bins with this number of pixels or less will be processed as an empty bin.

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

The current temperature image. See here for the difference between High Contrast and Temperature Image. If you don't know what to use the High Contrast Image is probably right for you.

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

Type:
  • Image
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingTemperatureImage
Read only:
  • No
Predicate:
  • This channel will only be available if Image Type is Linear Temperature Image.
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Spotmeter Mean Temperature

Mean temperature in the spotmeter region of interest.

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

Type:
  • Number:Temperature
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingSpotmeterMeanTemperature
Read only:
  • Yes
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Spotmeter Maximum Temperature

Maximum temperature in the spotmeter region of interest.

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

Type:
  • Number:Temperature
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingSpotmeterMaximumTemperature
Read only:
  • Yes
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Spotmeter Minimum Temperature

Minimum temperature in the spotmeter region of interest.

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

Type:
  • Number:Temperature
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingSpotmeterMinimumTemperature
Read only:
  • Yes
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Spotmeter ROI Pixel Count

Number of pixels in the spotmeter region of interest.

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

Type:
  • Number
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingSpotmeterROIPixelCount
Read only:
  • Yes
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Focal Plain Array Temperature

Current Focal Plain Array temperature

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

Type:
  • Number:Temperature
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingFocalPlainArrayTemperature
Read only:
  • Yes
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Focal Plain Array Temperature (last FFC)

Focal Plain Array temperature at last FFC (Flat Field Correction).

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

Type:
  • Number:Temperature
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingFocalPlainArrayTemperatureFFC
Read only:
  • Yes
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Housing Temperature

Current Housing temperature.

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

Type:
  • Number:Temperature
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingHousingTemperature
Read only:
  • Yes
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Housing Temperature (last FFC)

Housing temperature at last FFC (Flat Field Correction).

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

Type:
  • Number:Temperature
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingHousingTemperatureFFC
Read only:
  • Yes
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Flat Field Correction Status

Flat Field Correction Status

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

Type:
  • Choice
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingFFCStatus
Read only:
  • Yes
Options:
  • Never Commanded, Imminent, In Progress, Complete
Range:
  • 0 to 3
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Shutter Lockout

If enabled, shutter is locked out because temperature is outside -10°C to +65°C

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

Type:
  • Switch
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingShutterLockout
Read only:
  • No
Parameters:
  • Update Interval – Type: integer, Default: 1000, Unit: ms
  • Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Overtemperature Shutdown Imminent

Gets enabled 10 seconds before shutdown.

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

Type:
  • Switch
UID:
  • tinkerforge:brickletthermalimaging:[UID]:BrickletThermalImagingOvertemperatureShutdownImminent
Read only:
  • No
Parameters:
  • 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:brickletthermalimaging:[UID]")
val hwVersion = actions.brickletThermalImagingGetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))

Basic Actions

brickletThermalImagingGetHighContrastImage()
Return Map:
  • image – Type: int[], Length: 4800, Range: [0 to 255]

Returns the current high contrast image. See here for the difference between High Contrast and Temperature Image. If you don't know what to use the High Contrast Image is probably right for you.

The data is organized as a 8-bit value 80x60 pixel matrix linearized in a one-dimensional array. The data is arranged line by line from top left to bottom right.

Each 8-bit value represents one gray-scale image pixel that can directly be shown to a user on a display.

Before you can use this function you have to enable it with the thing configuration.

brickletThermalImagingGetTemperatureImage()
Return Map:
  • image – Type: int[], Length: 4800, Unit: ? K, Range: [0 to 216 - 1]

Returns the current temperature image. See here for the difference between High Contrast and Temperature Image. If you don't know what to use the High Contrast Image is probably right for you.

The data is organized as a 16-bit value 80x60 pixel matrix linearized in a one-dimensional array. The data is arranged line by line from top left to bottom right.

Each 16-bit value represents one temperature measurement in either Kelvin/10 or Kelvin/100 (depending on the resolution set with the thing configuration).

Before you can use this function you have to enable it with the thing configuration.

brickletThermalImagingGetStatistics()
Return Map:
  • spotmeterStatistics – Type: int[], Length: 4
    • 0: meanTemperature – Type: int, Unit: ? K, Range: [0 to 216 - 1]
    • 1: maxTemperature – Type: int, Unit: ? K, Range: [0 to 216 - 1]
    • 2: minTemperature – Type: int, Unit: ? K, Range: [0 to 216 - 1]
    • 3: pixelCount – Type: int, Range: [0 to 4800]
  • temperatures – Type: int[], Length: 4
    • 0: focalPlainArray – Type: int, Unit: ? K, Range: [0 to 216 - 1]
    • 1: focalPlainArrayLastFFC – Type: int, Unit: ? K, Range: [0 to 216 - 1]
    • 2: housing – Type: int, Unit: ? K, Range: [0 to 216 - 1]
    • 3: housingLastFFC – Type: int, Unit: ? K, Range: [0 to 216 - 1]
  • resolution – Type: int, Range: See constants
  • ffcStatus – Type: int, Range: See constants
  • temperatureWarning – Type: boolean[], Length: 2
    • 0: shutterLockout – Type: boolean
    • 1: overtemperatureShutDownImminent – Type: boolean

Returns the spotmeter statistics, various temperatures, current resolution and status bits.

The spotmeter statistics are:

  • Index 0: Mean Temperature.
  • Index 1: Maximum Temperature.
  • Index 2: Minimum Temperature.
  • Index 3: Pixel Count of spotmeter region of interest.

The temperatures are:

  • Index 0: Focal Plain Array temperature.
  • Index 1: Focal Plain Array temperature at last FFC (Flat Field Correction).
  • Index 2: Housing temperature.
  • Index 3: Housing temperature at last FFC.

The resolution is either 0 to 6553 Kelvin or 0 to 655 Kelvin. If the resolution is the former, the temperatures are in Kelvin/10, if it is the latter the temperatures are in Kelvin/100.

FFC (Flat Field Correction) Status:

  • FFC Never Commanded: Only seen on startup before first FFC.
  • FFC Imminent: This state is entered 2 seconds prior to initiating FFC.
  • FFC In Progress: Flat field correction is started (shutter moves in front of lens and back). Takes about 1 second.
  • FFC Complete: Shutter is in waiting position again, FFC done.

Temperature warning bits:

  • Index 0: Shutter lockout (if true shutter is locked out because temperature is outside -10°C to +65°C)
  • Index 1: Overtemperature shut down imminent (goes true 10 seconds before shutdown)

The following constants are available for this function:

For resolution:

  • val RESOLUTION_0_TO_6553_KELVIN = 0
  • val RESOLUTION_0_TO_655_KELVIN = 1

For ffcStatus:

  • val FFC_STATUS_NEVER_COMMANDED = 0
  • val FFC_STATUS_IMMINENT = 1
  • val FFC_STATUS_IN_PROGRESS = 2
  • val FFC_STATUS_COMPLETE = 3
brickletThermalImagingGetResolution()
Return Map:
  • resolution – Type: int, Range: See constants

Returns the resolution as set by the thing configuration.

The following constants are available for this function:

For resolution:

  • val RESOLUTION_0_TO_6553_KELVIN = 0
  • val RESOLUTION_0_TO_655_KELVIN = 1
brickletThermalImagingGetSpotmeterConfig()
Return Map:
  • regionOfInterest – Type: int[], Length: 4
    • 0: firstColumn – Type: int, Range: [0 to 78], Default: 39
    • 1: firstRow – Type: int, Range: [0 to 58], Default: 29
    • 2: lastColumn – Type: int, Range: [1 to 79], Default: 40
    • 3: lastRow – Type: int, Range: [1 to 59], Default: 30

Returns the spotmeter config as set by the thing configuration.

brickletThermalImagingGetHighContrastConfig()
Return Map:
  • regionOfInterest – Type: int[], Length: 4
    • 0: firstColumn – Type: int, Range: [0 to 78], Default: 0
    • 1: firstRow – Type: int, Range: [0 to 58], Default: 0
    • 2: lastColumn – Type: int, Range: [1 to 79], Default: 79
    • 3: lastRow – Type: int, Range: [1 to 59], Default: 59
  • dampeningFactor – Type: int, Range: [0 to 256], Default: 64
  • clipLimit – Type: int[], Length: 2
    • 0: agcHEQClipLimitHigh – Type: int, Range: [0 to 4800], Default: 4800
    • 1: agcHEQClipLimitLow – Type: int, Range: [0 to 210], Default: 29
  • emptyCounts – Type: int, Range: [0 to 216 - 1], Default: 2

Returns the high contrast config as set by the configuration of High Contrast Image.

Advanced Actions

brickletThermalImagingGetChipTemperature()
Return Map:
  • temperature – Type: int, Unit: 1 °C, Range: [-215 to 215 - 1]

Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature!

The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.

brickletThermalImagingGetStatusLEDConfig()
Return Map:
  • config – Type: int, Range: See constants, Default: 3

Returns the configuration as set by the thing configuration

The following constants are available for this function:

For config:

  • val STATUS_LED_CONFIG_OFF = 0
  • val STATUS_LED_CONFIG_ON = 1
  • val STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2
  • val STATUS_LED_CONFIG_SHOW_STATUS = 3
brickletThermalImagingGetSPITFPErrorCount()
Return Map:
  • errorCountAckChecksum – Type: long, Range: [0 to 232 - 1]
  • errorCountMessageChecksum – Type: long, Range: [0 to 232 - 1]
  • errorCountFrame – Type: long, Range: [0 to 232 - 1]
  • errorCountOverflow – Type: long, Range: [0 to 232 - 1]

Returns the error count for the communication between Brick and Bricklet.

The errors are divided into

  • ACK checksum errors,
  • message checksum errors,
  • framing errors and
  • overflow errors.

The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.

brickletThermalImagingGetIdentity()
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 as position 'z'.

The device identifier numbers can be found here

Internal Actions

brickletThermalImagingReadUID()
Return Map:
  • uid – Type: long, Range: [0 to 232 - 1]

Returns the current UID as an integer. Encode as Base58 to get the usual string version.